Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b909a512 authored by Aravind Venkateswaran's avatar Aravind Venkateswaran
Browse files

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.

CRs-Fixed: 2565704
Change-Id: I4f894a2ecf314a3a5fc0bb22a75a0e10dae31e07
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent a48b8eaf
Loading
Loading
Loading
Loading
+27 −7
Original line number Diff line number Diff line
@@ -13,13 +13,33 @@
#include "dp_aux.h"
#include "dp_display.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