aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-12-07 08:40:37 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2018-12-07 10:15:24 -0500
commita889580c087a9cf91fddb3832ece284174214183 (patch)
tree50b67fef76b204d5b5fa6c7a0a63feb32730bf42 /drivers/gpu/drm/i915/intel_ringbuffer.c
parente6154e4cb8b0d3692f84ca0d66b4e1ba0389b134 (diff)
drm/i915: Flush GPU relocs harder for gen3
Adding an extra MI_STORE_DWORD_IMM to the gpu relocation path for gen3 was good, but still not good enough. To survive 24+ hours under test we needed to perform not one, not two but three extra store-dw. Doing so for each GPU relocation was a little unsightly and since we need to worry about userspace hitting the same issues, we should apply the dummy store-dw into the EMIT_FLUSH. Fixes: 7dd4f6729f92 ("drm/i915: Async GPU relocation processing") References: 7fa28e146994 ("drm/i915: Write GPU relocs harder with gen3") Testcase: igt/gem_tiled_fence_blits # blb/pnv Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181207134037.11848-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 74a4d587c312..02f6a9b81083 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -69,19 +69,28 @@ unsigned int intel_ring_update_space(struct intel_ring *ring)
69static int 69static int
70gen2_render_ring_flush(struct i915_request *rq, u32 mode) 70gen2_render_ring_flush(struct i915_request *rq, u32 mode)
71{ 71{
72 unsigned int num_store_dw;
72 u32 cmd, *cs; 73 u32 cmd, *cs;
73 74
74 cmd = MI_FLUSH; 75 cmd = MI_FLUSH;
75 76 num_store_dw = 0;
76 if (mode & EMIT_INVALIDATE) 77 if (mode & EMIT_INVALIDATE)
77 cmd |= MI_READ_FLUSH; 78 cmd |= MI_READ_FLUSH;
79 if (mode & EMIT_FLUSH)
80 num_store_dw = 4;
78 81
79 cs = intel_ring_begin(rq, 2); 82 cs = intel_ring_begin(rq, 2 + 3 * num_store_dw);
80 if (IS_ERR(cs)) 83 if (IS_ERR(cs))
81 return PTR_ERR(cs); 84 return PTR_ERR(cs);
82 85
83 *cs++ = cmd; 86 *cs++ = cmd;
84 *cs++ = MI_NOOP; 87 while (num_store_dw--) {
88 *cs++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
89 *cs++ = i915_scratch_offset(rq->i915);
90 *cs++ = 0;
91 }
92 *cs++ = MI_FLUSH | MI_NO_WRITE_FLUSH;
93
85 intel_ring_advance(rq, cs); 94 intel_ring_advance(rq, cs);
86 95
87 return 0; 96 return 0;