[Mesa-dev] [PATCH 39/64] isl/state: Add support for OffsetX/Y in surface state

Jason Ekstrand jason at jlekstrand.net
Mon Jun 20 23:50:00 UTC 2016


On Mon, Jun 20, 2016 at 4:46 PM, Chad Versace <chad.versace at intel.com>
wrote:

> On Sat 11 Jun 2016, Jason Ekstrand wrote:
> > ---
> >  src/intel/isl/isl.h               | 3 +++
> >  src/intel/isl/isl_surface_state.c | 9 +++++++++
> >  2 files changed, 12 insertions(+)
> >
> > diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
> > index a987482..4dd4a2f 100644
> > --- a/src/intel/isl/isl.h
> > +++ b/src/intel/isl/isl.h
> > @@ -844,6 +844,9 @@ struct isl_surf_fill_state_info {
> >      * Valid values depend on hardware generation.
> >      */
> >     union isl_color_value clear_color;
> > +
> > +   /* Intra-tile offset */
> > +   uint16_t x_offset, y_offset;
> >  };
> >
> >  struct isl_buffer_fill_state_info {
> > diff --git a/src/intel/isl/isl_surface_state.c
> b/src/intel/isl/isl_surface_state.c
> > index 9bfc55f..65e4b8e 100644
> > --- a/src/intel/isl/isl_surface_state.c
> > +++ b/src/intel/isl/isl_surface_state.c
> > @@ -401,6 +401,15 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
> >     s.MOCS = info->mocs;
> >  #endif
> >
> > +#if GEN_GEN > 4 || GEN_IS_G4X
> > +   const unsigned x_div = 4;
> > +   const unsigned y_div = GEN_GEN >= 8 ? 4 : 2;
> > +   assert(info->x_offset % x_div == 0);
> > +   assert(info->y_offset % y_div == 0);
> > +   s.XOffset = info->x_offset / x_div;
> > +   s.YOffset = info->y_offset / y_div;
> > +#endif
>
> Perhaps add...
>
>    #else
>       assert(info->x_offset == 0);
>       assert(info->y_offset == 0);
>    #endif
>

I added exactly that code as I was rebasing in the G4X fixes in the gen4
patch.


>
> Or maybe not. You've thought about it more than I have.
>
> Either way, patch 39 is
> Reviewed-by: Chad Versace <chad.versace at intel.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160620/649b598a/attachment.html>


More information about the mesa-dev mailing list