]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Wrap around the tail offset before setting ring->tail
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Jun 2018 11:08:45 +0000 (12:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Jun 2018 13:03:49 +0000 (14:03 +0100)
commit9de0926d5cc5555f162f810d4ed89cc668a5c795
tree755292c6753cfc09aa1707871eba43a20e041ffd
parent738b0f4c649188773fef5690c7eee6da23d5e59c
drm/i915: Wrap around the tail offset before setting ring->tail

The HW only accepts offsets within ring->size, and fails peculiarly if
the RING_HEAD or RING_TAIL is set to ring->size. Therefore whenever we
set ring->head/ring->tail we want to make sure it is within value (using
intel_ring_wrap()).

v2: Double check execlists as well
v3: Remove redundancy with assert_ring_tail_valid()
v4: Just assert in intel_ring_reset() rather than be over-defensive.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v2
Link: https://patchwork.freedesktop.org/patch/msgid/20180611110845.31890-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h