From: Mika Kuoppala Date: Mon, 6 Jul 2015 08:08:30 +0000 (+0300) Subject: drm/i915: Assign request ringbuf before pin X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3cc01f0948c1deb12cfb1da2959f391229c9d4b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Assign request ringbuf before pin In preparation to make intel_lr_context_pin|unpin to accept requests, assign ringbuf into request before we call the pinning. v2: No need to unset ringbuf on error path (Chris) Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 8e1619a06f3b..fd285d32f62a 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -633,14 +633,14 @@ int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request { int ret; + request->ringbuf = request->ctx->engine[request->ring->id].ringbuf; + if (request->ctx != request->ring->default_context) { ret = intel_lr_context_pin(request->ring, request->ctx); if (ret) return ret; } - request->ringbuf = request->ctx->engine[request->ring->id].ringbuf; - return 0; }