From 69631c415c51b53d0b28183def2e4cde846c88c9 Mon Sep 17 00:00:00 2001 From: Aravind Venkateswaran Date: Tue, 5 Nov 2019 13:26:48 -0800 Subject: [PATCH] drm: msm: dp: update logging support Modify the macros to use default kernel logging function if DRM log levels are not explicitly set. This helps in being able to selectively enable function or file level logs. Change-Id: I4f894a2ecf314a3a5fc0bb22a75a0e10dae31e07 Signed-off-by: Aravind Venkateswaran Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_debug.h | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/msm/dp/dp_debug.h b/msm/dp/dp_debug.h index c5d09699a0..65874f2132 100644 --- a/msm/dp/dp_debug.h +++ b/msm/dp/dp_debug.h @@ -13,13 +13,33 @@ #include "dp_display.h" #include "dp_pll.h" -#define DP_WARN(fmt, ...) DRM_WARN("[msm-dp-warn] "fmt, ##__VA_ARGS__) -#define DP_ERR(fmt, ...) DRM_DEV_ERROR(NULL, "[msm-dp-error]" fmt, \ - ##__VA_ARGS__) -#define DP_INFO(fmt, ...) DRM_DEV_INFO(NULL, "[msm-dp-info] "fmt, \ - ##__VA_ARGS__) -#define DP_DEBUG(fmt, ...) DRM_DEV_DEBUG_DP(NULL, "[msm-dp-debug] "fmt, \ - ##__VA_ARGS__) +#define DP_DEBUG(fmt, ...) \ + do { \ + if (unlikely(drm_debug & DRM_UT_KMS)) \ + DRM_DEBUG("[msm-dp-debug][%-4d]"fmt, current->pid, \ + ##__VA_ARGS__); \ + else \ + pr_debug("[drm:%s][msm-dp-debug][%-4d]"fmt, __func__,\ + current->pid, ##__VA_ARGS__); \ + } while (0) + +#define DP_INFO(fmt, ...) \ + do { \ + if (unlikely(drm_debug & DRM_UT_KMS)) \ + DRM_INFO("[msm-dp-info][%-4d]"fmt, current->pid, \ + ##__VA_ARGS__); \ + else \ + pr_info("[drm:%s][msm-dp-info][%-4d]"fmt, __func__, \ + current->pid, ##__VA_ARGS__); \ + } while (0) + +#define DP_WARN(fmt, ...) \ + pr_warn("[drm:%s][msm-dp-warn][%-4d]"fmt, __func__, \ + current->pid, ##__VA_ARGS__) + +#define DP_ERR(fmt, ...) \ + pr_err("[drm:%s][msm-dp-err][%-4d]"fmt, __func__, \ + current->pid, ##__VA_ARGS__) /** * struct dp_debug