[Mesa-stable] [Mesa-dev] [PATCH 2/4] i965/miptree: Use the tiling from the modifier instead of the BO
Jason Ekstrand
jason at jlekstrand.net
Mon Jan 15 19:39:12 UTC 2018
On Mon, Jan 15, 2018 at 5:47 AM, Pohjolainen, Topi <
topi.pohjolainen at gmail.com> wrote:
> On Thu, Jan 11, 2018 at 05:40:51PM -0800, Jason Ekstrand wrote:
> > From: Jason Ekstrand <jason at jlekstrand.net>
> >
> > This fixes a bug where we were taking the tiling from the BO regardless
> > of what the modifier said. When we got images in from Vulkan where it
> > doesn't set the tiling on the BO, we would treat them as linear even
> > though the modifier expressly said to treat it as Y-tiled.
>
> I noticed that I didn't get the tiling from Vulkan when I played with
> ext_memory_object. Hence I only ran my new piglit test with linear tiling.
> I was about to ask how do we pass the tiling from Vulkan to GL?
>
That's where things get tricky... The way this is supposed to work is that
you specify TILING_OPTIMAL in Vulkan and then the two drivers are supposed
to just magically make the same choice. Even better, they're supposed to
magically make the same choice for everything: tiling, alignment
parameters, stride, qpitch, etc. This is why we needed to switch GL over
to ISL prior to even attempting to implement that extension. One other
option would be to store the isl_surf somewhere in the BO. However, even
there, the Vulkan driver needs to create an isl_surf that the GL driver
knows what to do with so all of the GL driver's restrictions apply.
In order for this to all work, we need to look at every additional
restriction in the GL driver and either get rid of it somehow, or move it
into ISL. I have a strong preference for getting rid of things over moving
stuff to ISL if we can help it. For instance, we may have to use the
blitter less to get rid of our linear fall-back for wide surfaces.
> Anyway here patches 1 and 2 are:
>
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
>
Thanks!
> >
> > Cc: mesa-stable at lists.freedesktop.org
> > Reviewed-by: Daniel Stone <daniels at collabora.com>
> > ---
> > src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 +++++----
> > 1 file changed, 5 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 a0474ef..a9c2810 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -986,7 +986,11 @@ intel_miptree_create_for_dri_image(struct
> brw_context *brw,
> > uint32_t bo_tiling, bo_swizzle;
> > brw_bo_get_tiling(image->bo, &bo_tiling, &bo_swizzle);
> >
> > - const enum isl_tiling tiling = isl_tiling_from_i915_tiling(
> bo_tiling);
> > + const struct isl_drm_modifier_info *mod_info =
> > + isl_drm_modifier_get_info(image->modifier);
> > +
> > + const enum isl_tiling tiling =
> > + mod_info ? mod_info->tiling : isl_tiling_from_i915_tiling(
> bo_tiling);
> >
> > if (image->planar_format && image->planar_format->nplanes > 1)
> > return miptree_create_for_planar_image(brw, image, target,
> tiling);
> > @@ -1010,9 +1014,6 @@ intel_miptree_create_for_dri_image(struct
> brw_context *brw,
> > if (!brw->ctx.TextureFormatSupported[format])
> > return NULL;
> >
> > - const struct isl_drm_modifier_info *mod_info =
> > - isl_drm_modifier_get_info(image->modifier);
> > -
> > enum intel_miptree_create_flags mt_create_flags = 0;
> >
> > /* If this image comes in from a window system, we have different
> > --
> > 2.5.0.400.gff86faf
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20180115/f7ad576e/attachment.html>
More information about the mesa-stable
mailing list