* [PATCH] drm/i915: Make wait-for-pending-flips more defensive
@ 2014-08-20 12:13 Chris Wilson
2014-08-20 13:12 ` Ville Syrjälä
2014-08-26 11:49 ` Jani Nikula
0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2014-08-20 12:13 UTC (permalink / raw)
To: intel-gfx
Be sure to always flush a stuck pageflip even if we couldn't possibly
expect one to be there.
References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_display.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a7582a46e82e..5898e7157c4c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3359,11 +3359,7 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- if (crtc->primary->fb == NULL)
- return;
-
WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
-
if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
!intel_crtc_has_pending_flip(crtc),
60*HZ) == 0)) {
@@ -3378,9 +3374,11 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
spin_unlock_irqrestore(&dev->event_lock, flags);
}
- mutex_lock(&dev->struct_mutex);
- intel_finish_fb(crtc->primary->fb);
- mutex_unlock(&dev->struct_mutex);
+ if (crtc->primary->fb) {
+ mutex_lock(&dev->struct_mutex);
+ intel_finish_fb(crtc->primary->fb);
+ mutex_unlock(&dev->struct_mutex);
+ }
}
/* Program iCLKIP clock to the desired frequency */
--
2.1.0.rc1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Make wait-for-pending-flips more defensive
2014-08-20 12:13 [PATCH] drm/i915: Make wait-for-pending-flips more defensive Chris Wilson
@ 2014-08-20 13:12 ` Ville Syrjälä
2014-08-26 11:49 ` Jani Nikula
1 sibling, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2014-08-20 13:12 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Wed, Aug 20, 2014 at 01:13:34PM +0100, Chris Wilson wrote:
> Be sure to always flush a stuck pageflip even if we couldn't possibly
> expect one to be there.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a7582a46e82e..5898e7157c4c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3359,11 +3359,7 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> struct drm_device *dev = crtc->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
>
> - if (crtc->primary->fb == NULL)
> - return;
> -
> WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
> -
> if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> !intel_crtc_has_pending_flip(crtc),
> 60*HZ) == 0)) {
> @@ -3378,9 +3374,11 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> spin_unlock_irqrestore(&dev->event_lock, flags);
> }
>
> - mutex_lock(&dev->struct_mutex);
> - intel_finish_fb(crtc->primary->fb);
> - mutex_unlock(&dev->struct_mutex);
> + if (crtc->primary->fb) {
> + mutex_lock(&dev->struct_mutex);
> + intel_finish_fb(crtc->primary->fb);
> + mutex_unlock(&dev->struct_mutex);
> + }
> }
>
> /* Program iCLKIP clock to the desired frequency */
> --
> 2.1.0.rc1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Make wait-for-pending-flips more defensive
2014-08-20 12:13 [PATCH] drm/i915: Make wait-for-pending-flips more defensive Chris Wilson
2014-08-20 13:12 ` Ville Syrjälä
@ 2014-08-26 11:49 ` Jani Nikula
2014-08-26 12:14 ` Chris Wilson
2014-08-26 12:51 ` Daniel Vetter
1 sibling, 2 replies; 5+ messages in thread
From: Jani Nikula @ 2014-08-26 11:49 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On Wed, 20 Aug 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Be sure to always flush a stuck pageflip even if we couldn't possibly
> expect one to be there.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_display.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a7582a46e82e..5898e7157c4c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3359,11 +3359,7 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> struct drm_device *dev = crtc->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
>
> - if (crtc->primary->fb == NULL)
> - return;
> -
> WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
> -
> if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> !intel_crtc_has_pending_flip(crtc),
> 60*HZ) == 0)) {
> @@ -3378,9 +3374,11 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> spin_unlock_irqrestore(&dev->event_lock, flags);
> }
Chris, the patch context has changed above, in fact I can't find such
context anywhere. Is the patch otherwise valid against current -fixes?
BR,
Jani.
>
> - mutex_lock(&dev->struct_mutex);
> - intel_finish_fb(crtc->primary->fb);
> - mutex_unlock(&dev->struct_mutex);
> + if (crtc->primary->fb) {
> + mutex_lock(&dev->struct_mutex);
> + intel_finish_fb(crtc->primary->fb);
> + mutex_unlock(&dev->struct_mutex);
> + }
> }
>
> /* Program iCLKIP clock to the desired frequency */
> --
> 2.1.0.rc1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Make wait-for-pending-flips more defensive
2014-08-26 11:49 ` Jani Nikula
@ 2014-08-26 12:14 ` Chris Wilson
2014-08-26 12:51 ` Daniel Vetter
1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2014-08-26 12:14 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Tue, Aug 26, 2014 at 02:49:07PM +0300, Jani Nikula wrote:
> On Wed, 20 Aug 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Be sure to always flush a stuck pageflip even if we couldn't possibly
> > expect one to be there.
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a7582a46e82e..5898e7157c4c 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -3359,11 +3359,7 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> > struct drm_device *dev = crtc->dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> >
> > - if (crtc->primary->fb == NULL)
> > - return;
> > -
> > WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
> > -
> > if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> > !intel_crtc_has_pending_flip(crtc),
> > 60*HZ) == 0)) {
> > @@ -3378,9 +3374,11 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> > spin_unlock_irqrestore(&dev->event_lock, flags);
> > }
>
> Chris, the patch context has changed above, in fact I can't find such
> context anywhere. Is the patch otherwise valid against current -fixes?
The context is from earlier patches to decouple stuck pageflips before a
modeset. They have been on the list for many months - a very useful
fixup in cases like this. This patch itself does not depend upon those
changes.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Make wait-for-pending-flips more defensive
2014-08-26 11:49 ` Jani Nikula
2014-08-26 12:14 ` Chris Wilson
@ 2014-08-26 12:51 ` Daniel Vetter
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2014-08-26 12:51 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Tue, Aug 26, 2014 at 02:49:07PM +0300, Jani Nikula wrote:
> On Wed, 20 Aug 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Be sure to always flush a stuck pageflip even if we couldn't possibly
> > expect one to be there.
> >
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=82612
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a7582a46e82e..5898e7157c4c 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -3359,11 +3359,7 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> > struct drm_device *dev = crtc->dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> >
> > - if (crtc->primary->fb == NULL)
> > - return;
> > -
> > WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));
> > -
> > if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue,
> > !intel_crtc_has_pending_flip(crtc),
> > 60*HZ) == 0)) {
> > @@ -3378,9 +3374,11 @@ void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> > spin_unlock_irqrestore(&dev->event_lock, flags);
> > }
>
> Chris, the patch context has changed above, in fact I can't find such
> context anywhere. Is the patch otherwise valid against current -fixes?
Until we have confirmation that it fixes a real bug I don't think this is
material for -fixes. Queued for -next, thanks for the patch.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-26 12:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 12:13 [PATCH] drm/i915: Make wait-for-pending-flips more defensive Chris Wilson
2014-08-20 13:12 ` Ville Syrjälä
2014-08-26 11:49 ` Jani Nikula
2014-08-26 12:14 ` Chris Wilson
2014-08-26 12:51 ` Daniel Vetter
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.