aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-25 11:01:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-25 11:01:06 -0400
commit6869ce1c145aaea9f9f8eb8623a261d316b0cd19 (patch)
treea12a8900465ccdb87854c2706ad907021ba9c408 /drivers
parent36373b4450105ec8908c6c9396c8715eaafcfd6a (diff)
parent0769d39c993145754852b517ddd9c11586f0a014 (diff)
Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* '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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/drm/drm_bufs.c13
-rw-r--r--drivers/char/drm/via_dmablit.c2
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 923174c54a1c..c115b39b8517 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -177,8 +177,14 @@ static int drm_addmap_core(struct drm_device * dev, unsigned int offset,
177 MTRR_TYPE_WRCOMB, 1); 177 MTRR_TYPE_WRCOMB, 1);
178 } 178 }
179 } 179 }
180 if (map->type == _DRM_REGISTERS) 180 if (map->type == _DRM_REGISTERS) {
181 map->handle = ioremap(map->offset, map->size); 181 map->handle = ioremap(map->offset, map->size);
182 if (!map->handle) {
183 drm_free(map, sizeof(*map), DRM_MEM_MAPS);
184 return -ENOMEM;
185 }
186 }
187
182 break; 188 break;
183 case _DRM_SHM: 189 case _DRM_SHM:
184 list = drm_find_matching_map(dev, map); 190 list = drm_find_matching_map(dev, map);
@@ -479,11 +485,6 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
479 return -EINVAL; 485 return -EINVAL;
480 } 486 }
481 487
482 if (!map) {
483 mutex_unlock(&dev->struct_mutex);
484 return -EINVAL;
485 }
486
487 /* Register and framebuffer maps are permanent */ 488 /* Register and framebuffer maps are permanent */
488 if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) { 489 if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) {
489 mutex_unlock(&dev->struct_mutex); 490 mutex_unlock(&dev->struct_mutex);
diff --git a/drivers/char/drm/via_dmablit.c b/drivers/char/drm/via_dmablit.c
index 832de1d9ba7e..3dd1ed3d1bf5 100644
--- a/drivers/char/drm/via_dmablit.c
+++ b/drivers/char/drm/via_dmablit.c
@@ -560,7 +560,7 @@ via_init_dmablit(struct drm_device *dev)
560 blitq->head = 0; 560 blitq->head = 0;
561 blitq->cur = 0; 561 blitq->cur = 0;
562 blitq->serviced = 0; 562 blitq->serviced = 0;
563 blitq->num_free = VIA_NUM_BLIT_SLOTS; 563 blitq->num_free = VIA_NUM_BLIT_SLOTS - 1;
564 blitq->num_outstanding = 0; 564 blitq->num_outstanding = 0;
565 blitq->is_active = 0; 565 blitq->is_active = 0;
566 blitq->aborting = 0; 566 blitq->aborting = 0;