From: Chris Wilson Date: Fri, 26 Feb 2016 11:22:31 +0000 (+0000) Subject: drm/i915: Execlists cannot pin a context without the object X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2743179d955bd7313bb68517d9d0de57b0b873f7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Execlists cannot pin a context without the object Given that the intel_lr_context_pin cannot succeed without the object, we cannot reach intel_lr_context_unpin() without first allocating that object - so we can remove the redundant test. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: http://patchwork.freedesktop.org/patch/msgid/1456485751-15213-1-git-send-email-tvrtko.ursulin@linux.intel.com --- diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index b594d890fd8d..6a978ce80244 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1145,10 +1145,6 @@ void intel_lr_context_unpin(struct intel_context *ctx, struct drm_i915_gem_object *ctx_obj = ctx->engine[engine->id].state; WARN_ON(!mutex_is_locked(&ctx->i915->dev->struct_mutex)); - - if (WARN_ON_ONCE(!ctx_obj)) - return; - if (--ctx->engine[engine->id].pin_count == 0) { kunmap(kmap_to_page(ctx->engine[engine->id].lrc_reg_state)); intel_unpin_ringbuffer_obj(ctx->engine[engine->id].ringbuf);