From patchwork Wed Apr 27 10:06:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 8954341 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5EC049F441 for ; Wed, 27 Apr 2016 10:07:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73EE420260 for ; Wed, 27 Apr 2016 10:07:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EDFF920259 for ; Wed, 27 Apr 2016 10:07:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4FDA6EA3A; Wed, 27 Apr 2016 10:07:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 712E96EA3A; Wed, 27 Apr 2016 10:07:07 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 27 Apr 2016 03:07:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,540,1455004800"; d="scan'208";a="963707627" Received: from tursulin-linux.isw.intel.com ([10.102.226.196]) by orsmga002.jf.intel.com with ESMTP; 27 Apr 2016 03:07:06 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Subject: [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Date: Wed, 27 Apr 2016 11:06:54 +0100 Message-Id: <1461751622-26927-2-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461751622-26927-1-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1461751622-26927-1-git-send-email-tvrtko.ursulin@linux.intel.com> Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, Tvrtko Ursulin X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Purpose is to enable drivers to print out just the mode string with their own formatting. Existing drm_mode_debug_printmodeline calls the new helper and the format is unchanged in this patch. Signed-off-by: Tvrtko Ursulin Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_modes.c | 29 ++++++++++++++++++++++------- include/drm/drm_modes.h | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 7def3d58da18..fd4795e2c8db 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -42,6 +42,24 @@ #include "drm_crtc_internal.h" /** + * drm_mode_debug_printmodeline_raw - print a mode raw string to dmesg + * @mode: mode to print + * + * Describe @mode using DRM_DEBUG without the loglevel, drm prefix and newline. + */ +void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode) +{ + if (drm_debug & DRM_UT_KMS) + printk("%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x", + mode->base.id, mode->name, mode->vrefresh, mode->clock, + mode->hdisplay, mode->hsync_start, + mode->hsync_end, mode->htotal, + mode->vdisplay, mode->vsync_start, + mode->vsync_end, mode->vtotal, mode->type, mode->flags); +} +EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw); + +/** * drm_mode_debug_printmodeline - print a mode to dmesg * @mode: mode to print * @@ -49,13 +67,10 @@ */ void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) { - DRM_DEBUG_KMS("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d " - "0x%x 0x%x\n", - mode->base.id, mode->name, mode->vrefresh, mode->clock, - mode->hdisplay, mode->hsync_start, - mode->hsync_end, mode->htotal, - mode->vdisplay, mode->vsync_start, - mode->vsync_end, mode->vtotal, mode->type, mode->flags); + DRM_DEBUG_KMS("Modeline "); + drm_mode_debug_printmodeline_raw(mode); + if (drm_debug & DRM_UT_KMS) + printk("\n"); } EXPORT_SYMBOL(drm_mode_debug_printmodeline); diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index 625966a906f2..9bb0cd06b80e 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -437,6 +437,7 @@ int drm_mode_convert_umode(struct drm_display_mode *out, const struct drm_mode_modeinfo *in); void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); void drm_mode_debug_printmodeline(const struct drm_display_mode *mode); +void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode); struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh,