[Mesa-stable] [PATCH] intel: Correct the BDW surface state size

Jason Ekstrand jason at jlekstrand.net
Fri Mar 10 03:01:36 UTC 2017


On Thu, Mar 9, 2017 at 5:32 PM, Nanley Chery <nanleychery at gmail.com> wrote:

> On Thu, Mar 09, 2017 at 05:03:30PM -0800, Jason Ekstrand wrote:
> > On Thu, Mar 9, 2017 at 3:35 PM, Nanley Chery <nanleychery at gmail.com>
> wrote:
> >
> > > The PRMs state that this packet is 16 DWORDS long. Ensure that the last
> > > three DWORDS are zeroed as required by the hardware when allocating a
> > > null surface state.
> > >
> > > Cc: <mesa-stable at lists.freedesktop.org>
> > > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > > ---
> > >  src/intel/isl/isl.c                            | 2 +-
> > >  src/mesa/drivers/dri/i965/gen8_surface_state.c | 5 ++---
> > >  2 files changed, 3 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > > index 6eb1e93efd..b4bdf2059a 100644
> > > --- a/src/intel/isl/isl.c
> > > +++ b/src/intel/isl/isl.c
> > > @@ -56,7 +56,7 @@ static const struct {
> > >     [5] = {24, 32,  4},
> > >     [6] = {24, 32,  4},
> > >     [7] = {32, 32,  4, 24},
> > > -   [8] = {52, 64, 32, 40},
> > > +   [8] = {64, 64, 32, 40},
> > >
> >
> > you're right.  Thanks!
> >
> >
> > >     [9] = {64, 64, 32, 40},
> > >  };
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c
> > > b/src/mesa/drivers/dri/i965/gen8_surface_state.c
> > > index 501531d4ad..f868293217 100644
> > > --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
> > > +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
> > > @@ -46,10 +46,9 @@ static uint32_t *
> > >  gen8_allocate_surface_state(struct brw_context *brw,
> > >                              uint32_t *out_offset, int index)
> > >  {
> > > -   int dwords = brw->gen >= 9 ? 16 : 13;
> > >     uint32_t *surf = __brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,
> > > -                                      dwords * 4, 64, index,
> out_offset);
> > > -   memset(surf, 0, dwords * 4);
> > > +                                      64, 64, index, out_offset);
> > > +   memset(surf, 0, 64);
> > >
> >
> > Actually, ISL (well, more like gen8_pack.h) does this for us when it
> fills
> > out the surface state so the memset isn't needed.
> >
> >
>
> This is done for the only surface state that ISL doesn't fill. See
> gen8_emit_null_surface_state().
>

Sorry, I missed that.  Good catch!

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20170309/9db7b320/attachment.html>


More information about the mesa-stable mailing list