mtk_drm_trace.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2015 MediaTek Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __MTK_DRM_TRACE__
  14. #define __MTK_DRM_TRACE__
  15. #include "mtk_drm_ddp_comp.h"
  16. #define DRM_TRACE_ID 0xFFFF0000
  17. #define DRM_TRACE_FPS_ID (DRM_TRACE_ID + 1)
  18. #define DRM_TRACE_FENCE_ID (DRM_TRACE_ID + 2)
  19. #define DRM_TRACE_VSYNC_ID (DRM_TRACE_ID + 3)
  20. /* MTK_DRM FTRACE */
  21. extern bool g_trace_log;
  22. #define mtk_drm_trace_begin(fmt, args...) do { \
  23. if (g_trace_log) { \
  24. preempt_disable(); \
  25. event_trace_printk(mtk_drm_get_tracing_mark(), \
  26. "B|%d|"fmt"\n", current->tgid, ##args); \
  27. preempt_enable();\
  28. } \
  29. } while (0)
  30. #define mtk_drm_trace_end() do { \
  31. if (g_trace_log) { \
  32. preempt_disable(); \
  33. event_trace_printk(mtk_drm_get_tracing_mark(), "E\n"); \
  34. preempt_enable(); \
  35. } \
  36. } while (0)
  37. #define mtk_drm_trace_c(fmt, args...) do { \
  38. if (g_trace_log) { \
  39. preempt_disable(); \
  40. event_trace_printk(mtk_drm_get_tracing_mark(), \
  41. "C|"fmt"\n", ##args); \
  42. preempt_enable();\
  43. } \
  44. } while (0)
  45. unsigned long mtk_drm_get_tracing_mark(void);
  46. void drm_trace_tag_start(const char *tag);
  47. void drm_trace_tag_end(const char *tag);
  48. void drm_trace_tag_mark(const char *tag);
  49. void mtk_drm_refresh_tag_start(struct mtk_ddp_comp *ddp_comp);
  50. void mtk_drm_refresh_tag_end(struct mtk_ddp_comp *ddp_comp);
  51. void MMPathTraceDRM(struct mtk_ddp_comp *ddp_comp);
  52. int MMPathTraceRDMA(struct mtk_ddp_comp *ddp_comp, char *str,
  53. unsigned int strlen, unsigned int n);
  54. int MMPathTraceWDMA(struct mtk_ddp_comp *ddp_comp, char *str,
  55. unsigned int strlen, unsigned int n);
  56. int MMPathTraceCrtcPlanes(struct drm_crtc *crtc,
  57. char *str, int strlen, int n);
  58. #endif