[Mesa-dev] [PATCH 03/53] i965: Make sure we don't use CPU maps for the scanout buffer.

Jason Ekstrand jason at jlekstrand.net
Wed Apr 5 03:20:53 UTC 2017


Seems like a good idea.

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

On Tue, Apr 4, 2017 at 5:09 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> Using an incoherent CPU map on the active scanout buffer is really
> sketchy - we may need extra flushing via GEM_SW_FINISH, or using
> drmModeDirtyFB() and kernel commit a6a7cc4b7db6d (4.10+).
>
> Chris suggests "never ever do that", which seems like a wise plan!
>
> intel_miptree_map_raw() uses CPU maps on linear buffers.
>
> Having a linear scanout buffer should be really rare, and mapping the
> front buffer should be similarly rare.  Together, it should basically
> never happen.  But, in case it does somehow...make sure that mapping
> the scanout buffer always goes through an uncached GTT map.
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 467ada5079b..272eb49867e 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2460,7 +2460,7 @@ intel_miptree_map_raw(struct brw_context *brw,
> struct intel_mipmap_tree *mt)
>     if (drm_intel_bo_references(brw->batch.bo, bo))
>        intel_batchbuffer_flush(brw);
>
> -   if (mt->tiling != I915_TILING_NONE)
> +   if (mt->tiling != I915_TILING_NONE || mt->is_scanout)
>        brw_bo_map_gtt(brw, bo, "miptree");
>     else
>        brw_bo_map(brw, bo, true, "miptree");
> --
> 2.12.1
>
> _______________________________________________
> 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-dev/attachments/20170404/84722b2a/attachment.html>


More information about the mesa-dev mailing list