mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-07 04:11:26 +00:00
kmssink: fallback to universal planes if no overlay plane is found
Without setting the DRM_CLIENT_CAP_UNIVERSAL_PLANES capability bit, only overlay planes are made available for compatibility with legacy clients. But if a CRTC doesn't have an overlay plane associated, then kmssink is not able to find a plane for the CRTC and the pipeline will fail, i.e: ERROR kmssink gstkmssink.c:482:gst_kms_sink_start:<kmssink0> Could not find a plane for crtc If no overlay planes were found for a given CRTC, fallback to universal planes so DRM will also return primary planes that can be used instead. https://bugzilla.gnome.org/show_bug.cgi?id=768183 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
This commit is contained in:
parent
c2cd60db0f
commit
34c88dca2d
1 changed files with 20 additions and 2 deletions
|
@ -352,9 +352,11 @@ gst_kms_sink_start (GstBaseSink * bsink)
|
|||
drmModeCrtc *crtc;
|
||||
drmModePlaneRes *pres;
|
||||
drmModePlane *plane;
|
||||
gboolean universal_planes;
|
||||
gboolean ret;
|
||||
|
||||
self = GST_KMS_SINK (bsink);
|
||||
universal_planes = FALSE;
|
||||
ret = FALSE;
|
||||
res = NULL;
|
||||
conn = NULL;
|
||||
|
@ -388,6 +390,11 @@ gst_kms_sink_start (GstBaseSink * bsink)
|
|||
if (!crtc)
|
||||
goto crtc_failed;
|
||||
|
||||
retry_find_plane:
|
||||
if (universal_planes &&
|
||||
drmSetClientCap (self->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1))
|
||||
goto set_cap_failed;
|
||||
|
||||
pres = drmModeGetPlaneResources (self->fd);
|
||||
if (!pres)
|
||||
goto plane_resources_failed;
|
||||
|
@ -472,6 +479,12 @@ crtc_failed:
|
|||
goto bail;
|
||||
}
|
||||
|
||||
set_cap_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (self, "Could not set universal planes capability bit");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
plane_resources_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (self, "drmModeGetPlaneResources failed: %s (%d)",
|
||||
|
@ -481,8 +494,13 @@ plane_resources_failed:
|
|||
|
||||
plane_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (self, "Could not find a plane for crtc");
|
||||
goto bail;
|
||||
if (universal_planes) {
|
||||
GST_ERROR_OBJECT (self, "Could not find a plane for crtc");
|
||||
goto bail;
|
||||
} else {
|
||||
universal_planes = TRUE;
|
||||
goto retry_find_plane;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue