From patchwork Tue Dec 4 16:00:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 1839071 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 8E1FADF230 for ; Tue, 4 Dec 2012 16:01:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C607E6038 for ; Tue, 4 Dec 2012 08:01:20 -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 97A31E638C; Tue, 4 Dec 2012 08:00:24 -0800 (PST) Received: by mail-wg0-f45.google.com with SMTP id dq12so1843044wgb.12 for ; Tue, 04 Dec 2012 08:00:23 -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=2KZDh7EVRQjgiNZ2v1f1GTdHx4EV+escOJEq8T1iN+Y=; b=UgTGeeHgdDB22shriGaAtIIRoBZ9d26tPEZRrkzohaSLV9H0pHZ8d3sAY/R4D5fVhm Z+uRUp6pdc91e07+XQAxm+5xEBnOkuJhAdgmVU8Kkt2d7SEBOAXnzeQ5PWPHjr8gTgA6 W+nZB+Vfh3KJEJIg5j8QjL1rWtjjq20f3UIb5E5Wjll79nq+elTu0RA/LXd8Fq9QdLJI Kc1+vJOx04hoSMK1UJBa+Xftvm160kP0RmOlLDdFRhFq89x8aircoeRBrzy333mTRiOg xJR3hQ3tWxnc2gG5slB6aZrmwvOlhAJJNoUxL3P64rJ1GSTNPhDd8qhZFwlTucK8ifZL 8dmQ== Received: by 10.216.54.129 with SMTP id i1mr4124027wec.183.1354636823478; Tue, 04 Dec 2012 08:00:23 -0800 (PST) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id fv2sm15554142wib.4.2012.12.04.08.00.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Dec 2012 08:00:22 -0800 (PST) From: Damien Lespiau 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 Message-Id: <1354636817-1426-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. Signed-off-by: Damien Lespiau --- 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; }