[Mesa-dev] [PATCH 2/2] i965: Always mark scanout images as not cache-coherent

Jason Ekstrand jason at jlekstrand.net
Thu Aug 3 14:04:42 UTC 2017


We already do this as a side-effect of intel_miptree_create_for_dri_image.  
Also, in the new world of modifiers, the usage flags don't get set.


On August 3, 2017 1:48:01 AM Chris Wilson <chris at chris-wilson.co.uk> wrote:

> Ensure that any buffer allocated for a scanout image is kept out of the
> CPU/LLC cache so as to avoid any visual glitch.
>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/intel_screen.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
> b/src/mesa/drivers/dri/i965/intel_screen.c
> index ced80cb879..a61ba05892 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -697,6 +697,16 @@ intel_create_image_common(__DRIscreen *dri_screen,
>     image->pitch = surf.row_pitch;
>     image->modifier = modifier;
>
> +   /* When a buffer is transformed into a framebuffer and mapped for use
> +    * by scanout (i.e. any sprite plane, scanout, cursor, overlay etc),
> +    * it is moved to UC - reads by the display engine are serviced directly
> +    * from memory ignoring the CPU/LLC cache. If we leave pixels in the CPU
> +    * cache due to mistaken use of WB, that causes screen corruption that
> +    * randomly heals over time (due to eventual cache eviction).
> +    */
> +   if (use & (__DRI_IMAGE_USE_CURSOR | __DRI_IMAGE_USE_SCANOUT))
> +      image->bo->cache_coherent = false;
> +
>     return image;
>  }
>
> --
> 2.13.3
>
> _______________________________________________
> 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