diff mbox

[2/4] drm/i915: Only trigger missed-seqno checking next to boundary

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

Commit Message

Chris Wilson June 27, 2018, 8:13 p.m. UTC
If we have more interrupts pending (because we know there are more
breadcrumb signals before the completion), then we do not need to
trigger an irq_seqno_barrier or even wakeup the task on this interrupt
as there will be another. To allow some margin of error (we are trying
to work around incoherent seqno after all), we wakeup the breadcrumb
before the target as well as on the target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mika Kuoppala June 28, 2018, 8:06 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> If we have more interrupts pending (because we know there are more
> breadcrumb signals before the completion), then we do not need to
> trigger an irq_seqno_barrier or even wakeup the task on this interrupt
> as there will be another. To allow some margin of error (we are trying
> to work around incoherent seqno after all), we wakeup the breadcrumb
> before the target as well as on the target.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Thanks for splitting this out.

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

> ---
>  drivers/gpu/drm/i915/i915_irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 56a080bc4498..55aba89adfb1 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1182,7 +1182,8 @@ static void notify_ring(struct intel_engine_cs *engine)
>  
>  			tsk = wait->tsk;
>  		} else {
> -			if (engine->irq_seqno_barrier) {
> +			if (engine->irq_seqno_barrier &&
> +			    i915_seqno_passed(seqno, wait->seqno - 1)) {
>  				set_bit(ENGINE_IRQ_BREADCRUMB,
>  					&engine->irq_posted);
>  				tsk = wait->tsk;
> -- 
> 2.18.0
Chris Wilson June 28, 2018, 8:06 p.m. UTC | #2
Quoting Mika Kuoppala (2018-06-28 09:06:37)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > If we have more interrupts pending (because we know there are more
> > breadcrumb signals before the completion), then we do not need to
> > trigger an irq_seqno_barrier or even wakeup the task on this interrupt
> > as there will be another. To allow some margin of error (we are trying
> > to work around incoherent seqno after all), we wakeup the breadcrumb
> > before the target as well as on the target.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> 
> Thanks for splitting this out.
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

And applied, thanks for the review.

Fingers crossed as always when touching interrupt handling.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 56a080bc4498..55aba89adfb1 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1182,7 +1182,8 @@  static void notify_ring(struct intel_engine_cs *engine)
 
 			tsk = wait->tsk;
 		} else {
-			if (engine->irq_seqno_barrier) {
+			if (engine->irq_seqno_barrier &&
+			    i915_seqno_passed(seqno, wait->seqno - 1)) {
 				set_bit(ENGINE_IRQ_BREADCRUMB,
 					&engine->irq_posted);
 				tsk = wait->tsk;