1<?xml version="1.0" ?> 2 3<!-- 4Copyright © 2022 Imagination Technologies Ltd. 5 6Permission is hereby granted, free of charge, to any person obtaining a copy 7of this software and associated documentation files (the "Software"), to deal 8in the Software without restriction, including without limitation the rights 9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10copies of the Software, and to permit persons to whom the Software is 11furnished to do so, subject to the following conditions: 12 13The above copyright notice and this permission notice (including the next 14paragraph) shall be included in all copies or substantial portions of the 15Software. 16 17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23SOFTWARE. 24--> 25 26<!-- 27These definitions are based on the ones for the firmware streams found 28in the fwif header (pvr_rogue_fwif_stream.h). 29 30TODO: Once the kernel driver is merged upstream, check to see if this comment 31needs updating. 32--> 33 34<!-- 35This file is structured as follows: 36 - defines 37 - enums 38 - structs 39 - streams 40 41Elements in each section are ordered alphabetically. 42--> 43 44<!-- 45TODO: Currently the sizes for fields are in bits. Those should be changed to 46bytes. Might want to do this in conjunction with csbgen being changed from 47dword to bytes granular. 48--> 49<!-- 50TODO: Allow embedding of struct definitions withing stream elements. And for 51structs that might be shared between multiple streams, allow for the field 52type to be set to a struct. 53--> 54<csbgen name="ROGUE" prefix="KMD_STREAM"> 55 56 <define name="EXTHDR_DATA_MASK" value="0xFFFFFFF"/> 57 58 <!-- 59 Note: this does not depend on 60 \ref pvr_device_features.has_eight_output_registers . 61 It's always 8 catering for the largest size. 62 --> 63 <!-- 64 TODO: Instead of defining this, see if we can use something like anvil's 65 "group" where a field is repeated n times. That would allow us to get the 66 total length of the whole group instead of the driver calculating it by 67 multiplying this with the size of the usc reg. 68 --> 69 <!-- 70 TODO: This should only be defined for `CMD_FRAG`. Allow the definition of 71 `define` elements within structs and streams. 72 --> 73 <define name="USC_CLEAR_REGISTER_COUNT" value="8"/> 74 75 <enum name="EXTHDR_TYPE_COMPUTE"> 76 <value name="0" value="0"/> 77 </enum> 78 79 <enum name="EXTHDR_TYPE_FRAG"> 80 <value name="0" value="0"/> 81 </enum> 82 83 <enum name="EXTHDR_TYPE_GEOM"> 84 <value name="0" value="0"/> 85 </enum> 86 87 <enum name="PIXEL_PHANTOM_STATE"> 88 <value name="DISABLED" value="0x0"/> 89 <value name="ENABLED" value="0xF"/> 90 </enum> 91 92 <struct name="EXTHDR_COMPUTE0" length="1"> 93 <field name="type" start="29" end="31" type="EXTHDR_TYPE_COMPUTE" default="0"/> 94 <field name="continuation" start="28" end="28" type="bool"/> 95 <field name="has_brn49927" start="0" end="0" type="bool"/> 96 </struct> 97 98 <struct name="EXTHDR_FRAG0" length="1"> 99 <field name="type" start="29" end="31" type="EXTHDR_TYPE_FRAG" default="0"/> 100 <field name="continuation" start="28" end="28" type="bool"/> 101 <field name="has_brn49927" start="1" end="1" type="bool"/> 102 <field name="has_brn47217" start="0" end="0" type="bool"/> 103 </struct> 104 105 <struct name="EXTHDR_GEOM0" length="1"> 106 <field name="type" start="29" end="31" type="EXTHDR_TYPE_GEOM" default="0"/> 107 <field name="continuation" start="28" end="28" type="bool"/> 108 <field name="has_brn49927" start="0" end="0" type="bool"/> 109 </struct> 110 111 <struct name="HDR" length="2"> 112 <field name="length" start="0" end="31" type="uint"/> 113 </struct> 114 115 <!-- 116 Note: if there's an attempt to disable all phantoms, they will all be set 117 to their default states (i.e. all enabled). 118 --> 119 <struct name="PIXEL_PHANTOM" length="1"> 120 <field name="phantom_1" start="4" end="7" type="PIXEL_PHANTOM_STATE"/> 121 <field name="phantom_0" start="0" end="3" type="PIXEL_PHANTOM_STATE"/> 122 </struct> 123 124 <struct name="VIEW_IDX" length="1"> 125 <field name="idx" start="0" end="7" type="uint"/> 126 </struct> 127 128 <stream name="CMD_COMPUTE" length="18"> 129 <field name="tpu_border_colour_table" size="64" type="uint"/> 130 <!-- Only present if PVR_FEATURE_CDM_USER_MODE_QUEUE supported on the current device --> 131 <field name="cdm_cb_queue" size="64" type="uint" feature="PVR_FEATURE_CDM_USER_MODE_QUEUE"/> 132 <!-- Only present if PVR_FEATURE_CDM_USER_MODE_QUEUE supported on the current device --> 133 <field name="cbm_cb_base" size="64" type="address" shift="0" feature="PVR_FEATURE_CDM_USER_MODE_QUEUE"/> 134 <!-- Only present if PVR_FEATURE_CDM_USER_MODE_QUEUE supported on the current device --> 135 <field name="cdm_cb" size="64" type="uint" feature="PVR_FEATURE_CDM_USER_MODE_QUEUE"/> 136 <!-- Only present if PVR_FEATURE_CDM_USER_MODE_QUEUE supported on the current device --> 137 <field name="cdm_ctrl_stream_base" size="64" type="address" shift="0" feature="PVR_FEATURE_CDM_USER_MODE_QUEUE"/> 138 <field name="cdm_context_state_base_addr" size="64" type="address" shift="0"/> 139 <field name="cdm_resume_pds1" size="32" type="uint"/> 140 <!-- Only present if PVR_FEATURE_COMPUTE_MORTON_CAPABLE supported on the current device --> 141 <field name="cdm_item" size="32" type="uint" feature="PVR_FEATURE_COMPUTE_MORTON_CAPABLE"/> 142 <!-- Only present if PVR_FEATURE_CLUSTER_GROUPING supported on the current device --> 143 <field name="compute_cluster" size="32" type="uint" feature="PVR_FEATURE_CLUSTER_GROUPING"/> 144 <!-- Only present if PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS supported on the current device --> 145 <field name="tpu_tag_cdm_ctrl" size="32" type="uint" feature="PVR_FEATURE_TPU_DM_GLOBAL_REGISTERS"/> 146 <!-- Only present if PVR_FEATURE_CDM_USER_MODE_QUEUE supported on the current device --> 147 <field name="stream_start_offset" size="32" type="uint" feature="PVR_FEATURE_CDM_USER_MODE_QUEUE"/> 148 <!-- Only present if PVR_FEATURE_GPU_MULTICORE_SUPPORT supported on the current device --> 149 <field name="execute_count" size="32" type="uint" feature="PVR_FEATURE_GPU_MULTICORE_SUPPORT"/> 150 </stream> 151 152 <stream name="CMD_COMPUTE_EXT_BRN49927" length="1"> 153 <field name="tpu" size="32" type="uint"/> 154 </stream> 155 156 <stream name="CMD_FRAG" length="100"> 157 <field name="isp_scissor_base" size="64" type="address" shift="0"/> 158 <field name="isp_dbias_base" size="64" type="address" shift="0"/> 159 <field name="isp_oclqry_base" size="64" type="address" shift="0"/> 160 <field name="isp_zlsctl" size="64" type="address" shift="0"/> 161 <field name="isp_zload_store_base" size="64" type="address" shift="0"/> 162 <field name="isp_stencil_load_store_base" size="64" type="address" shift="0"/> 163 <!-- Only present if PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP supported on the current device --> 164 <field name="fb_cdc_zls" size="64" type="uint" feature="PVR_FEATURE_REQUIRES_FB_CDC_ZLS_SETUP"/> 165 <field name="pbe_word" size="1536" type="uint_array"/> 166 <field name="tpu_border_colour_table" size="64" type="uint"/> 167 <field name="pds_bgnd" size="192" type="uint_array"/> 168 <field name="pds_pr_bgnd" size="192" type="uint_array"/> 169 <field name="usc_clear_register" size="256" type="uint_array"/> 170 <field name="usc_pixel_output_ctrl" size="32" type="uint"/> 171 <field name="isp_bgobjdepth" size="32" type="uint"/> 172 <field name="isp_bgobjvals" size="32" type="uint"/> 173 <field name="isp_aa" size="32" type="uint"/> 174 <!-- Only present if PVR_FEATURE_S7_TOP_INFRASTRUCTURE supported on the current device --> 175 <field name="isp_xtp_pipe_enable" size="32" type="uint" feature="PVR_FEATURE_S7_TOP_INFRASTRUCTURE"/> 176 <field name="isp_ctl" size="32" type="uint"/> 177 <field name="event_pixel_pds_info" size="32" type="uint"/> 178 <!-- Only present if PVR_FEATURE_CLUSTER_GROUPING supported on the current device --> 179 <field name="pixel_phantom" size="32" type="uint" feature="PVR_FEATURE_CLUSTER_GROUPING"/> 180 <field name="view_idx" size="32" type="uint"/> 181 <field name="event_pixel_pds_data" size="32" type="uint"/> 182 <!-- Only present if PVR_FEATURE_GPU_MULTICORE_SUPPORT supported on the current device --> 183 <field name="isp_oclqry_stride" size="32" type="uint" feature="PVR_FEATURE_GPU_MULTICORE_SUPPORT"/> 184 <!-- Only present if PVR_FEATURE_ZLS_SUBTILE supported on the current device --> 185 <field name="isp_zls_pixels" size="32" type="uint" feature="PVR_FEATURE_ZLS_SUBTILE"/> 186 <!-- Only present if PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE supported on the current device --> 187 <field name="rgx_cr_blackpearl_fix" size="32" type="uint" feature="PVR_FEATURE_ISP_ZLS_D24_S8_PACKING_OGL_MODE"/> 188 <field name="zls_stride" size="32" type="uint"/> 189 <field name="sls_stride" size="32" type="uint"/> 190 <!-- Only present if PVR_FEATURE_GPU_MULTICORE_SUPPORT supported on the current device --> 191 <field name="execute_count" size="32" type="uint" feature="PVR_FEATURE_GPU_MULTICORE_SUPPORT"/> 192 </stream> 193 194 <stream name="CMD_FRAG_EXT_BRN47217" length="1"> 195 <field name="isp_oclqry_stride" size="32" type="uint"/> 196 </stream> 197 198 <stream name="CMD_FRAG_EXT_BRN49927" length="1"> 199 <field name="tpu" size="32" type="uint"/> 200 </stream> 201 202 <stream name="CMD_GEOM" length="13"> 203 <field name="vdm_ctrl_stream_base" size="64" type="address" shift="0"/> 204 <field name="tpu_border_colour_table" size="64" type="uint"/> 205 <!-- Only present if PVR_FEATURE_VDM_DRAWINDIRECT supported on the current device --> 206 <field name="vdm_draw_indirect0" size="64" type="uint" feature="PVR_FEATURE_VDM_DRAWINDIRECT"/> 207 <!-- Only present if PVR_FEATURE_VDM_DRAWINDIRECT supported on the current device --> 208 <field name="vdm_draw_indirect1" size="32" type="uint" feature="PVR_FEATURE_VDM_DRAWINDIRECT"/> 209 <field name="ppp_ctrl" size="32" type="uint"/> 210 <field name="te_psg" size="32" type="uint"/> 211 <field name="vdm_context_resume_task0_size" size="32" type="uint"/> 212 <!-- Only present if PVR_FEATURE_VDM_OBJECT_LEVEL_LLS supported on the current device --> 213 <field name="vdm_context_resume_task3_size" size="32" type="uint" feature="PVR_FEATURE_VDM_OBJECT_LEVEL_LLS"/> 214 <field name="view_idx" size="32" type="uint"/> 215 <!-- Only present if PVR_FEATURE_TESSELLATION supported on the current device --> 216 <field name="pds_coeff_free_prog" size="32" type="uint" feature="PVR_FEATURE_TESSELLATION"/> 217 </stream> 218 219 <stream name="CMD_GEOM_EXT_BRN49927" length="1"> 220 <field name="tpu" size="32" type="uint"/> 221 </stream> 222 223 <stream name="CMD_TRANSFER" length="43"> 224 <field name="pds_bgnd0_base" size="64" type="address" shift="0"/> 225 <field name="pds_bgnd1_base" size="64" type="address" shift="0"/> 226 <field name="pds_bgnd3_sizeinfo" size="64" type="uint"/> 227 <field name="isp_mtile_base" size="64" type="address" shift="0"/> 228 <field name="pbr_wordx_mrty" size="576" type="uint_array"/> 229 <field name="isp_bgobjvals" size="32" type="uint"/> 230 <field name="usc_pixel_output_ctrl" size="32" type="uint"/> 231 <field name="usc_clear_register0" size="32" type="uint"/> 232 <field name="usc_clear_register1" size="32" type="uint"/> 233 <field name="usc_clear_register2" size="32" type="uint"/> 234 <field name="usc_clear_register3" size="32" type="uint"/> 235 <field name="isp_mtile_size" size="32" type="uint"/> 236 <field name="isp_render_origin" size="32" type="uint"/> 237 <field name="isp_ctl" size="32" type="uint"/> 238 <field name="isp_aa" size="32" type="uint"/> 239 <field name="event_pixel_pds_info" size="32" type="uint"/> 240 <field name="event_pixel_pds_code" size="32" type="uint"/> 241 <field name="event_pixel_pds_data" size="32" type="uint"/> 242 <field name="isp_render" size="32" type="uint"/> 243 <field name="isp_rgn" size="32" type="uint"/> 244 <!-- Only present if PVR_FEATURE_S7_TOP_INFRASTRUCTURE supported on the current device --> 245 <field name="isp_xtp_pipe_enable" size="32" type="uint" feature="PVR_FEATURE_S7_TOP_INFRASTRUCTURE"/> 246 <!-- Only present if PVR_FEATURE_GPU_MULTICORE_SUPPORT supported on the current device --> 247 <field name="frag_screen" size="32" type="uint" feature="PVR_FEATURE_GPU_MULTICORE_SUPPORT"/> 248 </stream> 249 250 <stream name="STATIC_COMPUTE_CONTEXT_STATE" length="14"> 251 <field name="cdm_reg_context_pds0" size="64" type="uint"/> 252 <field name="cdm_reg_context_pds1" size="64" type="uint"/> 253 <field name="cdm_reg_terminate_pds0" size="64" type="uint"/> 254 <field name="cdm_reg_terminate_pds1" size="64" type="uint"/> 255 <field name="cdm_reg_resume_pds0" size="64" type="uint"/> 256 <field name="cdm_reg_context_pds0_b" size="64" type="uint"/> 257 <field name="cdm_reg_resume_pds0_b" size="64" type="uint"/> 258 </stream> 259 260 <stream name="STATIC_RENDER_CONTEXT_STATE" length="46"> 261 <field name="geom_reg_vdm_context_state_base_addr" size="64" type="address" shift="0"/> 262 <field name="geom_reg_vdm_context_state_resume_addr" size="64" type="address" shift="0"/> 263 <field name="geom_reg_ta_context_state_base_addr" size="64" type="address" shift="0"/> 264 <field name="geom_state0_geom_reg_vdm_context_store_task0" size="64" type="uint"/> 265 <field name="geom_state0_geom_reg_vdm_context_store_task1" size="64" type="uint"/> 266 <field name="geom_state0_geom_reg_vdm_context_store_task2" size="64" type="uint"/> 267 <field name="geom_state0_geom_reg_vdm_context_store_task3" size="64" type="uint"/> 268 <field name="geom_state0_geom_reg_vdm_context_store_task4" size="64" type="uint"/> 269 <field name="geom_state0_geom_reg_vdm_context_resume_task0" size="64" type="uint"/> 270 <field name="geom_state0_geom_reg_vdm_context_resume_task1" size="64" type="uint"/> 271 <field name="geom_state0_geom_reg_vdm_context_resume_task2" size="64" type="uint"/> 272 <field name="geom_state0_geom_reg_vdm_context_resume_task3" size="64" type="uint"/> 273 <field name="geom_state0_geom_reg_vdm_context_resume_task4" size="64" type="uint"/> 274 <field name="geom_state1_geom_reg_vdm_context_store_task0" size="64" type="uint"/> 275 <field name="geom_state1_geom_reg_vdm_context_store_task1" size="64" type="uint"/> 276 <field name="geom_state1_geom_reg_vdm_context_store_task2" size="64" type="uint"/> 277 <field name="geom_state1_geom_reg_vdm_context_store_task3" size="64" type="uint"/> 278 <field name="geom_state1_geom_reg_vdm_context_store_task4" size="64" type="uint"/> 279 <field name="geom_state1_geom_reg_vdm_context_resume_task0" size="64" type="uint"/> 280 <field name="geom_state1_geom_reg_vdm_context_resume_task1" size="64" type="uint"/> 281 <field name="geom_state1_geom_reg_vdm_context_resume_task2" size="64" type="uint"/> 282 <field name="geom_state1_geom_reg_vdm_context_resume_task3" size="64" type="uint"/> 283 <field name="geom_state1_geom_reg_vdm_context_resume_task4" size="64" type="uint"/> 284 </stream> 285 286</csbgen> 287