]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Empty the ring before disabling
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 Oct 2017 09:43:11 +0000 (10:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 Oct 2017 11:09:29 +0000 (12:09 +0100)
commit3e82a6a185410bc4646a1f81838d48141c5f4c9c
tree2528a96186675d35d2a3fdba9f5195beb18a44c0
parent69e3db6c45453fc0503f7dad1b63da3350cf041d
drm/i915: Empty the ring before disabling

An interesting snippet from Sandybridge's prm:

"Although a Ring Buffer can be enabled in the non-empty state, it must
not be disabled unless it is empty. Attempting to disable a Ring Buffer
in the non-empty state is UNDEFINED."

Let's avoid the undefined behaviour as we disable the rings prior to
reset and resume.

v2: Tell HEAD to catch up to TAIL (empty ring) first, then reset both to
0 (supposedly while stopped).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171027094311.30380-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_uncore.c