aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/mga_dma.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-08-25 06:23:09 -0400
committerDave Airlie <airlied@optimus.(none)>2007-10-14 20:38:20 -0400
commit6c340eac0285f3d62406d2d902d0e96fbf2a5dc0 (patch)
treea92039951cb7eaced306cfff2bad6af0ac5257ad /drivers/char/drm/mga_dma.c
parent20caafa6ecb2487d9b223aa33e7cc704f912a758 (diff)
drm: 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 everyth on Linux dereferenced filp to get file_priv anyway, while only the mmap ioct went the other direction. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/mga_dma.c')
-rw-r--r--drivers/char/drm/mga_dma.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index 0f23760eb629..95ff450239dd 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -1013,7 +1013,7 @@ int mga_dma_init(DRM_IOCTL_ARGS)
1013 drm_mga_init_t init; 1013 drm_mga_init_t init;
1014 int err; 1014 int err;
1015 1015
1016 LOCK_TEST_WITH_RETURN(dev, filp); 1016 LOCK_TEST_WITH_RETURN(dev, file_priv);
1017 1017
1018 DRM_COPY_FROM_USER_IOCTL(init, (drm_mga_init_t __user *) data, 1018 DRM_COPY_FROM_USER_IOCTL(init, (drm_mga_init_t __user *) data,
1019 sizeof(init)); 1019 sizeof(init));
@@ -1042,7 +1042,7 @@ int mga_dma_flush(DRM_IOCTL_ARGS)
1042 drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; 1042 drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
1043 struct drm_lock lock; 1043 struct drm_lock lock;
1044 1044
1045 LOCK_TEST_WITH_RETURN(dev, filp); 1045 LOCK_TEST_WITH_RETURN(dev, file_priv);
1046 1046
1047 DRM_COPY_FROM_USER_IOCTL(lock, (struct drm_lock __user *) data, 1047 DRM_COPY_FROM_USER_IOCTL(lock, (struct drm_lock __user *) data,
1048 sizeof(lock)); 1048 sizeof(lock));
@@ -1077,7 +1077,7 @@ int mga_dma_reset(DRM_IOCTL_ARGS)
1077 DRM_DEVICE; 1077 DRM_DEVICE;
1078 drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; 1078 drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
1079 1079
1080 LOCK_TEST_WITH_RETURN(dev, filp); 1080 LOCK_TEST_WITH_RETURN(dev, file_priv);
1081 1081
1082 return mga_do_dma_reset(dev_priv); 1082 return mga_do_dma_reset(dev_priv);
1083} 1083}
@@ -1086,7 +1086,8 @@ int mga_dma_reset(DRM_IOCTL_ARGS)
1086 * DMA buffer management 1086 * DMA buffer management
1087 */ 1087 */
1088 1088
1089static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d) 1089static int mga_dma_get_buffers(struct drm_device * dev,
1090 struct drm_file *file_priv, struct drm_dma * d)
1090{ 1091{
1091 struct drm_buf *buf; 1092 struct drm_buf *buf;
1092 int i; 1093 int i;
@@ -1096,7 +1097,7 @@ static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm
1096 if (!buf) 1097 if (!buf)
1097 return -EAGAIN; 1098 return -EAGAIN;
1098 1099
1099 buf->filp = filp; 1100 buf->file_priv = file_priv;
1100 1101
1101 if (DRM_COPY_TO_USER(&d->request_indices[i], 1102 if (DRM_COPY_TO_USER(&d->request_indices[i],
1102 &buf->idx, sizeof(buf->idx))) 1103 &buf->idx, sizeof(buf->idx)))
@@ -1119,7 +1120,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
1119 struct drm_dma d; 1120 struct drm_dma d;
1120 int ret = 0; 1121 int ret = 0;
1121 1122
1122 LOCK_TEST_WITH_RETURN(dev, filp); 1123 LOCK_TEST_WITH_RETURN(dev, file_priv);
1123 1124
1124 DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d)); 1125 DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
1125 1126
@@ -1144,7 +1145,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
1144 d.granted_count = 0; 1145 d.granted_count = 0;
1145 1146
1146 if (d.request_count) { 1147 if (d.request_count) {
1147 ret = mga_dma_get_buffers(filp, dev, &d); 1148 ret = mga_dma_get_buffers(dev, file_priv, &d);
1148 } 1149 }
1149 1150
1150 DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d)); 1151 DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d));