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

Jason Ekstrand jason at jlekstrand.net
Tue Oct 3 06:04:44 UTC 2017


I'd personally separate the XML changes from the is changes but I don't 
care that much.  Either way, r-b me.


On October 2, 2017 3:49:16 PM Kenneth Graunke <kenneth at whitecape.org> wrote:

> 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.  While we're at it,
> let's make the genxml fields consistent.  We pick the boolean-per-face
> approach because it's clear which bits correspond to which cube faces.
>
> v2: Don't use "mbo" (requested by Matt and Jason).
> ---
>  src/intel/genxml/gen4.xml         |  7 ++++++-
>  src/intel/genxml/gen45.xml        |  7 ++++++-
>  src/intel/genxml/gen5.xml         |  7 ++++++-
>  src/intel/genxml/gen6.xml         |  7 ++++++-
>  src/intel/genxml/gen7.xml         |  7 ++++++-
>  src/intel/genxml/gen75.xml        |  7 ++++++-
>  src/intel/isl/isl_surface_state.c | 18 ++++++------------
>  7 files changed, 42 insertions(+), 18 deletions(-)
>
> diff --git a/src/intel/genxml/gen4.xml b/src/intel/genxml/gen4.xml
> index 6499346c999..fc24329535d 100644
> --- a/src/intel/genxml/gen4.xml
> +++ b/src/intel/genxml/gen4.xml
> @@ -526,7 +526,12 @@
>      <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 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="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..c91085831ea 100644
> --- a/src/intel/genxml/gen45.xml
> +++ b/src/intel/genxml/gen45.xml
> @@ -531,7 +531,12 @@
>        <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 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="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..93e687a32bd 100644
> --- a/src/intel/genxml/gen5.xml
> +++ b/src/intel/genxml/gen5.xml
> @@ -636,7 +636,12 @@
>      <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 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="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..96f4be784e3 100644
> --- a/src/intel/genxml/gen6.xml
> +++ b/src/intel/genxml/gen6.xml
> @@ -574,7 +574,12 @@
>        <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 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="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..cc17018b582 100644
> --- a/src/intel/genxml/gen7.xml
> +++ b/src/intel/genxml/gen7.xml
> @@ -638,7 +638,12 @@
>        <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 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="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..cb408a2bb8d 100644
> --- a/src/intel/genxml/gen75.xml
> +++ b/src/intel/genxml/gen75.xml
> @@ -657,7 +657,12 @@
>        <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 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="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/isl/isl_surface_state.c 
> b/src/intel/isl/isl_surface_state.c
> index c6a55ce9707..bfb27fa4a44 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -452,18 +452,12 @@ 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
> -   }
> +   s.CubeFaceEnablePositiveZ = 1;
> +   s.CubeFaceEnableNegativeZ = 1;
> +   s.CubeFaceEnablePositiveY = 1;
> +   s.CubeFaceEnableNegativeY = 1;
> +   s.CubeFaceEnablePositiveX = 1;
> +   s.CubeFaceEnableNegativeX = 1;
>
>  #if GEN_GEN >= 6
>     s.NumberofMultisamples = ffs(info->surf->samples) - 1;
> --
> 2.14.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list