sde_vbif.h 4.2 KB

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