OSDN Git Service

Fix vblank enable/disable callbacks
authorJesse Barnes <jbarnes@nietzche.virtuousgeek.org>
Thu, 7 Feb 2008 18:40:06 +0000 (10:40 -0800)
committerJesse Barnes <jbarnes@nietzche.virtuousgeek.org>
Thu, 7 Feb 2008 18:40:06 +0000 (10:40 -0800)
commit79d69285202b55f269aa88a6bcda257257c9dee3
tree7b68a0e162b885ae77fc00e8d8e14e2ccc190f25
parent76748efae2f51409813eeb6b91b783c73cb2845e
Fix vblank enable/disable callbacks

There were two problems with the existing callback code:  the vblank
enable callback happened multiple times per disable, making drivers more
complex than they had to be, and there was a race between the final
decrement of the vblank usage counter and the next enable call, which
could have resulted in a put->schedule disable->get->enable->disable
sequence, which would be bad.

So add a new vblank_enabled array to track vblank enable on per-pipe
basis, and add a lock to protect it along with the refcount +
enable/disable calls to fix the race.
linux-core/drmP.h
linux-core/drm_irq.c