aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drmP.h
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@nietzche.virtuousgeek.org>2008-02-07 10:40:06 -0800
committerJesse Barnes <jbarnes@nietzche.virtuousgeek.org>2008-02-07 10:40:06 -0800
commit79d69285202b55f269aa88a6bcda257257c9dee3 (patch)
tree7b68a0e162b885ae77fc00e8d8e14e2ccc190f25 /linux-core/drmP.h
parent76748efae2f51409813eeb6b91b783c73cb2845e (diff)
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.
Diffstat (limited to 'linux-core/drmP.h')
-rw-r--r--linux-core/drmP.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 4e8b087b..33f3649e 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -836,6 +836,8 @@ struct drm_device {
u32 *last_vblank; /* protected by dev->vbl_lock, used */
/* for wraparound handling */
u32 *vblank_offset; /* used to track how many vblanks */
+ int *vblank_enabled; /* so we don't call enable more than
+ once per disable */
u32 *vblank_premodeset; /* were lost during modeset */
struct timer_list vblank_disable_timer;