Mesa (master): i965: Don't bother flushing the batch if it doesn' t ref our mt to map.

Eric Anholt anholt at kemper.freedesktop.org
Sat Apr 26 01:20:48 UTC 2014


Module: Mesa
Branch: master
Commit: 07730e9463637a62e41a9783374102b4181ba960
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=07730e9463637a62e41a9783374102b4181ba960

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 23 13:45:22 2014 -0700

i965: Don't bother flushing the batch if it doesn't ref our mt to map.

-1.1372% +/- 0.858033% effect on cairo runtime on glamor (n=175).

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |    3 ++-
 1 file changed, 2 insertions(+), 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 59700ed..c24cfce 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1614,7 +1614,8 @@ intel_miptree_map_raw(struct brw_context *brw, struct intel_mipmap_tree *mt)
 
    drm_intel_bo *bo = mt->region->bo;
 
-   intel_batchbuffer_flush(brw);
+   if (drm_intel_bo_references(brw->batch.bo, bo))
+      intel_batchbuffer_flush(brw);
 
    if (mt->region->tiling != I915_TILING_NONE)
       brw_bo_map_gtt(brw, bo, "miptree");




More information about the mesa-commit mailing list