]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Reserve space improvements
authorJohn Harrison <John.C.Harrison@Intel.com>
Tue, 30 Jun 2015 11:40:55 +0000 (12:40 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 3 Jul 2015 05:38:59 +0000 (07:38 +0200)
commit541e06f31591b05944a6925e606173b31e47fa8e
tree0e0a57996f0e1e0ba94ef8ae2efe682026ff7ca1
parentc3eb2c3afd612bd7b031f505f210a99b735a6b54
drm/i915: Reserve space improvements

An earlier patch was added to reserve space in the ring buffer for the
commands issued during 'add_request()'. The initial version was
pessimistic in the way it handled buffer wrapping and would cause
premature wraps and thus waste ring space.

This patch updates the code to better handle the wrap case. It no
longer enforces that the space being asked for and the reserved space
are a single contiguous block. Instead, it allows the reserve to be on
the far end of a wrap operation. It still guarantees that the space is
available so when the wrap occurs, no wait will happen. Thus the wrap
cannot fail which is the whole point of the exercise.

Also fixed a merge failure with some comments from the original patch.

v2: Incorporated suggestion by David Gordon to move the wrap code
inside the prepare function and thus allow a single combined
wait_for_space() call rather than doing one before the wrap and
another after. This also makes the prepare code much simpler and
easier to follow.

v3: Fix for 'effective_size' vs 'size' during ring buffer remainder
calculations (spotted by Tomas Elf).

For: VIZ-5115
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h