All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Make the HPD status updates debug logs more readable
@ 2012-12-04 16:00 Damien Lespiau
  2012-12-04 17:39 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Lespiau @ 2012-12-04 16:00 UTC (permalink / raw)
  To: intel-gfx, dri-devel

From: Damien Lespiau <damien.lespiau@intel.com>

Instead of just printing "status updated from 1 to 2", make those enum
numbers immediately readable.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_crtc_helper.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1fe719f..8b963fd 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -1043,6 +1043,18 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
+static const char *connector_status_str(enum drm_connector_status status)
+{
+	switch (status) {
+	case connector_status_connected:
+		return "connected";
+	case connector_status_disconnected:
+		return "disconnected";
+	default:
+		return "unknown";
+	}
+}
+
 void drm_helper_hpd_irq_event(struct drm_device *dev)
 {
 	struct drm_connector *connector;
@@ -1062,10 +1074,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
 		old_status = connector->status;
 
 		connector->status = connector->funcs->detect(connector, false);
-		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
+		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
 			      connector->base.id,
 			      drm_get_connector_name(connector),
-			      old_status, connector->status);
+			      connector_status_str(old_status),
+			      connector_status_str(connector->status));
 		if (old_status != connector->status)
 			changed = true;
 	}
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-10 20:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 16:00 [PATCH] drm: Make the HPD status updates debug logs more readable Damien Lespiau
2012-12-04 17:39 ` Daniel Vetter
2012-12-10 20:28   ` Damien Lespiau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.