aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-25 17:51:24 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-12-22 13:54:43 -0500
commit87499ffdcb1c70f66988cd8febc4ead0ba2f9118 (patch)
treef4b3e1400ceafccf3b742c796a983882703a8dba /drivers
parent7a6e0daaf4058d1b7dd515bc470ec904454a798c (diff)
drm/i810: cleanup reclaim_buffers
My dear old i815 always hits the deadlocked on reclaim_buffers warning. Switch over to the idlelock duct-tape on hope that works better. I've fired up my i815 and now closing glxgears doesn't take 5 seconds anymore. \o/ Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i810/i810_dma.c17
-rw-r--r--drivers/gpu/drm/i810/i810_drv.c1
-rw-r--r--drivers/gpu/drm/i810/i810_drv.h6
3 files changed, 13 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index 8f371e8d630f..6b73c3e57d63 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -888,7 +888,7 @@ static int i810_flush_queue(struct drm_device *dev)
888} 888}
889 889
890/* Must be called with the lock held */ 890/* Must be called with the lock held */
891static void i810_reclaim_buffers(struct drm_device *dev, 891void i810_driver_reclaim_buffers(struct drm_device *dev,
892 struct drm_file *file_priv) 892 struct drm_file *file_priv)
893{ 893{
894 struct drm_device_dma *dma = dev->dma; 894 struct drm_device_dma *dma = dev->dma;
@@ -1225,12 +1225,17 @@ void i810_driver_preclose(struct drm_device *dev, struct drm_file *file_priv)
1225 if (dev_priv->page_flipping) 1225 if (dev_priv->page_flipping)
1226 i810_do_cleanup_pageflip(dev); 1226 i810_do_cleanup_pageflip(dev);
1227 } 1227 }
1228}
1229 1228
1230void i810_driver_reclaim_buffers_locked(struct drm_device *dev, 1229 if (file_priv->master && file_priv->master->lock.hw_lock) {
1231 struct drm_file *file_priv) 1230 drm_idlelock_take(&file_priv->master->lock);
1232{ 1231 i810_driver_reclaim_buffers(dev, file_priv);
1233 i810_reclaim_buffers(dev, file_priv); 1232 drm_idlelock_release(&file_priv->master->lock);
1233 } else {
1234 /* master disappeared, clean up stuff anyway and hope nothing
1235 * goes wrong */
1236 i810_driver_reclaim_buffers(dev, file_priv);
1237 }
1238
1234} 1239}
1235 1240
1236int i810_driver_dma_quiescent(struct drm_device *dev) 1241int i810_driver_dma_quiescent(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index ec12f7dc717a..053f1ee58393 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -63,7 +63,6 @@ static struct drm_driver driver = {
63 .lastclose = i810_driver_lastclose, 63 .lastclose = i810_driver_lastclose,
64 .preclose = i810_driver_preclose, 64 .preclose = i810_driver_preclose,
65 .device_is_agp = i810_driver_device_is_agp, 65 .device_is_agp = i810_driver_device_is_agp,
66 .reclaim_buffers_locked = i810_driver_reclaim_buffers_locked,
67 .dma_quiescent = i810_driver_dma_quiescent, 66 .dma_quiescent = i810_driver_dma_quiescent,
68 .ioctls = i810_ioctls, 67 .ioctls = i810_ioctls,
69 .fops = &i810_driver_fops, 68 .fops = &i810_driver_fops,
diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h
index c9339f481795..6e0acad9e0f5 100644
--- a/drivers/gpu/drm/i810/i810_drv.h
+++ b/drivers/gpu/drm/i810/i810_drv.h
@@ -116,14 +116,12 @@ typedef struct drm_i810_private {
116 116
117 /* i810_dma.c */ 117 /* i810_dma.c */
118extern int i810_driver_dma_quiescent(struct drm_device *dev); 118extern int i810_driver_dma_quiescent(struct drm_device *dev);
119extern void i810_driver_reclaim_buffers_locked(struct drm_device *dev, 119void i810_driver_reclaim_buffers(struct drm_device *dev,
120 struct drm_file *file_priv); 120 struct drm_file *file_priv);
121extern int i810_driver_load(struct drm_device *, unsigned long flags); 121extern int i810_driver_load(struct drm_device *, unsigned long flags);
122extern void i810_driver_lastclose(struct drm_device *dev); 122extern void i810_driver_lastclose(struct drm_device *dev);
123extern void i810_driver_preclose(struct drm_device *dev, 123extern void i810_driver_preclose(struct drm_device *dev,
124 struct drm_file *file_priv); 124 struct drm_file *file_priv);
125extern void i810_driver_reclaim_buffers_locked(struct drm_device *dev,
126 struct drm_file *file_priv);
127extern int i810_driver_device_is_agp(struct drm_device *dev); 125extern int i810_driver_device_is_agp(struct drm_device *dev);
128 126
129extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 127extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg);