Explorar el Código

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 <[email protected]>
Signed-off-by: Tatenda Chipeperekwa <[email protected]>
Aravind Venkateswaran hace 5 años
padre
commit
69631c415c
Se han modificado 1 ficheros con 27 adiciones y 7 borrados
  1. 27 7
      msm/dp/dp_debug.h

+ 27 - 7
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