From: Matt Turner Date: Thu, 1 Jun 2017 04:06:18 +0000 (-0700) Subject: i965: Elide call to set_domain() if MAP_ASYNC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68bfc377fbdf831a96a3614cf2b7eedb842e3c16;p=mesa.git i965: Elide call to set_domain() if MAP_ASYNC No functional change (no callers currently pass MAP_ASYNC) Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c index ec9611feb92..9e5847fb609 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c @@ -689,8 +689,10 @@ brw_bo_map_cpu(struct brw_context *brw, struct brw_bo *bo, unsigned flags) DBG("brw_bo_map_cpu: %d (%s) -> %p\n", bo->gem_handle, bo->name, bo->map_cpu); - set_domain(brw, "CPU mapping", bo, I915_GEM_DOMAIN_CPU, - flags & MAP_WRITE ? I915_GEM_DOMAIN_CPU : 0); + if (!(flags & MAP_ASYNC)) { + set_domain(brw, "CPU mapping", bo, I915_GEM_DOMAIN_CPU, + flags & MAP_WRITE ? I915_GEM_DOMAIN_CPU : 0); + } bo_mark_mmaps_incoherent(bo); VG(VALGRIND_MAKE_MEM_DEFINED(bo->map_cpu, bo->size)); @@ -762,8 +764,10 @@ brw_bo_map_gtt(struct brw_context *brw, struct brw_bo *bo, unsigned flags) * tell it when we're about to use things if we had done * rendering and it still happens to be bound to the GTT. */ - set_domain(brw, "GTT mapping", bo, - I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + if (!(flags & MAP_ASYNC)) { + set_domain(brw, "GTT mapping", bo, + I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + } bo_mark_mmaps_incoherent(bo); VG(VALGRIND_MAKE_MEM_DEFINED(bo->map_gtt, bo->size));