dp_debug.h 2.3 KB

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