i965: Mark all EGLimages as non-coherent.

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: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Kenneth Graunke 2017-08-16 11:15:24 -07:00
parent a727e03360
commit bc56dfbf3f
1 changed files with 3 additions and 5 deletions

View File

@ -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;
}