]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Cache ringbuf pointer in request structure
authorJohn Harrison <John.C.Harrison@Intel.com>
Fri, 13 Feb 2015 11:48:12 +0000 (11:48 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Feb 2015 21:53:10 +0000 (22:53 +0100)
commit7a44913310fbda81af978dd2584ad6c983871e26
treeb99d517d8b04653117ab492e7bf752a24a9a2580
parentc7eeedf3406e4c2a61b8c0ac20b2d3367d785478
drm/i915: Cache ringbuf pointer in request structure

In execlist mode, the ringbuf is a function of the ring and context whereas in
legacy mode, it is derived from the ring alone. Thus the calculation required to
determine the ringbuf pointer from the ring (and context) also needs to test
execlist mode or not. This is messy.

Further, the request structure holds a pointer to both the ring and the context
for which it was created. Thus, given a request, it is possible to derive the
ringbuf in either legacy or execlist mode. Hence it is necessary to pass just
the request in to all the low level functions rather than some combination of
request, ring, context and ringbuf. However, rather than recalculating it each
time, it is much simpler to just cache the ringbuf pointer in the request
structure itself.

Caching the pointer means the calculation is done once at request creation time
and all further code and simply read it directly from the request structure.

OTC-Jira: VIZ-5115
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
[danvet: Drop contentless comment in lrc alloc request entirely. And
spelling fix in the commit message.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c