Skip to content

Commit ce81a65

Browse files
mwiniarsmikuint
authored andcommitted
drm/i915: Adjust size of PIPE_CONTROL used for gen8 render seqno write
We started to use PIPE_CONTROL to write render ring seqno in order to combat seqno write vs interrupt generation problems. This was introduced by commit 7c17d37 ("drm/i915: Use ordered seqno write interrupt generation on gen8+ execlists"). On gen8+ size of PIPE_CONTROL with Post Sync Operation should be 6 dwords. When we're using older 5-dword variant it's possible to observe inconsistent values written by PIPE_CONTROL with Post Sync Operation from user batches, resulting in rendering corruptions. v2: Fix BAT failures v3: Comments on alignment and thrashing high dword of seqno (Chris) v4: Updated commit msg (Mika) Testcase: igt/gem_pipe_control_store_loop/*-qword-write Issue: VIZ-7393 Cc: [email protected] Cc: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Abdiel Janulgue <[email protected]> Signed-off-by: Michał Winiarski <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Tested-by: Abdiel Janulgue <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 97ea6be commit ce81a65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,23 +1954,29 @@ static int gen8_emit_request_render(struct drm_i915_gem_request *request)
19541954
struct intel_ringbuffer *ringbuf = request->ringbuf;
19551955
int ret;
19561956

1957-
ret = intel_logical_ring_begin(request, 6 + WA_TAIL_DWORDS);
1957+
ret = intel_logical_ring_begin(request, 8 + WA_TAIL_DWORDS);
19581958
if (ret)
19591959
return ret;
19601960

1961+
/* We're using qword write, seqno should be aligned to 8 bytes. */
1962+
BUILD_BUG_ON(I915_GEM_HWS_INDEX & 1);
1963+
19611964
/* w/a for post sync ops following a GPGPU operation we
19621965
* need a prior CS_STALL, which is emitted by the flush
19631966
* following the batch.
19641967
*/
1965-
intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(5));
1968+
intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6));
19661969
intel_logical_ring_emit(ringbuf,
19671970
(PIPE_CONTROL_GLOBAL_GTT_IVB |
19681971
PIPE_CONTROL_CS_STALL |
19691972
PIPE_CONTROL_QW_WRITE));
19701973
intel_logical_ring_emit(ringbuf, hws_seqno_address(request->engine));
19711974
intel_logical_ring_emit(ringbuf, 0);
19721975
intel_logical_ring_emit(ringbuf, i915_gem_request_get_seqno(request));
1976+
/* We're thrashing one dword of HWS. */
1977+
intel_logical_ring_emit(ringbuf, 0);
19731978
intel_logical_ring_emit(ringbuf, MI_USER_INTERRUPT);
1979+
intel_logical_ring_emit(ringbuf, MI_NOOP);
19741980
return intel_logical_ring_advance_and_submit(request);
19751981
}
19761982

0 commit comments

Comments
 (0)