intel: Make use of the new GPU-unsynchronized map functionality in libdrm.
authorEric Anholt <eric@anholt.net>
Fri, 24 Feb 2012 23:54:32 +0000 (15:54 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 21 Mar 2012 19:45:06 +0000 (12:45 -0700)
Improves Unigine Tropics performance at 1024x768 by 2.06236% +/-
0.50272% (n=11).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_buffer_objects.c

index 26f23fd0cb09457e29c5d5604b677d678cc78a69..d2a0709768842739ebb97d2b85798fe2907ddec6 100644 (file)
@@ -367,7 +367,9 @@ intel_bufferobj_map_range(struct gl_context * ctx,
       return obj->Pointer;
    }
 
-   if (!(access & GL_MAP_READ_BIT)) {
+   if (access & GL_MAP_UNSYNCHRONIZED_BIT)
+      drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer);
+   else if (!(access & GL_MAP_READ_BIT)) {
       drm_intel_gem_bo_map_gtt(intel_obj->buffer);
    } else {
       drm_intel_bo_map(intel_obj->buffer, (access & GL_MAP_WRITE_BIT) != 0);