intel: Don't map regions with drm_intel_gem_bo_map_gtt() unless they're tiled.
authorEric Anholt <eric@anholt.net>
Sat, 20 Jun 2009 00:14:27 +0000 (17:14 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 20 Jun 2009 00:25:20 +0000 (17:25 -0700)
This fixes a regression in region read performance that came in with the
texture tiling changes.  Ideally we'd have an access flag coming in so we
could also use bo_map_gtt for writing, like we do for buffer objects.

Bug #22190

src/mesa/drivers/dri/intel/intel_regions.c

index e142020d16977df8f6fb5d963ab0813caecaa2ca..65567e5b631892224907389504eee503e680a6b0 100644 (file)
@@ -116,7 +116,8 @@ intel_region_map(struct intel_context *intel, struct intel_region *region)
       if (region->pbo)
          intel_region_cow(intel, region);
 
-      if (intel->intelScreen->kernel_exec_fencing)
+      if (region->tiling != I915_TILING_NONE &&
+         intel->intelScreen->kernel_exec_fencing)
         drm_intel_gem_bo_map_gtt(region->buffer);
       else
         dri_bo_map(region->buffer, GL_TRUE);
@@ -131,7 +132,8 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region)
 {
    _DBG("%s %p\n", __FUNCTION__, region);
    if (!--region->map_refcount) {
-      if (intel->intelScreen->kernel_exec_fencing)
+      if (region->tiling != I915_TILING_NONE &&
+         intel->intelScreen->kernel_exec_fencing)
         drm_intel_gem_bo_unmap_gtt(region->buffer);
       else
         dri_bo_unmap(region->buffer);