mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
kmssink: add a plane-id property
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 This patch adds a plane-id property to the kmssink element so a specific plane can be used in case that a CRTC has only a primary plane associated. https://bugzilla.gnome.org/show_bug.cgi?id=768183
This commit is contained in:
parent
e7f8c62d42
commit
c2cd60db0f
2 changed files with 33 additions and 1 deletions
|
@ -72070,6 +72070,16 @@ Gestures in the defined region of interest will emit messages.</BLURB>
|
||||||
<DEFAULT>NULL</DEFAULT>
|
<DEFAULT>NULL</DEFAULT>
|
||||||
</ARG>
|
</ARG>
|
||||||
|
|
||||||
|
<ARG>
|
||||||
|
<NAME>GstKMSSink::plane-id</NAME>
|
||||||
|
<TYPE>gint</TYPE>
|
||||||
|
<RANGE>>= G_MAXULONG</RANGE>
|
||||||
|
<FLAGS>rwx</FLAGS>
|
||||||
|
<NICK>Plane ID</NICK>
|
||||||
|
<BLURB>DRM plane id.</BLURB>
|
||||||
|
<DEFAULT>-1</DEFAULT>
|
||||||
|
</ARG>
|
||||||
|
|
||||||
<ARG>
|
<ARG>
|
||||||
<NAME>GstBs2b::fcut</NAME>
|
<NAME>GstBs2b::fcut</NAME>
|
||||||
<TYPE>gint</TYPE>
|
<TYPE>gint</TYPE>
|
||||||
|
|
|
@ -73,6 +73,7 @@ enum
|
||||||
{
|
{
|
||||||
PROP_DRIVER_NAME = 1,
|
PROP_DRIVER_NAME = 1,
|
||||||
PROP_CONNECTOR_ID,
|
PROP_CONNECTOR_ID,
|
||||||
|
PROP_PLANE_ID,
|
||||||
PROP_N
|
PROP_N
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -391,7 +392,10 @@ gst_kms_sink_start (GstBaseSink * bsink)
|
||||||
if (!pres)
|
if (!pres)
|
||||||
goto plane_resources_failed;
|
goto plane_resources_failed;
|
||||||
|
|
||||||
|
if (self->plane_id == -1)
|
||||||
plane = find_plane_for_crtc (self->fd, res, pres, crtc->crtc_id);
|
plane = find_plane_for_crtc (self->fd, res, pres, crtc->crtc_id);
|
||||||
|
else
|
||||||
|
plane = drmModeGetPlane (self->fd, self->plane_id);
|
||||||
if (!plane)
|
if (!plane)
|
||||||
goto plane_failed;
|
goto plane_failed;
|
||||||
|
|
||||||
|
@ -1153,6 +1157,9 @@ gst_kms_sink_set_property (GObject * object, guint prop_id,
|
||||||
case PROP_CONNECTOR_ID:
|
case PROP_CONNECTOR_ID:
|
||||||
sink->conn_id = g_value_get_int (value);
|
sink->conn_id = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_PLANE_ID:
|
||||||
|
sink->plane_id = g_value_get_int (value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -1174,6 +1181,9 @@ gst_kms_sink_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_CONNECTOR_ID:
|
case PROP_CONNECTOR_ID:
|
||||||
g_value_set_int (value, sink->conn_id);
|
g_value_set_int (value, sink->conn_id);
|
||||||
break;
|
break;
|
||||||
|
case PROP_PLANE_ID:
|
||||||
|
g_value_set_int (value, sink->plane_id);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -1197,6 +1207,7 @@ gst_kms_sink_init (GstKMSSink * sink)
|
||||||
{
|
{
|
||||||
sink->fd = -1;
|
sink->fd = -1;
|
||||||
sink->conn_id = -1;
|
sink->conn_id = -1;
|
||||||
|
sink->plane_id = -1;
|
||||||
gst_poll_fd_init (&sink->pollfd);
|
gst_poll_fd_init (&sink->pollfd);
|
||||||
sink->poll = gst_poll_new (TRUE);
|
sink->poll = gst_poll_new (TRUE);
|
||||||
gst_video_info_init (&sink->vinfo);
|
gst_video_info_init (&sink->vinfo);
|
||||||
|
@ -1259,6 +1270,17 @@ gst_kms_sink_class_init (GstKMSSinkClass * klass)
|
||||||
"Connector ID", "DRM connector id", -1, G_MAXINT32, -1,
|
"Connector ID", "DRM connector id", -1, G_MAXINT32, -1,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* kmssink:plane-id:
|
||||||
|
*
|
||||||
|
* There could be several planes associated with a CRTC.
|
||||||
|
* By default the first plane that's possible to use with a given
|
||||||
|
* CRTC is tried.
|
||||||
|
*/
|
||||||
|
g_properties[PROP_PLANE_ID] = g_param_spec_int ("plane-id",
|
||||||
|
"Plane ID", "DRM plane id", -1, G_MAXINT32, -1,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
|
||||||
|
|
||||||
g_object_class_install_properties (gobject_class, PROP_N, g_properties);
|
g_object_class_install_properties (gobject_class, PROP_N, g_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue