summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}