[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <be10fda2-eeef-ba74-0f6c-8ce01e7e2087@amd.com>
Date: Mon, 24 Oct 2022 12:04:48 +0200
From: Christian König <christian.koenig@....com>
To: Hamza Mahfooz <hamza.mahfooz@....com>,
amd-gfx@...ts.freedesktop.org
Cc: Brian Chang <Brian.Chang@....com>, Ian Chen <ian.chen@....com>,
Jim Cromie <jim.cromie@...il.com>,
Anthony Koo <Anthony.Koo@....com>,
David Airlie <airlied@...ux.ie>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Leo Li <sunpeng.li@....com>, Daniel Vetter <daniel@...ll.ch>,
Alex Deucher <alexander.deucher@....com>,
"Leo (Hanghong) Ma" <hanghong.ma@....com>,
Harry Wentland <harry.wentland@....com>,
Christian König <christian.koenig@....com>
Subject: Re: [PATCH] drm/amd/display: don't print messages that contain %f in
dml
Am 21.10.22 um 18:34 schrieb Hamza Mahfooz:
> Unfortunately, printk() doesn't currently support the printing of %f
> entries. So, print statements that contain "%f" should be removed.
> However, since DC is used on other OSes that can still benefit from the
> additional debugging information, we should instead remove the
> problematic print statements at compile time.
>
> Reported-by: Jim Cromie <jim.cromie@...il.com>
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@....com>
> ---
> drivers/gpu/drm/amd/display/include/logger_types.h | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/include/logger_types.h b/drivers/gpu/drm/amd/display/include/logger_types.h
> index 3bf08a60c45c..f80630adb5f0 100644
> --- a/drivers/gpu/drm/amd/display/include/logger_types.h
> +++ b/drivers/gpu/drm/amd/display/include/logger_types.h
> @@ -30,6 +30,12 @@
>
> #define MAX_NAME_LEN 32
>
> +#define __DC_LOG_IGNORE_FLOATS(fmt, args...) \
> +do { \
> + if (!strstr((fmt), "%f")) \
> + pr_debug(fmt, ##args); \
> +} while (0)
This is absolutely not sufficient.
Linux drivers must be made for Linux, see the documentation about
porting drivers.
So just disabling the debug messages won't work in this case. Either
completely remove or properly fix them.
Regards,
Christian.
> +
> #define DC_LOG_ERROR(...) DRM_ERROR(__VA_ARGS__)
> #define DC_LOG_WARNING(...) DRM_WARN(__VA_ARGS__)
> #define DC_LOG_DEBUG(...) DRM_DEBUG_KMS(__VA_ARGS__)
> @@ -48,7 +54,8 @@
> #define DC_LOG_MST(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_SCALER(...) pr_debug("[SCALER]:"__VA_ARGS__)
> #define DC_LOG_BIOS(...) pr_debug("[BIOS]:"__VA_ARGS__)
> -#define DC_LOG_BANDWIDTH_CALCS(...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__)
> +#define DC_LOG_BANDWIDTH_CALCS(args...) \
> + __DC_LOG_IGNORE_FLOATS("[BANDWIDTH_CALCS]:" args)
> #define DC_LOG_BANDWIDTH_VALIDATION(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_I2C_AUX(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_SYNC(...) DRM_DEBUG_KMS(__VA_ARGS__)
> @@ -57,7 +64,7 @@
> #define DC_LOG_DETECTION_EDID_PARSER(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_DETECTION_DP_CAPS(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_RESOURCE(...) DRM_DEBUG_KMS(__VA_ARGS__)
> -#define DC_LOG_DML(...) pr_debug("[DML]:"__VA_ARGS__)
> +#define DC_LOG_DML(args...) __DC_LOG_IGNORE_FLOATS("[DML]:" args)
> #define DC_LOG_EVENT_MODE_SET(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_EVENT_DETECTION(...) DRM_DEBUG_KMS(__VA_ARGS__)
> #define DC_LOG_EVENT_LINK_TRAINING(...) DRM_DEBUG_KMS(__VA_ARGS__)
Powered by blists - more mailing lists