[Mesa-dev] [PATCH] i965: Mark all EGLimages as non-coherent.

Jason Ekstrand jason at jlekstrand.net
Wed Aug 16 19:33:42 UTC 2017


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Wed, Aug 16, 2017 at 12:30 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> EGLimages are shared with external users, and we don't know what they're
> going to do with them.  They might scan them out.  They might access
> them in a way that doesn't work with our explicit clflushing.
>
> It's safest to simply mark them non-coherent.
>
> Chris Wilson caught this problem and wrote a similar (though less
> aggressive) patch to solve it; the miptree code has since undergone
> a lot of refactoring so I had to rewrite it.
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 237ab182712..dab60c4b045 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -1061,12 +1061,10 @@ intel_miptree_create_for_dri_image(struct
> brw_context *brw,
>        }
>     }
>
> -   /* If this is a window-system image, then we can no longer assume it's
> -    * cache-coherent because it may suddenly get scanned out which
> destroys
> -    * coherency.
> +   /* Don't assume coherency for imported EGLimages.  We don't know what
> +    * external clients are going to do with it.  They may scan it out.
>      */
> -   if (is_winsys_image)
> -      image->bo->cache_coherent = false;
> +   image->bo->cache_coherent = false;
>
>     return mt;
>  }
> --
> 2.14.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170816/da01bdec/attachment.html>


More information about the mesa-dev mailing list