summaryrefslogtreecommitdiff
path: root/shared-core/mga_dma.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-07-20 06:39:25 -0700
committerEric Anholt <eric@anholt.net>2007-07-20 13:39:45 -0700
commitc1119b1b092527fbb6950d0b5e51e076ddb00f29 (patch)
tree1d4b0f26e40d572e4c92eb4ebde88e60b9b137e5 /shared-core/mga_dma.c
parent35de4868361ce1fb515cf33f27e6be4c59b07f89 (diff)
Replace filp in ioctl arguments with drm_file *file_priv.
As a fallout, replace filp storage with file_priv storage for "unique identifier of a client" all over the DRM. There is a 1:1 mapping, so this should be a noop. This could be a minor performance improvement, as everything on Linux dereferenced filp to get file_priv anyway, while only the mmap ioctls went the other direction.
Diffstat (limited to 'shared-core/mga_dma.c')
-rw-r--r--shared-core/mga_dma.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/shared-core/mga_dma.c b/shared-core/mga_dma.c
index cbcb6380..429ffa54 100644
--- a/shared-core/mga_dma.c
+++ b/shared-core/mga_dma.c
@@ -1016,7 +1016,7 @@ int mga_dma_init(DRM_IOCTL_ARGS)
drm_mga_init_t init;
int err;
- LOCK_TEST_WITH_RETURN(dev, filp);
+ LOCK_TEST_WITH_RETURN(dev, file_priv);
DRM_COPY_FROM_USER_IOCTL(init, (drm_mga_init_t __user *) data,
sizeof(init));
@@ -1045,7 +1045,7 @@ int mga_dma_flush(DRM_IOCTL_ARGS)
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
struct drm_lock lock;
- LOCK_TEST_WITH_RETURN(dev, filp);
+ LOCK_TEST_WITH_RETURN(dev, file_priv);
DRM_COPY_FROM_USER_IOCTL(lock, (struct drm_lock __user *) data,
sizeof(lock));
@@ -1080,7 +1080,7 @@ int mga_dma_reset(DRM_IOCTL_ARGS)
DRM_DEVICE;
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
- LOCK_TEST_WITH_RETURN(dev, filp);
+ LOCK_TEST_WITH_RETURN(dev, file_priv);
return mga_do_dma_reset(dev_priv);
}
@@ -1089,7 +1089,8 @@ int mga_dma_reset(DRM_IOCTL_ARGS)
* DMA buffer management
*/
-static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d)
+static int mga_dma_get_buffers(struct drm_device * dev,
+ struct drm_file *file_priv, struct drm_dma * d)
{
struct drm_buf *buf;
int i;
@@ -1099,7 +1100,7 @@ static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm
if (!buf)
return -EAGAIN;
- buf->filp = filp;
+ buf->file_priv = file_priv;
if (DRM_COPY_TO_USER(&d->request_indices[i],
&buf->idx, sizeof(buf->idx)))
@@ -1122,7 +1123,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
struct drm_dma d;
int ret = 0;
- LOCK_TEST_WITH_RETURN(dev, filp);
+ LOCK_TEST_WITH_RETURN(dev, file_priv);
DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
@@ -1147,7 +1148,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
d.granted_count = 0;
if (d.request_count) {
- ret = mga_dma_get_buffers(filp, dev, &d);
+ ret = mga_dma_get_buffers(dev, file_priv, &d);
}
DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d));