aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2015-02-13 06:48:12 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-25 16:53:10 -0500
commit98e1bd4ae68e0a122de21795c946ba36a8259f70 (patch)
treeb99d517d8b04653117ab492e7bf752a24a9a2580 /drivers/gpu/drm/i915/i915_drv.h
parent5e4be7bda1e3ca00c6f49a74991f438c720c6f4e (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ba0f5b690291..239a382c8b55 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2156,8 +2156,9 @@ struct drm_i915_gem_request {
2156 /** Position in the ringbuffer of the end of the whole request */ 2156 /** Position in the ringbuffer of the end of the whole request */
2157 u32 tail; 2157 u32 tail;
2158 2158
2159 /** Context related to this request */ 2159 /** Context and ring buffer related to this request */
2160 struct intel_context *ctx; 2160 struct intel_context *ctx;
2161 struct intel_ringbuffer *ringbuf;
2161 2162
2162 /** Batch buffer related to this request if any */ 2163 /** Batch buffer related to this request if any */
2163 struct drm_i915_gem_object *batch_obj; 2164 struct drm_i915_gem_object *batch_obj;