From patchwork Fri Aug 19 22:42:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 9291279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B3113607FF for ; Fri, 19 Aug 2016 22:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA224295C3 for ; Fri, 19 Aug 2016 22:28:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD764295C5; Fri, 19 Aug 2016 22:28:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0BFB295C3 for ; Fri, 19 Aug 2016 22:28:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 770BF6E0E7; Fri, 19 Aug 2016 22:28:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id C486D6E0E7; Fri, 19 Aug 2016 22:27:58 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 19 Aug 2016 15:27:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,546,1464678000"; d="scan'208"; a="1017604702" Received: from skynet.jf.intel.com ([10.54.75.148]) by orsmga001.jf.intel.com with ESMTP; 19 Aug 2016 15:27:54 -0700 From: Dhinakaran Pandiyan To: dri-devel@lists.freedesktop.org Date: Fri, 19 Aug 2016 15:42:03 -0700 Message-Id: <1471646523-2663-1-git-send-email-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.5.0 Cc: intel-gfx@lists.freedesktop.org, Dhinakaran Pandiyan Subject: [Intel-gfx] [RFC][PATCH] drm: Add DRM_DEBUG_DISPLAY macro for display configuration debug messages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP KMS has a lot of code sequences where the driver has to select a certain HW configuration among the available ones. For e.g., link rate, clock, voltage swing, training pattern etc. Printing such low-level messages is valuable for debugging display problems. But, will bloat dmesg if printed with DRM_DEBUG_KMS. DRM_DEBUG_DISPLAY will specifically address such cases where the developer wants communicate why a display related configuration choice was made. Signed-off-by: Dhinakaran Pandiyan Cc: Chris Wilson --- include/drm/drmP.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d377865..c831c69 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -114,6 +114,9 @@ struct dma_buf_attachment; * VBL: used for verbose debug message in the vblank code * This is the category used by the DRM_DEBUG_VBL() macro. * + * DISPLAY: used for low-level display configuration messages. + * This is the category used by the DRM_DEBUG_DISPLAY() macro. + * * Enabling verbose debug messages is done through the drm.debug parameter, * each category being enabled by a bit. * @@ -133,6 +136,7 @@ struct dma_buf_attachment; #define DRM_UT_PRIME 0x08 #define DRM_UT_ATOMIC 0x10 #define DRM_UT_VBL 0x20 +#define DRM_UT_DISPLAY 0x40 extern __printf(2, 3) void drm_ut_debug_printk(const char *function_name, @@ -230,6 +234,11 @@ void drm_err(const char *format, ...); if (unlikely(drm_debug & DRM_UT_VBL)) \ drm_ut_debug_printk(__func__, fmt, ##args); \ } while (0) +#define DRM_DEBUG_DISPLAY(fmt, args...) \ + do { \ + if (unlikely(drm_debug & DRM_UT_DISPLAY)) \ + drm_ut_debug_printk(__func__, fmt, ##args); \ + } while (0) /*@}*/