i965: Always use CPU mappings for BOs on LLC platforms.
authorEric Anholt <eric@anholt.net>
Thu, 27 Feb 2014 18:05:39 +0000 (10:05 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 14 Mar 2014 19:56:22 +0000 (12:56 -0700)
It looks like there's no big difference for write-only workloads, but
using a CPU map means that if they happen to read without having set the
MAP_READ_BIT, they get 100x the performance for those reads.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/intel_buffer_objects.c

index e496836905a3b121bef2c42b1a068c67755021d8..260308a80a26f3d21d3f7287a58cd05733f0e282 100644 (file)
@@ -429,7 +429,7 @@ intel_bufferobj_map_range(struct gl_context * ctx,
 
    if (access & GL_MAP_UNSYNCHRONIZED_BIT)
       drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer);
-   else if (!(access & GL_MAP_READ_BIT)) {
+   else if (!brw->has_llc && !(access & GL_MAP_READ_BIT)) {
       drm_intel_gem_bo_map_gtt(intel_obj->buffer);
       intel_bufferobj_mark_inactive(intel_obj);
    } else {