diff options
author | Eric Anholt <eric@anholt.net> | 2007-08-25 06:23:09 -0400 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-14 20:38:20 -0400 |
commit | 6c340eac0285f3d62406d2d902d0e96fbf2a5dc0 (patch) | |
tree | a92039951cb7eaced306cfff2bad6af0ac5257ad /drivers/char/drm/drm_ioctl.c | |
parent | 20caafa6ecb2487d9b223aa33e7cc704f912a758 (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/drm_ioctl.c')
-rw-r--r-- | drivers/char/drm/drm_ioctl.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c index 4eecfb9226d4..1b5d0da6566d 100644 --- a/drivers/char/drm/drm_ioctl.c +++ b/drivers/char/drm/drm_ioctl.c | |||
@@ -42,18 +42,17 @@ | |||
42 | * Get the bus id. | 42 | * Get the bus id. |
43 | * | 43 | * |
44 | * \param inode device inode. | 44 | * \param inode device inode. |
45 | * \param filp file pointer. | 45 | * \param file_priv DRM file private. |
46 | * \param cmd command. | 46 | * \param cmd command. |
47 | * \param arg user argument, pointing to a drm_unique structure. | 47 | * \param arg user argument, pointing to a drm_unique structure. |
48 | * \return zero on success or a negative number on failure. | 48 | * \return zero on success or a negative number on failure. |
49 | * | 49 | * |
50 | * Copies the bus id from drm_device::unique into user space. | 50 | * Copies the bus id from drm_device::unique into user space. |
51 | */ | 51 | */ |
52 | int drm_getunique(struct inode *inode, struct file *filp, | 52 | int drm_getunique(struct inode *inode, struct drm_file *file_priv, |
53 | unsigned int cmd, unsigned long arg) | 53 | unsigned int cmd, unsigned long arg) |
54 | { | 54 | { |
55 | struct drm_file *priv = filp->private_data; | 55 | struct drm_device *dev = file_priv->head->dev; |
56 | struct drm_device *dev = priv->head->dev; | ||
57 | struct drm_unique __user *argp = (void __user *)arg; | 56 | struct drm_unique __user *argp = (void __user *)arg; |
58 | struct drm_unique u; | 57 | struct drm_unique u; |
59 | 58 | ||
@@ -73,7 +72,7 @@ int drm_getunique(struct inode *inode, struct file *filp, | |||
73 | * Set the bus id. | 72 | * Set the bus id. |
74 | * | 73 | * |
75 | * \param inode device inode. | 74 | * \param inode device inode. |
76 | * \param filp file pointer. | 75 | * \param file_priv DRM file private. |
77 | * \param cmd command. | 76 | * \param cmd command. |
78 | * \param arg user argument, pointing to a drm_unique structure. | 77 | * \param arg user argument, pointing to a drm_unique structure. |
79 | * \return zero on success or a negative number on failure. | 78 | * \return zero on success or a negative number on failure. |
@@ -83,11 +82,10 @@ int drm_getunique(struct inode *inode, struct file *filp, | |||
83 | * in interface version 1.1 and will return EBUSY when setversion has requested | 82 | * in interface version 1.1 and will return EBUSY when setversion has requested |
84 | * version 1.1 or greater. | 83 | * version 1.1 or greater. |
85 | */ | 84 | */ |
86 | int drm_setunique(struct inode *inode, struct file *filp, | 85 | int drm_setunique(struct inode *inode, struct drm_file *file_priv, |
87 | unsigned int cmd, unsigned long arg) | 86 | unsigned int cmd, unsigned long arg) |
88 | { | 87 | { |
89 | struct drm_file *priv = filp->private_data; | 88 | struct drm_device *dev = file_priv->head->dev; |
90 | struct drm_device *dev = priv->head->dev; | ||
91 | struct drm_unique u; | 89 | struct drm_unique u; |
92 | int domain, bus, slot, func, ret; | 90 | int domain, bus, slot, func, ret; |
93 | 91 | ||
@@ -172,7 +170,7 @@ static int drm_set_busid(struct drm_device * dev) | |||
172 | * Get a mapping information. | 170 | * Get a mapping information. |
173 | * | 171 | * |
174 | * \param inode device inode. | 172 | * \param inode device inode. |
175 | * \param filp file pointer. | 173 | * \param file_priv DRM file private. |
176 | * \param cmd command. | 174 | * \param cmd command. |
177 | * \param arg user argument, pointing to a drm_map structure. | 175 | * \param arg user argument, pointing to a drm_map structure. |
178 | * | 176 | * |
@@ -181,11 +179,10 @@ static int drm_set_busid(struct drm_device * dev) | |||
181 | * Searches for the mapping with the specified offset and copies its information | 179 | * Searches for the mapping with the specified offset and copies its information |
182 | * into userspace | 180 | * into userspace |
183 | */ | 181 | */ |
184 | int drm_getmap(struct inode *inode, struct file *filp, | 182 | int drm_getmap(struct inode *inode, struct drm_file *file_priv, |
185 | unsigned int cmd, unsigned long arg) | 183 | unsigned int cmd, unsigned long arg) |
186 | { | 184 | { |
187 | struct drm_file *priv = filp->private_data; | 185 | struct drm_device *dev = file_priv->head->dev; |
188 | struct drm_device *dev = priv->head->dev; | ||
189 | struct drm_map __user *argp = (void __user *)arg; | 186 | struct drm_map __user *argp = (void __user *)arg; |
190 | struct drm_map map; | 187 | struct drm_map map; |
191 | struct drm_map_list *r_list = NULL; | 188 | struct drm_map_list *r_list = NULL; |
@@ -233,7 +230,7 @@ int drm_getmap(struct inode *inode, struct file *filp, | |||
233 | * Get client information. | 230 | * Get client information. |
234 | * | 231 | * |
235 | * \param inode device inode. | 232 | * \param inode device inode. |
236 | * \param filp file pointer. | 233 | * \param file_priv DRM file private. |
237 | * \param cmd command. | 234 | * \param cmd command. |
238 | * \param arg user argument, pointing to a drm_client structure. | 235 | * \param arg user argument, pointing to a drm_client structure. |
239 | * | 236 | * |
@@ -242,11 +239,10 @@ int drm_getmap(struct inode *inode, struct file *filp, | |||
242 | * Searches for the client with the specified index and copies its information | 239 | * Searches for the client with the specified index and copies its information |
243 | * into userspace | 240 | * into userspace |
244 | */ | 241 | */ |
245 | int drm_getclient(struct inode *inode, struct file *filp, | 242 | int drm_getclient(struct inode *inode, struct drm_file *file_priv, |
246 | unsigned int cmd, unsigned long arg) | 243 | unsigned int cmd, unsigned long arg) |
247 | { | 244 | { |
248 | struct drm_file *priv = filp->private_data; | 245 | struct drm_device *dev = file_priv->head->dev; |
249 | struct drm_device *dev = priv->head->dev; | ||
250 | struct drm_client __user *argp = (struct drm_client __user *)arg; | 246 | struct drm_client __user *argp = (struct drm_client __user *)arg; |
251 | struct drm_client client; | 247 | struct drm_client client; |
252 | struct drm_file *pt; | 248 | struct drm_file *pt; |
@@ -285,17 +281,16 @@ int drm_getclient(struct inode *inode, struct file *filp, | |||
285 | * Get statistics information. | 281 | * Get statistics information. |
286 | * | 282 | * |
287 | * \param inode device inode. | 283 | * \param inode device inode. |
288 | * \param filp file pointer. | 284 | * \param file_priv DRM file private. |
289 | * \param cmd command. | 285 | * \param cmd command. |
290 | * \param arg user argument, pointing to a drm_stats structure. | 286 | * \param arg user argument, pointing to a drm_stats structure. |
291 | * | 287 | * |
292 | * \return zero on success or a negative number on failure. | 288 | * \return zero on success or a negative number on failure. |
293 | */ | 289 | */ |
294 | int drm_getstats(struct inode *inode, struct file *filp, | 290 | int drm_getstats(struct inode *inode, struct drm_file *file_priv, |
295 | unsigned int cmd, unsigned long arg) | 291 | unsigned int cmd, unsigned long arg) |
296 | { | 292 | { |
297 | struct drm_file *priv = filp->private_data; | 293 | struct drm_device *dev = file_priv->head->dev; |
298 | struct drm_device *dev = priv->head->dev; | ||
299 | struct drm_stats stats; | 294 | struct drm_stats stats; |
300 | int i; | 295 | int i; |
301 | 296 | ||
@@ -325,7 +320,7 @@ int drm_getstats(struct inode *inode, struct file *filp, | |||
325 | * Setversion ioctl. | 320 | * Setversion ioctl. |
326 | * | 321 | * |
327 | * \param inode device inode. | 322 | * \param inode device inode. |
328 | * \param filp file pointer. | 323 | * \param file_priv DRM file private. |
329 | * \param cmd command. | 324 | * \param cmd command. |
330 | * \param arg user argument, pointing to a drm_lock structure. | 325 | * \param arg user argument, pointing to a drm_lock structure. |
331 | * \return zero on success or negative number on failure. | 326 | * \return zero on success or negative number on failure. |
@@ -381,7 +376,7 @@ int drm_setversion(DRM_IOCTL_ARGS) | |||
381 | } | 376 | } |
382 | 377 | ||
383 | /** No-op ioctl. */ | 378 | /** No-op ioctl. */ |
384 | int drm_noop(struct inode *inode, struct file *filp, unsigned int cmd, | 379 | int drm_noop(struct inode *inode, struct drm_file *file_priv, unsigned int cmd, |
385 | unsigned long arg) | 380 | unsigned long arg) |
386 | { | 381 | { |
387 | DRM_DEBUG("\n"); | 382 | DRM_DEBUG("\n"); |