[Mesa-dev] [PATCH 2/5] genxml: Add alias for MOCS.

Rafael Antognolli rafael.antognolli at intel.com
Wed May 10 15:57:07 UTC 2017


On Wed, May 10, 2017 at 11:36:46AM +0300, Pohjolainen, Topi wrote:
> On Tue, May 09, 2017 at 05:12:09PM -0700, Rafael Antognolli wrote:
> > Use an alias for this field on 3DSTATE_INDEX_BUFFER on gen6+, so we can set
> > the same value as the defines.
> > 
> > Signed-off-by: Rafael Antognolli <rafael.antognolli at intel.com>
> > ---
> >  src/intel/genxml/gen6.xml  | 1 +
> >  src/intel/genxml/gen7.xml  | 1 +
> >  src/intel/genxml/gen75.xml | 1 +
> >  src/intel/genxml/gen8.xml  | 1 +
> >  src/intel/genxml/gen9.xml  | 1 +
> >  5 files changed, 5 insertions(+)
> > 
> > diff --git a/src/intel/genxml/gen6.xml b/src/intel/genxml/gen6.xml
> > index 5aa19a58..1294929 100644
> > --- a/src/intel/genxml/gen6.xml
> > +++ b/src/intel/genxml/gen6.xml
> > @@ -1047,6 +1047,7 @@
> >      <field name="3D Command Opcode" start="24" end="26" type="uint" default="0"/>
> >      <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="10"/>
> >      <field name="Memory Object Control State" start="12" end="15" type="MEMORY_OBJECT_CONTROL_STATE"/>
> > +    <field name="IndexBufferMOCS" start="12" end="15" type="uint"/>
> 
> In patch four you only use this field for gen8+. Should we do the
> "mustbezero"-trick for gen < 8?

IMHO it makes more sense to have this alias on any struct that already has the
"Memory Object Control State" field, even if it's not used (just like the
memory object control state field is also not used).

Also regarding the "mustbezero", since the documentation doesn't say it should
be zero, I would do that. Not setting it in the code will already make sure it
defaults to zero.

> >      <field name="Cut Index Enable" start="10" end="10" type="bool"/>
> >      <field name="Index Format" start="8" end="9" type="uint" prefix="INDEX">
> >        <value name="BYTE" value="0"/>
> > diff --git a/src/intel/genxml/gen7.xml b/src/intel/genxml/gen7.xml
> > index fd70414..c98327a 100644
> > --- a/src/intel/genxml/gen7.xml
> > +++ b/src/intel/genxml/gen7.xml
> > @@ -1220,6 +1220,7 @@
> >      <field name="3D Command Opcode" start="24" end="26" type="uint" default="0"/>
> >      <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="10"/>
> >      <field name="Memory Object Control State" start="12" end="15" type="MEMORY_OBJECT_CONTROL_STATE"/>
> > +    <field name="IndexBufferMOCS" start="12" end="15" type="uint"/>
> >      <field name="Cut Index Enable" start="10" end="10" type="bool"/>
> >      <field name="Index Format" start="8" end="9" type="uint" prefix="INDEX">
> >        <value name="BYTE" value="0"/>
> > diff --git a/src/intel/genxml/gen75.xml b/src/intel/genxml/gen75.xml
> > index ac2dbc3..11f1462 100644
> > --- a/src/intel/genxml/gen75.xml
> > +++ b/src/intel/genxml/gen75.xml
> > @@ -1506,6 +1506,7 @@
> >      <field name="3D Command Opcode" start="24" end="26" type="uint" default="0"/>
> >      <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="10"/>
> >      <field name="Memory Object Control State" start="12" end="15" type="MEMORY_OBJECT_CONTROL_STATE"/>
> > +    <field name="IndexBufferMOCS" start="12" end="15" type="uint"/>
> >      <field name="Index Format" start="8" end="9" type="uint" prefix="INDEX">
> >        <value name="BYTE" value="0"/>
> >        <value name="WORD" value="1"/>
> > diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml
> > index 1392466..541a788 100644
> > --- a/src/intel/genxml/gen8.xml
> > +++ b/src/intel/genxml/gen8.xml
> > @@ -1583,6 +1583,7 @@
> >        <value name="DWORD" value="2"/>
> >      </field>
> >      <field name="Memory Object Control State" start="32" end="38" type="MEMORY_OBJECT_CONTROL_STATE"/>
> > +    <field name="IndexBufferMOCS" start="32" end="38" type="uint"/>
> >      <field name="Buffer Starting Address" start="64" end="127" type="address"/>
> >      <field name="Buffer Size" start="128" end="159" type="uint"/>
> >    </instruction>
> > diff --git a/src/intel/genxml/gen9.xml b/src/intel/genxml/gen9.xml
> > index 445a366..a2c2020 100644
> > --- a/src/intel/genxml/gen9.xml
> > +++ b/src/intel/genxml/gen9.xml
> > @@ -1696,6 +1696,7 @@
> >        <value name="DWORD" value="2"/>
> >      </field>
> >      <field name="Memory Object Control State" start="32" end="38" type="MEMORY_OBJECT_CONTROL_STATE"/>
> > +    <field name="IndexBufferMOCS" start="32" end="38" type="uint"/>
> >      <field name="Buffer Starting Address" start="64" end="127" type="address"/>
> >      <field name="Buffer Size" start="128" end="159" type="uint"/>
> >    </instruction>
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > 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