dp_debug.h 3.5 KB

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