diff mbox

drm/i915/execlists: Detect an out-of-order context switch

Message ID 20170223145031.26210-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Feb. 23, 2017, 2:50 p.m. UTC
We require that the request is completed before the context is switched
away.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_lrc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mika Kuoppala Feb. 24, 2017, 12:49 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> We require that the request is completed before the context is switched
> away.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 8b64af63f914..a331fd36992f 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -594,6 +594,7 @@ static void intel_lrc_irq_handler(unsigned long data)
>  			GEM_BUG_ON(port[0].count == 0);
>  			if (--port[0].count == 0) {
>  				GEM_BUG_ON(status & GEN8_CTX_STATUS_PREEMPTED);
> +				GEM_BUG_ON(!i915_gem_request_completed(port[0].request));
>  				execlists_context_status_change(port[0].request,
>  								INTEL_CONTEXT_SCHEDULE_OUT);
>  
> -- 
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson Feb. 24, 2017, 1:38 p.m. UTC | #2
On Fri, Feb 24, 2017 at 02:49:25PM +0200, Mika Kuoppala wrote:
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > We require that the request is completed before the context is switched
> > away.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

Thanks, I hope this will help catch problems (sloppy seqno coherency)
earlier before it shows up as an explosion in reset.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 8b64af63f914..a331fd36992f 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -594,6 +594,7 @@  static void intel_lrc_irq_handler(unsigned long data)
 			GEM_BUG_ON(port[0].count == 0);
 			if (--port[0].count == 0) {
 				GEM_BUG_ON(status & GEN8_CTX_STATUS_PREEMPTED);
+				GEM_BUG_ON(!i915_gem_request_completed(port[0].request));
 				execlists_context_status_change(port[0].request,
 								INTEL_CONTEXT_SCHEDULE_OUT);