[Intel-gfx] [PATCH 3/7] drm/i915: Assign request ringbuf before pin
Chris Wilson
chris at chris-wilson.co.uk
Fri Jul 3 07:11:46 PDT 2015
On Fri, Jul 03, 2015 at 05:09:34PM +0300, Mika Kuoppala wrote:
> In preparation to make intel_lr_context_pin|unpin to accept
> requests, assign ringbuf into request before we call the pinning.
>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 4139eb6..ab8a98c 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -633,14 +633,16 @@ 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)
> + if (ret) {
> + request->ringbuf = NULL;
You don't need to unset it again. We just trash the request on error.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list