[Mesa-dev] [PATCH 15/18] intel/genxml: Add and use enum for tile mode
Kristian Høgsberg
hoegsberg at gmail.com
Wed Nov 30 00:08:28 UTC 2016
On Tue, Nov 29, 2016 at 4:03 PM Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Tue, Nov 29, 2016 at 12:48 PM, Kristian H. Kristensen <
> hoegsberg at gmail.com> wrote:
>
> Signed-off-by: Kristian H. Kristensen <hoegsberg at gmail.com>
> ---
> src/intel/genxml/gen8.xml | 9 ++++++++-
> src/intel/genxml/gen9.xml | 14 ++++++++------
> 2 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml
> index 165ff25..17234f6 100644
> --- a/src/intel/genxml/gen8.xml
> +++ b/src/intel/genxml/gen8.xml
> @@ -401,6 +401,13 @@
> <value name="HALF_BORDER" value="6"/>
> </enum>
>
> + <enum name="TILE_MODE">
> + <value name="LINEAR" value="0"/>
> + <value name="WMAJOR" value="1"/>
> + <value name="XMAJOR" value="2"/>
> + <value name="YMAJOR" value="3"/>
> + </enum>
> +
> <struct name="3DSTATE_CONSTANT_BODY" length="10">
> <field name="Constant Buffer 1 Read Length" start="16" end="31"
> type="uint"/>
> <field name="Constant Buffer 0 Read Length" start="0" end="15"
> type="uint"/>
> @@ -670,7 +677,7 @@
> <value name="HALIGN 8" value="2"/>
> <value name="HALIGN 16" value="3"/>
> </field>
> - <field name="Tile Mode" start="12" end="13" type="uint">
> + <field name="Tile Mode" start="12" end="13" type="TILE_MODE">
> <value name="LINEAR" value="0"/>
> <value name="WMAJOR" value="1"/>
> <value name="XMAJOR" value="2"/>
>
>
> I don't think you want these anymore.
>
Right, thanks
> As a side-note, what's the purpose of pulling one-use things out into
> enums? Tile Mode is not very general.
>
To let gen_pack_header.py use an enum in the packing struct. Maybe we
should just generate C enums for inline values instead, though that breaks
for the cases where inline values are duplicated. That works today because
the C preprocessor ignores duplicate but identical #defines.
Kristian
>
>
> diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml
> index ec85494..c9fb770 100644
> --- a/src/intel/genxml/gen9.xml
> +++ b/src/intel/genxml/gen9.xml
> @@ -422,6 +422,13 @@
> <value name="HALF_BORDER" value="6"/>
> </enum>
>
> + <enum name="TILE_MODE">
> + <value name="LINEAR" value="0"/>
> + <value name="WMAJOR" value="1"/>
> + <value name="XMAJOR" value="2"/>
> + <value name="YMAJOR" value="3"/>
> + </enum>
> +
> <struct name="3DSTATE_CONSTANT_BODY" length="10">
> <field name="Constant Buffer 1 Read Length" start="16" end="31"
> type="uint"/>
> <field name="Constant Buffer 0 Read Length" start="0" end="15"
> type="uint"/>
> @@ -696,12 +703,7 @@
> <value name="HALIGN 8" value="2"/>
> <value name="HALIGN 16" value="3"/>
> </field>
> - <field name="Tile Mode" start="12" end="13" type="uint">
> - <value name="LINEAR" value="0"/>
> - <value name="WMAJOR" value="1"/>
> - <value name="XMAJOR" value="2"/>
> - <value name="YMAJOR" value="3"/>
> - </field>
> + <field name="Tile Mode" start="12" end="13" type="TILE_MODE"/>
> <field name="Vertical Line Stride" start="11" end="11" type="uint"/>
> <field name="Vertical Line Stride Offset" start="10" end="10"
> type="uint"/>
> <field name="Sampler L2 Bypass Mode Disable" start="9" end="9"
> type="bool"/>
>
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161130/fe75acd1/attachment-0001.html>
More information about the mesa-dev
mailing list