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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-04-25 11:09:35 +01:00
parent 1abd92cd01
commit a3371613c9
1 changed files with 2 additions and 1 deletions

View File

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