summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lrc.c
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2015-05-29 17:43:26 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-06-23 14:01:58 +0200
commit40e895ceca40b9c3104b2abd0ed5c72650fb20a4 (patch)
treeb745bcc65b18aa6685fab276a889ef79a96ddeca /drivers/gpu/drm/i915/intel_lrc.c
parent0c8dac889539ab26382ba1636ec1159cae73f2b3 (diff)
downloadtalos-obmc-linux-40e895ceca40b9c3104b2abd0ed5c72650fb20a4.tar.gz
talos-obmc-linux-40e895ceca40b9c3104b2abd0ed5c72650fb20a4.zip
drm/i915: Set context in request from creation even in legacy mode
In execlist mode, the context object pointer is written in to the request structure (and reference counted) at the point of request creation. In legacy mode, this only happens inside i915_add_request(). This patch updates the legacy code path to match the execlist version. This allows all the intermediate code between request creation and request submission to get at the context object given only a request structure. Thus negating the need to pass context pointers here, there and everywhere. v2: Moved the context reference so it does not need to be undone if the get_seqno() fails. v3: Fixed execlist mode always hitting a warning about invalid last_contexts (which don't exist in execlist mode). v4: Updated for new i915_gem_request_alloc() scheme. For: VIZ-5115 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>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 5373b0d1068a..6f3ec7197d89 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -659,20 +659,17 @@ static int execlists_move_to_gpu(struct intel_ringbuffer *ringbuf,
return logical_ring_invalidate_all_caches(ringbuf, ctx);
}
-int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request,
- struct intel_context *ctx)
+int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request)
{
int ret;
- if (ctx != request->ring->default_context) {
- ret = intel_lr_context_pin(request->ring, ctx);
+ if (request->ctx != request->ring->default_context) {
+ ret = intel_lr_context_pin(request->ring, request->ctx);
if (ret)
return ret;
}
- request->ringbuf = ctx->engine[request->ring->id].ringbuf;
- request->ctx = ctx;
- i915_gem_context_reference(request->ctx);
+ request->ringbuf = request->ctx->engine[request->ring->id].ringbuf;
return 0;
}
OpenPOWER on IntegriCloud