From: Damien Lespiau <damien.lespiau@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 2/5] drm: Make the HPD status updates debug logs more readable
Date: Wed, 8 May 2013 17:03:31 +0100 [thread overview]
Message-ID: <1368029014-30181-3-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <1368029014-30181-1-git-send-email-damien.lespiau@intel.com>
Instead of just printing "status updated from 1 to 2", make those enum
numbers immediately readable.
v2: Also patch output_poll_execute() (Daniel Vetter)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/gpu/drm/drm_crtc_helper.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 7b2d378..8976eb6 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -968,6 +968,18 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_kms_helper_hotplug_event);
+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";
+ }
+}
+
#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
static void output_poll_execute(struct work_struct *work)
{
@@ -1002,10 +1014,11 @@ static void output_poll_execute(struct work_struct *work)
continue;
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;
}
@@ -1080,10 +1093,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.8.1.4
next prev parent reply other threads:[~2013-05-08 16:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 16:03 Some lost drm patches Damien Lespiau
2013-05-08 16:03 ` [PATCH 1/5] drm: Add missing break in the command line mode parsing code Damien Lespiau
2013-05-08 16:03 ` Damien Lespiau [this message]
2013-05-08 16:43 ` [PATCH 2/5] drm: Make the HPD status updates debug logs more readable Chris Wilson
2013-05-08 16:43 ` Ville Syrjälä
2013-05-10 6:27 ` Jani Nikula
2013-05-08 16:03 ` [PATCH 3/5] drm: Don't prune modes loudly when a connector is disconnected Damien Lespiau
2013-05-08 16:03 ` [PATCH 4/5] drm: Fix a typo in the struct drm_plane_funcs documentation Damien Lespiau
2013-05-08 16:43 ` Ville Syrjälä
2013-05-08 16:03 ` [PATCH 5/5] drm: Use names of ioctls in debug traces Damien Lespiau
2013-05-08 16:55 ` [Intel-gfx] " Ville Syrjälä
2013-05-09 1:46 ` Ben Widawsky
2013-05-09 13:20 ` [PATCH v2 " Chris Cummins
2013-05-09 13:29 ` Alex Deucher
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=1368029014-30181-3-git-send-email-damien.lespiau@intel.com \
--to=damien.lespiau@intel.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