From a3371613c9bf577a69cdf811ca1bebaea46bbe95 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 25 Apr 2012 11:09:35 +0100 Subject: [PATCH] sna: Do not automagically convert GTT mappings on untiled scanout to CPU The likelihood of an untiled mapping of the scanout is slim, except for gen3 with large desktops, and there it should never be in the CPU domain... The issue is that we may perform an operation "inplace", yet incoherent with the display engine, and never flush the CPU cache, resulting in render corruption. In theory at least! Signed-off-by: Chris Wilson --- src/sna/kgem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index d97f5590..4c4aa7c3 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3167,7 +3167,7 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo) assert(bo->exec == NULL); assert(list_is_empty(&bo->list)); - if (bo->tiling == I915_TILING_NONE && + if (bo->tiling == I915_TILING_NONE && !bo->scanout && (kgem->has_llc || bo->domain == DOMAIN_CPU)) { DBG(("%s: converting request for GTT map into CPU map\n", __FUNCTION__)); @@ -3274,6 +3274,7 @@ void *kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo) DBG(("%s(handle=%d, size=%d)\n", __FUNCTION__, bo->handle, bytes(bo))); assert(!bo->purged); assert(list_is_empty(&bo->list)); + assert(!bo->scanout); if (IS_CPU_MAP(bo->map)) return MAP(bo->map);