[Mesa-dev] [PATCH] intel: Always set Cube Face Enables for all surfaces.

Kenneth Graunke kenneth at whitecape.org
Sat Sep 30 05:54:16 UTC 2017


These shouldn't matter for non-cubes, and we always enable them all
for cubes, so we may as well set them all the time.  We can just mark
the fields "mbo" (must be one) and genxml will automatically set them
for us, and we never even have to think about them.
---
 src/intel/genxml/gen10.xml        |  7 +------
 src/intel/genxml/gen4.xml         |  2 +-
 src/intel/genxml/gen45.xml        |  2 +-
 src/intel/genxml/gen5.xml         |  2 +-
 src/intel/genxml/gen6.xml         |  2 +-
 src/intel/genxml/gen7.xml         |  2 +-
 src/intel/genxml/gen75.xml        |  2 +-
 src/intel/genxml/gen8.xml         |  7 +------
 src/intel/genxml/gen9.xml         |  7 +------
 src/intel/isl/isl_surface_state.c | 13 -------------
 10 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/src/intel/genxml/gen10.xml b/src/intel/genxml/gen10.xml
index a7ae49ae659..e6f10010b6d 100644
--- a/src/intel/genxml/gen10.xml
+++ b/src/intel/genxml/gen10.xml
@@ -714,12 +714,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <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="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Memory Object Control State" start="56" end="62" type="MEMORY_OBJECT_CONTROL_STATE"/>
     <field name="MOCS" start="56" end="62" type="uint"/>
     <field name="Base Mip Level" start="51" end="55" type="u4.1"/>
diff --git a/src/intel/genxml/gen4.xml b/src/intel/genxml/gen4.xml
index 6499346c999..6fe411d09ef 100644
--- a/src/intel/genxml/gen4.xml
+++ b/src/intel/genxml/gen4.xml
@@ -526,7 +526,7 @@
     <field name="Media Boundary Pixel Mode" start="6" end="7" type="uint">
       <value name="NORMAL_MODE" value="0"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="83" end="95" type="uint"/>
     <field name="Width" start="70" end="82" type="uint"/>
diff --git a/src/intel/genxml/gen45.xml b/src/intel/genxml/gen45.xml
index 0f905754071..db297f4d461 100644
--- a/src/intel/genxml/gen45.xml
+++ b/src/intel/genxml/gen45.xml
@@ -531,7 +531,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="83" end="95" type="uint"/>
     <field name="Width" start="70" end="82" type="uint"/>
diff --git a/src/intel/genxml/gen5.xml b/src/intel/genxml/gen5.xml
index 70f50076abf..d33d3be003c 100644
--- a/src/intel/genxml/gen5.xml
+++ b/src/intel/genxml/gen5.xml
@@ -636,7 +636,7 @@
     <field name="Media Boundary Pixel Mode" start="6" end="7" type="uint">
       <value name="NORMAL_MODE" value="0"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="83" end="95" type="uint"/>
     <field name="Width" start="70" end="82" type="uint"/>
diff --git a/src/intel/genxml/gen6.xml b/src/intel/genxml/gen6.xml
index 8aa03355055..c6394911438 100644
--- a/src/intel/genxml/gen6.xml
+++ b/src/intel/genxml/gen6.xml
@@ -574,7 +574,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="83" end="95" type="uint"/>
     <field name="Width" start="70" end="82" type="uint"/>
diff --git a/src/intel/genxml/gen7.xml b/src/intel/genxml/gen7.xml
index 993d10264fa..6f21fc33de2 100644
--- a/src/intel/genxml/gen7.xml
+++ b/src/intel/genxml/gen7.xml
@@ -638,7 +638,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="80" end="93" type="uint"/>
     <field name="Width" start="64" end="77" type="uint"/>
diff --git a/src/intel/genxml/gen75.xml b/src/intel/genxml/gen75.xml
index 105effa8cef..208018359ce 100644
--- a/src/intel/genxml/gen75.xml
+++ b/src/intel/genxml/gen75.xml
@@ -657,7 +657,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <field name="Cube Face Enables" start="0" end="5" type="uint"/>
+    <field name="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Surface Base Address" start="32" end="63" type="address"/>
     <field name="Height" start="80" end="93" type="uint"/>
     <field name="Width" start="64" end="77" type="uint"/>
diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml
index 99c4aca8fb4..3d4adee2858 100644
--- a/src/intel/genxml/gen8.xml
+++ b/src/intel/genxml/gen8.xml
@@ -680,12 +680,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <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="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Memory Object Control State" start="56" end="62" type="MEMORY_OBJECT_CONTROL_STATE"/>
     <field name="MOCS" start="56" end="62" type="uint"/>
     <field name="Base Mip Level" start="51" end="55" type="u4.1"/>
diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml
index 1422463693d..9f94c027c5a 100644
--- a/src/intel/genxml/gen9.xml
+++ b/src/intel/genxml/gen9.xml
@@ -712,12 +712,7 @@
       <value name="PROGRESSIVE_FRAME" value="2"/>
       <value name="INTERLACED_FRAME" value="3"/>
     </field>
-    <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="Cube Face Enables" start="0" end="5" type="mbo"/>
     <field name="Memory Object Control State" start="56" end="62" type="MEMORY_OBJECT_CONTROL_STATE"/>
     <field name="MOCS" start="56" end="62" type="uint"/>
     <field name="Base Mip Level" start="51" end="55" type="u4.1"/>
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index c6a55ce9707..71a6ed2168b 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -452,19 +452,6 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
    s.RenderCacheReadWriteMode = 0;
 #endif
 
-   if (info->view->usage & ISL_SURF_USAGE_CUBE_BIT) {
-#if GEN_GEN >= 8
-      s.CubeFaceEnablePositiveZ = 1;
-      s.CubeFaceEnableNegativeZ = 1;
-      s.CubeFaceEnablePositiveY = 1;
-      s.CubeFaceEnableNegativeY = 1;
-      s.CubeFaceEnablePositiveX = 1;
-      s.CubeFaceEnableNegativeX = 1;
-#else
-      s.CubeFaceEnables = 0x3f;
-#endif
-   }
-
 #if GEN_GEN >= 6
    s.NumberofMultisamples = ffs(info->surf->samples) - 1;
 #if GEN_GEN >= 7
-- 
2.14.1



More information about the mesa-dev mailing list