drm/msm: update wrapper macros for event logging
Create a reusable wrapper macro under msm_drv.h (tied to the evtlog
instance) rather than requiring similar macros in each file.
Change MSM_EVT(log*, ...) to MSM_EVT(dev*, ...)
Change MSM_EVT_MSG(log*, ...) to MSM_EVTMSG(dev*, ...)
Change-Id: I95c74470ab1cd3c02e97186a6c1560ef31e9749e
Signed-off-by: Clarence Ip <cip@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 44b2d32..8a3f522 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -191,6 +191,19 @@
struct msm_evtlog evtlog;
};
+/* Helper macro for accessing msm_drm_private's event log */
+#define MSM_EVTMSG(dev, msg, x, y) do { \
+ if ((dev) && ((struct drm_device *)(dev))->dev_private) \
+ msm_evtlog_sample(&((struct msm_drm_private *) \
+ ((struct drm_device *) \
+ (dev))->dev_private)->evtlog, __func__,\
+ (msg), (uint64_t)(x), (uint64_t)(y), \
+ __LINE__); \
+ } while (0)
+
+/* Helper macro for accessing msm_drm_private's event log */
+#define MSM_EVT(dev, x, y) MSM_EVTMSG((dev), 0, (x), (y))
+
struct msm_format {
uint32_t pixel_format;
};