* [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros
[not found] <20210721175526.22020-1-sean@poorly.run>
@ 2021-07-21 17:55 ` Sean Paul
2021-08-05 14:00 ` Dmitry Baryshkov
2021-09-17 18:23 ` [Freedreno] " abhinavk
0 siblings, 2 replies; 3+ messages in thread
From: Sean Paul @ 2021-07-21 17:55 UTC (permalink / raw)
To: dri-devel, ppaalanen, maarten.lankhorst, tzimmermann, airlied,
daniel.vetter
Cc: Sean Paul, Rob Clark, Sean Paul, Daniel Vetter, linux-arm-msm, freedreno
From: Sean Paul <seanpaul@chromium.org>
The debug messages shouldn't be logged as errors when debug categories
are enabled. Use the drm logging helpers to do the right thing
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-5-sean@poorly.run #v5
Changes in v5:
-Added to the set
Changes in v6:
-None
---
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
index 323a6bce9e64..c33164d3944a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
@@ -31,27 +31,15 @@
* DPU_DEBUG - macro for kms/plane/crtc/encoder/connector logs
* @fmt: Pointer to format string
*/
-#define DPU_DEBUG(fmt, ...) \
- do { \
- if (drm_debug_enabled(DRM_UT_KMS)) \
- DRM_DEBUG(fmt, ##__VA_ARGS__); \
- else \
- pr_debug(fmt, ##__VA_ARGS__); \
- } while (0)
+#define DPU_DEBUG(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
/**
* DPU_DEBUG_DRIVER - macro for hardware driver logging
* @fmt: Pointer to format string
*/
-#define DPU_DEBUG_DRIVER(fmt, ...) \
- do { \
- if (drm_debug_enabled(DRM_UT_DRIVER)) \
- DRM_ERROR(fmt, ##__VA_ARGS__); \
- else \
- pr_debug(fmt, ##__VA_ARGS__); \
- } while (0)
-
-#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
+#define DPU_DEBUG_DRIVER(fmt, ...) DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
+
+#define DPU_ERROR(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
/**
* ktime_compare_safe - compare two ktime structures
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros
2021-07-21 17:55 ` [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros Sean Paul
@ 2021-08-05 14:00 ` Dmitry Baryshkov
2021-09-17 18:23 ` [Freedreno] " abhinavk
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2021-08-05 14:00 UTC (permalink / raw)
To: Sean Paul, dri-devel, ppaalanen, maarten.lankhorst, tzimmermann,
airlied, daniel.vetter
Cc: Sean Paul, Rob Clark, Daniel Vetter, linux-arm-msm, freedreno
On 21/07/2021 20:55, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> The debug messages shouldn't be logged as errors when debug categories
> are enabled. Use the drm logging helpers to do the right thing
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-5-sean@poorly.run #v5
The patch seems correct, but I'd propose another approach.
There is just 1 user of DPU_DEBUG_DRIVER and 29 users of DPU_DEBUG. So
we might instead replace them with DRM_DEBUG_* calls and drop the
DPU_DEBUG/DPU_DEBUG_DRIVER altogether. DPU_ERROR is used in ~190 places,
so it will be more intrusive, but still doable.
> Changes in v5:
> -Added to the set
> Changes in v6:
> -None
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 20 ++++----------------
> 1 file changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> index 323a6bce9e64..c33164d3944a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> @@ -31,27 +31,15 @@
> * DPU_DEBUG - macro for kms/plane/crtc/encoder/connector logs
> * @fmt: Pointer to format string
> */
> -#define DPU_DEBUG(fmt, ...) \
> - do { \
> - if (drm_debug_enabled(DRM_UT_KMS)) \
> - DRM_DEBUG(fmt, ##__VA_ARGS__); \
> - else \
> - pr_debug(fmt, ##__VA_ARGS__); \
> - } while (0)
> +#define DPU_DEBUG(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
>
> /**
> * DPU_DEBUG_DRIVER - macro for hardware driver logging
> * @fmt: Pointer to format string
> */
> -#define DPU_DEBUG_DRIVER(fmt, ...) \
> - do { \
> - if (drm_debug_enabled(DRM_UT_DRIVER)) \
> - DRM_ERROR(fmt, ##__VA_ARGS__); \
> - else \
> - pr_debug(fmt, ##__VA_ARGS__); \
> - } while (0)
> -
> -#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
> +#define DPU_DEBUG_DRIVER(fmt, ...) DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
> +
> +#define DPU_ERROR(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
>
> /**
> * ktime_compare_safe - compare two ktime structures
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Freedreno] [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros
2021-07-21 17:55 ` [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros Sean Paul
2021-08-05 14:00 ` Dmitry Baryshkov
@ 2021-09-17 18:23 ` abhinavk
1 sibling, 0 replies; 3+ messages in thread
From: abhinavk @ 2021-09-17 18:23 UTC (permalink / raw)
To: Sean Paul
Cc: dri-devel, ppaalanen, maarten.lankhorst, tzimmermann, airlied,
daniel.vetter, freedreno, Rob Clark, Sean Paul, Daniel Vetter,
linux-arm-msm
On 2021-07-21 10:55, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> The debug messages shouldn't be logged as errors when debug categories
> are enabled. Use the drm logging helpers to do the right thing
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-5-sean@poorly.run
> #v5
>
> Changes in v5:
> -Added to the set
> Changes in v6:
> -None
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 20 ++++----------------
> 1 file changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> index 323a6bce9e64..c33164d3944a 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
> @@ -31,27 +31,15 @@
> * DPU_DEBUG - macro for kms/plane/crtc/encoder/connector logs
> * @fmt: Pointer to format string
> */
> -#define DPU_DEBUG(fmt, ...)
> \
> - do { \
> - if (drm_debug_enabled(DRM_UT_KMS)) \
> - DRM_DEBUG(fmt, ##__VA_ARGS__); \
> - else \
> - pr_debug(fmt, ##__VA_ARGS__); \
> - } while (0)
> +#define DPU_DEBUG(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
>
> /**
> * DPU_DEBUG_DRIVER - macro for hardware driver logging
> * @fmt: Pointer to format string
> */
> -#define DPU_DEBUG_DRIVER(fmt, ...)
> \
> - do { \
> - if (drm_debug_enabled(DRM_UT_DRIVER)) \
> - DRM_ERROR(fmt, ##__VA_ARGS__); \
> - else \
> - pr_debug(fmt, ##__VA_ARGS__); \
> - } while (0)
> -
> -#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
> +#define DPU_DEBUG_DRIVER(fmt, ...) DRM_DEBUG_DRIVER(fmt,
> ##__VA_ARGS__)
> +
> +#define DPU_ERROR(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
>
> /**
> * ktime_compare_safe - compare two ktime structures
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-17 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210721175526.22020-1-sean@poorly.run>
2021-07-21 17:55 ` [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros Sean Paul
2021-08-05 14:00 ` Dmitry Baryshkov
2021-09-17 18:23 ` [Freedreno] " abhinavk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).