dp_debug.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _DP_DEBUG_H_
  6. #define _DP_DEBUG_H_
  7. #include "dp_panel.h"
  8. #include "dp_ctrl.h"
  9. #include "dp_link.h"
  10. #include "dp_aux.h"
  11. #include "dp_display.h"
  12. #include "dp_pll.h"
  13. #define DP_WARN(fmt, ...) DRM_WARN("[msm-dp-warn] "fmt, ##__VA_ARGS__)
  14. #define DP_ERR(fmt, ...) DRM_DEV_ERROR(NULL, "[msm-dp-error]" fmt, \
  15. ##__VA_ARGS__)
  16. #define DP_INFO(fmt, ...) DRM_DEV_INFO(NULL, "[msm-dp-info] "fmt, \
  17. ##__VA_ARGS__)
  18. #define DP_DEBUG(fmt, ...) DRM_DEV_DEBUG_DP(NULL, "[msm-dp-debug] "fmt, \
  19. ##__VA_ARGS__)
  20. /**
  21. * struct dp_debug
  22. * @debug_en: specifies whether debug mode enabled
  23. * @sim_mode: specifies whether sim mode enabled
  24. * @psm_enabled: specifies whether psm enabled
  25. * @hdcp_disabled: specifies if hdcp is disabled
  26. * @hdcp_wait_sink_sync: used to wait for sink synchronization before HDCP auth
  27. * @aspect_ratio: used to filter out aspect_ratio value
  28. * @vdisplay: used to filter out vdisplay value
  29. * @hdisplay: used to filter out hdisplay value
  30. * @vrefresh: used to filter out vrefresh value
  31. * @tpg_state: specifies whether tpg feature is enabled
  32. * @max_pclk_khz: max pclk supported
  33. * @force_encryption: enable/disable forced encryption for HDCP 2.2
  34. * @skip_uevent: skip hotplug uevent to the user space
  35. * @hdcp_status: string holding hdcp status information
  36. * @dp_mst_connector_list: list containing all dp mst connectors
  37. * @mst_hpd_sim: specifies whether simulated hpd enabled
  38. * @mst_sim_add_con: specifies whether new sim connector is to be added
  39. * @mst_sim_remove_con: specifies whether sim connector is to be removed
  40. * @mst_sim_remove_con_id: specifies id of sim connector to be removed
  41. * @mst_port_cnt: number of mst ports to be added during hpd
  42. */
  43. struct dp_debug {
  44. bool debug_en;
  45. bool sim_mode;
  46. bool psm_enabled;
  47. bool hdcp_disabled;
  48. bool hdcp_wait_sink_sync;
  49. int aspect_ratio;
  50. int vdisplay;
  51. int hdisplay;
  52. int vrefresh;
  53. bool tpg_state;
  54. u32 max_pclk_khz;
  55. bool force_encryption;
  56. bool skip_uevent;
  57. char hdcp_status[SZ_128];
  58. struct dp_mst_connector dp_mst_connector_list;
  59. bool mst_hpd_sim;
  60. bool mst_sim_add_con;
  61. bool mst_sim_remove_con;
  62. int mst_sim_remove_con_id;
  63. u32 mst_port_cnt;
  64. u8 *(*get_edid)(struct dp_debug *dp_debug);
  65. void (*abort)(struct dp_debug *dp_debug);
  66. };
  67. /**
  68. * struct dp_debug_in
  69. * @dev: device instance of the caller
  70. * @panel: instance of panel module
  71. * @hpd: instance of hpd module
  72. * @link: instance of link module
  73. * @aux: instance of aux module
  74. * @connector: double pointer to display connector
  75. * @catalog: instance of catalog module
  76. * @parser: instance of parser module
  77. * @ctrl: instance of controller module
  78. * @pll: instance of pll module
  79. */
  80. struct dp_debug_in {
  81. struct device *dev;
  82. struct dp_panel *panel;
  83. struct dp_hpd *hpd;
  84. struct dp_link *link;
  85. struct dp_aux *aux;
  86. struct drm_connector **connector;
  87. struct dp_catalog *catalog;
  88. struct dp_parser *parser;
  89. struct dp_ctrl *ctrl;
  90. struct dp_pll *pll;
  91. };
  92. /**
  93. * dp_debug_get() - configure and get the DisplayPlot debug module data
  94. *
  95. * @in: input structure containing data to initialize the debug module
  96. * return: pointer to allocated debug module data
  97. *
  98. * This function sets up the debug module and provides a way
  99. * for debugfs input to be communicated with existing modules
  100. */
  101. struct dp_debug *dp_debug_get(struct dp_debug_in *in);
  102. /**
  103. * dp_debug_put()
  104. *
  105. * Cleans up dp_debug instance
  106. *
  107. * @dp_debug: instance of dp_debug
  108. */
  109. void dp_debug_put(struct dp_debug *dp_debug);
  110. #endif /* _DP_DEBUG_H_ */