diff options
Diffstat (limited to 'linux/i810_dma.c')
-rw-r--r-- | linux/i810_dma.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 8a279be8..11d99734 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -253,16 +253,15 @@ static int i810_dma_get_buffer(drm_device_t *dev, drm_i810_dma_t *d, buf = i810_freelist_get(dev); if (!buf) { retcode = -ENOMEM; - DRM_DEBUG("%s retcode %d\n", __FUNCTION__, retcode); - goto out_get_buf; + DRM_DEBUG("retcode=%d\n", retcode); + return retcode; } retcode = i810_map_buffer(buf, filp); if(retcode) { i810_freelist_put(dev, buf); - DRM_DEBUG("mapbuf failed in %s retcode %d\n", - __FUNCTION__, retcode); - goto out_get_buf; + DRM_DEBUG("mapbuf failed, retcode %d\n", retcode); + return retcode; } buf->pid = priv->pid; buf_priv = buf->dev_private; @@ -271,7 +270,6 @@ static int i810_dma_get_buffer(drm_device_t *dev, drm_i810_dma_t *d, d->request_size = buf->total; d->virtual = buf_priv->virtual; -out_get_buf: return retcode; } @@ -1070,11 +1068,11 @@ static void i810_dma_quiescent(drm_device_t *dev) return; } atomic_set(&dev_priv->flush_done, 0); - current->state = TASK_INTERRUPTIBLE; add_wait_queue(&dev_priv->flush_queue, &entry); end = jiffies + (HZ*3); for (;;) { + current->state = TASK_INTERRUPTIBLE; i810_dma_quiescent_emit(dev); if (atomic_read(&dev_priv->flush_done) == 1) break; if((signed)(end - jiffies) <= 0) { @@ -1105,10 +1103,10 @@ static int i810_flush_queue(drm_device_t *dev) return 0; } atomic_set(&dev_priv->flush_done, 0); - current->state = TASK_INTERRUPTIBLE; add_wait_queue(&dev_priv->flush_queue, &entry); end = jiffies + (HZ*3); for (;;) { + current->state = TASK_INTERRUPTIBLE; i810_dma_emit_flush(dev); if (atomic_read(&dev_priv->flush_done) == 1) break; if((signed)(end - jiffies) <= 0) { @@ -1202,6 +1200,7 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd, if (!ret) { add_wait_queue(&dev->lock.lock_queue, &entry); for (;;) { + current->state = TASK_INTERRUPTIBLE; if (!dev->lock.hw_lock) { /* Device has been unregistered */ ret = -EINTR; @@ -1217,7 +1216,6 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd, /* Contention */ atomic_inc(&dev->total_sleeps); - current->state = TASK_INTERRUPTIBLE; DRM_DEBUG("Calling lock schedule\n"); schedule(); if (signal_pending(current)) { |