* [PATCH 2/3] drm: Warn if vblank state has become inconsistent.
2011-04-27 6:10 [PATCH 1/3] drm: Send pending vblank events before disabling vblank christopher.halse.rogers
@ 2011-04-27 6:10 ` christopher.halse.rogers
2011-04-27 8:38 ` Michel Dänzer
0 siblings, 1 reply; 5+ messages in thread
From: christopher.halse.rogers @ 2011-04-27 6:10 UTC (permalink / raw)
To: dri-devel
From: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
After emitting all the waiting vblank events no-one should hold
a vblank reference. Emit a warning if this is not the case.
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
---
drivers/gpu/drm/drm_irq.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index a1f12cb..72407fa 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
e->event.sequence);
}
+ WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0);
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
}
EXPORT_SYMBOL(drm_vblank_off);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] drm: Warn if vblank state has become inconsistent.
2011-04-27 6:10 ` [PATCH 2/3] drm: Warn if vblank state has become inconsistent christopher.halse.rogers
@ 2011-04-27 8:38 ` Michel Dänzer
0 siblings, 0 replies; 5+ messages in thread
From: Michel Dänzer @ 2011-04-27 8:38 UTC (permalink / raw)
To: christopher.halse.rogers; +Cc: dri-devel
On Mit, 2011-04-27 at 16:10 +1000, christopher.halse.rogers@canonical.com wrote:
> From: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
>
> After emitting all the waiting vblank events no-one should hold
> a vblank reference. Emit a warning if this is not the case.
>
> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
> ---
> drivers/gpu/drm/drm_irq.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index a1f12cb..72407fa 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
> e->event.sequence);
> }
>
> + WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0);
> spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
> }
> EXPORT_SYMBOL(drm_vblank_off);
Reviewed-by: Michel Dänzer <michel@daenzer.net>
--
Earthling Michel Dänzer | http://www.vmware.com
Libre software enthusiast | Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] drm: Warn if vblank state has become inconsistent.
[not found] <mailman.30.1303894729.31758.dri-devel@lists.freedesktop.org>
@ 2011-04-27 15:50 ` Mario Kleiner
2011-04-28 7:47 ` Christopher James Halse Rogers
0 siblings, 1 reply; 5+ messages in thread
From: Mario Kleiner @ 2011-04-27 15:50 UTC (permalink / raw)
To: Christopher James Halse Rogers, dri-devel
On Apr 27, 2011, at 10:58 AM, dri-devel-request@lists.freedesktop.org
wrote:
> Message: 5
> Date: Wed, 27 Apr 2011 10:38:14 +0200
> From: Michel D?nzer <michel@daenzer.net>
> Subject: Re: [PATCH 2/3] drm: Warn if vblank state has become
> inconsistent.
> To: christopher.halse.rogers@canonical.com
> Cc: dri-devel@lists.freedesktop.org
> Message-ID: <1303893494.5633.129.camel@thor.local>
> Content-Type: text/plain; charset="UTF-8"
>
> On Mit, 2011-04-27 at 16:10 +1000,
> christopher.halse.rogers@canonical.com wrote:
>> From: Christopher James Halse Rogers
>> <christopher.halse.rogers@canonical.com>
>>
>> After emitting all the waiting vblank events no-one should hold
>> a vblank reference. Emit a warning if this is not the case.
>>
>> Signed-off-by: Christopher James Halse Rogers
>> <christopher.halse.rogers@canonical.com>
>> ---
>> drivers/gpu/drm/drm_irq.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>> index a1f12cb..72407fa 100644
>> --- a/drivers/gpu/drm/drm_irq.c
>> +++ b/drivers/gpu/drm/drm_irq.c
>> @@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev,
>> int crtc)
>> e->event.sequence);
>> }
>>
>> + WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0);
>> spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
>> }
>> EXPORT_SYMBOL(drm_vblank_off);
>
> Reviewed-by: Michel D?nzer <michel@daenzer.net>
>
Any pending kms pageflip will also hold a reference on the vblank of
a crtc, so having the refcount non-zero there is not really a sign of
inconsistency, so i'm not sure if a warning is appropriate there.
-mario
*********************************************************************
Mario Kleiner
Max Planck Institute for Biological Cybernetics
Spemannstr. 38
72076 Tuebingen
Germany
e-mail: mario.kleiner@tuebingen.mpg.de
office: +49 (0)7071/601-1623
fax: +49 (0)7071/601-616
www: http://www.kyb.tuebingen.mpg.de/~kleinerm
*********************************************************************
"For a successful technology, reality must take precedence
over public relations, for Nature cannot be fooled."
(Richard Feynman)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] drm: Warn if vblank state has become inconsistent.
2011-04-27 15:50 ` [PATCH 2/3] drm: Warn if vblank state has become inconsistent Mario Kleiner
@ 2011-04-28 7:47 ` Christopher James Halse Rogers
2011-04-28 16:40 ` Mario Kleiner
0 siblings, 1 reply; 5+ messages in thread
From: Christopher James Halse Rogers @ 2011-04-28 7:47 UTC (permalink / raw)
To: Mario Kleiner; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 2153 bytes --]
On Wed, 2011-04-27 at 17:50 +0200, Mario Kleiner wrote:
> On Apr 27, 2011, at 10:58 AM, dri-devel-request@lists.freedesktop.org
> wrote:
> > Message: 5
> > Date: Wed, 27 Apr 2011 10:38:14 +0200
> > From: Michel D?nzer <michel@daenzer.net>
> > Subject: Re: [PATCH 2/3] drm: Warn if vblank state has become
> > inconsistent.
> > To: christopher.halse.rogers@canonical.com
> > Cc: dri-devel@lists.freedesktop.org
> > Message-ID: <1303893494.5633.129.camel@thor.local>
> > Content-Type: text/plain; charset="UTF-8"
> >
> > On Mit, 2011-04-27 at 16:10 +1000,
> > christopher.halse.rogers@canonical.com wrote:
> >> From: Christopher James Halse Rogers
> >> <christopher.halse.rogers@canonical.com>
> >>
> >> After emitting all the waiting vblank events no-one should hold
> >> a vblank reference. Emit a warning if this is not the case.
> >>
> >> Signed-off-by: Christopher James Halse Rogers
> >> <christopher.halse.rogers@canonical.com>
> >> ---
> >> drivers/gpu/drm/drm_irq.c | 1 +
> >> 1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> >> index a1f12cb..72407fa 100644
> >> --- a/drivers/gpu/drm/drm_irq.c
> >> +++ b/drivers/gpu/drm/drm_irq.c
> >> @@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev,
> >> int crtc)
> >> e->event.sequence);
> >> }
> >>
> >> + WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0);
> >> spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
> >> }
> >> EXPORT_SYMBOL(drm_vblank_off);
> >
> > Reviewed-by: Michel D?nzer <michel@daenzer.net>
> >
>
>
> Any pending kms pageflip will also hold a reference on the vblank of
> a crtc, so having the refcount non-zero there is not really a sign of
> inconsistency, so i'm not sure if a warning is appropriate there.
But at this point the vblank interrupts have been disabled, or at least
the driver's disable function has been called. Will that not mean that
any pending pageflips will wait indefinitely for a vblank interrupt
that's not going to come - ie: exactly the state we're warning against?
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] drm: Warn if vblank state has become inconsistent.
2011-04-28 7:47 ` Christopher James Halse Rogers
@ 2011-04-28 16:40 ` Mario Kleiner
0 siblings, 0 replies; 5+ messages in thread
From: Mario Kleiner @ 2011-04-28 16:40 UTC (permalink / raw)
To: Christopher James Halse Rogers; +Cc: dri-devel
On Apr 28, 2011, at 9:47 AM, Christopher James Halse Rogers wrote:
> On Wed, 2011-04-27 at 17:50 +0200, Mario Kleiner wrote:
>> On Apr 27, 2011, at 10:58 AM, dri-devel-request@lists.freedesktop.org
>> wrote:
>>> Message: 5
>>> Date: Wed, 27 Apr 2011 10:38:14 +0200
>>> From: Michel D?nzer <michel@daenzer.net>
>>> Subject: Re: [PATCH 2/3] drm: Warn if vblank state has become
>>> inconsistent.
>>> To: christopher.halse.rogers@canonical.com
>>> Cc: dri-devel@lists.freedesktop.org
>>> Message-ID: <1303893494.5633.129.camel@thor.local>
>>> Content-Type: text/plain; charset="UTF-8"
>>>
>>> On Mit, 2011-04-27 at 16:10 +1000,
>>> christopher.halse.rogers@canonical.com wrote:
>>>> From: Christopher James Halse Rogers
>>>> <christopher.halse.rogers@canonical.com>
>>>>
>>>> After emitting all the waiting vblank events no-one should hold
>>>> a vblank reference. Emit a warning if this is not the case.
>>>>
>>>> Signed-off-by: Christopher James Halse Rogers
>>>> <christopher.halse.rogers@canonical.com>
>>>> ---
>>>> drivers/gpu/drm/drm_irq.c | 1 +
>>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>>>> index a1f12cb..72407fa 100644
>>>> --- a/drivers/gpu/drm/drm_irq.c
>>>> +++ b/drivers/gpu/drm/drm_irq.c
>>>> @@ -960,6 +960,7 @@ void drm_vblank_off(struct drm_device *dev,
>>>> int crtc)
>>>> e->event.sequence);
>>>> }
>>>>
>>>> + WARN_ON(atomic_read(&dev->vblank_refcount[crtc]) != 0);
>>>> spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
>>>> }
>>>> EXPORT_SYMBOL(drm_vblank_off);
>>>
>>> Reviewed-by: Michel D?nzer <michel@daenzer.net>
>>>
>>
>>
>> Any pending kms pageflip will also hold a reference on the vblank of
>> a crtc, so having the refcount non-zero there is not really a sign of
>> inconsistency, so i'm not sure if a warning is appropriate there.
>
> But at this point the vblank interrupts have been disabled, or at
> least
> the driver's disable function has been called. Will that not mean
> that
> any pending pageflips will wait indefinitely for a vblank interrupt
> that's not going to come - ie: exactly the state we're warning
> against?
>
Ok, if that is the state we're warning against, then the warning
makes sense. But it would make more sense to somehow handle this more
gracefully. The pageflip completion path does depend on vblank irq's
to unpin buffers, release fences and notify user apps of swap
completion. Hanging there due to disabled vblank irq sounds bad.
Otoh the only caller of drm_vblank_off() i can find in 2.6.38 is the
crtc disable code in intel_display.c and those routines protect
against pending pageflips - they wait for all pageflips to finish
before calling drm_vblank_off().
If this warning is just a precaution against possible future bugs
then i happily rest my case.
-mario
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-28 16:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.30.1303894729.31758.dri-devel@lists.freedesktop.org>
2011-04-27 15:50 ` [PATCH 2/3] drm: Warn if vblank state has become inconsistent Mario Kleiner
2011-04-28 7:47 ` Christopher James Halse Rogers
2011-04-28 16:40 ` Mario Kleiner
2011-04-27 6:10 [PATCH 1/3] drm: Send pending vblank events before disabling vblank christopher.halse.rogers
2011-04-27 6:10 ` [PATCH 2/3] drm: Warn if vblank state has become inconsistent christopher.halse.rogers
2011-04-27 8:38 ` Michel Dänzer
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.