aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-10-17 00:18:27 -0400
committerDave Airlie <airlied@redhat.com>2008-10-22 23:45:56 -0400
commit9e44af790f8bf8c3aa8a3101fd4f9bca2e932baa (patch)
treea83337632a96be5da2078bebbb24c0cbb6d82b6a /drivers/gpu/drm/i915/i915_drv.h
parentfe8133dc07e613587f8e667bce769edce8490f2a (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index eae4ed3956e0..f20ffe17df71 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -90,7 +90,7 @@ struct mem_block {
90typedef struct _drm_i915_vbl_swap { 90typedef struct _drm_i915_vbl_swap {
91 struct list_head head; 91 struct list_head head;
92 drm_drawable_t drw_id; 92 drm_drawable_t drw_id;
93 unsigned int plane; 93 unsigned int pipe;
94 unsigned int sequence; 94 unsigned int sequence;
95} drm_i915_vbl_swap_t; 95} drm_i915_vbl_swap_t;
96 96
@@ -240,6 +240,9 @@ typedef struct drm_i915_private {
240 u8 saveDACDATA[256*3]; /* 256 3-byte colors */ 240 u8 saveDACDATA[256*3]; /* 256 3-byte colors */
241 u8 saveCR[37]; 241 u8 saveCR[37];
242 242
243 /** Work task for vblank-related ring access */
244 struct work_struct vblank_work;
245
243 struct { 246 struct {
244 struct drm_mm gtt_space; 247 struct drm_mm gtt_space;
245 248
@@ -285,9 +288,6 @@ typedef struct drm_i915_private {
285 */ 288 */
286 struct delayed_work retire_work; 289 struct delayed_work retire_work;
287 290
288 /** Work task for vblank-related ring access */
289 struct work_struct vblank_work;
290
291 uint32_t next_gem_seqno; 291 uint32_t next_gem_seqno;
292 292
293 /** 293 /**
@@ -441,7 +441,7 @@ extern int i915_irq_wait(struct drm_device *dev, void *data,
441void i915_user_irq_get(struct drm_device *dev); 441void i915_user_irq_get(struct drm_device *dev);
442void i915_user_irq_put(struct drm_device *dev); 442void i915_user_irq_put(struct drm_device *dev);
443 443
444extern void i915_gem_vblank_work_handler(struct work_struct *work); 444extern void i915_vblank_work_handler(struct work_struct *work);
445extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); 445extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
446extern void i915_driver_irq_preinstall(struct drm_device * dev); 446extern void i915_driver_irq_preinstall(struct drm_device * dev);
447extern int i915_driver_irq_postinstall(struct drm_device *dev); 447extern int i915_driver_irq_postinstall(struct drm_device *dev);