]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operations
authorKeith Packard <keithp@keithp.com>
Fri, 17 Oct 2008 04:18:27 +0000 (21:18 -0700)
committerDave Airlie <airlied@redhat.com>
Thu, 23 Oct 2008 03:45:56 +0000 (13:45 +1000)
commit9e44af790f8bf8c3aa8a3101fd4f9bca2e932baa
treea83337632a96be5da2078bebbb24c0cbb6d82b6a
parentfe8133dc07e613587f8e667bce769edce8490f2a
drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operations

To synchronize clip lists with the X server, the DRM lock must be held while
looking at drawable clip lists. To synchronize with other ring access, the
ring mutex must be held while inserting commands into the ring.  Failure to
do the first resulted in easy visual corruption when moving windows, and the
second could have corrupted the ring with DRI2.

Grabbing the DRM lock involves using the DRM tasklet mechanism, grabbing the
ring mutex means potentially sleeping. Deal with both of these by always
running the tasklet from a work handler.

Also, protect from clip list changes since the vblank request was queued by
making sure the window has at least one rectangle while looking inside,
preventing oopses .

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_lock.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_irq.c