[Mesa-dev] [PATCH 01/17] intel/isl: Add missing stencil pitch validation

Pohjolainen, Topi topi.pohjolainen at gmail.com
Fri Jul 21 18:25:08 UTC 2017


On Fri, Jul 21, 2017 at 10:47:34AM -0700, Jason Ekstrand wrote:
> On Fri, Jul 21, 2017 at 8:00 AM, Topi Pohjolainen <
> topi.pohjolainen at gmail.com> wrote:
> 
> > Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> > ---
> >  src/intel/isl/isl.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > index 7d1356f0ac..4393088409 100644
> > --- a/src/intel/isl/isl.c
> > +++ b/src/intel/isl/isl.c
> > @@ -1316,8 +1316,10 @@ isl_calc_row_pitch(const struct isl_device *dev,
> >         !pitch_in_range(row_pitch, _3DSTATE_HIER_DEPTH_BUFFER_
> > SurfacePitch_bits(dev->info)))
> >        return false;
> >
> > -   if (surf_info->usage & ISL_SURF_USAGE_STENCIL_BIT)
> > -      isl_finishme("validate row pitch of stencil surfaces");
> > +   if ((surf_info->usage & ISL_SURF_USAGE_STENCIL_BIT) &&
> > +       !pitch_in_range(row_pitch,
> > +                       _3DSTATE_STENCIL_BUFFER_
> > SurfacePitch_bits(dev->info)))
> > +      return false;
> >
> 
> I think we want this to be
> 
> if (surf_info->usage & ISL_SURF_USAGE_STENCIL_BIT) {
>    if (surf_info->format == ISL_FORMAT_R8_UINT) {
>       if (!pitch_in_range(row_pitch, _3DSTATE_STENCIL_BUFFER_
> SurfacePitch_bits(dev->info)))
>          return false;
>    } else {
>       if (!pitch_in_range(row_pitch, _3DSTATE_DEPTH_BUFFER_
> SurfacePitch_bits(dev->info)))
>          return false;
>    }
> }
> 
> I'm not sure how gen4 is even working without doing that.

Ah, I'm ISL_SURF_USAGE_STENCIL_BIT in make_surface() for gen < 6 for the
depth buffer.

> 
> 
> >
> >   done:
> >     *out_row_pitch = row_pitch;
> > --
> > 2.11.0
> >
> > _______________________________________________
> > 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