From 4b3baab40a3baa2042985a0fce6421661cbffca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 30 Nov 2016 19:53:30 +0100 Subject: [PATCH] kmssink: post error message if start() fails It is expected to post an error message in the bus if the device cannot be started. --- sys/kms/gstkmssink.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c index 835f02c61d..2f05c633d3 100644 --- a/sys/kms/gstkmssink.c +++ b/sys/kms/gstkmssink.c @@ -555,7 +555,7 @@ retry_find_plane: goto plane_failed; if (!ensure_allowed_caps (self, conn, plane, res)) - goto bail; + goto allowed_caps_failed; self->conn_id = conn->connector_id; self->crtc_id = crtc->crtc_id; @@ -602,53 +602,68 @@ bail: /* ERRORS */ open_failed: { - GST_ERROR_OBJECT (self, "Could not open DRM module %s: %s", - GST_STR_NULL (self->devname), strerror (errno)); + GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ_WRITE, + ("Could not open DRM module %s", GST_STR_NULL (self->devname)), + ("reason: %s (%d)", strerror (errno), errno)); return FALSE; } resources_failed: { - GST_ERROR_OBJECT (self, "drmModeGetResources failed: %s (%d)", - strerror (errno), errno); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("drmModeGetResources failed"), + ("reason: %s (%d)", strerror (errno), errno)); goto bail; } connector_failed: { - GST_ERROR_OBJECT (self, "Could not find a valid monitor connector"); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("Could not find a valid monitor connector"), (NULL)); goto bail; } crtc_failed: { - GST_ERROR_OBJECT (self, "Could not find a crtc for connector"); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("Could not find a crtc for connector"), (NULL)); goto bail; } set_cap_failed: { - GST_ERROR_OBJECT (self, "Could not set universal planes capability bit"); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("Could not set universal planes capability bit"), (NULL)); goto bail; } plane_resources_failed: { - GST_ERROR_OBJECT (self, "drmModeGetPlaneResources failed: %s (%d)", - strerror (errno), errno); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("drmModeGetPlaneResources failed"), + ("reason: %s (%d)", strerror (errno), errno)); goto bail; } plane_failed: { if (universal_planes) { - GST_ERROR_OBJECT (self, "Could not find a plane for crtc"); + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("Could not find a plane for crtc"), (NULL)); goto bail; } else { universal_planes = TRUE; goto retry_find_plane; } } + +allowed_caps_failed: + { + GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS, + ("Could not get allowed GstCaps of device"), + ("driver does not provide mode settings configuration")); + goto bail; + } } static gboolean