This moves the intel_batchbuffer_flush before the drm_intel_bo_busy
call, which is a change in behavior. However, the old behavior was
broken.
In the future, we may want to only flush in the batchbuffer references
the BO being mapped. That's certainly more typical.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
drm_intel_bo *bo = mt->region->bo;
- if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
- if (drm_intel_bo_busy(bo)) {
- perf_debug("Mapping a busy miptree, causing a stall on the GPU.\n");
- }
- }
-
intel_batchbuffer_flush(brw);
if (mt->region->tiling != I915_TILING_NONE)
- drm_intel_gem_bo_map_gtt(bo);
+ brw_bo_map_gtt(brw, bo, "miptree");
else
- drm_intel_bo_map(bo, true);
+ brw_bo_map(brw, bo, true, "miptree");
return bo->virtual;
}