summaryrefslogtreecommitdiff
path: root/linux-core/drm_scatter.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-07-19 17:11:11 -0700
committerEric Anholt <eric@anholt.net>2007-07-20 18:16:42 -0700
commit5b38e134163cc375e91424c4688cc9328c6e9082 (patch)
tree3930e659e99aa4c5c319aaca8cffa041e9087e62 /linux-core/drm_scatter.c
parentc1119b1b092527fbb6950d0b5e51e076ddb00f29 (diff)
Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.
The data is now in kernel space, copied in/out as appropriate according to the This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal with those failures. This also means that XFree86 4.2.0 support for i810 DRM is lost.
Diffstat (limited to 'linux-core/drm_scatter.c')
-rw-r--r--linux-core/drm_scatter.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c
index 58696347..3c0f672e 100644
--- a/linux-core/drm_scatter.c
+++ b/linux-core/drm_scatter.c
@@ -187,49 +187,28 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
}
EXPORT_SYMBOL(drm_sg_alloc);
-int drm_sg_alloc_ioctl(struct inode *inode, struct drm_file *file_priv,
- unsigned int cmd, unsigned long arg)
+int drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
- struct drm_device *dev = file_priv->head->dev;
- struct drm_scatter_gather __user *argp = (void __user *)arg;
- struct drm_scatter_gather request;
- int ret;
+ struct drm_scatter_gather *request = data;
- if (copy_from_user(&request, argp, sizeof(request)))
- return -EFAULT;
-
- ret = drm_sg_alloc(dev, &request);
- if ( ret ) return ret;
-
- if (copy_to_user(argp, &request, sizeof(request))) {
- drm_sg_cleanup(dev->sg);
- return -EFAULT;
- }
-
-
- return 0;
+ return drm_sg_alloc(dev, request);
}
-int drm_sg_free(struct inode *inode, struct drm_file *file_priv,
- unsigned int cmd, unsigned long arg)
+int drm_sg_free(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
- struct drm_device *dev = file_priv->head->dev;
- struct drm_scatter_gather request;
+ struct drm_scatter_gather *request = data;
struct drm_sg_mem *entry;
if (!drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL;
- if (copy_from_user(&request,
- (struct drm_scatter_gather __user *) arg,
- sizeof(request)))
- return -EFAULT;
-
entry = dev->sg;
dev->sg = NULL;
- if (!entry || entry->handle != request.handle)
+ if (!entry || entry->handle != request->handle)
return -EINVAL;
DRM_DEBUG("sg free virtual = %p\n", entry->virtual);