diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-08-17 11:12:26 +0200 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-08-21 11:49:55 -0400 |
commit | 62a194c78189be629b868944006ba14f017f46f5 (patch) | |
tree | 69dc930acca9f0ce57113c11a304d1a1e9bd01c7 /sys | |
parent | 203d1825c51481b6efe7ae2b275742cd789452c4 (diff) |
kmssink: configure mode setting from video info
drmModeGetFB returns -EINVAL for multi-planar framebuffers. Instead of
depending on the framebuffer dimensions to select the mode, use width
and height from GstVideoInfo, which was used to create the framebuffer
in the first place. This enables kmssink to display multi-planar
formats such as I420 or NV12 with modesetting enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=796985
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kms/gstkmssink.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c index 1331883ce..3400d3244 100644 --- a/sys/kms/gstkmssink.c +++ b/sys/kms/gstkmssink.c @@ -414,7 +414,6 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo) gboolean ret; drmModeConnector *conn; int err; - drmModeFB *fb; gint i; drmModeModeInfo *mode; guint32 fb_id; @@ -422,7 +421,6 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo) ret = FALSE; conn = NULL; - fb = NULL; mode = NULL; kmsmem = NULL; @@ -440,13 +438,9 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo) if (!conn) goto connector_failed; - fb = drmModeGetFB (self->fd, fb_id); - if (!fb) - goto framebuffer_failed; - for (i = 0; i < conn->count_modes; i++) { - if (conn->modes[i].vdisplay == fb->height && - conn->modes[i].hdisplay == fb->width) { + if (conn->modes[i].vdisplay == GST_VIDEO_INFO_HEIGHT (vinfo) && + conn->modes[i].hdisplay == GST_VIDEO_INFO_WIDTH (vinfo)) { mode = &conn->modes[i]; break; } @@ -464,8 +458,6 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo) ret = TRUE; bail: - if (fb) - drmModeFreeFB (fb); if (conn) drmModeFreeConnector (conn); @@ -483,12 +475,6 @@ connector_failed: GST_ERROR_OBJECT (self, "Could not find a valid monitor connector"); goto bail; } -framebuffer_failed: - { - GST_ERROR_OBJECT (self, "drmModeGetFB failed: %s (%d)", - strerror (errno), errno); - goto bail; - } mode_failed: { GST_ERROR_OBJECT (self, "cannot find appropriate mode"); |