dp_debug.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2019, 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. #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. * @hdcp_status: string holding hdcp status information
  35. * @dp_mst_connector_list: list containing all dp mst connectors
  36. * @mst_hpd_sim: specifies whether simulated hpd enabled
  37. * @mst_sim_add_con: specifies whether new sim connector is to be added
  38. * @mst_sim_remove_con: specifies whether sim connector is to be removed
  39. * @mst_sim_remove_con_id: specifies id of sim connector to be removed
  40. * @mst_port_cnt: number of mst ports to be added during hpd
  41. */
  42. struct dp_debug {
  43. bool debug_en;
  44. bool sim_mode;
  45. bool psm_enabled;
  46. bool hdcp_disabled;
  47. bool hdcp_wait_sink_sync;
  48. int aspect_ratio;
  49. int vdisplay;
  50. int hdisplay;
  51. int vrefresh;
  52. bool tpg_state;
  53. u32 max_pclk_khz;
  54. bool force_encryption;
  55. char hdcp_status[SZ_128];
  56. struct dp_mst_connector dp_mst_connector_list;
  57. bool mst_hpd_sim;
  58. bool mst_sim_add_con;
  59. bool mst_sim_remove_con;
  60. int mst_sim_remove_con_id;
  61. u32 mst_port_cnt;
  62. u8 *(*get_edid)(struct dp_debug *dp_debug);
  63. void (*abort)(struct dp_debug *dp_debug);
  64. };
  65. /**
  66. * struct dp_debug_in
  67. * @dev: device instance of the caller
  68. * @panel: instance of panel module
  69. * @hpd: instance of hpd module
  70. * @link: instance of link module
  71. * @aux: instance of aux module
  72. * @connector: double pointer to display connector
  73. * @catalog: instance of catalog module
  74. * @parser: instance of parser module
  75. */
  76. struct dp_debug_in {
  77. struct device *dev;
  78. struct dp_panel *panel;
  79. struct dp_hpd *hpd;
  80. struct dp_link *link;
  81. struct dp_aux *aux;
  82. struct drm_connector **connector;
  83. struct dp_catalog *catalog;
  84. struct dp_parser *parser;
  85. struct dp_ctrl *ctrl;
  86. };
  87. /**
  88. * dp_debug_get() - configure and get the DisplayPlot debug module data
  89. *
  90. * @in: input structure containing data to initialize the debug module
  91. * return: pointer to allocated debug module data
  92. *
  93. * This function sets up the debug module and provides a way
  94. * for debugfs input to be communicated with existing modules
  95. */
  96. struct dp_debug *dp_debug_get(struct dp_debug_in *in);
  97. /**
  98. * dp_debug_put()
  99. *
  100. * Cleans up dp_debug instance
  101. *
  102. * @dp_debug: instance of dp_debug
  103. */
  104. void dp_debug_put(struct dp_debug *dp_debug);
  105. #endif /* _DP_DEBUG_H_ */