From patchwork Sat Dec 21 09:55:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FFE61580 for ; Sat, 21 Dec 2019 09:56:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D7B8222C2 for ; Sat, 21 Dec 2019 09:56:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zk6QhhN2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D7B8222C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50DD36E433; Sat, 21 Dec 2019 09:56:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id C67DD6E42E for ; Sat, 21 Dec 2019 09:56:10 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id k8so12471558ljh.5 for ; Sat, 21 Dec 2019 01:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MegBDSu66fhUyXe+1lMvrcBAGgIc0C7vgWNW74n27Xs=; b=Zk6QhhN2nBhYYoVBxf9hv09dk1/kGEVtbib80tQ088NaNWh5D44nU6TnghgezRCbA1 X+krKGru5ugeo5xtZZdQpiPsIgGNmr2xIl5XghzIXK3Cxdo4s+fSIpx5DpGbirWfEPdx kq+NmnLivVAtnxpFyiecfJxK2qHQjh5/TINdpuk+GoahjaVuixCfSYgiMabv4iVQUfhC aNjUb06JMyA3vYMoHj39MBFuw4uuPJ9tAE+D9BbMWPaBADaM5OEl/DQ/bV+0q/F3/heK YCQnHyMhBAMpSZLQJ32sA4wQXir74XYxTUA3yqc44RAHN5NRKL2+LvM8KmuEFu3FEGXN ifbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MegBDSu66fhUyXe+1lMvrcBAGgIc0C7vgWNW74n27Xs=; b=qAfvMo5pHIp451qdDhxl/BXUTsjmTs+T0kbeQ/7eqhS6xJYTSry+z2geut7H7O+Zc4 cWwTAz3kKGfQOKi6By/MBNzrTr+Fik6vmJNsfklGGy4lffmOJsS7/Sr3tB91EyYz1L3g U1X6q3UrkHCR+6XEN4qTAzXqqbmYhBtB75MGjr7YJDXYn3kwEvjKwxhBlo+Mz9DkmAhW SETp+q0XiqccjKMjHy2mO8YFL3b5zthhMzp/eqOtalvvOhGYAGNr32POK4HPJqkLhcQL Te/183saJHGm7IXEY5qvLV4/3Nq5KUvU0eyDBhtXjfb5All8UcSaWVMHMovsCOS3DeKI rYtg== X-Gm-Message-State: APjAAAW8zGCygZXQKCIG0rDtZBY02VVH5rEWcCAL2CuEQSsbntfBWBe0 MVk4feBPSuUZwp6IWRYbGz2mx/Dm268= X-Google-Smtp-Source: APXvYqwE1iFlyoGvAeQ4M9bwTCnozw7UB/J1wAIPswt51kKTV9vftziqr8RSsq6am6Z0lTxkul8p7Q== X-Received: by 2002:a2e:95c4:: with SMTP id y4mr12602719ljh.38.1576922168990; Sat, 21 Dec 2019 01:56:08 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:08 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 1/8] drm/print: document logging functions Date: Sat, 21 Dec 2019 10:55:46 +0100 Message-Id: <20191221095553.13332-2-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is the documentation I have missed when I looked for help how to do proper logging. Hopefully it can help others. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- Documentation/gpu/drm-internals.rst | 6 ++ include/drm/drm_print.h | 91 ++++++++++++++++++++++++++--- 2 files changed, 90 insertions(+), 7 deletions(-) diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-internals.rst index a73320576ca9..c2093611999c 100644 --- a/Documentation/gpu/drm-internals.rst +++ b/Documentation/gpu/drm-internals.rst @@ -164,6 +164,12 @@ File Operations Misc Utilities ============== +Logging +------- + +.. kernel-doc:: include/drm/drm_print.h + :doc: logging + Printer ------- diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 8f99d389792d..e9e31ace0afa 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -250,22 +250,42 @@ static inline struct drm_printer drm_err_printer(const char *prefix) } /** - * enum drm_debug_category - The DRM debug categories + * DOC: logging + * + * There is a set of functions/macros available used for logging + * in the DRM subsystem. + * Using the drm logging function enables that the logging is consistently + * prefixed with *[drm]* thus the logging is easy to recognize. + * + * Example of logging with *[drm]* prefix:: * - * Each of the DRM debug logging macros use a specific category, and the logging - * is filtered by the drm.debug module parameter. This enum specifies the values - * for the interface. + * [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). + * [drm] Driver supports precise vblank timestamp query. * - * Each DRM_DEBUG_ macro logs to DRM_UT_ category, except - * DRM_DEBUG() logs to DRM_UT_CORE. + * + * Each of the debug logging macros use a specific category, and the logging + * is filtered by the drm.debug module parameter. The &drm_debug_category enum + * specifies the values for the interface. + * + * Each drm_dbg_ macro logs to a DRM_UT_ category, + * except drm_dbg() that logs to DRM_UT_DRIVER. * * Enabling verbose debug messages is done through the drm.debug parameter, each * category being enabled by a bit: * * - drm.debug=0x1 will enable CORE messages * - drm.debug=0x2 will enable DRIVER messages + * - drm.debug=0x4 will enable KMS messages + * - drm.debug=0x8 will enable PRIME messages + * - drm.debug=0x10 will enable ATOMIC messages + * - drm.debug=0x20 will enable VBL messages + * - drm.debug=0x40 will enable STATE messages + * - drm.debug=0x80 will enable LEASE messages + * - drm.debug=0x100 will enable DP messages + * + * To enable more than one category OR the values - examples: + * * - drm.debug=0x3 will enable CORE and DRIVER messages - * - ... * - drm.debug=0x1ff will enable all messages * * An interesting feature is that it's possible to enable verbose logging at @@ -273,6 +293,63 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * * # echo 0xf > /sys/module/drm/parameters/debug * + * + * When a &drm_device * is available use one of the following logging functions. + * The same prototype is shared by all the logging functions + * that take a &drm_device * as first argument: + * + * .. code-block:: c + * + * void drm_xxx(struct drm_device *, char * fmt, ...) + * + * Drivers can use the following functions for logging. + * + * .. code-block:: none + * + * # Plain logging + * drm_dbg() + * drm_info() + * drm_notice() + * drm_warn() + * drm_err() + * + * # Log only once + * drm_info_once() + * drm_notice_once() + * drm_warn_once() + * drm_err_once() + * + * # Ratelimited - do not flood the logs + * drm_err_ratelimited() + * + * # Logging with a specific category + * drm_dbg_core() + * drm_dbg() # Uses the DRIVER category + * drm_dbg_kms() + * drm_dbg_prime() + * drm_dbg_atomic() + * drm_dbg_vbl() + * drm_dbg_state() + * drm_dbg_lease() + * drm_dbg_dp() + * + * See enum &drm_debug_category for a description of the categories. + * + * Logging when a &device * is available, but no &drm_device * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * TODO + * + * Logging when no &device * nor &drm_device * is available + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * TODO + * + * Obsoleted logging functions + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * The DRM_*() logging functions are deprecated - do not use them in new code. + */ + +/** + * enum drm_debug_category - The DRM debug categories */ enum drm_debug_category { /** From patchwork Sat Dec 21 09:55:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4020D109A for ; Sat, 21 Dec 2019 09:56:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1DC3B21927 for ; Sat, 21 Dec 2019 09:56:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TpKU3QB9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DC3B21927 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 309F96E431; Sat, 21 Dec 2019 09:56:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 014D16E432 for ; Sat, 21 Dec 2019 09:56:11 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id k8so12471585ljh.5 for ; Sat, 21 Dec 2019 01:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IkjYykOxo9qxEFU02ctTPlXXkHxlR5KUocag0pQ+sSQ=; b=TpKU3QB90IpiPg45PzEmXr+2yUsA7g/BVOHrz9QPNxRP2n1SHFgwVGpdNDNvmrPNQI yNlaO5sV/Agb5jH3ZusfKgIevNkhMzW67ZXVZ4O615fyLQzrVDJ3m0Opl6QI0S8lm6o0 VeIpNSBFUmqxtA29xeo+PEQ5ICD4WD5Xbpw2XvRabfeza/eXwTTk2VZmX20PWE403kTk TvPF8t2LhoLWJZ/OI20xUaLF7/W0upT2Gm77ci5v8r+1FTqBQZ6E9cSt/rjyflQIkWlf S1aSiHu/gSwpfQgrN4zOZNtniEQaVxnWrhubxSQ6cVYUgQ4mxwKgiRY35GwgrZ2MnUez DosA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IkjYykOxo9qxEFU02ctTPlXXkHxlR5KUocag0pQ+sSQ=; b=RVHqqLsvk8AsmoGlOm2Ln7GgxiWQTQi0S2OsRXSiVyrCrQC6SpPh3yd4NmuQEEbYT9 OcTFa1ICxLp0CZD8lmsTJRZO409Tz3LmKA8s7Q2dhsaVQjY/fwklpIk0kpekwY8Vd0FD 0EAnLSWTp3mVO3yAXhREvYxaTCFPyIFCXXr7pJ1gA3c2UiVqPp5RBUTWzo2FDOQyVh8T +5Izv5tHGmDgzKajwRadslb6ZD8BQDv2dBjaqy+3spWW3+ozEniwWeQXRD+wHtuVijpJ IU7vBsv9/YkW9T88AeNaj9Cf46RTlZGAcFTQlZMDss59RxUyj+gpEqnOa7rClQNZ026i v9tQ== X-Gm-Message-State: APjAAAVk2x2/wPPR/rmRhtSgSDsnLqbsNQok5oDYaI3lEwetkdAFOY+D XRZph4y2BTQtVjiFqm60HYUmOj8eYXM= X-Google-Smtp-Source: APXvYqyaYuIKg0mmUtvb1C44ze05hSP4nye4i8tCL0dnfViCV2wn+W5CMpOtb+K7jLwZY/u1wvC/5A== X-Received: by 2002:a2e:2d11:: with SMTP id t17mr12243175ljt.177.1576922169994; Sat, 21 Dec 2019 01:56:09 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:09 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 2/8] drm/print: move new style logging functions Date: Sat, 21 Dec 2019 10:55:47 +0100 Message-Id: <20191221095553.13332-3-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the new style logging function up right after the documentation of their usage. And note that remaining logging functions are legacy. While moving, drop some extra lines. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- include/drm/drm_print.h | 117 +++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 61 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index e9e31ace0afa..d2b9ac6a6e18 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -397,6 +397,62 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) return unlikely(__drm_debug & category); } +/* + * struct drm_device based logging + * + * Prefer drm_device based logging over device or printk based logging. + */ + +/* Helper for struct drm_device based logging. */ +#define __drm_printk(drm, level, type, fmt, ...) \ + dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) + + +#define drm_info(drm, fmt, ...) \ + __drm_printk((drm), info,, fmt, ##__VA_ARGS__) +#define drm_notice(drm, fmt, ...) \ + __drm_printk((drm), notice,, fmt, ##__VA_ARGS__) +#define drm_warn(drm, fmt, ...) \ + __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) +#define drm_err(drm, fmt, ...) \ + __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_info_once(drm, fmt, ...) \ + __drm_printk((drm), info, _once, fmt, ##__VA_ARGS__) +#define drm_notice_once(drm, fmt, ...) \ + __drm_printk((drm), notice, _once, fmt, ##__VA_ARGS__) +#define drm_warn_once(drm, fmt, ...) \ + __drm_printk((drm), warn, _once, fmt, ##__VA_ARGS__) +#define drm_err_once(drm, fmt, ...) \ + __drm_printk((drm), err, _once, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_err_ratelimited(drm, fmt, ...) \ + __drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_dbg_core(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) +#define drm_dbg(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) +#define drm_dbg_kms(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) +#define drm_dbg_prime(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) +#define drm_dbg_atomic(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) +#define drm_dbg_vbl(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) +#define drm_dbg_state(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_STATE, fmt, ##__VA_ARGS__) +#define drm_dbg_lease(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_LEASE, fmt, ##__VA_ARGS__) +#define drm_dbg_dp(drm, fmt, ...) \ + drm_dev_dbg((drm)->dev, DRM_UT_DP, fmt, ##__VA_ARGS__) + + +/* + * LEGACY logging support - do not use in new code + */ + /* * struct device based logging * @@ -496,67 +552,6 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_PRIME, \ fmt, ##__VA_ARGS__) -/* - * struct drm_device based logging - * - * Prefer drm_device based logging over device or prink based logging. - */ - -/* Helper for struct drm_device based logging. */ -#define __drm_printk(drm, level, type, fmt, ...) \ - dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) - - -#define drm_info(drm, fmt, ...) \ - __drm_printk((drm), info,, fmt, ##__VA_ARGS__) - -#define drm_notice(drm, fmt, ...) \ - __drm_printk((drm), notice,, fmt, ##__VA_ARGS__) - -#define drm_warn(drm, fmt, ...) \ - __drm_printk((drm), warn,, fmt, ##__VA_ARGS__) - -#define drm_err(drm, fmt, ...) \ - __drm_printk((drm), err,, "*ERROR* " fmt, ##__VA_ARGS__) - - -#define drm_info_once(drm, fmt, ...) \ - __drm_printk((drm), info, _once, fmt, ##__VA_ARGS__) - -#define drm_notice_once(drm, fmt, ...) \ - __drm_printk((drm), notice, _once, fmt, ##__VA_ARGS__) - -#define drm_warn_once(drm, fmt, ...) \ - __drm_printk((drm), warn, _once, fmt, ##__VA_ARGS__) - -#define drm_err_once(drm, fmt, ...) \ - __drm_printk((drm), err, _once, "*ERROR* " fmt, ##__VA_ARGS__) - - -#define drm_err_ratelimited(drm, fmt, ...) \ - __drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__) - - -#define drm_dbg_core(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) -#define drm_dbg(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) -#define drm_dbg_kms(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) -#define drm_dbg_prime(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) -#define drm_dbg_atomic(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) -#define drm_dbg_vbl(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) -#define drm_dbg_state(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_STATE, fmt, ##__VA_ARGS__) -#define drm_dbg_lease(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_LEASE, fmt, ##__VA_ARGS__) -#define drm_dbg_dp(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_DP, fmt, ##__VA_ARGS__) - - /* * printk based logging * From patchwork Sat Dec 21 09:55:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2E2C109A for ; Sat, 21 Dec 2019 09:56:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF3F821655 for ; Sat, 21 Dec 2019 09:56:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ADqvu1rD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF3F821655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 632946E1E0; Sat, 21 Dec 2019 09:56:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8B976E431 for ; Sat, 21 Dec 2019 09:56:12 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id j26so12470492ljc.12 for ; Sat, 21 Dec 2019 01:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OVQ/28tbLBbbJHmoAL63ZaoS8Vr4XCpJtvfNALNn8PU=; b=ADqvu1rDwix9tI+1hiviZOWAJP7jCjpZlwVhARzkoWSjvdy3Ki+AG3+cNcPIJd8Oym AFXj+YuF85C48rpWLH8IKp0QcuPBf/34laDlz9TPXUfR0GdDkIdoe0Vf6HUxi9hqgpO4 nGnIuIhrUD0431g1NMt5P3WB71lks3EhXFgVhAp4/kWL+U9KIQNJx9ZAZmoCfw/XdHHB +LaBuKCe/UHztZIEhOe57P7AAhVQPZBm1qrB8J2k17pvIrl+7g9747sbJOUihOnOim5d QlPUOP94dd3DdM3p2o9Dy0SjaM82MTc4Tx7gEsuMHZw0UsOJ91weYJdLUmTU8G3pu9fT Hkaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OVQ/28tbLBbbJHmoAL63ZaoS8Vr4XCpJtvfNALNn8PU=; b=aIvM+RV+9oE5VmCGvoPBbwnJtoP5ziQ/B3JKQSK2XkqI8z8RR8mzwS4IbxJqhdRH+I ofSQdAriYDmNkhxe7TG4OcxUqQjDl3r7Kapn1Or2FQmGImQsNZ+ik08EF0+16GZq+5LF q/1I9NSV1L3Djo2teRJXi9oYg+cSHEsoJfQnOpJUUopQMMSUaY0kLkLcLfagNF7PFvxv MrcgB92tmg4ZCu9uEmyir8eUk9d7KdXkjdSnD2OPluDLoGxvs8zUQhT5+mGtSXyDBqjZ RdbrkWM+jnZ4+q3IMpo/TVbp9s5JY+646XUzMC8kfi6X1ycHlmnJ48yoy8Cmljzq37hE DJsw== X-Gm-Message-State: APjAAAUE9A/2Ohak43oqxKUbEQte/oIk+dPUFb7LPXiaL1D3ddo8009v iZVEaQ1k4HsD4ELMjeKn2zt0jzRnsE4= X-Google-Smtp-Source: APXvYqzno63LqFts2rXrMVDu+Rp80iYLjiAJUYHcxyxKIaUIKTuJHT6rbGZwdGnzc17I9DgpBEqlBg== X-Received: by 2002:a2e:b010:: with SMTP id y16mr12822379ljk.238.1576922171075; Sat, 21 Dec 2019 01:56:11 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:10 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 3/8] drm/print: add new logging helper for drm logging Date: Sat, 21 Dec 2019 10:55:48 +0100 Message-Id: <20191221095553.13332-4-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add new helper so logging can use the standard logging functions without an extra helper function. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- include/drm/drm_print.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index d2b9ac6a6e18..c1d333bb7534 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -403,10 +403,15 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) * Prefer drm_device based logging over device or printk based logging. */ -/* Helper for struct drm_device based logging. */ +/* Helpers for struct drm_device based logging. */ #define __drm_printk(drm, level, type, fmt, ...) \ dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) +#define __drm_cat_printk(drm, cat, fmt, ...) \ +({ \ + if (drm_debug_enabled(cat)) \ + dev_dbg((drm)->dev, "[drm] " fmt, ##__VA_ARGS__); \ +}) #define drm_info(drm, fmt, ...) \ __drm_printk((drm), info,, fmt, ##__VA_ARGS__) @@ -430,24 +435,23 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) __drm_printk((drm), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__) #define drm_dbg_core(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_CORE, fmt, ##__VA_ARGS__) #define drm_dbg(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_DRIVER, fmt, ##__VA_ARGS__) #define drm_dbg_kms(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) #define drm_dbg_prime(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_PRIME, fmt, ##__VA_ARGS__) #define drm_dbg_atomic(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) #define drm_dbg_vbl(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_VBL, fmt, ##__VA_ARGS__) #define drm_dbg_state(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_STATE, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_STATE, fmt, ##__VA_ARGS__) #define drm_dbg_lease(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_LEASE, fmt, ##__VA_ARGS__) + __drm_cat_printk((drm), DRM_UT_LEASE, fmt, ##__VA_ARGS__) #define drm_dbg_dp(drm, fmt, ...) \ - drm_dev_dbg((drm)->dev, DRM_UT_DP, fmt, ##__VA_ARGS__) - + __drm_cat_printk((drm), DRM_UT_DP, fmt, ##__VA_ARGS__) /* * LEGACY logging support - do not use in new code From patchwork Sat Dec 21 09:55:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4481B109A for ; Sat, 21 Dec 2019 09:56:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 221CC21655 for ; Sat, 21 Dec 2019 09:56:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QMXdFfo/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 221CC21655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B1196E43A; Sat, 21 Dec 2019 09:56:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAC486E437 for ; Sat, 21 Dec 2019 09:56:13 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id o13so1078500ljg.4 for ; Sat, 21 Dec 2019 01:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vxp75EnGkSNIF0JYpEC2skGbIkHaQW/WtoO50nbShD8=; b=QMXdFfo/cHM3xsnJVr3/Gas/HfObj8PfF0dIVm+iWPNJOB/FLcUhrMXnI+cRoGASk/ G+f7HlFStdNsCrpa2SQIeXg4NFgWlvy56mrx2jwzkDWHiEI5m3ybUOfGmdlDiYcL4ibI O8T/zoo+NXAdW2NYLQfVFVnPvLTLPsoIg4v8tWb/mI7RTH4kcQXbJoffORW9extqVfO3 M6aOrK/B6oeWu6kzuluWhPk/v2HkA5pZ2et9JnpUCYiYiCqE9m/H8NHzd0hUHHFGDl9N xSduM8lNGkWaSkNjH2XFjww35RQrD3ZHTMf5Um4+otqd2kNf8g8TsKEuiYh8XISzgj79 6hjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Vxp75EnGkSNIF0JYpEC2skGbIkHaQW/WtoO50nbShD8=; b=mZNcw54wZ5q4x6GbygFezo39UVgjEQfsaiOzGyl0IGkOpBRm13YcRCejSR+dCKdApd qEvGQYkMFU5kl01u9wXXk2gi/RO37xgDXdSwwObifsfJhoxhUWLW3wIUAIQnHYJ/rySW wig+MVwEO9yhHSbD+Gf9x5JJCzE6mU2nCIm0bLc1pOkye344PkQaWiCmCtTxQ0xoLOiB RubEs4KJbS0GJCM3qmrsRGkQrlEUjGTVvVi4g/lULhp+Du5sTYnmEV0GGmvRBO/fTmuz VJhhjzWWe9valI/u1VgAKvqUjAE/LJhU+amdf/THNKuY9ll8zAfaXhhOCk9nURfexg8s 7R4Q== X-Gm-Message-State: APjAAAX+ti+i0FcdWlozNVAdB4F6wOM/DtZozqqKbBNMuE4d9/JQ3uDi ht5TGHSTHCf/Ys8Km0/Dx01i1ePeQyw= X-Google-Smtp-Source: APXvYqyFWOZuMwyGOeAvs/2Ndizp2K2nI1I/QmJ7KC7Kd9Ht5v5d8xPlLoP8k8/NhHy8bbvXRmtNNg== X-Received: by 2002:a2e:580c:: with SMTP id m12mr12514671ljb.150.1576922172059; Sat, 21 Dec 2019 01:56:12 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:11 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 4/8] drm/print: add kernel-doc for drm_debug_enabled Date: Sat, 21 Dec 2019 10:55:49 +0100 Message-Id: <20191221095553.13332-5-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- include/drm/drm_print.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index c1d333bb7534..c9fa06b517cc 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -392,6 +392,21 @@ enum drm_debug_category { DRM_UT_DP = 0x100, }; +/** + * drm_debug_enabled - check if debug logging is enabled for the + * specified category + * @category: the category that is checked + * + * The category specified can be either one &drm_debug_category value or several + * &drm_debug_category values ORed together. + * drm_debug_enabled() can be used to avoid expensive logging functionality + * when logging is not enabled. + * Use with care. + * + * RETURNS: + * true if debug logging for the specified category is enabled. + * false otherwise + */ static inline bool drm_debug_enabled(enum drm_debug_category category) { return unlikely(__drm_debug & category); From patchwork Sat Dec 21 09:55:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 539F51580 for ; Sat, 21 Dec 2019 09:56:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3158921655 for ; Sat, 21 Dec 2019 09:56:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qqh3Xg4c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3158921655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C26026E434; Sat, 21 Dec 2019 09:56:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3F6E6E433 for ; Sat, 21 Dec 2019 09:56:14 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id y1so8887243lfb.6 for ; Sat, 21 Dec 2019 01:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ZuQyKqz34oFckcd2mFhJSLF/pZbMU6cTALMsZuI4Vs=; b=Qqh3Xg4cUqUm8uRlmlZB/l0m5JVPF0W+iTpe3tBxjpfUt/61RQoTNM8iGkkJcPZdkW Xki/D6mDgvRz21UEKg5WmzURs0DLY9erocpbJf05YdGvENzyQt5McE4CUGRdhe58L7Ex MCHdFD6NhH+gTYfIb+HykirYXSxf7n+BrhwIE8SJxSOGpnyxVYS/Vikb/o1V+lPPY72E 1PoqIrtL4z6ssIXpzZsBerF2zB7e1xpF3X5jGAQhIy4wKvO7hHE26jFUVktLS3rLQuzN wUKFQdUqwC7ICTAPqNPYpSrAZBkpAXIcNgRPUVB1aOPB1bU2DE3jdttrIGw7IrPooLrl iuCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4ZuQyKqz34oFckcd2mFhJSLF/pZbMU6cTALMsZuI4Vs=; b=tT5gTC0mVMVDLgPQ494gzkIpFOoKzXeMzFnzhHULp+0CE7GLggxEiHP0aKNn8ltKUr NKQO/rXXUEuxDEr3ecviMS+k5Kh4M6ZBsX6JlX6KW1SU+z7/2gheaT1Kf4Nv5u4dlwoI VSAvpakV6Mn2qQf1YxPQXLMExUc3Slqx+3rwEB1XH/vRDChPrVzx26pv2nLBPEdVk1HK nTliPg72miQmcONvSbpmqgA2BsPrhVQlTV1DON6xqauA+Q+eWb4j3TmR4cYzUZcOH+Xf XutYdqWME5kjxhHHFsLBY6y3Klu2cWc0IJiuzz13Md/eLWEChBYEPPagjrjcqMRFRoto GISQ== X-Gm-Message-State: APjAAAUJL+ZiBjRC8Zeh557U/kW8mlpezx/5gmQIpc+DFr+3VNQM9jTe JGSLc0kQZUEY9/DlVm597TztCwJQYbM= X-Google-Smtp-Source: APXvYqz2lTvWJPeDh9Oz7HfLHRGWhpko466fFO+f7byIca7x05LXc8aEuo/DCWH3p+JiwgUXzzVUoA== X-Received: by 2002:a19:cc49:: with SMTP id c70mr11868847lfg.73.1576922173122; Sat, 21 Dec 2019 01:56:13 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:12 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 5/8] drm/print: rename drm_dev_dbg Date: Sat, 21 Dec 2019 10:55:50 +0100 Message-Id: <20191221095553.13332-6-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rename drm_dev_dbg to the internal name __drm_dev_dbg. This will make room for a new logging macro with the same name. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- drivers/gpu/drm/drm_print.c | 6 +++--- include/drm/drm_print.h | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 111b932cf2a9..fd70205f8c5c 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -256,8 +256,8 @@ void drm_dev_printk(const struct device *dev, const char *level, } EXPORT_SYMBOL(drm_dev_printk); -void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, - const char *format, ...) +void __drm_dev_dbg(const struct device *dev, enum drm_debug_category category, + const char *format, ...) { struct va_format vaf; va_list args; @@ -278,7 +278,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, va_end(args); } -EXPORT_SYMBOL(drm_dev_dbg); +EXPORT_SYMBOL(__drm_dev_dbg); void __drm_dbg(enum drm_debug_category category, const char *format, ...) { diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index c9fa06b517cc..7c0b93e6cb80 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -482,8 +482,8 @@ __printf(3, 4) void drm_dev_printk(const struct device *dev, const char *level, const char *format, ...); __printf(3, 4) -void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, - const char *format, ...); +void __drm_dev_dbg(const struct device *dev, enum drm_debug_category category, + const char *format, ...); /** * Error output. @@ -529,19 +529,19 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, * @fmt: printf() like format string. */ #define DRM_DEV_DEBUG(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DRIVER(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_KMS(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_PRIME(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_VBL(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DP(dev, fmt, ...) \ - drm_dev_dbg(dev, DRM_UT_DP, fmt, ## __VA_ARGS__) + __drm_dev_dbg(dev, DRM_UT_DP, fmt, ## __VA_ARGS__) #define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, category, fmt, ...) \ ({ \ @@ -549,7 +549,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, DEFAULT_RATELIMIT_INTERVAL, \ DEFAULT_RATELIMIT_BURST); \ if (__ratelimit(&_rs)) \ - drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__); \ + __drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__); \ }) /** From patchwork Sat Dec 21 09:55:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45B551580 for ; Sat, 21 Dec 2019 09:56:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23A7821655 for ; Sat, 21 Dec 2019 09:56:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NG68w9mc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23A7821655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B9E106E43B; Sat, 21 Dec 2019 09:56:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id E00D46E433 for ; Sat, 21 Dec 2019 09:56:15 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id m26so10038578ljc.13 for ; Sat, 21 Dec 2019 01:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GqRix+uR2dI/9Zd4Du8z4kKyTdDG/QeI0JIJQu8vYug=; b=NG68w9mcEI4TvejvuPrh98RFuth6Ru5zW3H3+d3cTAsvU1U2j4EZr2rGV2gCiA7HJu Wb1YWM03riQt0/oPyPDYhsYr7wX5Dj1X1hqdPz4YvXal+kvfUlVK28nStc5oH9l99jjQ XjJiZ+yGygX3IPhXm+x+fZf1kp0Z5ojWxAguxPRkS1buaf3ZI7+466Ps/vx9xB/fITMH fojLu2Fk6y8EzUtJrPMnNjGsNrC+2ekaZqbXos12+TlYnp7XpSYng36m1ClEdOKmIbmu GXAVvEO6pX9ZhKFwPnKF/opFlv0PRA2YlQg/7b5Zg3Es94rcTnUxWSUFEHHITBWLVSA7 u/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=GqRix+uR2dI/9Zd4Du8z4kKyTdDG/QeI0JIJQu8vYug=; b=kJp3LHIdizaGQ6lxcASfEs3Sr9PA0PXNWT+zlk/LR6C5yGd4h+mny0AMfX3tBy1FAE CdHM3vJHehVarGCtyogR5tPSXj9ccUX3zMSbFy/bWxJPp6CALuJhOmCFP7FCNfyhKQNo ZdUyrCr/G/a97dNFdb6HRd9FWEgN+ZhcakYoKZu3lGeT0jJ6ZhBbdhPgvIOX9jWePOU/ yN2cMk0tQJSA6zCaL4mfVOQOWuLZ+7W/DySP0YgUVit/IXnCNwa/PVe2C8vjAytDcKLX JEHXCy+t35qswZkZxbdQWl7sNirPvyMeLscOPkuVNSFeqdZ7Sszp9x6BfNe8Sr4ay08N fHUw== X-Gm-Message-State: APjAAAXlH1Zg/8O8QD94OxvNuL70bZNXi2AxRPQeAGhWdCM1ZBA19qw9 K6c/+wy8LH2vZcknI9lGDA0xk1YpvAA= X-Google-Smtp-Source: APXvYqzXuNrfnFAAFMtImWbjFkPtQP69dGrbAkTevPSoCrDa/qsME3Fd8Dd8ncnp/BtUZI1HpKvzQg== X-Received: by 2002:a2e:9592:: with SMTP id w18mr12404088ljh.98.1576922174057; Sat, 21 Dec 2019 01:56:14 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:13 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 6/8] drm/print: add drm_dev_* logging functions Date: Sat, 21 Dec 2019 10:55:51 +0100 Message-Id: <20191221095553.13332-7-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There are a lot of cases where we have a device * but no drm_device *. Add drm_dev_* variants of the logging functions to cover these cases. Include brief documentation. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- include/drm/drm_print.h | 99 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 7c0b93e6cb80..b2e5d0209010 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -337,7 +337,50 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * * Logging when a &device * is available, but no &drm_device * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * TODO + * + * Adding a device pointer (if no &drm_device * is available) is always a good + * idea as it add more information in the logging message thus making it easier + * to determine the source of the logging. + * + * All logging functions in this block share the same prototype: + * + * .. code-block:: c + * + * void drm_dev_xxx(struct device *, char * fmt, ...) + * + * The following functions are available: + * + * .. code-block:: none + * + * # Plain logging + * drm_dev_dbg() + * drm_dev_info() + * drm_dev_notice() + * drm_dev_warn() + * drm_dev_err() + * + * # Log only once + * drm_dev_info_once() + * drm_dev_notice_once() + * drm_dev_warn_once() + * drm_dev_err_once() + * + * # Ratelimited - do not flood the logs + * drm_dev_err_ratelimited() + * drm_dev_dbg_ratelimited() + * drm_dev_dbg_kms_ratelimited() + * + * # Logging with a specific category + * drm_dev_dbg_core() + * drm_dev_dbg() # Uses the DRIVER category + * drm_dev_dbg_kms() + * drm_dev_dbg_prime() + * drm_dev_dbg_atomic() + * drm_dev_dbg_vbl() + * drm_dev_dbg_state() + * drm_dev_dbg_lease() + * drm_dev_dbg_dp() + * * * Logging when no &device * nor &drm_device * is available * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -468,6 +511,60 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) #define drm_dbg_dp(drm, fmt, ...) \ __drm_cat_printk((drm), DRM_UT_DP, fmt, ##__VA_ARGS__) +/* struct device based logging. */ +#define __drm_dev_printk(dev, level, type, fmt, ...) \ + dev_##level##type(dev, "[drm] " fmt, ##__VA_ARGS__) + +#define __drm_dev_cat_printk(dev, cat, type, fmt, ...) \ +({ \ + if (drm_debug_enabled(cat)) \ + dev_dbg##type((dev), "[drm] " fmt, ##__VA_ARGS__); \ +}) + +#define drm_dev_info(dev, fmt, ...) \ + __drm_dev_printk((dev), info,, fmt, ##__VA_ARGS__) +#define drm_dev_notice(dev, fmt, ...) \ + __drm_dev_printk((dev), notice,, fmt, ##__VA_ARGS__) +#define drm_dev_warn(dev, fmt, ...) \ + __drm_dev_printk((dev), warn,, fmt, ##__VA_ARGS__) +#define drm_dev_err(dev, fmt, ...) \ + __drm_dev_printk((dev), err,, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_dev_info_once(dev, fmt, ...) \ + __drm_dev_printk((dev), info, _once, fmt, ##__VA_ARGS__) +#define drm_dev_notice_once(dev, fmt, ...) \ + __drm_dev_printk((dev), notice, _once, fmt, ##__VA_ARGS__) +#define drm_dev_warn_once(dev, fmt, ...) \ + __drm_dev_printk((dev), warn, _once, fmt, ##__VA_ARGS__) +#define drm_dev_err_once(dev, fmt, ...) \ + __drm_dev_printk((dev), err, _once, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_dev_err_ratelimited(dev, fmt, ...) \ + __drm_dev_printk((dev), err, _ratelimited, "*ERROR* " fmt, ##__VA_ARGS__) +#define drm_dev_dbg_ratelimited(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_DRIVER,_ratelimited, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_kms_ratelimited(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_KMS,_ratelimited, fmt, ##__VA_ARGS__) + +#define drm_dev_dbg_core(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_CORE,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_DRIVER,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_kms(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_KMS,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_prime(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_PRIME,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_atomic(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_ATOMIC,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_vbl(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_VBL,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_state(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_STATE,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_lease(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_LEASE,, fmt, ##__VA_ARGS__) +#define drm_dev_dbg_dp(dev, fmt, ...) \ + __drm_dev_cat_printk((dev), DRM_UT_DP,, fmt, ##__VA_ARGS__) + /* * LEGACY logging support - do not use in new code */ From patchwork Sat Dec 21 09:55:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2901109A for ; Sat, 21 Dec 2019 09:56:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C07C921655 for ; Sat, 21 Dec 2019 09:56:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Npzi8axX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C07C921655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6CC66E438; Sat, 21 Dec 2019 09:56:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 091EA6E438 for ; Sat, 21 Dec 2019 09:56:17 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id i23so8891480lfo.7 for ; Sat, 21 Dec 2019 01:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tdWgzBmBhFIY0yV6azzdb6ioleZW2L9QwhOviQaYTGM=; b=Npzi8axXY6xt7zYHFLUy12HZkVqCzENo9BMGhrVekavfWuuwIwpIITU/Bu5TXoF+dH hNQZv3Lm/9wLeFGp23jT6d4dYCdSFVQmOt2+hiBuqblyq+cfkVNx/SJwpZCK975sFH/r M0Ut/7P/2b7maYmMt9T8er0NjY6pQB32pr/sEgZgviuzTxr69NgeplJQAZ2TKTX5UEWu J4MOOE2r58nhaaTD+MTSYXwZJ7bBv3m/6iOlHcKyC/dPlzS/QEyeU/LiuxCBRZb4iLK0 nHuupZPcNCi4lOqhwTmtl+m2g51iSFhU5GlJcL0M506VrQ6fp3bbiHyywL2BCsVPWa7Y fZ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tdWgzBmBhFIY0yV6azzdb6ioleZW2L9QwhOviQaYTGM=; b=HI+VUbwPMVcpjhnC0XFcHa0s8lAVJIkKbNYm/OaGTWKXNLt2Ol8yr659L80H5fXhDX IxlSmagfaz2md2v8Wk1D3i7MzXmGSeYMC8dNcbe/a3UYBFT1gRh7e/K0wog1+IYOIWEF WlJffOlYkGhkfVQC0oCeYwR45ezP/3cSjnNWxRrc2Mfc89gka82GD5mFmptjuMwO3SLu W0uP9nq4W7HEL0Z4lSA00ENBJMno8qi3Hnt26FU6EyJ//B6EzvNKN72wqt1ERUmDwYP9 l8/pZZYZTW1vNIOb+I1Wc9+JialNWaKuCY80Y27J3yB5oqCSFqL8VbR+hGTuwt4L6orJ AQSA== X-Gm-Message-State: APjAAAUXW8rcPVVC8ExA6PN8vAM5RrKhKGmUm33OpBo6SuqzAknuC+SD my3kpDYefQZcgZm8ekh+AD2lW2D5B3M= X-Google-Smtp-Source: APXvYqyo11ktOp3oYKgdfoPZi7W5MGdt3PhroKks+SZp+GRfIpvUdlzAZrWs6HuowKEiXQTACtPQ3Q== X-Received: by 2002:a19:ec14:: with SMTP id b20mr12009198lfa.63.1576922175165; Sat, 21 Dec 2019 01:56:15 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:14 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 7/8] drm/print: add drm_pr_ logging Date: Sat, 21 Dec 2019 10:55:52 +0100 Message-Id: <20191221095553.13332-8-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add standard logging functions that can be used when no struct device *, nor struct drm_device * is available. Include brief documentation. Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter --- include/drm/drm_print.h | 88 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index b2e5d0209010..0b0468340573 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -384,7 +384,46 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * * Logging when no &device * nor &drm_device * is available * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * TODO + * + * When there is neither a struct &drm_device *, nor a struct device * use + * the logging variants that does not take a pointer. + * It is important to note that the logging core cannot provide much extra + * info but as the logging has a fixed *[drm]* prefix then the logging continue + * to be easy to spot. + * + * All logging functions in this block share the same prototype: + * + * .. code-block:: c + * + * void drm_pr_xxx(char * fmt, ...) + * + * The following functions are available: + * + * .. code-block:: none + * + * # Plain logging + * drm_pr_dbg() + * drm_pr_info() + * drm_pr_notice() + * drm_pr_warn() + * drm_pr_err() + * + * # Log only once + * drm_pr_info_once() + * drm_pr_notice_once() + * drm_pr_warn_once() + * drm_pr_err_once() + * + * # Logging with a specific category + * drm_pr_dbg_core() + * drm_pr_dbg() # Uses the DRIVER category + * drm_pr_dbg_kms() + * drm_pr_dbg_prime() + * drm_pr_dbg_atomic() + * drm_pr_dbg_vbl() + * drm_pr_dbg_state() + * drm_pr_dbg_lease() + * drm_pr_dbg_dp() * * Obsoleted logging functions * ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -565,6 +604,53 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) #define drm_dev_dbg_dp(dev, fmt, ...) \ __drm_dev_cat_printk((dev), DRM_UT_DP,, fmt, ##__VA_ARGS__) +/* logging with no struct device * and no struct drm_device * */ +#define __drm_pr_printk(level, type, fmt, ...) \ + pr_##level##type("[drm] " fmt, ##__VA_ARGS__) + +#define __drm_pr_cat_printk(cat, type, fmt, ...) \ +({ \ + if (drm_debug_enabled(cat)) \ + pr_debug##type("[drm] " fmt, ##__VA_ARGS__); \ +}) + +#define drm_pr_info(fmt, ...) \ + __drm_pr_printk(info,, fmt, ##__VA_ARGS__) +#define drm_pr_notice(fmt, ...) \ + __drm_pr_printk(notice,, fmt, ##__VA_ARGS__) +#define drm_pr_warn(fmt, ...) \ + __drm_pr_printk(warn,, fmt, ##__VA_ARGS__) +#define drm_pr_err(fmt, ...) \ + __drm_pr_printk(err,, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_pr_info_once(fmt, ...) \ + __drm_pr_printk(info, _once, fmt, ##__VA_ARGS__) +#define drm_pr_notice_once(fmt, ...) \ + __drm_pr_printk(notice, _once, fmt, ##__VA_ARGS__) +#define drm_pr_warn_once(fmt, ...) \ + __drm_pr_printk(warn, _once, fmt, ##__VA_ARGS__) +#define drm_pr_err_once(fmt, ...) \ + __drm_pr_printk(err, _once, "*ERROR* " fmt, ##__VA_ARGS__) + +#define drm_pr_dbg_core(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_CORE,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_DRIVER,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_kms(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_KMS,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_prime(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_PRIME,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_atomic(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_ATOMIC,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_vbl(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_VBL,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_state(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_STATE,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_lease(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_LEASE,, fmt, ##__VA_ARGS__) +#define drm_pr_dbg_dp(fmt, ...) \ + __drm_pr_cat_printk(DRM_UT_DP,, fmt, ##__VA_ARGS__) + /* * LEGACY logging support - do not use in new code */ From patchwork Sat Dec 21 09:55:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11306905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 260AC1580 for ; Sat, 21 Dec 2019 09:56:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0409D21927 for ; Sat, 21 Dec 2019 09:56:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EEyxs3GG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0409D21927 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AC536E1BB; Sat, 21 Dec 2019 09:56:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 205576E438 for ; Sat, 21 Dec 2019 09:56:18 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id 9so8888581lfq.10 for ; Sat, 21 Dec 2019 01:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qyR8wy1tx62FF4l+ENQewsFn6aI0y0YU/g+Vd/atmkY=; b=EEyxs3GGhV2sathVuz8DjOiqj5tURUb4S8Mv/DHx5abYq4mtbqGWKfwS0Af/26B9U1 hFo10qrAqVxMPyuRejoT/BG5lhXhl1QLd53lpzuoo27ogbm7dxxte+PPMj4N2UDvVAFf FFN7ssFNFLvMN0S+vDmj7nxVl1wS20aerp1KDyBDHepgYo/48kY9P4MD8sqFHcMAFpUx 7dLEHvQz8GW+k7+xwx92afus0rtcEsviv3wCvXTuZqpFTVjy6VMaZEDg01NCkDul2kkQ Sdgd+D/nmUpEiBLLmaOSDUiQPUWE13wZtlW6DQabWWNAiOXPK0rFalyTPOmVuk6z9533 htoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=qyR8wy1tx62FF4l+ENQewsFn6aI0y0YU/g+Vd/atmkY=; b=FhHtdWs51tfqMO1DbJDCzZGu52BEGugyJRlpOtpHO39C7OoUFvCSUBaHgW5yDl4XDu eLBypy+xGa5Dzm6aeW40A73RVo2V/NdtxCQncDYRutCI7D5BmZXWZYvrhDi+U0kv2F/S 8VR45oxM/GGUX/cRhDzBfo96A9TtvpuJDkU7qgeAgDxbi3DgbOY+LSOHriz3yhzRukC8 p8klz5F4Vh4eJwN4xU47WdSqupHjZdj9j2vv554AueeXmPCTxJc2oVbvBRuUggiBGDfQ uY9I8d8eyFwMIAfotD8IK6+GC+9+bS5+lOB82HBeboVpx7jQ3G0XTyA1wjEhImuR+ITD yyyA== X-Gm-Message-State: APjAAAVQ6y5Xm1S25M092D9NIqvW2y21+/nrtemcH6s+aOgk1ABai4/l hK50EWwL3EuXjgnpZu3rH0cPeEa+ydU= X-Google-Smtp-Source: APXvYqxB8cPUGYGdW2TeNZWYCu7aldi3Fks5mZbY2vxYeehJMNMd/Ag5HlgBtccqkxsPnbERi82RDA== X-Received: by 2002:a19:e30b:: with SMTP id a11mr11881961lfh.48.1576922176154; Sat, 21 Dec 2019 01:56:16 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id n23sm5187263lfa.41.2019.12.21.01.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 01:56:15 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Jani Nikula , Daniel Vetter Subject: [PATCH v1 8/8] drm/print: let legacy logging use new style functions Date: Sat, 21 Dec 2019 10:55:53 +0100 Message-Id: <20191221095553.13332-9-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191221095553.13332-1-sam@ravnborg.org> References: <20191221095553.13332-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joe Perches , Sam Ravnborg , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Update the legacy logging functions to use the new style logging functions. This will help people when transition to the new style as they can just go and see what new style logging function to use. This also makes logging look a bit more consistent as the same base is now used for logging. While converting, drop the unused ratelimited variants. Delete the now unused logging support functions in drm_print.c Signed-off-by: Sam Ravnborg Cc: Jani Nikula Cc: Sean Paul Cc: Daniel Vetter Cc: Joe Perches --- drivers/gpu/drm/drm_print.c | 80 ---------------- include/drm/drm_print.h | 184 ++++++------------------------------ 2 files changed, 31 insertions(+), 233 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index fd70205f8c5c..e5a3d2576d6f 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -235,86 +235,6 @@ void drm_print_bits(struct drm_printer *p, unsigned long value, } EXPORT_SYMBOL(drm_print_bits); -void drm_dev_printk(const struct device *dev, const char *level, - const char *format, ...) -{ - struct va_format vaf; - va_list args; - - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; - - if (dev) - dev_printk(level, dev, "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - else - printk("%s" "[" DRM_NAME ":%ps] %pV", - level, __builtin_return_address(0), &vaf); - - va_end(args); -} -EXPORT_SYMBOL(drm_dev_printk); - -void __drm_dev_dbg(const struct device *dev, enum drm_debug_category category, - const char *format, ...) -{ - struct va_format vaf; - va_list args; - - if (!drm_debug_enabled(category)) - return; - - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; - - if (dev) - dev_printk(KERN_DEBUG, dev, "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - else - printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - - va_end(args); -} -EXPORT_SYMBOL(__drm_dev_dbg); - -void __drm_dbg(enum drm_debug_category category, const char *format, ...) -{ - struct va_format vaf; - va_list args; - - if (!drm_debug_enabled(category)) - return; - - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; - - printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", - __builtin_return_address(0), &vaf); - - va_end(args); -} -EXPORT_SYMBOL(__drm_dbg); - -void __drm_err(const char *format, ...) -{ - struct va_format vaf; - va_list args; - - va_start(args, format); - vaf.fmt = format; - vaf.va = &args; - - printk(KERN_ERR "[" DRM_NAME ":%ps] *ERROR* %pV", - __builtin_return_address(0), &vaf); - - va_end(args); -} -EXPORT_SYMBOL(__drm_err); - /** * drm_print_regset32 - print the contents of registers to a * &drm_printer stream. diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 0b0468340573..f305454544ee 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -655,176 +655,54 @@ static inline bool drm_debug_enabled(enum drm_debug_category category) * LEGACY logging support - do not use in new code */ -/* - * struct device based logging - * - * Prefer drm_device based logging over device or prink based logging. - */ - -__printf(3, 4) -void drm_dev_printk(const struct device *dev, const char *level, - const char *format, ...); -__printf(3, 4) -void __drm_dev_dbg(const struct device *dev, enum drm_debug_category category, - const char *format, ...); +#define DRM_DEV_ERROR(dev, fmt, ...) \ + drm_dev_err((dev), fmt, ##__VA_ARGS__) +#define DRM_DEV_INFO(dev, fmt, ...) \ + drm_dev_info((dev), fmt, ##__VA_ARGS__) +#define DRM_DEV_INFO_ONCE(dev, fmt, ...) \ + drm_dev_info_once((dev), fmt, ##__VA_ARGS__) -/** - * Error output. - * - * @dev: device pointer - * @fmt: printf() like format string. - */ -#define DRM_DEV_ERROR(dev, fmt, ...) \ - drm_dev_printk(dev, KERN_ERR, "*ERROR* " fmt, ##__VA_ARGS__) - -/** - * Rate limited error output. Like DRM_ERROR() but won't flood the log. - * - * @dev: device pointer - * @fmt: printf() like format string. - */ -#define DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...) \ -({ \ - static DEFINE_RATELIMIT_STATE(_rs, \ - DEFAULT_RATELIMIT_INTERVAL, \ - DEFAULT_RATELIMIT_BURST); \ - \ - if (__ratelimit(&_rs)) \ - DRM_DEV_ERROR(dev, fmt, ##__VA_ARGS__); \ -}) - -#define DRM_DEV_INFO(dev, fmt, ...) \ - drm_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__) - -#define DRM_DEV_INFO_ONCE(dev, fmt, ...) \ -({ \ - static bool __print_once __read_mostly; \ - if (!__print_once) { \ - __print_once = true; \ - DRM_DEV_INFO(dev, fmt, ##__VA_ARGS__); \ - } \ -}) - -/** - * Debug output. - * - * @dev: device pointer - * @fmt: printf() like format string. - */ #define DRM_DEV_DEBUG(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__) + drm_dev_dbg_core((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DRIVER(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + drm_dev_dbg((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_KMS(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__) + drm_dev_dbg_kms((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_PRIME(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + drm_dev_dbg_prime((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_ATOMIC(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + drm_dev_dbg_atomic((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_VBL(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_VBL, fmt, ##__VA_ARGS__) + drm_dev_dbg_vbl((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_DP(dev, fmt, ...) \ - __drm_dev_dbg(dev, DRM_UT_DP, fmt, ## __VA_ARGS__) - -#define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, category, fmt, ...) \ -({ \ - static DEFINE_RATELIMIT_STATE(_rs, \ - DEFAULT_RATELIMIT_INTERVAL, \ - DEFAULT_RATELIMIT_BURST); \ - if (__ratelimit(&_rs)) \ - __drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__); \ -}) + drm_dev_dbg_dp((dev), fmt, ## __VA_ARGS__) -/** - * Rate limited debug output. Like DRM_DEBUG() but won't flood the log. - * - * @dev: device pointer - * @fmt: printf() like format string. - */ -#define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, ...) \ - _DEV_DRM_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_CORE, \ - fmt, ##__VA_ARGS__) -#define DRM_DEV_DEBUG_DRIVER_RATELIMITED(dev, fmt, ...) \ - _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_DRIVER, \ - fmt, ##__VA_ARGS__) +#define DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...) \ + drm_dev_err_ratelimited((dev), fmt, ##__VA_ARGS__) #define DRM_DEV_DEBUG_KMS_RATELIMITED(dev, fmt, ...) \ - _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_KMS, \ - fmt, ##__VA_ARGS__) -#define DRM_DEV_DEBUG_PRIME_RATELIMITED(dev, fmt, ...) \ - _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_PRIME, \ - fmt, ##__VA_ARGS__) - -/* - * printk based logging - * - * Prefer drm_device based logging over device or prink based logging. - */ - -__printf(2, 3) -void __drm_dbg(enum drm_debug_category category, const char *format, ...); -__printf(1, 2) -void __drm_err(const char *format, ...); - -/* Macros to make printk easier */ - -#define _DRM_PRINTK(once, level, fmt, ...) \ - printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) - -#define DRM_INFO(fmt, ...) \ - _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) -#define DRM_NOTE(fmt, ...) \ - _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) -#define DRM_WARN(fmt, ...) \ - _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + drm_dev_dbg_kms_ratelimited((dev), fmt, ##__VA_ARGS__) -#define DRM_INFO_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) -#define DRM_NOTE_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) -#define DRM_WARN_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) +#define DRM_INFO(fmt, ...) drm_pr_info(fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) drm_pr_notice(fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) drm_pr_warn(fmt, ##__VA_ARGS__) -#define DRM_ERROR(fmt, ...) \ - __drm_err(fmt, ##__VA_ARGS__) +#define DRM_INFO_ONCE(fmt, ...) drm_pr_info_once(fmt, ##__VA_ARGS__) +#define DRM_NOTE_ONCE(fmt, ...) drm_pr_notice_once(fmt, ##__VA_ARGS__) +#define DRM_WARN_ONCE(fmt, ...) drm_pr_warn_once(fmt, ##__VA_ARGS__) +#define DRM_ERROR(fmt, ...) drm_pr_err(fmt, ##__VA_ARGS__) #define DRM_ERROR_RATELIMITED(fmt, ...) \ DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG(fmt, ...) \ - __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_DRIVER(fmt, ...) \ - __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_KMS(fmt, ...) \ - __drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_PRIME(fmt, ...) \ - __drm_dbg(DRM_UT_PRIME, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_ATOMIC(fmt, ...) \ - __drm_dbg(DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_VBL(fmt, ...) \ - __drm_dbg(DRM_UT_VBL, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_LEASE(fmt, ...) \ - __drm_dbg(DRM_UT_LEASE, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_DP(fmt, ...) \ - __drm_dbg(DRM_UT_DP, fmt, ## __VA_ARGS__) - - -#define DRM_DEBUG_RATELIMITED(fmt, ...) \ - DRM_DEV_DEBUG_RATELIMITED(NULL, fmt, ##__VA_ARGS__) - -#define DRM_DEBUG_DRIVER_RATELIMITED(fmt, ...) \ - DRM_DEV_DEBUG_DRIVER_RATELIMITED(NULL, fmt, ##__VA_ARGS__) - #define DRM_DEBUG_KMS_RATELIMITED(fmt, ...) \ DRM_DEV_DEBUG_KMS_RATELIMITED(NULL, fmt, ##__VA_ARGS__) -#define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...) \ - DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__) +#define DRM_DEBUG(fmt, ...) drm_pr_dbg_core(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_DRIVER(fmt, ...) drm_pr_dbg(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_KMS(fmt, ...) drm_pr_dbg_kms(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_PRIME(fmt, ...) drm_pr_dbg_prime(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_ATOMIC(fmt, ...) drm_pr_dbg_atomic(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_VBL(fmt, ...) drm_pr_dbg_vbl(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_LEASE(fmt, ...) drm_pr_dbg_lease(fmt, ##__VA_ARGS__) +#define DRM_DEBUG_DP(fmt, ...) drm_pr_dbg_dp(fmt, ##__VA_ARGS__) #endif /* DRM_PRINT_H_ */