Message ID | 4d1acd84e914bafe491cfb42e7adab32d41ca0ab.1671566741.git.code@siddh.me |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3162514wrn; Tue, 20 Dec 2022 12:18:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXujNacxqt1jvIWFrUl3xMrPfEH3xsWBBf4COAJrII5o6QmJfstfP7Z2BuKowzAGNwYwVJdj X-Received: by 2002:a17:903:22c3:b0:189:6bda:e98c with SMTP id y3-20020a17090322c300b001896bdae98cmr20901584plg.58.1671567500250; Tue, 20 Dec 2022 12:18:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671567500; cv=pass; d=google.com; s=arc-20160816; b=YmTGMa8D1uK/FIQlHM7C0DP2K23rvt5L9Vvf5pMh5Fx9k9x5Hza7PwhXKDgwRlP2Vy ZkQOtpzoMJ5bTKOQr+B096qTFZyrJhH//8j1yKCb9VlhSfhNn6WjL0oJR1cqy2/TbbLg G6LEMvM4pQiIS3TM4Nlz9YXxvMwyIWjCa+ESdTt4N9oE/OQeE+UTSLfqHA7+a0HgZqK7 uU5SIXrYgREomSC6IbEq97ZhwhjPRLwZJhOQTXTE5D+ZX5lpCiVMJoRhber3ZJJ6SD0G pRUN23Cca3Ov4u0FRcLmJD4eqlQ26/k5tME2IpocFggDXWXIPvHdwxDm6+plY3/Xrmog 2K6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=mB40fcLJ2Ur35N0dmtlnvuXL20RmbKrSBSMdFwhnDkI=; b=zoVMz77kXO//G81c4puigmY5n5UQoTCaTHSu4jg/kLHcdsSlcbzMN6ivq8Y8Z9p5EQ vEHQVuqAReYmF1WgvAMQCaYM/ukTso5uK7hnJlYP1OcoP6r5pWCdWBHLTBdVmZEELyFf eWrgpbjiGLVHV8Td0Ixptcp6WjZ/ATnyUYxSNq2SbZUKOIQ0jyMQQ38reP5Aw5WAZaJG Gv3LWJHEvLLkpXjqCU9lYkaUYF0LKV0jT1+s/UK7iO/Vlxo/q/1ZIQx4uTTPdJYcilJt ZRHedrIv/TxLshisJ832uv5sLmaIHrYq7N9lCcbDFWfNHNuhbgOb0Dn3FSzQoPLFRqs0 3ybw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=S4L0nNia; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a170902e88400b00189e9aca9b3si16287125plg.34.2022.12.20.12.18.05; Tue, 20 Dec 2022 12:18:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=S4L0nNia; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234256AbiLTURl (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Tue, 20 Dec 2022 15:17:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbiLTURh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 20 Dec 2022 15:17:37 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C1FABB5 for <linux-kernel@vger.kernel.org>; Tue, 20 Dec 2022 12:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671567423; cv=none; d=zohomail.in; s=zohoarc; b=RLZT5a88nzgdtbI2STSwJGLxuQSvuQHDT/xVYIBi8zfwza2Ji9OW357QVhopZaRU8JgQbjYiqERUQYR+5sTJTYn5SFl1D4Cq90AGHA8C0fXxhFiKnRZYmuBbusOw9n3l7N8b0A54D+zjj81xCTFIJWyXVsoaJ8RGJNaQgg9Rpkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1671567423; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=mB40fcLJ2Ur35N0dmtlnvuXL20RmbKrSBSMdFwhnDkI=; b=RisT/oTd1UkWH3YcGD8J4amIZPOj4yyOth5CfNXJTdrgzrD5wtXzKWWWuujxbQi8PFu/mJlLUEn2UTVaiiCrZmWV1rg5qINQKPFISsHpsU6vRmFJtD5dlMjGxolyEfXBsUYH0B0PSmCcmRfrGQNwhaqSTq4OyeKyS0bSiaHpO1g= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from=<code@siddh.me> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1671567423; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=mB40fcLJ2Ur35N0dmtlnvuXL20RmbKrSBSMdFwhnDkI=; b=S4L0nNiauFt0CvSYBkFUafTJVbAWs0vwMFlqJeXxMvxo30zkKkErOdDpjCpc2ffG BI7t1FfrREtoyDGiIiwQ3BrU6Ti1qsfVvdu+/JRooGazOMkxXa/udfADwVmfCY4WR5O urusJhvwef6/gSBhsD8lxVjEcSWPolU4SibYwbdg= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1671567422565129.3515538184248; Wed, 21 Dec 2022 01:47:02 +0530 (IST) From: Siddh Raman Pant <code@siddh.me> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel <dri-devel@lists.freedesktop.org>, linux-kernel <linux-kernel@vger.kernel.org> Message-ID: <4d1acd84e914bafe491cfb42e7adab32d41ca0ab.1671566741.git.code@siddh.me> Subject: [PATCH 06/10] drm: Remove usage of deprecated DRM_DEBUG_DRIVER Date: Wed, 21 Dec 2022 01:46:41 +0530 X-Mailer: git-send-email 2.35.1 In-Reply-To: <cover.1671566741.git.code@siddh.me> References: <cover.1671566741.git.code@siddh.me> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752765562978199696?= X-GMAIL-MSGID: =?utf-8?q?1752765562978199696?= |
Series |
drm: Remove usage of deprecated DRM_* macros
|
|
Commit Message
Siddh Raman Pant
Dec. 20, 2022, 8:16 p.m. UTC
drm_print.h says DRM_DEBUG_DRIVER is deprecated.
Thus, use newer drm_dbg_driver().
Also fix the deprecation comment in drm_print.h which
mentions drm_dbg() instead of drm_dbg_driver().
Signed-off-by: Siddh Raman Pant <code@siddh.me>
---
drivers/gpu/drm/drm_mipi_dbi.c | 10 +++++-----
include/drm/drm_print.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
Comments
On Wed, 21 Dec 2022, Siddh Raman Pant <code@siddh.me> wrote: > drm_print.h says DRM_DEBUG_DRIVER is deprecated. > Thus, use newer drm_dbg_driver(). > > Also fix the deprecation comment in drm_print.h which > mentions drm_dbg() instead of drm_dbg_driver(). > > Signed-off-by: Siddh Raman Pant <code@siddh.me> > --- > drivers/gpu/drm/drm_mipi_dbi.c | 10 +++++----- > include/drm/drm_print.h | 2 +- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c > index 24af507bb687..6ad399f6ab03 100644 > --- a/drivers/gpu/drm/drm_mipi_dbi.c > +++ b/drivers/gpu/drm/drm_mipi_dbi.c > @@ -69,11 +69,11 @@ > #define MIPI_DBI_DEBUG_COMMAND(cmd, data, len) \ > ({ \ > if (!len) \ > - DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ > + drm_dbg_driver(NULL, "cmd=%02x\n", cmd); \ > else if (len <= 32) \ > - DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ > + drm_dbg_driver(NULL, "cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ > else \ > - DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ > + drm_dbg_driver(NULL, "cmd=%02x, len=%zu\n", cmd, len); \ > }) > > static const u8 mipi_dbi_dcs_read_commands[] = { > @@ -632,7 +632,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *dbi) > DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE)) > return false; > > - DRM_DEBUG_DRIVER("Display is ON\n"); > + drm_dbg_driver(NULL, "Display is ON\n"); > > return true; > } > @@ -1168,7 +1168,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi, > > mutex_init(&dbi->cmdlock); > > - DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); > + drm_dbg_driver(NULL, "SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); > > return 0; > } > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > index 53702d830291..10261faec8b6 100644 > --- a/include/drm/drm_print.h > +++ b/include/drm/drm_print.h > @@ -614,7 +614,7 @@ void __drm_err(const char *format, ...); > #define DRM_DEBUG(fmt, ...) \ > __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) > > -/* NOTE: this is deprecated in favor of drm_dbg(NULL, ...). */ > +/* NOTE: this is deprecated in favor of drm_dbg_driver(NULL, ...). */ Way back the idea was to make the shorter drm_dbg() the driver debug, and drm_dbg_core() the drm core debug, because the former vastly outnumbers the the latter. I don't know if that changed with the dyndbg stuff. BR, Jani. > #define DRM_DEBUG_DRIVER(fmt, ...) \ > __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
Hi Am 21.12.22 um 11:00 schrieb Jani Nikula: > On Wed, 21 Dec 2022, Siddh Raman Pant <code@siddh.me> wrote: >> drm_print.h says DRM_DEBUG_DRIVER is deprecated. >> Thus, use newer drm_dbg_driver(). >> >> Also fix the deprecation comment in drm_print.h which >> mentions drm_dbg() instead of drm_dbg_driver(). >> >> Signed-off-by: Siddh Raman Pant <code@siddh.me> >> --- >> drivers/gpu/drm/drm_mipi_dbi.c | 10 +++++----- >> include/drm/drm_print.h | 2 +- >> 2 files changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c >> index 24af507bb687..6ad399f6ab03 100644 >> --- a/drivers/gpu/drm/drm_mipi_dbi.c >> +++ b/drivers/gpu/drm/drm_mipi_dbi.c >> @@ -69,11 +69,11 @@ >> #define MIPI_DBI_DEBUG_COMMAND(cmd, data, len) \ >> ({ \ >> if (!len) \ >> - DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ >> + drm_dbg_driver(NULL, "cmd=%02x\n", cmd); \ >> else if (len <= 32) \ >> - DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ >> + drm_dbg_driver(NULL, "cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ >> else \ >> - DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ >> + drm_dbg_driver(NULL, "cmd=%02x, len=%zu\n", cmd, len); \ >> }) >> >> static const u8 mipi_dbi_dcs_read_commands[] = { >> @@ -632,7 +632,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *dbi) >> DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE)) >> return false; >> >> - DRM_DEBUG_DRIVER("Display is ON\n"); >> + drm_dbg_driver(NULL, "Display is ON\n"); >> >> return true; >> } >> @@ -1168,7 +1168,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi, >> >> mutex_init(&dbi->cmdlock); >> >> - DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); >> + drm_dbg_driver(NULL, "SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); >> >> return 0; >> } >> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h >> index 53702d830291..10261faec8b6 100644 >> --- a/include/drm/drm_print.h >> +++ b/include/drm/drm_print.h >> @@ -614,7 +614,7 @@ void __drm_err(const char *format, ...); >> #define DRM_DEBUG(fmt, ...) \ >> __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) >> >> -/* NOTE: this is deprecated in favor of drm_dbg(NULL, ...). */ >> +/* NOTE: this is deprecated in favor of drm_dbg_driver(NULL, ...). */ > > Way back the idea was to make the shorter drm_dbg() the driver debug, > and drm_dbg_core() the drm core debug, because the former vastly > outnumbers the the latter. > > I don't know if that changed with the dyndbg stuff. I've recently grepped for these macros and nothing uses drm_dbg_driver() directly. I also wondered whether the driver debug macro makes much sense. For example, if a driver implements its own atomic helpers, it's much more useful to use drm_dbg_kms() within those functions. If enabled, their output would then blend into the overall KMS-related debugging. drm_dbg/drm_dbg_driver() appears to be mostly useful for init and status reporting. Best regards Thomas > > > BR, > Jani. > > >> #define DRM_DEBUG_DRIVER(fmt, ...) \ >> __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
On Wed, Dec 21, 2022 at 3:14 AM Thomas Zimmermann <tzimmermann@suse.de> wrote: > > Hi > > Am 21.12.22 um 11:00 schrieb Jani Nikula: > > On Wed, 21 Dec 2022, Siddh Raman Pant <code@siddh.me> wrote: > >> drm_print.h says DRM_DEBUG_DRIVER is deprecated. > >> Thus, use newer drm_dbg_driver(). > >> > >> Also fix the deprecation comment in drm_print.h which > >> mentions drm_dbg() instead of drm_dbg_driver(). > >> > >> Signed-off-by: Siddh Raman Pant <code@siddh.me> > >> --- > >> drivers/gpu/drm/drm_mipi_dbi.c | 10 +++++----- > >> include/drm/drm_print.h | 2 +- > >> 2 files changed, 6 insertions(+), 6 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c > >> index 24af507bb687..6ad399f6ab03 100644 > >> --- a/drivers/gpu/drm/drm_mipi_dbi.c > >> +++ b/drivers/gpu/drm/drm_mipi_dbi.c > >> @@ -69,11 +69,11 @@ > >> #define MIPI_DBI_DEBUG_COMMAND(cmd, data, len) \ > >> ({ \ > >> if (!len) \ > >> - DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ > >> + drm_dbg_driver(NULL, "cmd=%02x\n", cmd); \ > >> else if (len <= 32) \ > >> - DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ > >> + drm_dbg_driver(NULL, "cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ > >> else \ > >> - DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ > >> + drm_dbg_driver(NULL, "cmd=%02x, len=%zu\n", cmd, len); \ > >> }) > >> > >> static const u8 mipi_dbi_dcs_read_commands[] = { > >> @@ -632,7 +632,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *dbi) > >> DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE)) > >> return false; > >> > >> - DRM_DEBUG_DRIVER("Display is ON\n"); > >> + drm_dbg_driver(NULL, "Display is ON\n"); > >> > >> return true; > >> } > >> @@ -1168,7 +1168,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi, > >> > >> mutex_init(&dbi->cmdlock); > >> > >> - DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); > >> + drm_dbg_driver(NULL, "SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); > >> > >> return 0; > >> } > >> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > >> index 53702d830291..10261faec8b6 100644 > >> --- a/include/drm/drm_print.h > >> +++ b/include/drm/drm_print.h > >> @@ -614,7 +614,7 @@ void __drm_err(const char *format, ...); > >> #define DRM_DEBUG(fmt, ...) \ > >> __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) > >> > >> -/* NOTE: this is deprecated in favor of drm_dbg(NULL, ...). */ > >> +/* NOTE: this is deprecated in favor of drm_dbg_driver(NULL, ...). */ > > > > Way back the idea was to make the shorter drm_dbg() the driver debug, > > and drm_dbg_core() the drm core debug, because the former vastly > > outnumbers the the latter. > > > > I don't know if that changed with the dyndbg stuff. well, there was: commit 95a77b6331c2d2313aa843fa77ec91cd092ab0e4 Author: Jim Cromie <jim.cromie@gmail.com> Date: Sun Sep 11 23:28:49 2022 -0600 drm-print: add drm_dbg_driver to improve namespace symmetry drm_print defines all of these: drm_dbg_{core,kms,prime,atomic,vbl,lease,_dp,_drmres} but not drm_dbg_driver itself, since it was the original drm_dbg. To improve namespace symmetry, change the drm_dbg defn to drm_dbg_driver, and redef grandfathered name to symmetric one. > > I've recently grepped for these macros and nothing uses drm_dbg_driver() > directly. I have a use-case for it, in an unready branch thats trying to adapt nouveau to use dyndbg. Its presence allows macro constructs to paste 'driver' onto the end, and have it resolve. (see ##cat below) --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -39,6 +39,7 @@ */ #include <linux/notifier.h> +#include <linux/dynamic_debug.h> #include <nvif/client.h> #include <nvif/device.h> @@ -263,13 +264,16 @@ void nouveau_drm_device_remove(struct drm_device *dev); #define NV_WARN(drm,f,a...) NV_PRINTK(warn, &(drm)->client, f, ##a) #define NV_INFO(drm,f,a...) NV_PRINTK(info, &(drm)->client, f, ##a) -#define NV_DEBUG(drm,f,a...) do { \ - if (drm_debug_enabled(DRM_UT_DRIVER)) \ - NV_PRINTK(info, &(drm)->client, f, ##a); \ +#define NV_DRMDBG(cat,c,f,a...) do { \ + struct nouveau_cli *_cli = (c); \ + drm_dbg_##cat(_cli->drm->dev, "%s: "f, _cli->name, ##a); \ } while(0) -#define NV_ATOMIC(drm,f,a...) do { \ - if (drm_debug_enabled(DRM_UT_ATOMIC)) \ - NV_PRINTK(info, &(drm)->client, f, ##a); \ + +#define NV_DEBUG(drm,f,a...) do { \ + NV_DRMDBG(driver, &(drm)->client, f, ##a); \ +} while(0) +#define NV_ATOMIC(drm,f,a...) do { \ + NV_DRMDBG(atomic, &(drm)->client, f, ##a); \ } while(0) That could probably be special-cased to avoid pasting "driver", but it would be harder to read. > > I also wondered whether the driver debug macro makes much sense. For > example, if a driver implements its own atomic helpers, it's much more > useful to use drm_dbg_kms() within those functions. If enabled, their > output would then blend into the overall KMS-related debugging. > drm_dbg/drm_dbg_driver() appears to be mostly useful for init and status > reporting. This seems a larger, separate topic: How to rationalize the broad sub-system-wide use of drm.debug ? if we can veer onto that topic: dyndbg has optional decorations, controlled by flags: "mfl" -> module.func.lineno DRM has its own conventions, which I wont try to summarize or enumerate beyond noting driver name can appear 2x DRM_INFO prefixes "[drm]", others too Im sure. can they (the debug anyway) be made optional - flag controlled ? extending flags or even redefining them seems practical. I have WIP dyndbg-to-trace interface, with a T flag to enable each drm-dbg callsite to write to tracefs how would DRM / DRI best use this ? Currently, drm -> tracefs works, but messages include trailing \n, and 2nd is added by trace, giving blank lines. Stripping it at runtime is possible, but cost >0, stripping it in src from fmt strings, and restoring it in the underlying printk is practical, but sorta flag-day. Is it distasteful ? is there any pr_cont() style use of drm.debug ? that would interfere with \n stripping. should drm.debug --> dyndbg --> tracefs messages include the decorations ? or a different form of them ? Separately (while Im here), what tree does patchwork apply to ? I seem to always guess wrong. > > Best regards > Thomas > > > > > > > BR, > > Jani. > > > > > >> #define DRM_DEBUG_DRIVER(fmt, ...) \ > >> __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) > > > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 Nürnberg, Germany > (HRB 36809, AG Nürnberg) > Geschäftsführer: Ivo Totev
diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 24af507bb687..6ad399f6ab03 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -69,11 +69,11 @@ #define MIPI_DBI_DEBUG_COMMAND(cmd, data, len) \ ({ \ if (!len) \ - DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ + drm_dbg_driver(NULL, "cmd=%02x\n", cmd); \ else if (len <= 32) \ - DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ + drm_dbg_driver(NULL, "cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ else \ - DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ + drm_dbg_driver(NULL, "cmd=%02x, len=%zu\n", cmd, len); \ }) static const u8 mipi_dbi_dcs_read_commands[] = { @@ -632,7 +632,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *dbi) DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE)) return false; - DRM_DEBUG_DRIVER("Display is ON\n"); + drm_dbg_driver(NULL, "Display is ON\n"); return true; } @@ -1168,7 +1168,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi, mutex_init(&dbi->cmdlock); - DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); + drm_dbg_driver(NULL, "SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); return 0; } diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 53702d830291..10261faec8b6 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -614,7 +614,7 @@ void __drm_err(const char *format, ...); #define DRM_DEBUG(fmt, ...) \ __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of drm_dbg(NULL, ...). */ +/* NOTE: this is deprecated in favor of drm_dbg_driver(NULL, ...). */ #define DRM_DEBUG_DRIVER(fmt, ...) \ __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__)