Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129820
b: refs/heads/master
c: dc1336f
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes authored and Dave Airlie committed Jan 10, 2009
1 parent 21b3bb4 commit e833daf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71e0ffa599f54058d9b8724b4b14d0486751681d
refs/heads/master: dc1336ff4fe08ae7cfe8301bfd7f0b2cfd31d20a
18 changes: 15 additions & 3 deletions trunk/drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ EXPORT_SYMBOL(drm_irq_install);
*/
int drm_irq_uninstall(struct drm_device * dev)
{
int irq_enabled;
unsigned long irqflags;
int irq_enabled, i;

if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
Expand All @@ -277,6 +278,16 @@ int drm_irq_uninstall(struct drm_device * dev)
dev->irq_enabled = 0;
mutex_unlock(&dev->struct_mutex);

/*
* Wake up any waiters so they don't hang.
*/
spin_lock_irqsave(&dev->vbl_lock, irqflags);
for (i = 0; i < dev->num_crtcs; i++) {
DRM_WAKEUP(&dev->vbl_queue[i]);
dev->vblank_enabled[i] = 0;
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);

if (!irq_enabled)
return -EINVAL;

Expand Down Expand Up @@ -652,8 +663,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
vblwait->request.sequence, crtc);
dev->last_vblank_wait[crtc] = vblwait->request.sequence;
DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
((drm_vblank_count(dev, crtc)
- vblwait->request.sequence) <= (1 << 23)));
(((drm_vblank_count(dev, crtc) -
vblwait->request.sequence) <= (1 << 23)) ||
!dev->irq_enabled));

if (ret != -EINTR) {
struct timeval now;
Expand Down

0 comments on commit e833daf

Please sign in to comment.