pvr: use pvr_csb_pack() to setup CR_FB_CDC_ZLS
authorSarah Walker <sarah.walker@imgtec.com>
Tue, 30 Aug 2022 14:23:47 +0000 (15:23 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 28 Jun 2023 22:26:07 +0000 (22:26 +0000)
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

src/imagination/csbgen/rogue_cr.xml
src/imagination/vulkan/pvr_job_render.c

index 803162a..f7c2d53 100644 (file)
@@ -685,4 +685,21 @@ SOFTWARE.
     <field name="val" start="0" end="31" type="uint"/>
   </struct>
 
+  <!-- FIXME: When csbgen supports conditional structs, make this conditional
+       on FB_CDC.
+  -->
+  <struct name="FB_CDC_ZLS" length="2">
+    <condition type="if" check="!ROGUEXE"/>
+      <field name="fbc_iaddr_mode" start="42" end="42" type="bool"/>
+      <field name="fbdc_iaddr_mode" start="41" end="41" type="bool"/>
+    <condition type="endif" check="!ROGUEXE"/>
+    <!-- FIXME: should be dependent on !ROGUEXE || (ROGUEXE && FB_CDC_V4) -->
+    <field name="fbdc_stencil_fmt" start="34" end="40" type="uint"/>
+    <!-- FIXME: should be dependent on !ROGUEXE || (ROGUEXE && FB_CDC_V4) -->
+    <field name="fbdc_depth_fmt" start="27" end="33" type="uint"/>
+    <field name="fbc_num_tiles" start="4" end="26" type="uint"/>
+    <field name="fbc_iaddr" start="1" end="1" type="bool"/>
+    <field name="fbdc_iaddr" start="0" end="0" type="bool"/>
+  </struct>
+
 </csbgen>
index da9f1f9..e157f27 100644 (file)
@@ -1171,8 +1171,14 @@ static void pvr_frag_state_stream_init(struct pvr_render_ctx *ctx,
    stream_ptr += pvr_cmd_length(CR_ISP_STENCIL_LOAD_BASE);
 
    if (PVR_HAS_FEATURE(dev_info, requires_fb_cdc_zls_setup)) {
-      *(uint64_t *)stream_ptr = 0;
-      stream_ptr += 2U;
+      /* Currently no support for FBC, so just go ahead and set the default
+       * values.
+       */
+      pvr_csb_pack ((uint64_t *)stream_ptr, CR_FB_CDC_ZLS, value) {
+         value.fbdc_depth_fmt = PVRX(TEXSTATE_FORMAT_F32);
+         value.fbdc_stencil_fmt = PVRX(TEXSTATE_FORMAT_U8);
+      }
+      stream_ptr += pvr_cmd_length(CR_FB_CDC_ZLS);
    }
 
    STATIC_ASSERT(ARRAY_SIZE(job->pbe_reg_words) == 8U);