From patchwork Mon Dec 10 20:24:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 1859851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 00675DFB79 for ; Mon, 10 Dec 2012 20:24:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E045BE6220 for ; Mon, 10 Dec 2012 12:24:48 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by gabe.freedesktop.org (Postfix) with ESMTP id E609FE5C37; Mon, 10 Dec 2012 12:24:34 -0800 (PST) Received: by mail-wg0-f45.google.com with SMTP id dq12so1520739wgb.12 for ; Mon, 10 Dec 2012 12:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=hZBvCNjZkdpvqeyT923j5SCTmWZB9/IUvY29DVxRtGo=; b=eMw/Qithc+12yAl/ayNHz2j0MqXEExDJEnMKMNffTxIEUcmpdAj/cFWt4QUEeD8gkB tIuYCjOlBiulry3zzp/yxaBzs+pWN8JL6tgXQG6CZs8giYiWLkApvWehnjAFIM0Y/Pft amEs+oMgVWO/6B38w6zF1eJrXxOrZ6XUIUsAVkjJbvafu9OhH57jGAai0laOZ4PlFPhs xBypVCnNofIYvE0xyigwZDT54I3Rx0IHRioNOWFTfVY+1sQ29vMfSKZbrHnPqo4q1tj1 jTQew8MjuTATSAiaY42icxTjuR6BRMA4q+2xgfzsT5hOEPJZYd5yke8O2Wl/YBciobpq 1h3A== Received: by 10.216.205.79 with SMTP id i57mr5964885weo.209.1355171073620; Mon, 10 Dec 2012 12:24:33 -0800 (PST) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id gz3sm11552381wib.2.2012.12.10.12.24.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 12:24:32 -0800 (PST) From: Damien Lespiau To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Date: Mon, 10 Dec 2012 20:24:23 +0000 Message-Id: <1355171064-1321-1-git-send-email-damien.lespiau@gmail.com> X-Mailer: git-send-email 1.7.11.7 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Damien Lespiau 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 Reviewed-by: Jesse Barnes --- 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 1fe719f..524f0d3 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -950,6 +950,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) { @@ -984,10 +996,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; } @@ -1062,10 +1075,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; }