aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-04-08 09:28:40 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-18 03:43:11 -0400
commit4615d4c9e27eda42c3e965f208a4b4065841498c (patch)
treeda45fd1c1644445310af66f67420576bf9da11a2
parent57d277bbfcfbacaf1dc738bf23279cc60d5cda65 (diff)
drm/i915: Use MLC (l3$) for context objects
Enabling context support increases SwapBuffers latency by about 20% (measured on an i7-3720qm). We can offset that loss slightly by enabling faster caching for the contexts. As they are not backed by any particular cache (such as the sampler or render caches) our only option is to select the generic mid-level cache. This reduces the latency of the swap by about 5%. Oddly this effect can be observed running smokin-guns on IVB at 1280x1024: Using BLT copies for swaps: 151.67 fps Using Render copies for swaps (unpatched): 141.70 fps With contexts disabled: 150.23 fps With contexts in L3$: 150.77 fps Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 94d873a6cffb..a1e8ecb6adf6 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -152,6 +152,13 @@ create_hw_context(struct drm_device *dev,
152 return ERR_PTR(-ENOMEM); 152 return ERR_PTR(-ENOMEM);
153 } 153 }
154 154
155 if (INTEL_INFO(dev)->gen >= 7) {
156 ret = i915_gem_object_set_cache_level(ctx->obj,
157 I915_CACHE_LLC_MLC);
158 if (ret)
159 goto err_out;
160 }
161
155 /* The ring associated with the context object is handled by the normal 162 /* The ring associated with the context object is handled by the normal
156 * object tracking code. We give an initial ring value simple to pass an 163 * object tracking code. We give an initial ring value simple to pass an
157 * assertion in the context switch code. 164 * assertion in the context switch code.