Module: Mesa
Branch: main
Commit: e9b633619c1ff87475c5c597e86f4515a7bc3549
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9b633619c1ff87475c5c597e86f4515a7bc3549

Author: Zhang, Jianxun <jianxun.zh...@intel.com>
Date:   Mon Aug  1 13:50:24 2022 -0700

intel/genxml: Add RENDER_SURFACE_STATE for xe2

The indirect BO of clear color is also removed along with clear value
address and its enabling.

Other delta in struct RENDER_SURFACE_STATE are deferred to their
functional enabling changes.

Signed-off-by: Zhang, Jianxun <jianxun.zh...@intel.com>
Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
Signed-off-by: Rohan Garg <rohan.g...@intel.com>
Reviewed-by: Sagar Ghuge <sagar.gh...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>

---

 src/intel/genxml/gen20.xml        | 104 ++++++++++++++++++++++++++++++++++++++
 src/intel/isl/isl_surface_state.c |  14 +++--
 2 files changed, 114 insertions(+), 4 deletions(-)

diff --git a/src/intel/genxml/gen20.xml b/src/intel/genxml/gen20.xml
index 0e3a796dbe1..944bf8fc98b 100644
--- a/src/intel/genxml/gen20.xml
+++ b/src/intel/genxml/gen20.xml
@@ -2,6 +2,7 @@
 <genxml name="XE2" gen="20">
   <import name="gen125.xml">
     <exclude name="3DSTATE_CLEAR_PARAMS" />
+    <exclude name="CLEAR_COLOR" />
   </import>
   <enum name="PREF_SLM_ALLOCATION_SIZE">
     <value name="SLM_ENCODES_0K" value="0" />
@@ -151,6 +152,109 @@
       <field name="Inline Data" start="0" end="31" type="uint" />
     </group>
   </struct>
+  <struct name="RENDER_SURFACE_STATE" length="16">
+    <field name="Cube Face Enable - Positive Z" start="0" end="0" type="bool" 
/>
+    <field name="Cube Face Enable - Negative Z" start="1" end="1" type="bool" 
/>
+    <field name="Cube Face Enable - Positive Y" start="2" end="2" type="bool" 
/>
+    <field name="Cube Face Enable - Negative Y" start="3" end="3" type="bool" 
/>
+    <field name="Cube Face Enable - Positive X" start="4" end="4" type="bool" 
/>
+    <field name="Cube Face Enable - Negative X" start="5" end="5" type="bool" 
/>
+    <field name="Media Boundary Pixel Mode" start="6" end="7" type="uint">
+      <value name="NORMAL_MODE" value="0" />
+      <value name="PROGRESSIVE_FRAME" value="2" />
+      <value name="INTERLACED_FRAME" value="3" />
+    </field>
+    <field name="Render Cache Read Write Mode" start="8" end="8" type="uint">
+      <value name="Write-Only Cache" value="0" />
+      <value name="Read-Write Cache" value="1" />
+    </field>
+    <field name="Enable Sampler Route to LSC" start="9" end="9" type="bool" />
+    <field name="Vertical Line Stride Offset" start="10" end="10" type="uint" 
/>
+    <field name="Vertical Line Stride" start="11" end="11" type="uint" />
+    <field name="Tile Mode" start="12" end="13" type="uint">
+      <value name="LINEAR" value="0" />
+      <value name="TILE64" value="1" />
+      <value name="XMAJOR" value="2" />
+      <value name="TILE4" value="3" />
+    </field>
+    <field name="Surface Horizontal Alignment" start="14" end="15" type="uint">
+      <value name="HALIGN_16" value="0" />
+      <value name="HALIGN_32" value="1" />
+      <value name="HALIGN_64" value="2" />
+      <value name="HALIGN_128" value="3" />
+    </field>
+    <field name="Surface Vertical Alignment" start="16" end="17" type="uint">
+      <value name="VALIGN_4" value="1" />
+      <value name="VALIGN_8" value="2" />
+      <value name="VALIGN_16" value="3" />
+    </field>
+    <field name="Surface Format" start="18" end="26" type="uint" />
+    <field name="Surface Array" start="28" end="28" type="bool" />
+    <field name="Surface Type" start="29" end="31" type="STATE_SURFACE_TYPE" />
+    <field name="Surface QPitch" start="32" end="46" type="uint" />
+    <field name="Sample Tap Discard Disable" start="47" end="47" type="bool" />
+    <field name="Corner Texel Mode" start="50" end="50" type="bool" />
+    <field name="Base Mip Level" start="51" end="55" type="uint" />
+    <field name="MOCS" start="56" end="62" type="uint" nonzero="true" />
+    <field name="Width" start="64" end="77" type="uint" />
+    <field name="Height" start="80" end="93" type="uint" />
+    <field name="Depth Stencil Resource" start="95" end="95" type="bool" />
+    <field name="Surface Pitch" start="96" end="113" type="uint" />
+    <field name="Depth" start="117" end="127" type="uint" />
+    <field name="Multisample Position Palette Index" start="128" end="130" 
type="uint" />
+    <field name="Number of Multisamples" start="131" end="133" type="uint">
+      <value name="MULTISAMPLECOUNT_1" value="0" />
+      <value name="MULTISAMPLECOUNT_2" value="1" />
+      <value name="MULTISAMPLECOUNT_4" value="2" />
+      <value name="MULTISAMPLECOUNT_8" value="3" />
+      <value name="MULTISAMPLECOUNT_16" value="4" />
+    </field>
+    <field name="Multisampled Surface Storage Format" start="134" end="134" 
type="uint">
+      <value name="MSFMT_MSS" value="0" />
+      <value name="MSFMT_DEPTH_STENCIL" value="1" />
+    </field>
+    <field name="Render Target View Extent" start="135" end="145" type="uint" 
/>
+    <field name="Minimum Array Element" start="146" end="156" type="uint" />
+    <field name="Render Target And Sample Unorm Rotation" start="157" 
end="158" type="uint">
+      <value name="0DEG" value="0" />
+      <value name="90DEG" value="1" />
+      <value name="180DEG" value="2" />
+      <value name="270DEG" value="3" />
+    </field>
+    <field name="MIP Count / LOD" start="160" end="163" type="uint" />
+    <field name="Surface Min LOD" start="164" end="167" type="uint" />
+    <field name="Mip Tail Start LOD" start="168" end="171" type="uint" />
+    <field name="L1 Cache Control" start="176" end="178" 
type="L1_CACHE_CONTROL" />
+    <field name="EWA Disable For Cube" start="180" end="180" type="bool" />
+    <field name="Y Offset" start="181" end="183" type="uint" />
+    <field name="X Offset" start="185" end="191" type="uint" />
+    <field name="Auxiliary Surface Mode" start="192" end="194" type="uint">
+      <value name="AUX_NONE" value="0" />
+      <value name="AUX_APPEND" value="1" />
+      <value name="AUX_MCS" value="2" />
+    </field>
+    <field name="Y Offset for U or UV Plane" start="192" end="205" type="uint" 
/>
+    <field name="Auxiliary Surface Pitch" start="195" end="204" type="uint" />
+    <field name="YUV Interpolation Enable" start="207" end="207" type="bool" />
+    <field name="X Offset for U or UV Plane" start="208" end="221" type="uint" 
/>
+    <field name="Auxiliary Surface QPitch" start="208" end="222" type="uint" />
+    <field name="Resource Min LOD" start="224" end="235" type="u4.8" />
+    <field name="Shader Channel Select Alpha" start="240" end="242" 
type="Shader Channel Select" />
+    <field name="Shader Channel Select Blue" start="243" end="245" 
type="Shader Channel Select" />
+    <field name="Shader Channel Select Green" start="246" end="248" 
type="Shader Channel Select" />
+    <field name="Shader Channel Select Red" start="249" end="251" type="Shader 
Channel Select" />
+    <field name="Surface Base Address" start="256" end="319" type="address" />
+    <field name="Mip Region Width In Log2" start="320" end="323" type="uint" />
+    <field name="Append Counter Address" start="322" end="383" type="address" 
/>
+    <field name="Mip Region Height In Log2" start="324" end="327" type="uint" 
/>
+    <field name="Procedural Texture" start="331" end="331" type="bool" />
+    <field name="Auxiliary Surface Base Address" start="332" end="383" 
type="address" />
+    <field name="Y Offset for V Plane" start="352" end="365" type="uint" />
+    <field name="X Offset for V Plane" start="368" end="381" type="uint" />
+    <field name="Compression Format" start="384" end="387" 
type="UNIFIED_COMPRESSION_FORMAT" />
+    <field name="Mip Region Depth In Log2" start="388" end="391" type="uint" />
+    <field name="Disallowlowqualityfiltering" start="447" end="447" 
type="bool" />
+  </struct>
   <instruction name="3DSTATE_DEPTH_BUFFER" bias="2" length="8" engine="render">
     <field name="DWord Length" start="0" end="7" type="uint" default="6" />
     <field name="3D Command Sub Opcode" start="16" end="23" type="uint" 
default="5" />
diff --git a/src/intel/isl/isl_surface_state.c 
b/src/intel/isl/isl_surface_state.c
index deac7fcf185..eb3eafdba00 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -78,7 +78,13 @@ static const uint32_t isl_encode_multisample_layout[] = {
 };
 #endif
 
-#if GFX_VER >= 12
+#if GFX_VER >= 20
+static const uint32_t isl_encode_aux_mode[] = {
+   [ISL_AUX_USAGE_NONE] = AUX_NONE,
+   [ISL_AUX_USAGE_MC] = AUX_NONE,
+   [ISL_AUX_USAGE_MCS_CCS] = AUX_MCS,
+};
+#elif GFX_VER >= 12
 static const uint32_t isl_encode_aux_mode[] = {
    [ISL_AUX_USAGE_NONE] = AUX_NONE,
    [ISL_AUX_USAGE_MC] = AUX_NONE,
@@ -664,7 +670,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, 
void *state,
             isl_get_render_compression_format(info->surf->format);
       }
 #endif
-#if GFX_VER >= 12
+#if GFX_VER == 12
       s.MemoryCompressionEnable = info->aux_usage == ISL_AUX_USAGE_MC;
 
       /* The Tiger Lake PRM for RENDER_SURFACE_STATE::DecompressInL3 says:
@@ -790,11 +796,11 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, 
void *state,
 
    if (isl_aux_usage_has_fast_clears(info->aux_usage)) {
       if (info->use_clear_address) {
-#if GFX_VER >= 10
+#if GFX_VER > 10 && GFX_VER < 20
          s.ClearValueAddressEnable = true;
          s.ClearValueAddress = info->clear_address;
 #else
-         unreachable("Gfx9 and earlier do not support indirect clear colors");
+         unreachable("Only Gfx11 and Gfx12 support indirect clear colors");
 #endif
       }
 

Reply via email to