diff options
-rw-r--r-- | linux-core/i810_dma.c | 1 | ||||
-rw-r--r-- | linux/i810_dma.c | 1 | ||||
-rw-r--r-- | linux/mga_dma.c | 10 | ||||
-rw-r--r-- | linux/picker.c | 2 | ||||
-rw-r--r-- | linux/r128_drv.h | 2 |
5 files changed, 9 insertions, 7 deletions
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index a9f860cd..7294c65e 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -1367,6 +1367,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, dev_priv->sarea_priv; DRM_DEBUG("getbuf\n"); + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) return -EFAULT; diff --git a/linux/i810_dma.c b/linux/i810_dma.c index a9f860cd..7294c65e 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -1367,6 +1367,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, dev_priv->sarea_priv; DRM_DEBUG("getbuf\n"); + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) return -EFAULT; diff --git a/linux/mga_dma.c b/linux/mga_dma.c index f80fb489..ae1d3e12 100644 --- a/linux/mga_dma.c +++ b/linux/mga_dma.c @@ -214,6 +214,7 @@ drm_buf_t *mga_freelist_get(drm_device_t *dev) drm_mga_freelist_t *prev; drm_mga_freelist_t *next; static int failed = 0; + int return_null = 0; DRM_DEBUG("%s : tail->age : %d last_prim_age : %d\n", __FUNCTION__, dev_priv->tail->age, dev_priv->last_prim_age); @@ -222,7 +223,6 @@ drm_buf_t *mga_freelist_get(drm_device_t *dev) DRM_DEBUG("I'm waiting on the freelist!!! %d\n", dev_priv->last_prim_age); set_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status); - current->state = TASK_INTERRUPTIBLE; add_wait_queue(&dev_priv->buf_queue, &entry); for (;;) { mga_dma_schedule(dev, 0); @@ -230,15 +230,17 @@ drm_buf_t *mga_freelist_get(drm_device_t *dev) &dev_priv->dispatch_status)) break; atomic_inc(&dev->total_sleeps); + current->state = TASK_INTERRUPTIBLE; schedule(); if (signal_pending(current)) { + ++return_null; clear_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status); - goto failed_getbuf; + break; } } - current->state = TASK_RUNNING; remove_wait_queue(&dev_priv->buf_queue, &entry); + if (return_null) return NULL; } if(dev_priv->tail->age < dev_priv->last_prim_age) { @@ -251,8 +253,6 @@ drm_buf_t *mga_freelist_get(drm_device_t *dev) failed = 0; return next->buf; } - -failed_getbuf: failed++; return NULL; } diff --git a/linux/picker.c b/linux/picker.c index f8cfe459..6053a947 100644 --- a/linux/picker.c +++ b/linux/picker.c @@ -1,4 +1,4 @@ -#include <linux/autoconf.h> +#include <linux/config.h> #include <linux/version.h> #ifndef CONFIG_SMP diff --git a/linux/r128_drv.h b/linux/r128_drv.h index 9083af3a..7139eddf 100644 --- a/linux/r128_drv.h +++ b/linux/r128_drv.h @@ -292,7 +292,7 @@ extern int r128_context_switch_complete(drm_device_t *dev, int new); #define R128_VB_AGE_REG R128_GUI_SCRATCH_REG0 -#define R128_BASE(reg) ((u32)(dev_priv->mmio->handle)) +#define R128_BASE(reg) ((unsigned long)(dev_priv->mmio->handle)) #define R128_ADDR(reg) (R128_BASE(reg) + reg) #define R128_DEREF(reg) *(__volatile__ int *)R128_ADDR(reg) |