dp_debug.h 3.0 KB

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