sde_rotator_debug.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. void sde_rot_evtlog(const char *name, int line, int flag, ...);
  30. void sde_rot_evtlog_tout_handler(bool queue, const char *name, ...);
  31. struct sde_rotator_device;
  32. struct sde_rotator_debug_base {
  33. char name[80];
  34. void __iomem *base;
  35. size_t off;
  36. size_t cnt;
  37. size_t max_offset;
  38. char *buf;
  39. size_t buf_len;
  40. struct sde_rot_mgr *mgr;
  41. struct mutex buflock;
  42. };
  43. #if defined(CONFIG_DEBUG_FS)
  44. struct dentry *sde_rotator_create_debugfs(
  45. struct sde_rotator_device *rot_dev);
  46. void sde_rotator_destroy_debugfs(struct dentry *debugfs);
  47. #else
  48. static inline
  49. struct dentry *sde_rotator_create_debugfs(
  50. struct sde_rotator_device *rot_dev)
  51. {
  52. return NULL;
  53. }
  54. static inline
  55. void sde_rotator_destroy_debugfs(struct dentry *debugfs)
  56. {
  57. }
  58. #endif
  59. #endif /* __SDE_ROTATOR_DEBUG_H__ */