All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: prevent gt fifo count underflow
@ 2014-05-14 12:10 Mika Kuoppala
  2014-05-14 13:18 ` Mika Kuoppala
  0 siblings, 1 reply; 5+ messages in thread
From: Mika Kuoppala @ 2014-05-14 12:10 UTC (permalink / raw)
  To: intel-gfx

If we get the final value of zero as a count of free
entries available, we will underflow our own fifo_count
and then it will take a long time before we check things again.
Admittedly we are in trouble already if we get into this situation,
but prevent the underflow by checking against zero before decreasing
fifo_count.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 76dc185..159f8ab 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -174,7 +174,7 @@ static int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)
 		}
 		if (WARN_ON(loop < 0 && fifo <= GT_FIFO_NUM_RESERVED_ENTRIES))
 			++ret;
-		dev_priv->uncore.fifo_count = fifo;
+		dev_priv->uncore.fifo_count = fifo ?: 1;
 	}
 	dev_priv->uncore.fifo_count--;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-14 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-14 12:10 [PATCH] drm/i915: prevent gt fifo count underflow Mika Kuoppala
2014-05-14 13:18 ` Mika Kuoppala
2014-05-14 13:35   ` Ville Syrjälä
2014-05-14 13:48     ` Chris Wilson
2014-05-14 14:22     ` [PATCH v3] " Mika Kuoppala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.