sde_vbif.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SDE_VBIF_H__
  6. #define __SDE_VBIF_H__
  7. #include "sde_kms.h"
  8. struct sde_vbif_set_ot_params {
  9. u32 xin_id;
  10. u32 num;
  11. u32 width;
  12. u32 height;
  13. u32 frame_rate;
  14. bool rd;
  15. bool is_wfd;
  16. u32 vbif_idx;
  17. u32 clk_ctrl;
  18. };
  19. struct sde_vbif_set_memtype_params {
  20. u32 xin_id;
  21. u32 vbif_idx;
  22. u32 clk_ctrl;
  23. bool is_cacheable;
  24. };
  25. /**
  26. * struct sde_vbif_set_xin_halt_params - xin halt parameters
  27. * @vbif_idx: vbif identifier
  28. * @xin_id: client interface identifier
  29. * @clk_ctrl: clock control identifier of the xin
  30. * @forced_on: whether or not previous call to xin halt forced the clocks on,
  31. * only applicable to xin halt disable calls
  32. * @enable: whether to enable/disable xin halts
  33. */
  34. struct sde_vbif_set_xin_halt_params {
  35. u32 vbif_idx;
  36. u32 xin_id;
  37. u32 clk_ctrl;
  38. bool forced_on;
  39. bool enable;
  40. };
  41. /**
  42. * struct sde_vbif_get_xin_status_params - xin halt parameters
  43. * @vbif_idx: vbif identifier
  44. * @xin_id: client interface identifier
  45. * @clk_ctrl: clock control identifier of the xin
  46. */
  47. struct sde_vbif_get_xin_status_params {
  48. u32 vbif_idx;
  49. u32 xin_id;
  50. u32 clk_ctrl;
  51. };
  52. /**
  53. * struct sde_vbif_set_qos_params - QoS remapper parameter
  54. * @vbif_idx: vbif identifier
  55. * @xin_id: client interface identifier
  56. * @clk_ctrl: clock control identifier of the xin
  57. * @num: pipe identifier (debug only)
  58. * @client_type: client type enumerated by sde_vbif_client_type
  59. */
  60. struct sde_vbif_set_qos_params {
  61. u32 vbif_idx;
  62. u32 xin_id;
  63. u32 clk_ctrl;
  64. u32 num;
  65. enum sde_vbif_client_type client_type;
  66. };
  67. /**
  68. * sde_vbif_set_ot_limit - set OT limit for vbif client
  69. * @sde_kms: SDE handler
  70. * @params: Pointer to OT configuration parameters
  71. */
  72. void sde_vbif_set_ot_limit(struct sde_kms *sde_kms,
  73. struct sde_vbif_set_ot_params *params);
  74. /**
  75. * sde_vbif_set_xin_halt - halt one of the xin ports
  76. * This function isn't thread safe.
  77. * @sde_kms: SDE handler
  78. * @params: Pointer to halt configuration parameters
  79. * Returns: Whether or not VBIF clocks were forced on
  80. */
  81. bool sde_vbif_set_xin_halt(struct sde_kms *sde_kms,
  82. struct sde_vbif_set_xin_halt_params *params);
  83. /**
  84. * sde_vbif_get_xin_status - halt one of the xin ports
  85. * This function isn't thread safe.
  86. * @sde_kms: SDE handler
  87. * @params: Pointer to xin status parameters
  88. * Returns: true if xin client is idle, false otherwise
  89. */
  90. bool sde_vbif_get_xin_status(struct sde_kms *sde_kms,
  91. struct sde_vbif_get_xin_status_params *params);
  92. /**
  93. * sde_vbif_set_qos_remap - set QoS priority level remap
  94. * @sde_kms: SDE handler
  95. * @params: Pointer to QoS configuration parameters
  96. */
  97. void sde_vbif_set_qos_remap(struct sde_kms *sde_kms,
  98. struct sde_vbif_set_qos_params *params);
  99. /**
  100. * sde_vbif_clear_errors - clear any vbif errors
  101. * @sde_kms: SDE handler
  102. */
  103. void sde_vbif_clear_errors(struct sde_kms *sde_kms);
  104. /**
  105. * sde_vbif_init_memtypes - initialize xin memory types for vbif
  106. * @sde_kms: SDE handler
  107. */
  108. void sde_vbif_init_memtypes(struct sde_kms *sde_kms);
  109. /**
  110. * sde_vbif_axi_halt_request - halt all axi transcations on vbif
  111. * @sde_kms: SDE handler
  112. */
  113. void sde_vbif_axi_halt_request(struct sde_kms *sde_kms);
  114. /**
  115. * sde_vbif_halt_plane_xin - halts the xin client for the unused plane
  116. * On unused plane, check if the vbif for this plane is idle or not.
  117. * If not then first force_on the planes clock and then send the
  118. * halt request. Wait for some time then check for the vbif idle
  119. * or not again.
  120. * @sde_kms: SDE handler
  121. * @xin_id: xin id of the unused plane
  122. * @clk_ctrl: clk ctrl type for the unused plane
  123. * Returns: 0 on success, error code otherwise
  124. */
  125. int sde_vbif_halt_plane_xin(struct sde_kms *sde_kms, u32 xin_id,
  126. u32 clk_ctrl);
  127. /**
  128. * sde_vbif_halt_xin_mask - halts/unhalts all the xin clients present in
  129. * the mask.
  130. * @sde_kms: SDE handler
  131. * @xin_id_mask: Mask of all the xin-ids to be halted/unhalted
  132. * halt: boolen to indicate halt/unhalt
  133. */
  134. int sde_vbif_halt_xin_mask(struct sde_kms *sde_kms, u32 xin_id_mask, bool halt);
  135. #ifdef CONFIG_DEBUG_FS
  136. int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root);
  137. void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms);
  138. #else
  139. static inline int sde_debugfs_vbif_init(struct sde_kms *sde_kms,
  140. struct dentry *debugfs_root)
  141. {
  142. return 0;
  143. }
  144. static inline void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms)
  145. {
  146. }
  147. #endif
  148. #endif /* __SDE_VBIF_H__ */