Skip to content

Commit

Permalink
Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  • Loading branch information
Linus Torvalds committed Aug 25, 2007
2 parents 36373b4 + 0769d39 commit 6869ce1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions drivers/char/drm/drm_bufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/drm/via_dmablit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6869ce1

Please sign in to comment.