rgx_bridge.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*************************************************************************/ /*!
  2. @File
  3. @Title RGX Bridge Functionality
  4. @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  5. @Description Header for the Rogue Bridge code
  6. @License Dual MIT/GPLv2
  7. The contents of this file are subject to the MIT license as set out below.
  8. Permission is hereby granted, free of charge, to any person obtaining a copy
  9. of this software and associated documentation files (the "Software"), to deal
  10. in the Software without restriction, including without limitation the rights
  11. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. copies of the Software, and to permit persons to whom the Software is
  13. furnished to do so, subject to the following conditions:
  14. The above copyright notice and this permission notice shall be included in
  15. all copies or substantial portions of the Software.
  16. Alternatively, the contents of this file may be used under the terms of
  17. the GNU General Public License Version 2 ("GPL") in which case the provisions
  18. of GPL are applicable instead of those above.
  19. If you wish to allow use of your version of this file only under the terms of
  20. GPL, and not to allow others to use your version of this file under the terms
  21. of the MIT license, indicate your decision by deleting the provisions above
  22. and replace them with the notice and other provisions required by GPL as set
  23. out in the file called "GPL-COPYING" included in this distribution. If you do
  24. not delete the provisions above, a recipient may use your version of this file
  25. under the terms of either the MIT license or GPL.
  26. This License is also included in this distribution in the file called
  27. "MIT-COPYING".
  28. EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  29. PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  30. BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  31. PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  32. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  33. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  34. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  35. */ /**************************************************************************/
  36. #ifndef RGX_BRIDGE_H
  37. #define RGX_BRIDGE_H
  38. #include "pvr_bridge.h"
  39. #if defined(__cplusplus)
  40. extern "C" {
  41. #endif
  42. #include "rgx_fwif_km.h"
  43. #define RGXFWINITPARAMS_VERSION 1
  44. #define RGXFWINITPARAMS_EXTENSION 128
  45. #include "common_rgxta3d_bridge.h"
  46. #include "common_rgxcmp_bridge.h"
  47. #include "common_rgxtq2_bridge.h"
  48. #if defined(SUPPORT_RGXTQ_BRIDGE)
  49. #include "common_rgxtq_bridge.h"
  50. #endif
  51. #if defined(SUPPORT_USC_BREAKPOINT)
  52. #include "common_rgxbreakpoint_bridge.h"
  53. #endif
  54. #include "common_rgxfwdbg_bridge.h"
  55. #if defined(PDUMP)
  56. #include "common_rgxpdump_bridge.h"
  57. #endif
  58. #include "common_rgxhwperf_bridge.h"
  59. #if !defined(EXCLUDE_RGXREGCONFIG_BRIDGE)
  60. #include "common_rgxregconfig_bridge.h"
  61. #endif
  62. #include "common_rgxkicksync_bridge.h"
  63. #include "common_rgxtimerquery_bridge.h"
  64. #if defined(SUPPORT_RGXRAY_BRIDGE)
  65. #include "common_rgxray_bridge.h"
  66. #endif
  67. /*
  68. * Bridge Cmd Ids
  69. */
  70. /* *REMEMBER* to update PVRSRV_BRIDGE_RGX_LAST if you add/remove a bridge
  71. * group!
  72. * Also you need to ensure all PVRSRV_BRIDGE_RGX_xxx_DISPATCH_FIRST offsets
  73. * follow on from the previous bridge group's commands!
  74. *
  75. * If a bridge group is optional, ensure you *ALWAYS* define its index
  76. * (e.g. PVRSRV_BRIDGE_RGXCMP is always 151, even is the feature is not
  77. * defined). If an optional bridge group is not defined you must still
  78. * define PVRSRV_BRIDGE_RGX_xxx_DISPATCH_FIRST for it with an assigned
  79. * value of 0.
  80. */
  81. /* The RGX bridge groups start at 128 (PVRSRV_BRIDGE_RGX_FIRST) rather than
  82. * follow-on from the other non-device bridge groups (meaning that they then
  83. * won't be displaced if other non-device bridge groups are added).
  84. */
  85. #define PVRSRV_BRIDGE_RGX_FIRST 128UL
  86. /* 128: RGX TQ interface functions */
  87. #define PVRSRV_BRIDGE_RGXTQ 128UL
  88. /* The RGXTQ bridge is conditional since the definitions in this header file
  89. * support both the rogue and volcanic servers, but the RGXTQ bridge is not
  90. * required at all on the Volcanic architecture.
  91. */
  92. #if defined(SUPPORT_RGXTQ_BRIDGE)
  93. #define PVRSRV_BRIDGE_RGXTQ_DISPATCH_FIRST (PVRSRV_BRIDGE_DISPATCH_LAST + 1)
  94. #define PVRSRV_BRIDGE_RGXTQ_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTQ_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXTQ_CMD_LAST)
  95. #else
  96. #define PVRSRV_BRIDGE_RGXTQ_DISPATCH_FIRST 0
  97. #define PVRSRV_BRIDGE_RGXTQ_DISPATCH_LAST (PVRSRV_BRIDGE_DISPATCH_LAST)
  98. #endif
  99. /* 129: RGX Compute interface functions */
  100. #define PVRSRV_BRIDGE_RGXCMP 129UL
  101. #define PVRSRV_BRIDGE_RGXCMP_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXTQ_DISPATCH_LAST + 1)
  102. #define PVRSRV_BRIDGE_RGXCMP_DISPATCH_LAST (PVRSRV_BRIDGE_RGXCMP_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXCMP_CMD_LAST)
  103. /* 130: RGX TA/3D interface functions */
  104. #define PVRSRV_BRIDGE_RGXTA3D 130UL
  105. #define PVRSRV_BRIDGE_RGXTA3D_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXCMP_DISPATCH_LAST + 1)
  106. #define PVRSRV_BRIDGE_RGXTA3D_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTA3D_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXTA3D_CMD_LAST)
  107. /* 131: RGX Breakpoint interface functions */
  108. #define PVRSRV_BRIDGE_RGXBREAKPOINT 131UL
  109. #if defined(SUPPORT_USC_BREAKPOINT)
  110. #define PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXTA3D_DISPATCH_LAST + 1)
  111. #define PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_LAST (PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXBREAKPOINT_CMD_LAST)
  112. #else
  113. #define PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_FIRST 0
  114. #define PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTA3D_DISPATCH_LAST)
  115. #endif
  116. /* 132: RGX Debug/Misc interface functions */
  117. #define PVRSRV_BRIDGE_RGXFWDBG 132UL
  118. #define PVRSRV_BRIDGE_RGXFWDBG_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXBREAKPOINT_DISPATCH_LAST + 1)
  119. #define PVRSRV_BRIDGE_RGXFWDBG_DISPATCH_LAST (PVRSRV_BRIDGE_RGXFWDBG_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXFWDBG_CMD_LAST)
  120. /* 133: RGX PDump interface functions */
  121. #define PVRSRV_BRIDGE_RGXPDUMP 133UL
  122. #if defined(PDUMP)
  123. #define PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXFWDBG_DISPATCH_LAST + 1)
  124. #define PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_LAST (PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXPDUMP_CMD_LAST)
  125. #else
  126. #define PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_FIRST 0
  127. #define PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_LAST (PVRSRV_BRIDGE_RGXFWDBG_DISPATCH_LAST)
  128. #endif
  129. /* 134: RGX HWPerf interface functions */
  130. #define PVRSRV_BRIDGE_RGXHWPERF 134UL
  131. #define PVRSRV_BRIDGE_RGXHWPERF_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXPDUMP_DISPATCH_LAST + 1)
  132. #define PVRSRV_BRIDGE_RGXHWPERF_DISPATCH_LAST (PVRSRV_BRIDGE_RGXHWPERF_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXHWPERF_CMD_LAST)
  133. /* 135: RGX Register Configuration interface functions */
  134. #define PVRSRV_BRIDGE_RGXREGCONFIG 135UL
  135. #if !defined(EXCLUDE_RGXREGCONFIG_BRIDGE)
  136. #define PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXHWPERF_DISPATCH_LAST + 1)
  137. #define PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_LAST (PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXREGCONFIG_CMD_LAST)
  138. #else
  139. #define PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_FIRST 0
  140. #define PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_LAST (PVRSRV_BRIDGE_RGXHWPERF_DISPATCH_LAST)
  141. #endif
  142. /* 136: RGX kicksync interface */
  143. #define PVRSRV_BRIDGE_RGXKICKSYNC 136UL
  144. #define PVRSRV_BRIDGE_RGXKICKSYNC_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXREGCONFIG_DISPATCH_LAST + 1)
  145. #define PVRSRV_BRIDGE_RGXKICKSYNC_DISPATCH_LAST (PVRSRV_BRIDGE_RGXKICKSYNC_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXKICKSYNC_CMD_LAST)
  146. #define PVRSRV_BRIDGE_RGXTQ2 137UL
  147. #define PVRSRV_BRIDGE_RGXTQ2_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXKICKSYNC_DISPATCH_LAST + 1)
  148. #define PVRSRV_BRIDGE_RGXTQ2_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTQ2_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXTQ2_CMD_LAST)
  149. #define PVRSRV_BRIDGE_RGXTIMERQUERY 138UL
  150. #define PVRSRV_BRIDGE_RGXTIMERQUERY_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXTQ2_DISPATCH_LAST + 1)
  151. #define PVRSRV_BRIDGE_RGXTIMERQUERY_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTIMERQUERY_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXTIMERQUERY_CMD_LAST)
  152. #define PVRSRV_BRIDGE_RGXRAY 139UL
  153. #if defined(SUPPORT_RGXRAY_BRIDGE)
  154. #define PVRSRV_BRIDGE_RGXRAY_DISPATCH_FIRST (PVRSRV_BRIDGE_RGXTIMERQUERY_DISPATCH_LAST + 1)
  155. #define PVRSRV_BRIDGE_RGXRAY_DISPATCH_LAST (PVRSRV_BRIDGE_RGXRAY_DISPATCH_FIRST + PVRSRV_BRIDGE_RGXRAY_CMD_LAST)
  156. #else
  157. #define PVRSRV_BRIDGE_RGXRAY_DISPATCH_FIRST 0
  158. #define PVRSRV_BRIDGE_RGXRAY_DISPATCH_LAST (PVRSRV_BRIDGE_RGXTIMERQUERY_DISPATCH_LAST)
  159. #endif
  160. #define PVRSRV_BRIDGE_RGX_LAST (PVRSRV_BRIDGE_RGXRAY)
  161. #define PVRSRV_BRIDGE_RGX_DISPATCH_LAST (PVRSRV_BRIDGE_RGXRAY_DISPATCH_LAST)
  162. /* bit mask representing the enabled RGX bridges */
  163. static const IMG_UINT32 gui32RGXBridges =
  164. (1U << (PVRSRV_BRIDGE_RGXTQ - PVRSRV_BRIDGE_RGX_FIRST))
  165. #if defined(RGX_FEATURE_COMPUTE) || defined(__KERNEL__)
  166. | (1U << (PVRSRV_BRIDGE_RGXCMP - PVRSRV_BRIDGE_RGX_FIRST))
  167. #endif
  168. | (1U << (PVRSRV_BRIDGE_RGXTA3D - PVRSRV_BRIDGE_RGX_FIRST))
  169. #if defined(SUPPORT_BREAKPOINT)
  170. | (1U << (PVRSRV_BRIDGE_BREAKPOINT - PVRSRV_BRIDGE_RGX_FIRST))
  171. #endif
  172. | (1U << (PVRSRV_BRIDGE_RGXFWDBG - PVRSRV_BRIDGE_RGX_FIRST))
  173. #if defined(PDUMP)
  174. | (1U << (PVRSRV_BRIDGE_RGXPDUMP - PVRSRV_BRIDGE_RGX_FIRST))
  175. #endif
  176. | (1U << (PVRSRV_BRIDGE_RGXHWPERF - PVRSRV_BRIDGE_RGX_FIRST))
  177. #if defined(SUPPORT_REGCONFIG)
  178. | (1U << (PVRSRV_BRIDGE_RGXREGCONFIG - PVRSRV_BRIDGE_RGX_FIRST))
  179. #endif
  180. | (1U << (PVRSRV_BRIDGE_RGXKICKSYNC - PVRSRV_BRIDGE_RGX_FIRST))
  181. #if defined(SUPPORT_FASTRENDER_DM) || defined(__KERNEL__)
  182. | (1U << (PVRSRV_BRIDGE_RGXTQ2 - PVRSRV_BRIDGE_RGX_FIRST))
  183. #endif
  184. #if defined(SUPPORT_TIMERQUERY)
  185. | (1U << (PVRSRV_BRIDGE_RGXTIMERQUERY - PVRSRV_BRIDGE_RGX_FIRST))
  186. #endif
  187. | (1U << (PVRSRV_BRIDGE_RGXRAY - PVRSRV_BRIDGE_RGX_FIRST))
  188. ;
  189. /* bit field representing which RGX bridge groups may optionally not
  190. * be present in the server
  191. */
  192. #define RGX_BRIDGES_OPTIONAL \
  193. ( \
  194. 0 /* no RGX bridges are currently optional */ \
  195. )
  196. #if defined(__cplusplus)
  197. }
  198. #endif
  199. #endif /* RGX_BRIDGE_H */