summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-26 16:09:24 +1000
committerDave Airlie <airlied@linux.ie>2007-04-26 16:09:24 +1000
commit71d44cda52f239b543cb1fad93ef35adc3093d38 (patch)
tree9b6421eed4f3aee6be22882dc5f753b6bd62d34b /linux-core
parent3c384a9ad5f964709a237cfe035ea5d6df2da5fa (diff)
drm/ttm: allow drm_buffer_object_create to be used in-kernel
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 9501ba6e..1c7013b3 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -1540,7 +1540,7 @@ static int drm_bo_handle_wait(drm_file_t * priv, uint32_t handle,
return ret;
}
-int drm_buffer_object_create(drm_file_t * priv,
+int drm_buffer_object_create(drm_device_t *dev,
unsigned long size,
drm_bo_type_t type,
uint32_t mask,
@@ -1549,7 +1549,6 @@ int drm_buffer_object_create(drm_file_t * priv,
unsigned long buffer_start,
drm_buffer_object_t ** buf_obj)
{
- drm_device_t *dev = priv->head->dev;
drm_buffer_manager_t *bm = &dev->bm;
drm_buffer_object_t *bo;
int ret = 0;
@@ -1683,7 +1682,8 @@ int drm_bo_ioctl(DRM_IOCTL_ARGS)
if (rep.ret)
break;
rep.ret =
- drm_buffer_object_create(priv, req->size,
+ drm_buffer_object_create(priv->head->dev,
+ req->size,
req->type,
req->mask,
req->hint,
@@ -2306,6 +2306,9 @@ void drm_bo_unmap_virtual(drm_buffer_object_t * bo)
loff_t offset = ((loff_t) bo->map_list.hash.key) << PAGE_SHIFT;
loff_t holelen = ((loff_t) bo->mem.num_pages) << PAGE_SHIFT;
+ if (!dev->dev_mapping)
+ return;
+
unmap_mapping_range(dev->dev_mapping, offset, holelen, 1);
}