Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 25 Aug 2007 15:01:06 +0000 (08:01 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 25 Aug 2007 15:01:06 +0000 (08:01 -0700)
* 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: ioremap return value checks
  drm/via: Fix dmablit when blit queue is full
  drm_rmmap_ioctl(): remove dead code

drivers/char/drm/drm_bufs.c
drivers/char/drm/via_dmablit.c

index 923174c54a1cd3150d30cd06f298d130beb20e57..c115b39b85178cc4d84fd9d9b55f5521ccb6d7c5 100644 (file)
@@ -177,8 +177,14 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset,
                                                     MTRR_TYPE_WRCOMB, 1);
                        }
                }
-               if (map->type == _DRM_REGISTERS)
+               if (map->type == _DRM_REGISTERS) {
                        map->handle = ioremap(map->offset, map->size);
+                       if (!map->handle) {
+                               drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+                               return -ENOMEM;
+                       }
+               }
+                               
                break;
        case _DRM_SHM:
                list = drm_find_matching_map(dev, map);
@@ -479,11 +485,6 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
                return -EINVAL;
        }
 
-       if (!map) {
-               mutex_unlock(&dev->struct_mutex);
-               return -EINVAL;
-       }
-
        /* Register and framebuffer maps are permanent */
        if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) {
                mutex_unlock(&dev->struct_mutex);
index 832de1d9ba7e81bae74c780524c2c5b345c719fe..3dd1ed3d1bf5c859c388979a25a6c05f7c17c113 100644 (file)
@@ -560,7 +560,7 @@ via_init_dmablit(struct drm_device *dev)
                blitq->head = 0;
                blitq->cur = 0;
                blitq->serviced = 0;
-               blitq->num_free = VIA_NUM_BLIT_SLOTS;
+               blitq->num_free = VIA_NUM_BLIT_SLOTS - 1;
                blitq->num_outstanding = 0;
                blitq->is_active = 0;
                blitq->aborting = 0;