From: Damien Lespiau <damien.lespiau@gmail.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm: Make the HPD status updates debug logs more readable
Date: Tue, 4 Dec 2012 16:00:17 +0000 [thread overview]
Message-ID: <1354636817-1426-1-git-send-email-damien.lespiau@gmail.com> (raw)
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
next reply other threads:[~2012-12-04 16:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 16:00 Damien Lespiau [this message]
2012-12-04 17:39 ` [PATCH] drm: Make the HPD status updates debug logs more readable Daniel Vetter
2012-12-10 20:28 ` Damien Lespiau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354636817-1426-1-git-send-email-damien.lespiau@gmail.com \
--to=damien.lespiau@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox