aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-06-04 17:42:48 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-14 11:36:18 -0400
commite37ec39b180c53dea3106ceb8f247bcba47dfb82 (patch)
tree3f917fe34f6e94f104140664d57b8709bb3442af
parent3af7b8572f5e375421ba6128585972d4a42a0762 (diff)
drm/i915: Ivybridge MI_ARB_ON_OFF context w/a
The workaround itself applies to gen7 only (according to the docs) and as Eric Anholt points out shouldn't be required since we don't use HW scheduling features, and therefore arbitration. Though since it is a small, and simple addition, and we don't really understand the issue, just do it. FWIW, I eventually want to play with some of the arbitration stuff, and I'd hate to forget about this. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c12
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h3
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index fb6aa5e10991..d49d5fc0a592 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -324,10 +324,15 @@ mi_set_context(struct intel_ring_buffer *ring,
324{ 324{
325 int ret; 325 int ret;
326 326
327 ret = intel_ring_begin(ring, 4); 327 ret = intel_ring_begin(ring, 6);
328 if (ret) 328 if (ret)
329 return ret; 329 return ret;
330 330
331 if (IS_GEN7(ring->dev))
332 intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_DISABLE);
333 else
334 intel_ring_emit(ring, MI_NOOP);
335
331 intel_ring_emit(ring, MI_NOOP); 336 intel_ring_emit(ring, MI_NOOP);
332 intel_ring_emit(ring, MI_SET_CONTEXT); 337 intel_ring_emit(ring, MI_SET_CONTEXT);
333 intel_ring_emit(ring, new_context->obj->gtt_offset | 338 intel_ring_emit(ring, new_context->obj->gtt_offset |
@@ -338,6 +343,11 @@ mi_set_context(struct intel_ring_buffer *ring,
338 /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */ 343 /* w/a: MI_SET_CONTEXT must always be followed by MI_NOOP */
339 intel_ring_emit(ring, MI_NOOP); 344 intel_ring_emit(ring, MI_NOOP);
340 345
346 if (IS_GEN7(ring->dev))
347 intel_ring_emit(ring, MI_ARB_ON_OFF | MI_ARB_ENABLE);
348 else
349 intel_ring_emit(ring, MI_NOOP);
350
341 intel_ring_advance(ring); 351 intel_ring_advance(ring);
342 352
343 return ret; 353 return ret;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index bee101208195..14cb714df352 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -210,6 +210,9 @@
210#define MI_DISPLAY_FLIP MI_INSTR(0x14, 2) 210#define MI_DISPLAY_FLIP MI_INSTR(0x14, 2)
211#define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1) 211#define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1)
212#define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20) 212#define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20)
213#define MI_ARB_ON_OFF MI_INSTR(0x08, 0)
214#define MI_ARB_ENABLE (1<<0)
215#define MI_ARB_DISABLE (0<<0)
213#define MI_SET_CONTEXT MI_INSTR(0x18, 0) 216#define MI_SET_CONTEXT MI_INSTR(0x18, 0)
214#define MI_MM_SPACE_GTT (1<<8) 217#define MI_MM_SPACE_GTT (1<<8)
215#define MI_MM_SPACE_PHYSICAL (0<<8) 218#define MI_MM_SPACE_PHYSICAL (0<<8)