[Mesa-dev] [PATCH 1/5] intel: genxml: add SAMPLER_BORDER_COLOR_STATE structures

Jason Ekstrand jason at jlekstrand.net
Tue Oct 18 21:23:20 UTC 2016


Thanks for the sandy bridge doc link.  With all of the extra MBZ removed,
this patch is

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Mon, Oct 17, 2016 at 11:39 AM, Lionel Landwerlin <llandwerlin at gmail.com>
wrote:

> On Mon, 2016-10-17 at 10:56 -0700, Jason Ekstrand wrote:
> >
> >
> > On Mon, Oct 17, 2016 at 8:46 AM, Lionel Landwerlin <llandwerlin at gmail
> > .com> wrote:
> > > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> > > ---
> > >  src/intel/genxml/gen6.xml  | 32 ++++++++++++++++++++++++++++++++
> > >  src/intel/genxml/gen7.xml  | 12 ++++++++++++
> > >  src/intel/genxml/gen75.xml | 40
> > > ++++++++++++++++++++++++++++++++++++++++
> > >  src/intel/genxml/gen8.xml  | 12 ++++++++++++
> > >  src/intel/genxml/gen9.xml  | 12 ++++++++++++
> > >  5 files changed, 108 insertions(+)
> > >
> > > diff --git a/src/intel/genxml/gen6.xml b/src/intel/genxml/gen6.xml
> > > index 211716b..7ba8954 100644
> > > --- a/src/intel/genxml/gen6.xml
> > > +++ b/src/intel/genxml/gen6.xml
> > > @@ -372,6 +372,38 @@
> > >      <field name="MOCS" start="176" end="179" type="uint"/>
> > >    </struct>
> > >
> > > +  <struct name="SAMPLER_BORDER_COLOR_STATE" length="12">
> > > +    <field name="Border Color Unorm Red" start="0" end="7"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Green" start="8" end="15"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Blue" start="16" end="23"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Alpha" start="24" end="31"
> > > type="uint"/>
> > > +
> > > +    <field name="Border Color Float Red" start="32" end="63"
> > > type="float"/>
> > > +    <field name="Border Color Float Green" start="64" end="95"
> > > type="float"/>
> > > +    <field name="Border Color Float Blue" start="96" end="127"
> > > type="float"/>
> > > +    <field name="Border Color Float Alpha" start="128" end="159"
> > > type="float"/>
> > > +
> > > +    <field name="Border Color Float16 Red" start="160" end="175"
> > > type="uint"/>
> > > +    <field name="Border Color Float16 Green" start="176" end="191"
> > > type="uint"/>
> > > +    <field name="Border Color Float16 Blue" start="192" end="207"
> > > type="uint"/>
> > > +    <field name="Border Color Float16 Alpha" start="208" end="223"
> > > type="uint"/>
> > > +
> > > +    <field name="Border Color Unorm16 Red" start="224" end="239"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm16 Green" start="240" end="255"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm16 Blue" start="256" end="271"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm16 Alpha" start="272" end="287"
> > > type="uint"/>
> > > +
> > > +    <field name="Border Color Snorm16 Red" start="288" end="303"
> > > type="int"/>
> > > +    <field name="Border Color Snorm16 Green" start="304" end="319"
> > > type="int"/>
> > > +    <field name="Border Color Snorm16 Blue" start="320" end="335"
> > > type="int"/>
> > > +    <field name="Border Color Snorm16 Alpha" start="336" end="351"
> > > type="int"/>
> > > +
> > > +    <field name="Border Color Snorm8 Red" start="352" end="359"
> > > type="int"/>
> > > +    <field name="Border Color Snorm8 Green" start="360" end="367"
> > > type="int"/>
> > > +    <field name="Border Color Snorm8 Blue" start="368" end="375"
> > > type="int"/>
> > > +    <field name="Border Color Snorm8 Alpha" start="376" end="383"
> > > type="int"/>
> > > +  </struct>
> >
> > Are there docs for this anywhere or did you just pull it out of the
> > gen6 GL code?
> >
>
> Yes, there are but indeed not in the PRMs.
>
>
> > > +
> > >    <struct name="SAMPLER_STATE" length="4">
> > >      <field name="Sampler Disable" start="31" end="31"
> > > type="bool"/>
> > >      <field name="Texture Border Color Mode" start="29" end="29"
> > > type="uint">
> > > diff --git a/src/intel/genxml/gen7.xml b/src/intel/genxml/gen7.xml
> > > index eabb244..a950603 100644
> > > --- a/src/intel/genxml/gen7.xml
> > > +++ b/src/intel/genxml/gen7.xml
> > > @@ -428,6 +428,18 @@
> > >      <field name="Resource Min LOD" start="224" end="235"
> > > type="u4.8"/>
> > >    </struct>
> > >
> > > +  <struct name="SAMPLER_BORDER_COLOR_STATE" length="4">
> > > +    <field name="Border Color Unorm Red" start="0" end="7"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Green" start="8" end="15"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Blue" start="16" end="23"
> > > type="uint"/>
> > > +    <field name="Border Color Unorm Alpha" start="24" end="31"
> > > type="uint"/>
> > > +
> > > +    <field name="Border Color Float Red" start="0" end="31"
> > > type="float"/>
> > > +    <field name="Border Color Float Green" start="32" end="63"
> > > type="float"/>
> > > +    <field name="Border Color Float Blue" start="64" end="95"
> > > type="float"/>
> > > +    <field name="Border Color Float Alpha" start="96" end="127"
> > > type="float"/>
> > > +  </struct>
> > > +
> > >    <struct name="SAMPLER_STATE" length="4">
> > >      <field name="Sampler Disable" start="31" end="31"
> > > type="bool"/>
> > >      <field name="Texture Border Color Mode" start="29" end="29"
> > > type="uint">
> > > diff --git a/src/intel/genxml/gen75.xml
> > > b/src/intel/genxml/gen75.xml
> > > index 27a12cb..42f66cb 100644
> > > --- a/src/intel/genxml/gen75.xml
> > > +++ b/src/intel/genxml/gen75.xml
> > > @@ -438,6 +438,46 @@
> > >      <field name="Resource Min LOD" start="224" end="235"
> > > type="u4.8"/>
> > >    </struct>
> > >
> > > +  <struct name="SAMPLER_BORDER_COLOR_STATE" length="20">
> > > +    <field name="Border Color Float Red" start="0" end="31"
> > > type="float"/>
> > > +    <field name="Border Color Float Green" start="32" end="63"
> > > type="float"/>
> > > +    <field name="Border Color Float Blue" start="64" end="95"
> > > type="float"/>
> > > +    <field name="Border Color Float Alpha" start="96" end="127"
> > > type="float"/>
> > > +
> > > +    <field name="Reserved1 MBZ" start="128" end="159"
> > > type="uint"/>
> > > +    <field name="Reserved2 MBZ" start="160" end="191"
> > > type="uint"/>
> > > +    <field name="Reserved3 MBZ" start="192" end="223"
> > > type="uint"/>
> > > +    <field name="Reserved4 MBZ" start="224" end="255"
> > > type="uint"/>
> > > +    <field name="Reserved5 MBZ" start="256" end="287"
> > > type="uint"/>
> > > +    <field name="Reserved6 MBZ" start="288" end="319"
> > > type="uint"/>
> > > +    <field name="Reserved7 MBZ" start="320" end="351"
> > > type="uint"/>
> > > +    <field name="Reserved8 MBZ" start="352" end="383"
> > > type="uint"/>
> > > +    <field name="Reserved9 MBZ" start="384" end="415"
> > > type="uint"/>
> > > +    <field name="Reserved10 MBZ" start="416" end="447"
> > > type="uint"/>
> > > +    <field name="Reserved11 MBZ" start="448" end="479"
> > > type="uint"/>
> > > +    <field name="Reserved12 MBZ" start="480" end="511"
> > > type="uint"/>
> >
> > In the rest of the XML, MBZ fields simply don't exist.  The packing
> > functions will automatically zero anything that doesn't have data in
> > it.  I'm not sure if that's true for whole dwords but if it's not, we
> > should fix that.  In other words, I believe the correct solution is
> > to just delete these and let "Border Color 8bit Red" start super-late
> > in the packet.
> >
> > > +
> > > +    <field name="Border Color 8bit Red" start="512" end="519"
> > > type="uint"/>
> > > +    <field name="Border Color 8bit Green" start="520" end="527"
> > > type="uint"/>
> > > +    <field name="Border Color 8bit Blue" start="528" end="535"
> > > type="uint"/>
> > > +    <field name="Border Color 8bit Alpha" start="536" end="543"
> > > type="uint"/>
> > > +    <field name="Border Color 8bit Reserved1 MBZ" start="544"
> > > end="575" type="uint"/>
> > > +    <field name="Border Color 8bit Reserved2 MBZ" start="576"
> > > end="607" type="uint"/>
> > > +    <field name="Border Color 8bit Reserved3 MBZ" start="608"
> > > end="639" type="uint"/>
> >
> > These can go as well
> >
> > > +
> > > +    <field name="Border Color 16bit Red" start="512" end="527"
> > > type="uint"/>
> > > +    <field name="Border Color 16bit Green" start="528" end="543"
> > > type="uint"/>
> > > +    <field name="Border Color 16bit Reserved1 MBZ" start="544"
> > > end="575" type="uint"/>
> >
> > and this
> >
> > > +    <field name="Border Color 16bit Blue" start="576" end="591"
> > > type="uint"/>
> > > +    <field name="Border Color 16bit Alpha" start="592" end="607"
> > > type="uint"/>
> > > +    <field name="Border Color 16bit Reserved2 MBZ" start="608"
> > > end="639" type="uint"/>
> >
> > and this
> >
> > > +
> > > +    <field name="Border Color 32bit Red" start="512" end="543"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Green" start="544" end="575"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Blue" start="576" end="607"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Alpha" start="608" end="639"
> > > type="uint"/>
> > > +  </struct>
> > > +
> > >    <struct name="SAMPLER_STATE" length="4">
> > >      <field name="Sampler Disable" start="31" end="31"
> > > type="bool"/>
> > >      <field name="Texture Border Color Mode" start="29" end="29"
> > > type="uint">
> > > diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml
> > > index ee62614..a281f01 100644
> > > --- a/src/intel/genxml/gen8.xml
> > > +++ b/src/intel/genxml/gen8.xml
> > > @@ -358,6 +358,18 @@
> > >      <field name="Filter Coefficient" start="0" end="7"
> > > type="s1.6"/>
> > >    </struct>
> > >
> > > +  <struct name="SAMPLER_BORDER_COLOR_STATE" length="4">
> > > +    <field name="Border Color Float Red" start="0" end="31"
> > > type="float"/>
> > > +    <field name="Border Color Float Green" start="32" end="63"
> > > type="float"/>
> > > +    <field name="Border Color Float Blue" start="64" end="95"
> > > type="float"/>
> > > +    <field name="Border Color Float Alpha" start="96" end="127"
> > > type="float"/>
> > > +
> > > +    <field name="Border Color 32bit Red" start="0" end="31"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Green" start="32" end="63"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Blue" start="64" end="95"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Alpha" start="96" end="127"
> > > type="uint"/>
> > > +  </struct>
> > > +
> > >    <struct name="SAMPLER_STATE" length="4">
> > >      <field name="Sampler Disable" start="31" end="31"
> > > type="bool"/>
> > >      <field name="Texture Border Color Mode" start="29" end="29"
> > > type="uint">
> > > diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml
> > > index 9c81c5a..665b61f 100644
> > > --- a/src/intel/genxml/gen9.xml
> > > +++ b/src/intel/genxml/gen9.xml
> > > @@ -382,6 +382,18 @@
> > >      <field name="Filter Coefficient" start="0" end="7"
> > > type="s1.6"/>
> > >    </struct>
> > >
> > > +  <struct name="SAMPLER_BORDER_COLOR_STATE" length="4">
> > > +    <field name="Border Color Float Red" start="0" end="31"
> > > type="float"/>
> > > +    <field name="Border Color Float Green" start="32" end="63"
> > > type="float"/>
> > > +    <field name="Border Color Float Blue" start="64" end="95"
> > > type="float"/>
> > > +    <field name="Border Color Float Alpha" start="96" end="127"
> > > type="float"/>
> > > +
> > > +    <field name="Border Color 32bit Red" start="0" end="31"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Green" start="32" end="63"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Blue" start="64" end="95"
> > > type="uint"/>
> > > +    <field name="Border Color 32bit Alpha" start="96" end="127"
> > > type="uint"/>
> > > +  </struct>
> > > +
> > >    <struct name="SAMPLER_STATE" length="4">
> > >      <field name="Sampler Disable" start="31" end="31"
> > > type="bool"/>
> > >      <field name="Texture Border Color Mode" start="29" end="29"
> > > type="uint">
> > > --
> > > 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/20161018/6cc5dd47/attachment-0001.html>


More information about the mesa-dev mailing list