From: Chris Wilson Date: Mon, 20 Nov 2017 12:34:57 +0000 (+0000) Subject: drm/i915/execlists: Assert that we don't get mixed IDLE_ACTIVE | COMPLETE events X-Git-Tag: v4.16-rc1~96^2~27^2~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f5f9edb44ca9fd7255cdc60a1880241d2d17e48;p=thirdparty%2Fkernel%2Flinux.git drm/i915/execlists: Assert that we don't get mixed IDLE_ACTIVE | COMPLETE events If IDLE_ACTIVE is set, then all other bits are invalid. For us, we can assert that if we see a COMPLETE | PREEMPTED event, then it should be impossible for it to also contain an IDLE_ACTIVE flag. Suggested-by: Joonas Lahtinen Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: Michal Winiarski Cc: Michel Thierry Link: https://patchwork.freedesktop.org/patch/msgid/20171120123458.23242-3-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen --- diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index a2c7fc7bf4a46..4aed003237808 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -874,6 +874,9 @@ static void execlists_submission_tasklet(unsigned long data) if (!(status & GEN8_CTX_STATUS_COMPLETED_MASK)) continue; + /* We should never get a COMPLETED | IDLE_ACTIVE! */ + GEM_BUG_ON(status & GEN8_CTX_STATUS_IDLE_ACTIVE); + if (status & GEN8_CTX_STATUS_COMPLETE && buf[2*head + 1] == PREEMPT_ID) { execlists_cancel_port_requests(execlists);