<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 15, 2018 at 5:47 AM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Jan 11, 2018 at 05:40:51PM -0800, Jason Ekstrand wrote:<br>
> From: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
><br>
> This fixes a bug where we were taking the tiling from the BO regardless<br>
> of what the modifier said. When we got images in from Vulkan where it<br>
> doesn't set the tiling on the BO, we would treat them as linear even<br>
> though the modifier expressly said to treat it as Y-tiled.<br>
<br>
</span>I noticed that I didn't get the tiling from Vulkan when I played with<br>
ext_memory_object. Hence I only ran my new piglit test with linear tiling.<br>
I was about to ask how do we pass the tiling from Vulkan to GL?<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Anyway here patches 1 and 2 are:<br>
<br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br><div><div class="h5"></div></div></blockquote><div><br></div><div>Thanks!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><br>
> Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.<wbr>org</a><br>
> Reviewed-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
> ---<br>
> src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 9 +++++----<br>
> 1 file changed, 5 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> index a0474ef..a9c2810 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> @@ -986,7 +986,11 @@ intel_miptree_create_for_dri_<wbr>image(struct brw_context *brw,<br>
> uint32_t bo_tiling, bo_swizzle;<br>
> brw_bo_get_tiling(image->bo, &bo_tiling, &bo_swizzle);<br>
><br>
> - const enum isl_tiling tiling = isl_tiling_from_i915_tiling(<wbr>bo_tiling);<br>
> + const struct isl_drm_modifier_info *mod_info =<br>
> + isl_drm_modifier_get_info(<wbr>image->modifier);<br>
> +<br>
> + const enum isl_tiling tiling =<br>
> + mod_info ? mod_info->tiling : isl_tiling_from_i915_tiling(<wbr>bo_tiling);<br>
><br>
> if (image->planar_format && image->planar_format->nplanes > 1)<br>
> return miptree_create_for_planar_<wbr>image(brw, image, target, tiling);<br>
> @@ -1010,9 +1014,6 @@ intel_miptree_create_for_dri_<wbr>image(struct brw_context *brw,<br>
> if (!brw->ctx.<wbr>TextureFormatSupported[format]<wbr>)<br>
> return NULL;<br>
><br>
> - const struct isl_drm_modifier_info *mod_info =<br>
> - isl_drm_modifier_get_info(<wbr>image->modifier);<br>
> -<br>
> enum intel_miptree_create_flags mt_create_flags = 0;<br>
><br>
> /* If this image comes in from a window system, we have different<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>