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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev