Commit a1a2d1d3 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Dave Airlie

drm: GEM handles are u32, not int

Several functions in the GEM kernel API used int as handle type, but
user API has it __u32 which is also the intended type.

Replace int with u32.
Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 3f7dc91a
...@@ -164,7 +164,7 @@ EXPORT_SYMBOL(drm_gem_object_alloc); ...@@ -164,7 +164,7 @@ EXPORT_SYMBOL(drm_gem_object_alloc);
* Removes the mapping from handle to filp for this object. * Removes the mapping from handle to filp for this object.
*/ */
static int static int
drm_gem_handle_delete(struct drm_file *filp, int handle) drm_gem_handle_delete(struct drm_file *filp, u32 handle)
{ {
struct drm_device *dev; struct drm_device *dev;
struct drm_gem_object *obj; struct drm_gem_object *obj;
...@@ -207,7 +207,7 @@ drm_gem_handle_delete(struct drm_file *filp, int handle) ...@@ -207,7 +207,7 @@ drm_gem_handle_delete(struct drm_file *filp, int handle)
int int
drm_gem_handle_create(struct drm_file *file_priv, drm_gem_handle_create(struct drm_file *file_priv,
struct drm_gem_object *obj, struct drm_gem_object *obj,
int *handlep) u32 *handlep)
{ {
int ret; int ret;
...@@ -221,7 +221,7 @@ drm_gem_handle_create(struct drm_file *file_priv, ...@@ -221,7 +221,7 @@ drm_gem_handle_create(struct drm_file *file_priv,
/* do the allocation under our spinlock */ /* do the allocation under our spinlock */
spin_lock(&file_priv->table_lock); spin_lock(&file_priv->table_lock);
ret = idr_get_new_above(&file_priv->object_idr, obj, 1, handlep); ret = idr_get_new_above(&file_priv->object_idr, obj, 1, (int *)handlep);
spin_unlock(&file_priv->table_lock); spin_unlock(&file_priv->table_lock);
if (ret == -EAGAIN) if (ret == -EAGAIN)
goto again; goto again;
...@@ -237,7 +237,7 @@ EXPORT_SYMBOL(drm_gem_handle_create); ...@@ -237,7 +237,7 @@ EXPORT_SYMBOL(drm_gem_handle_create);
/** Returns a reference to the object named by the handle. */ /** Returns a reference to the object named by the handle. */
struct drm_gem_object * struct drm_gem_object *
drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp, drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp,
int handle) u32 handle)
{ {
struct drm_gem_object *obj; struct drm_gem_object *obj;
...@@ -344,7 +344,7 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data, ...@@ -344,7 +344,7 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data,
struct drm_gem_open *args = data; struct drm_gem_open *args = data;
struct drm_gem_object *obj; struct drm_gem_object *obj;
int ret; int ret;
int handle; u32 handle;
if (!(dev->driver->driver_features & DRIVER_GEM)) if (!(dev->driver->driver_features & DRIVER_GEM))
return -ENODEV; return -ENODEV;
...@@ -539,7 +539,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -539,7 +539,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND; vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND;
vma->vm_ops = obj->dev->driver->gem_vm_ops; vma->vm_ops = obj->dev->driver->gem_vm_ops;
vma->vm_private_data = map->handle; vma->vm_private_data = map->handle;
/* FIXME: use pgprot_writecombine when available */
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
/* Take a ref for this mapping of the object, so that the fault /* Take a ref for this mapping of the object, so that the fault
......
...@@ -111,7 +111,8 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data, ...@@ -111,7 +111,8 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
{ {
struct drm_i915_gem_create *args = data; struct drm_i915_gem_create *args = data;
struct drm_gem_object *obj; struct drm_gem_object *obj;
int handle, ret; int ret;
u32 handle;
args->size = roundup(args->size, PAGE_SIZE); args->size = roundup(args->size, PAGE_SIZE);
......
...@@ -1441,7 +1441,7 @@ drm_gem_object_unreference(struct drm_gem_object *obj) ...@@ -1441,7 +1441,7 @@ drm_gem_object_unreference(struct drm_gem_object *obj)
int drm_gem_handle_create(struct drm_file *file_priv, int drm_gem_handle_create(struct drm_file *file_priv,
struct drm_gem_object *obj, struct drm_gem_object *obj,
int *handlep); u32 *handlep);
static inline void static inline void
drm_gem_object_handle_reference(struct drm_gem_object *obj) drm_gem_object_handle_reference(struct drm_gem_object *obj)
...@@ -1467,7 +1467,7 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj) ...@@ -1467,7 +1467,7 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj)
struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
struct drm_file *filp, struct drm_file *filp,
int handle); u32 handle);
int drm_gem_close_ioctl(struct drm_device *dev, void *data, int drm_gem_close_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
int drm_gem_flink_ioctl(struct drm_device *dev, void *data, int drm_gem_flink_ioctl(struct drm_device *dev, void *data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment