]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Micro-optimise hotpath through intel_ring_begin()
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 May 2017 13:08:46 +0000 (14:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 4 May 2017 14:40:38 +0000 (15:40 +0100)
commit112e2c219fa8906540ae7549ff96218a23c1cd06
tree3436e783ba56065ce254fc3ac3c4de9582fab0be
parent9b62196a0ab0ea4b572d45c6b6365d5f2fe38d02
drm/i915: Micro-optimise hotpath through intel_ring_begin()

Typically, there is space available within the ring and if not we have
to wait (by definition a slow path). Rearrange the code to reduce the
number of branches and stack size for the hotpath, accomodating a slight
growth for the wait.

v2: Fix the new assert that packets are not larger than the actual ring.
v3: Make the parameters unsigned as well to make usage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170504130846.4807-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h