aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/savage_bci.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/savage_bci.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/savage_bci.c')
-rw-r--r--drivers/char/drm/savage_bci.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/char/drm/savage_bci.c b/drivers/char/drm/savage_bci.c
index e1e88ca1c53c..18a3bc387817 100644
--- a/drivers/char/drm/savage_bci.c
+++ b/drivers/char/drm/savage_bci.c
@@ -933,7 +933,7 @@ static int savage_bci_init(DRM_IOCTL_ARGS)
933 DRM_DEVICE; 933 DRM_DEVICE;
934 drm_savage_init_t init; 934 drm_savage_init_t init;
935 935
936 LOCK_TEST_WITH_RETURN(dev, filp); 936 LOCK_TEST_WITH_RETURN(dev, file_priv);
937 937
938 DRM_COPY_FROM_USER_IOCTL(init, (drm_savage_init_t __user *) data, 938 DRM_COPY_FROM_USER_IOCTL(init, (drm_savage_init_t __user *) data,
939 sizeof(init)); 939 sizeof(init));
@@ -956,7 +956,7 @@ static int savage_bci_event_emit(DRM_IOCTL_ARGS)
956 956
957 DRM_DEBUG("\n"); 957 DRM_DEBUG("\n");
958 958
959 LOCK_TEST_WITH_RETURN(dev, filp); 959 LOCK_TEST_WITH_RETURN(dev, file_priv);
960 960
961 DRM_COPY_FROM_USER_IOCTL(event, (drm_savage_event_emit_t __user *) data, 961 DRM_COPY_FROM_USER_IOCTL(event, (drm_savage_event_emit_t __user *) data,
962 sizeof(event)); 962 sizeof(event));
@@ -1007,7 +1007,9 @@ static int savage_bci_event_wait(DRM_IOCTL_ARGS)
1007 * DMA buffer management 1007 * DMA buffer management
1008 */ 1008 */
1009 1009
1010static int savage_bci_get_buffers(DRMFILE filp, struct drm_device *dev, struct drm_dma *d) 1010static int savage_bci_get_buffers(struct drm_device *dev,
1011 struct drm_file *file_priv,
1012 struct drm_dma *d)
1011{ 1013{
1012 struct drm_buf *buf; 1014 struct drm_buf *buf;
1013 int i; 1015 int i;
@@ -1017,7 +1019,7 @@ static int savage_bci_get_buffers(DRMFILE filp, struct drm_device *dev, struct d
1017 if (!buf) 1019 if (!buf)
1018 return -EAGAIN; 1020 return -EAGAIN;
1019 1021
1020 buf->filp = filp; 1022 buf->file_priv = file_priv;
1021 1023
1022 if (DRM_COPY_TO_USER(&d->request_indices[i], 1024 if (DRM_COPY_TO_USER(&d->request_indices[i],
1023 &buf->idx, sizeof(buf->idx))) 1025 &buf->idx, sizeof(buf->idx)))
@@ -1038,7 +1040,7 @@ int savage_bci_buffers(DRM_IOCTL_ARGS)
1038 struct drm_dma d; 1040 struct drm_dma d;
1039 int ret = 0; 1041 int ret = 0;
1040 1042
1041 LOCK_TEST_WITH_RETURN(dev, filp); 1043 LOCK_TEST_WITH_RETURN(dev, file_priv);
1042 1044
1043 DRM_COPY_FROM_USER_IOCTL(d, (struct drm_dma __user *) data, sizeof(d)); 1045 DRM_COPY_FROM_USER_IOCTL(d, (struct drm_dma __user *) data, sizeof(d));
1044 1046
@@ -1061,7 +1063,7 @@ int savage_bci_buffers(DRM_IOCTL_ARGS)
1061 d.granted_count = 0; 1063 d.granted_count = 0;
1062 1064
1063 if (d.request_count) { 1065 if (d.request_count) {
1064 ret = savage_bci_get_buffers(filp, dev, &d); 1066 ret = savage_bci_get_buffers(dev, file_priv, &d);
1065 } 1067 }
1066 1068
1067 DRM_COPY_TO_USER_IOCTL((struct drm_dma __user *) data, d, sizeof(d)); 1069 DRM_COPY_TO_USER_IOCTL((struct drm_dma __user *) data, d, sizeof(d));
@@ -1069,7 +1071,7 @@ int savage_bci_buffers(DRM_IOCTL_ARGS)
1069 return ret; 1071 return ret;
1070} 1072}
1071 1073
1072void savage_reclaim_buffers(struct drm_device *dev, DRMFILE filp) 1074void savage_reclaim_buffers(struct drm_device *dev, struct drm_file *file_priv)
1073{ 1075{
1074 struct drm_device_dma *dma = dev->dma; 1076 struct drm_device_dma *dma = dev->dma;
1075 drm_savage_private_t *dev_priv = dev->dev_private; 1077 drm_savage_private_t *dev_priv = dev->dev_private;
@@ -1088,7 +1090,7 @@ void savage_reclaim_buffers(struct drm_device *dev, DRMFILE filp)
1088 struct drm_buf *buf = dma->buflist[i]; 1090 struct drm_buf *buf = dma->buflist[i];
1089 drm_savage_buf_priv_t *buf_priv = buf->dev_private; 1091 drm_savage_buf_priv_t *buf_priv = buf->dev_private;
1090 1092
1091 if (buf->filp == filp && buf_priv && 1093 if (buf->file_priv == file_priv && buf_priv &&
1092 buf_priv->next == NULL && buf_priv->prev == NULL) { 1094 buf_priv->next == NULL && buf_priv->prev == NULL) {
1093 uint16_t event; 1095 uint16_t event;
1094 DRM_DEBUG("reclaimed from client\n"); 1096 DRM_DEBUG("reclaimed from client\n");
@@ -1098,7 +1100,7 @@ void savage_reclaim_buffers(struct drm_device *dev, DRMFILE filp)
1098 } 1100 }
1099 } 1101 }
1100 1102
1101 drm_core_reclaim_buffers(dev, filp); 1103 drm_core_reclaim_buffers(dev, file_priv);
1102} 1104}
1103 1105
1104drm_ioctl_desc_t savage_ioctls[] = { 1106drm_ioctl_desc_t savage_ioctls[] = {