[Mesa-dev] [PATCH 10/15] i965/miptree: Add support for isl based offsets

Pohjolainen, Topi topi.pohjolainen at gmail.com
Fri Jun 16 05:34:25 UTC 2017


On Thu, Jun 15, 2017 at 03:57:42PM -0700, Jason Ekstrand wrote:
> On Tue, Jun 13, 2017 at 12:11 PM, Topi Pohjolainen <
> topi.pohjolainen at gmail.com> wrote:
> 
> > Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 27
> > +++++++++++++++++++++++----
> >  1 file changed, 23 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index a2d4fa9d92..c513a69a5c 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -1344,9 +1344,19 @@ uint32_t
> >  intel_miptree_get_aligned_offset(const struct intel_mipmap_tree *mt,
> >                                   uint32_t x, uint32_t y)
> >  {
> > -   int cpp = mt->cpp;
> > -   uint32_t pitch = mt->pitch;
> > -   uint32_t tiling = mt->tiling;
> > +   int cpp;
> > +   uint32_t pitch;
> > +   uint32_t tiling;
> > +
> > +   if (mt->surf.size > 0) {
> > +      cpp = isl_format_get_layout(mt->surf.format)->bpb / 8;
> > +      pitch = mt->surf.row_pitch;
> > +      tiling = isl_tiling_to_bufmgr_tiling(mt->surf.tiling);
> > +   } else {
> > +      cpp = mt->cpp;
> > +      pitch = mt->pitch;
> > +      tiling = mt->tiling;
> > +   }
> >
> >     switch (tiling) {
> >     default:
> > @@ -1382,8 +1392,17 @@ intel_miptree_get_tile_offsets(const struct
> > intel_mipmap_tree *mt,
> >  {
> >     uint32_t x, y;
> >     uint32_t mask_x, mask_y;
> > +   uint32_t cpp, tiling;
> > +
> > +   if (mt->surf.size > 0) {
> > +      cpp = isl_format_get_layout(mt->surf.format)->bpb / 8;
> > +      tiling = isl_tiling_to_bufmgr_tiling(mt->surf.tiling);
> > +   } else {
> > +      cpp = mt->cpp;
> > +      tiling = mt->tiling;
> > +   }
> >
> > -   intel_get_tile_masks(mt->tiling, mt->cpp, &mask_x, &mask_y);
> > +   intel_get_tile_masks(tiling, cpp, &mask_x, &mask_y);
> >     intel_miptree_get_image_offset(mt, level, slice, &x, &y);
> >
> 
> This references the mapping table.  However, I don't think your
> create_surface function actually fills it out for ISL-based miptrees.  Did
> I miss something?

Earlier patch already needed for stencil bypasses the table if isl surface
is present:

i965/miptree: Add option to resolve offsets using isl_surf

> 
> 
> >
> >     *tile_x = x & mask_x;
> > --
> > 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