intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged
@ 2011-07-20  0:28 Keith Packard
  2011-07-20 22:28 ` Chris Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Packard @ 2011-07-20  0:28 UTC (permalink / raw)
  To: intel-gfx

Failing to pin a scanout buffer will most likely lead to a black
screen, so if the GPU is wedged, then just let the pin happen and hope
that things work out OK.

v2: Just ignore any error from i915_gem_object_wait_rendering, as
suggested by Chris Wilson

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e9d1d5c..e46f273 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3113,7 +3113,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 
 	if (pipelined != obj->ring) {
 		ret = i915_gem_object_wait_rendering(obj);
-		if (ret)
+		if (ret == -ERESTARTSYS)
 			return ret;
 	}
 
-- 
1.7.5.4

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

* Re: [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged
  2011-07-20  0:28 [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged Keith Packard
@ 2011-07-20 22:28 ` Chris Wilson
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2011-07-20 22:28 UTC (permalink / raw)
  To: Keith Packard, intel-gfx

On Tue, 19 Jul 2011 17:28:53 -0700, Keith Packard <keithp@keithp.com> wrote:
> Failing to pin a scanout buffer will most likely lead to a black
> screen, so if the GPU is wedged, then just let the pin happen and hope
> that things work out OK.
> 
> v2: Just ignore any error from i915_gem_object_wait_rendering, as
> suggested by Chris Wilson
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>

I couldn't find a way to make this any simpler, or spot why it couldn't
possible work, so
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

For the sake of our sanity, we should document which paths we think can
safely ignore GPU hangs. Can we detect lockups in any other functions?
Would any of the test signals help us diagnose which link in the chain
failed?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged
  2011-07-20  0:03 ` Chris Wilson
@ 2011-07-20  0:22   ` Keith Packard
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Packard @ 2011-07-20  0:22 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 767 bytes --]

On Wed, 20 Jul 2011 01:03:17 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:

> This doesn't prevent us returning an error should the wait-rendering abort
> due to a GPU hang occurring in the middle of the wait.

Yeah, should probably check the return value and ignore the error instead.

> i915_gem_object_pin_to_display_plane is used for more than just the
> scanout, cursors and overlay are also included, otherwise we could just
> ignore any errors. So,

Given that the GPU is wedged, I don't see any problem pinning any of
these instead of failing.

> /* Update the display engine regardless of any GPU hangs */
> if (ret == -ERESTARTSYS)
> 	return ret;

Yeah, that seems simpler in all ways. Much nicer.

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged
  2011-07-19 23:26 Keith Packard
@ 2011-07-20  0:03 ` Chris Wilson
  2011-07-20  0:22   ` Keith Packard
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2011-07-20  0:03 UTC (permalink / raw)
  To: Keith Packard, intel-gfx

On Tue, 19 Jul 2011 16:26:43 -0700, Keith Packard <keithp@keithp.com> wrote:
> Failing to pin a scanout buffer will most likely lead to a black
> screen, so if the GPU is wedged, then just let the pin happen and hope
> that things work out OK.

This doesn't prevent us returning an error should the wait-rendering abort
due to a GPU hang occurring in the middle of the wait.

i915_gem_object_pin_to_display_plane is used for more than just the
scanout, cursors and overlay are also included, otherwise we could just
ignore any errors. So,

/* Update the display engine regardless of any GPU hangs */
if (ret == -ERESTARTSYS)
	return ret;

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged
@ 2011-07-19 23:26 Keith Packard
  2011-07-20  0:03 ` Chris Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Packard @ 2011-07-19 23:26 UTC (permalink / raw)
  To: intel-gfx

Failing to pin a scanout buffer will most likely lead to a black
screen, so if the GPU is wedged, then just let the pin happen and hope
that things work out OK.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/gpu/drm/i915/i915_gem.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e9d1d5c..d8d623e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3112,9 +3112,15 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 		return ret;
 
 	if (pipelined != obj->ring) {
-		ret = i915_gem_object_wait_rendering(obj);
-		if (ret)
-			return ret;
+		struct drm_device *dev = obj->base.dev;
+		drm_i915_private_t *dev_priv = dev->dev_private;
+		if (atomic_read(&dev_priv->mm.wedged)) {
+			DRM_ERROR("Skip GPU wait for scanout while wedged\n");
+		} else {
+			ret = i915_gem_object_wait_rendering(obj);
+			if (ret)
+				return ret;
+		}
 	}
 
 	/* The display engine is not coherent with the LLC cache on gen6.  As
-- 
1.7.5.4

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

end of thread, other threads:[~2011-07-20 22:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-20  0:28 [PATCH] drm/i915: Skip GPU wait for scanout pin while wedged Keith Packard
2011-07-20 22:28 ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2011-07-19 23:26 Keith Packard
2011-07-20  0:03 ` Chris Wilson
2011-07-20  0:22   ` Keith Packard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).