linux_dsm_epyc7002/drivers/gpu/drm/i915
Daniel Vetter 53d227f282 drm/i915: fixup seqno allocation logic for lazy_request
Currently we reserve seqnos only when we emit the request to the ring
(by bumping dev_priv->next_seqno), but start using it much earlier for
ring->oustanding_lazy_request. When 2 threads compete for the gpu and
run on two different rings (e.g. ddx on blitter vs. compositor)
hilarity ensued, especially when we get constantly interrupted while
reserving buffers.

Breakage seems to have been introduced in

commit 6f392d5486
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 7 11:01:22 2010 +0100

    drm/i915: Use a common seqno for all rings.

This patch fixes up the seqno reservation logic by moving it into
i915_gem_next_request_seqno. The ring->add_request functions now
superflously still return the new seqno through a pointer, that will
be refactored in the next patch.

Note that with this change we now unconditionally allocate a seqno,
even when ->add_request might fail because the rings are full and the
gpu died. But this does not open up a new can of worms because we can
already leave behind an outstanding_request_seqno if e.g. the caller
gets interrupted with a signal while stalling for the gpu in the
eviciton paths. And with the bugfix we only ever have one seqno
allocated per ring (and only that ring), so there are no ordering
issues with multiple outstanding seqnos on the same ring.

v2: Keep i915_gem_get_seqno (but move it to i915_gem.c) to make it
clear that we only have one seqno counter for all rings. Suggested by
Chris Wilson.

v3: As suggested by Chris Wilson use i915_gem_next_request_seqno
instead of ring->oustanding_lazy_request to make the follow-up
refactoring more clearly correct. Also improve the commit message
with issues discussed on irc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45181
Tested-by: Nicolas Kalkhof nkalkhof()at()web.de
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-13 10:55:57 +01:00
..
dvo_ch7xxx.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ch7017.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ivch.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_sil164.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_tfp410.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo.h
i915_debugfs.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
i915_dma.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
i915_drv.c drm/i915: check gtfifodbg after possibly failed writes 2012-02-12 00:21:41 +01:00
i915_drv.h drm/i915: fixup seqno allocation logic for lazy_request 2012-02-13 10:55:57 +01:00
i915_gem_debug.c drm/i915: drop KM_USER0 argument to k(un)map_atomic 2011-10-20 15:26:37 -07:00
i915_gem_evict.c drm/i915: argument to control retiring behavior 2012-01-26 11:19:19 +01:00
i915_gem_execbuffer.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
i915_gem_gtt.c drm/i915: ppgtt binding/unbinding support 2012-02-09 21:25:23 +01:00
i915_gem_tiling.c drm/i915: swizzling support for snb/ivb 2012-02-08 23:16:24 +01:00
i915_gem.c drm/i915: fixup seqno allocation logic for lazy_request 2012-02-13 10:55:57 +01:00
i915_ioc32.c
i915_irq.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
i915_reg.h drm/i915: use gtfifodbg 2012-02-12 00:21:16 +01:00
i915_suspend.c drm/i915: Re-enable gen7 RC6 and GPU turbo after resume. 2012-01-24 13:25:10 -08:00
i915_trace_points.c
i915_trace.h Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_acpi.c drm/i915: Silence _DSM errors 2012-01-16 21:08:19 +01:00
intel_bios.c drm/i915: Use kcalloc instead of kzalloc to allocate array 2012-01-17 17:33:24 +01:00
intel_bios.h drm/i915: VBT Parser cleanup for eDP block 2012-01-13 08:37:44 -08:00
intel_crt.c drm/i915: don't allow interlaced pipeconf on gen2 2012-02-10 17:28:45 +01:00
intel_display.c drm/i915: use gtfifodbg 2012-02-12 00:21:16 +01:00
intel_dp.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
intel_drv.h drm/i915: Separate fence pin counting from normal bind pin counting 2012-01-29 18:23:37 +01:00
intel_dvo.c drm/i915: fixup interlaced vertical timings confusion, part 1 2012-02-10 17:24:06 +01:00
intel_fb.c drm/i915: add SNB and IVB video sprite support v6 2012-01-03 09:31:09 -08:00
intel_hdmi.c drm/i915: allow interlaced mode output on the HDMI connector 2012-02-10 17:28:49 +01:00
intel_i2c.c gpu: Add export.h as required to drivers/gpu files. 2011-10-31 19:32:03 -04:00
intel_lvds.c drm/i915: no lvds quirk for AOpen MP45 2012-02-08 09:20:49 -08:00
intel_modes.c drm/i915: pass ELD to HDMI/DP audio driver 2011-09-21 14:52:41 -07:00
intel_opregion.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_overlay.c drm/i915: fixup overlay checks for interlaced modes 2012-02-10 17:43:49 +01:00
intel_panel.c drm/i915: fixup interlaced vertical timings confusion, part 1 2012-02-10 17:24:06 +01:00
intel_ringbuffer.c drm/i915: fixup seqno allocation logic for lazy_request 2012-02-13 10:55:57 +01:00
intel_ringbuffer.h drm/i915: switch ring->id to be a real id 2012-01-29 17:32:58 +01:00
intel_sdvo_regs.h misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
intel_sdvo.c drm/i915: allow interlaced mode output on the SDVO connector 2012-02-10 17:28:48 +01:00
intel_sprite.c Merge remote-tracking branch 'airlied/drm-fixes' into drm-intel-next-queued 2012-02-10 17:14:49 +01:00
intel_tv.c drm/i915: fixup interlaced vertical timings confusion, part 1 2012-02-10 17:24:06 +01:00
Makefile drm/i915: kill i915_mem.c 2012-01-17 20:01:01 +01:00