sde_rotator_debug.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SDE_ROTATOR_DEBUG_H__
  6. #define __SDE_ROTATOR_DEBUG_H__
  7. #include <linux/types.h>
  8. #include <linux/dcache.h>
  9. #define SDE_ROT_DATA_LIMITER (-1)
  10. #define SDE_ROT_EVTLOG_TOUT_DATA_LIMITER (NULL)
  11. #define SDE_ROT_EVTLOG_PANIC 0xdead
  12. #define SDE_ROT_EVTLOG_FATAL 0xbad
  13. #define SDE_ROT_EVTLOG_ERROR 0xebad
  14. enum sde_rot_dbg_reg_dump_flag {
  15. SDE_ROT_DBG_DUMP_IN_LOG = BIT(0),
  16. SDE_ROT_DBG_DUMP_IN_MEM = BIT(1),
  17. };
  18. enum sde_rot_dbg_evtlog_flag {
  19. SDE_ROT_EVTLOG_DEFAULT = BIT(0),
  20. SDE_ROT_EVTLOG_IOMMU = BIT(1),
  21. SDE_ROT_EVTLOG_DBG = BIT(6),
  22. SDE_ROT_EVTLOG_ALL = BIT(7)
  23. };
  24. #define SDEROT_EVTLOG(...) sde_rot_evtlog(__func__, __LINE__, \
  25. SDE_ROT_EVTLOG_DEFAULT, ##__VA_ARGS__, SDE_ROT_DATA_LIMITER)
  26. #define SDEROT_EVTLOG_TOUT_HANDLER(...) \
  27. sde_rot_evtlog_tout_handler(false, __func__, ##__VA_ARGS__, \
  28. SDE_ROT_EVTLOG_TOUT_DATA_LIMITER)
  29. #if defined(CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG)
  30. void sde_rot_evtlog(const char *name, int line, int flag, ...);
  31. void sde_rot_evtlog_tout_handler(bool queue, const char *name, ...);
  32. #else
  33. static inline
  34. void sde_rot_evtlog(const char *name, int line, int flag, ...)
  35. {
  36. }
  37. static inline
  38. void sde_rot_evtlog_tout_handler(bool queue, const char *name, ...)
  39. {
  40. }
  41. #endif
  42. struct sde_rotator_device;
  43. struct sde_rotator_debug_base {
  44. char name[80];
  45. void __iomem *base;
  46. size_t off;
  47. size_t cnt;
  48. size_t max_offset;
  49. char *buf;
  50. size_t buf_len;
  51. struct sde_rot_mgr *mgr;
  52. struct mutex buflock;
  53. };
  54. #if defined(CONFIG_DEBUG_FS)
  55. struct dentry *sde_rotator_create_debugfs(
  56. struct sde_rotator_device *rot_dev);
  57. void sde_rotator_destroy_debugfs(struct dentry *debugfs);
  58. #else
  59. static inline
  60. struct dentry *sde_rotator_create_debugfs(
  61. struct sde_rotator_device *rot_dev)
  62. {
  63. return NULL;
  64. }
  65. static inline
  66. void sde_rotator_destroy_debugfs(struct dentry *debugfs)
  67. {
  68. }
  69. #endif
  70. #endif /* __SDE_ROTATOR_DEBUG_H__ */