aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2018-01-02 15:06:51 +0100
committerGitHub <noreply@github.com>2018-01-02 15:06:51 +0100
commitba827f8475966e43d1138598372f8c9e5483e3f9 (patch)
tree8cb5e84027e29b9c4972ede0b0e7541035510a1a
parent2d2e07f12f82cf432dfaf01c42cd8a687d4dbbf0 (diff)
parent83fb8840f2df149a77c3915a91fc53b7fb6d3534 (diff)
Merge pull request #13286 from Kwiboo/gbm-windowing-fixes
windowing/gbm: use first overlay plane and fix vga refresh rate
-rw-r--r--xbmc/windowing/gbm/DRMUtils.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp
index 8003559566..4ba20c4702 100644
--- a/xbmc/windowing/gbm/DRMUtils.cpp
+++ b/xbmc/windowing/gbm/DRMUtils.cpp
@@ -277,8 +277,8 @@ bool CDRMUtils::GetPreferredMode()
bool CDRMUtils::GetPlanes()
{
drmModePlaneResPtr plane_resources;
- uint32_t primary_plane_id = -1;
- uint32_t overlay_plane_id = -1;
+ uint32_t primary_plane_id = 0;
+ uint32_t overlay_plane_id = 0;
uint32_t fourcc = 0;
plane_resources = drmModeGetPlaneResources(m_fd);
@@ -306,14 +306,14 @@ bool CDRMUtils::GetPlanes()
{
drmModePropertyPtr p = drmModeGetProperty(m_fd, props->props[j]);
- if ((strcmp(p->name, "type") == 0) && (props->prop_values[j] == DRM_PLANE_TYPE_PRIMARY))
+ if ((strcmp(p->name, "type") == 0) && (props->prop_values[j] == DRM_PLANE_TYPE_PRIMARY) && (primary_plane_id == 0))
{
- CLog::Log(LOGDEBUG, "CDRMUtils::%s - found primary plane: %d", __FUNCTION__, id);
+ CLog::Log(LOGDEBUG, "CDRMUtils::%s - found primary plane: %u", __FUNCTION__, id);
primary_plane_id = id;
}
- else if ((strcmp(p->name, "type") == 0) && (props->prop_values[j] == DRM_PLANE_TYPE_OVERLAY))
+ else if ((strcmp(p->name, "type") == 0) && (props->prop_values[j] == DRM_PLANE_TYPE_OVERLAY) && (overlay_plane_id == 0))
{
- CLog::Log(LOGDEBUG, "CDRMUtils::%s - found overlay plane: %d", __FUNCTION__, id);
+ CLog::Log(LOGDEBUG, "CDRMUtils::%s - found overlay plane: %u", __FUNCTION__, id);
overlay_plane_id = id;
}
@@ -332,7 +332,7 @@ bool CDRMUtils::GetPlanes()
m_primary_plane->plane = drmModeGetPlane(m_fd, primary_plane_id);
if (!m_primary_plane->plane)
{
- CLog::Log(LOGERROR, "CDRMUtils::%s - could not get primary plane %i: %s", __FUNCTION__, primary_plane_id, strerror(errno));
+ CLog::Log(LOGERROR, "CDRMUtils::%s - could not get primary plane %u: %s", __FUNCTION__, primary_plane_id, strerror(errno));
return false;
}
@@ -377,7 +377,7 @@ bool CDRMUtils::GetPlanes()
m_overlay_plane->plane = drmModeGetPlane(m_fd, overlay_plane_id);
if (!m_overlay_plane->plane)
{
- CLog::Log(LOGERROR, "CDRMUtils::%s - could not get overlay plane %i: %s", __FUNCTION__, overlay_plane_id, strerror(errno));
+ CLog::Log(LOGERROR, "CDRMUtils::%s - could not get overlay plane %u: %s", __FUNCTION__, overlay_plane_id, strerror(errno));
return false;
}
@@ -623,7 +623,7 @@ bool CDRMUtils::GetModes(std::vector<RESOLUTION_INFO> &resolutions)
res.iHeight = m_connector->connector->modes[i].vdisplay;
res.iScreenWidth = m_connector->connector->modes[i].hdisplay;
res.iScreenHeight = m_connector->connector->modes[i].vdisplay;
- if (m_connector->connector->modes[i].clock % 10 != 0)
+ if (m_connector->connector->modes[i].clock % 5 != 0)
res.fRefreshRate = (float)m_connector->connector->modes[i].vrefresh * (1000.0f/1001.0f);
else
res.fRefreshRate = m_connector->connector->modes[i].vrefresh;