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_agpsupport.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_agpsupport.c')
-rw-r--r-- | drivers/char/drm/drm_agpsupport.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/drivers/char/drm/drm_agpsupport.c b/drivers/char/drm/drm_agpsupport.c index 354f0e3674bf..6d7a69abdc62 100644 --- a/drivers/char/drm/drm_agpsupport.c +++ b/drivers/char/drm/drm_agpsupport.c | |||
@@ -40,7 +40,7 @@ | |||
40 | * Get AGP information. | 40 | * Get AGP information. |
41 | * | 41 | * |
42 | * \param inode device inode. | 42 | * \param inode device inode. |
43 | * \param filp file pointer. | 43 | * \param file_priv DRM file private. |
44 | * \param cmd command. | 44 | * \param cmd command. |
45 | * \param arg pointer to a (output) drm_agp_info structure. | 45 | * \param arg pointer to a (output) drm_agp_info structure. |
46 | * \return zero on success or a negative number on failure. | 46 | * \return zero on success or a negative number on failure. |
@@ -71,11 +71,10 @@ int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info) | |||
71 | 71 | ||
72 | EXPORT_SYMBOL(drm_agp_info); | 72 | EXPORT_SYMBOL(drm_agp_info); |
73 | 73 | ||
74 | int drm_agp_info_ioctl(struct inode *inode, struct file *filp, | 74 | int drm_agp_info_ioctl(struct inode *inode, struct drm_file *file_priv, |
75 | unsigned int cmd, unsigned long arg) | 75 | unsigned int cmd, unsigned long arg) |
76 | { | 76 | { |
77 | struct drm_file *priv = filp->private_data; | 77 | struct drm_device *dev = file_priv->head->dev; |
78 | struct drm_device *dev = priv->head->dev; | ||
79 | struct drm_agp_info info; | 78 | struct drm_agp_info info; |
80 | int err; | 79 | int err; |
81 | 80 | ||
@@ -115,7 +114,7 @@ EXPORT_SYMBOL(drm_agp_acquire); | |||
115 | * Acquire the AGP device (ioctl). | 114 | * Acquire the AGP device (ioctl). |
116 | * | 115 | * |
117 | * \param inode device inode. | 116 | * \param inode device inode. |
118 | * \param filp file pointer. | 117 | * \param file_priv DRM file private. |
119 | * \param cmd command. | 118 | * \param cmd command. |
120 | * \param arg user argument. | 119 | * \param arg user argument. |
121 | * \return zero on success or a negative number on failure. | 120 | * \return zero on success or a negative number on failure. |
@@ -123,12 +122,10 @@ EXPORT_SYMBOL(drm_agp_acquire); | |||
123 | * Verifies the AGP device hasn't been acquired before and calls | 122 | * Verifies the AGP device hasn't been acquired before and calls |
124 | * \c agp_backend_acquire. | 123 | * \c agp_backend_acquire. |
125 | */ | 124 | */ |
126 | int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, | 125 | int drm_agp_acquire_ioctl(struct inode *inode, struct drm_file *file_priv, |
127 | unsigned int cmd, unsigned long arg) | 126 | unsigned int cmd, unsigned long arg) |
128 | { | 127 | { |
129 | struct drm_file *priv = filp->private_data; | 128 | return drm_agp_acquire((struct drm_device *) file_priv->head->dev); |
130 | |||
131 | return drm_agp_acquire((struct drm_device *) priv->head->dev); | ||
132 | } | 129 | } |
133 | 130 | ||
134 | /** | 131 | /** |
@@ -149,11 +146,10 @@ int drm_agp_release(struct drm_device * dev) | |||
149 | } | 146 | } |
150 | EXPORT_SYMBOL(drm_agp_release); | 147 | EXPORT_SYMBOL(drm_agp_release); |
151 | 148 | ||
152 | int drm_agp_release_ioctl(struct inode *inode, struct file *filp, | 149 | int drm_agp_release_ioctl(struct inode *inode, struct drm_file *file_priv, |
153 | unsigned int cmd, unsigned long arg) | 150 | unsigned int cmd, unsigned long arg) |
154 | { | 151 | { |
155 | struct drm_file *priv = filp->private_data; | 152 | struct drm_device *dev = file_priv->head->dev; |
156 | struct drm_device *dev = priv->head->dev; | ||
157 | 153 | ||
158 | return drm_agp_release(dev); | 154 | return drm_agp_release(dev); |
159 | } | 155 | } |
@@ -182,11 +178,10 @@ int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode) | |||
182 | 178 | ||
183 | EXPORT_SYMBOL(drm_agp_enable); | 179 | EXPORT_SYMBOL(drm_agp_enable); |
184 | 180 | ||
185 | int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, | 181 | int drm_agp_enable_ioctl(struct inode *inode, struct drm_file *file_priv, |
186 | unsigned int cmd, unsigned long arg) | 182 | unsigned int cmd, unsigned long arg) |
187 | { | 183 | { |
188 | struct drm_file *priv = filp->private_data; | 184 | struct drm_device *dev = file_priv->head->dev; |
189 | struct drm_device *dev = priv->head->dev; | ||
190 | struct drm_agp_mode mode; | 185 | struct drm_agp_mode mode; |
191 | 186 | ||
192 | if (copy_from_user(&mode, (struct drm_agp_mode __user *) arg, sizeof(mode))) | 187 | if (copy_from_user(&mode, (struct drm_agp_mode __user *) arg, sizeof(mode))) |
@@ -199,7 +194,7 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, | |||
199 | * Allocate AGP memory. | 194 | * Allocate AGP memory. |
200 | * | 195 | * |
201 | * \param inode device inode. | 196 | * \param inode device inode. |
202 | * \param filp file pointer. | 197 | * \param file_priv file private pointer. |
203 | * \param cmd command. | 198 | * \param cmd command. |
204 | * \param arg pointer to a drm_agp_buffer structure. | 199 | * \param arg pointer to a drm_agp_buffer structure. |
205 | * \return zero on success or a negative number on failure. | 200 | * \return zero on success or a negative number on failure. |
@@ -241,11 +236,10 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) | |||
241 | } | 236 | } |
242 | EXPORT_SYMBOL(drm_agp_alloc); | 237 | EXPORT_SYMBOL(drm_agp_alloc); |
243 | 238 | ||
244 | int drm_agp_alloc_ioctl(struct inode *inode, struct file *filp, | 239 | int drm_agp_alloc_ioctl(struct inode *inode, struct drm_file *file_priv, |
245 | unsigned int cmd, unsigned long arg) | 240 | unsigned int cmd, unsigned long arg) |
246 | { | 241 | { |
247 | struct drm_file *priv = filp->private_data; | 242 | struct drm_device *dev = file_priv->head->dev; |
248 | struct drm_device *dev = priv->head->dev; | ||
249 | struct drm_agp_buffer request; | 243 | struct drm_agp_buffer request; |
250 | struct drm_agp_buffer __user *argp = (void __user *)arg; | 244 | struct drm_agp_buffer __user *argp = (void __user *)arg; |
251 | int err; | 245 | int err; |
@@ -297,7 +291,7 @@ static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device * dev, | |||
297 | * Unbind AGP memory from the GATT (ioctl). | 291 | * Unbind AGP memory from the GATT (ioctl). |
298 | * | 292 | * |
299 | * \param inode device inode. | 293 | * \param inode device inode. |
300 | * \param filp file pointer. | 294 | * \param file_priv DRM file private. |
301 | * \param cmd command. | 295 | * \param cmd command. |
302 | * \param arg pointer to a drm_agp_binding structure. | 296 | * \param arg pointer to a drm_agp_binding structure. |
303 | * \return zero on success or a negative number on failure. | 297 | * \return zero on success or a negative number on failure. |
@@ -323,11 +317,10 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request) | |||
323 | } | 317 | } |
324 | EXPORT_SYMBOL(drm_agp_unbind); | 318 | EXPORT_SYMBOL(drm_agp_unbind); |
325 | 319 | ||
326 | int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, | 320 | int drm_agp_unbind_ioctl(struct inode *inode, struct drm_file *file_priv, |
327 | unsigned int cmd, unsigned long arg) | 321 | unsigned int cmd, unsigned long arg) |
328 | { | 322 | { |
329 | struct drm_file *priv = filp->private_data; | 323 | struct drm_device *dev = file_priv->head->dev; |
330 | struct drm_device *dev = priv->head->dev; | ||
331 | struct drm_agp_binding request; | 324 | struct drm_agp_binding request; |
332 | 325 | ||
333 | if (copy_from_user | 326 | if (copy_from_user |
@@ -341,7 +334,7 @@ int drm_agp_unbind_ioctl(struct inode *inode, struct file *filp, | |||
341 | * Bind AGP memory into the GATT (ioctl) | 334 | * Bind AGP memory into the GATT (ioctl) |
342 | * | 335 | * |
343 | * \param inode device inode. | 336 | * \param inode device inode. |
344 | * \param filp file pointer. | 337 | * \param file_priv DRM file private. |
345 | * \param cmd command. | 338 | * \param cmd command. |
346 | * \param arg pointer to a drm_agp_binding structure. | 339 | * \param arg pointer to a drm_agp_binding structure. |
347 | * \return zero on success or a negative number on failure. | 340 | * \return zero on success or a negative number on failure. |
@@ -372,11 +365,10 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) | |||
372 | } | 365 | } |
373 | EXPORT_SYMBOL(drm_agp_bind); | 366 | EXPORT_SYMBOL(drm_agp_bind); |
374 | 367 | ||
375 | int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, | 368 | int drm_agp_bind_ioctl(struct inode *inode, struct drm_file *file_priv, |
376 | unsigned int cmd, unsigned long arg) | 369 | unsigned int cmd, unsigned long arg) |
377 | { | 370 | { |
378 | struct drm_file *priv = filp->private_data; | 371 | struct drm_device *dev = file_priv->head->dev; |
379 | struct drm_device *dev = priv->head->dev; | ||
380 | struct drm_agp_binding request; | 372 | struct drm_agp_binding request; |
381 | 373 | ||
382 | if (copy_from_user | 374 | if (copy_from_user |
@@ -390,7 +382,7 @@ int drm_agp_bind_ioctl(struct inode *inode, struct file *filp, | |||
390 | * Free AGP memory (ioctl). | 382 | * Free AGP memory (ioctl). |
391 | * | 383 | * |
392 | * \param inode device inode. | 384 | * \param inode device inode. |
393 | * \param filp file pointer. | 385 | * \param file_priv DRM file private. |
394 | * \param cmd command. | 386 | * \param cmd command. |
395 | * \param arg pointer to a drm_agp_buffer structure. | 387 | * \param arg pointer to a drm_agp_buffer structure. |
396 | * \return zero on success or a negative number on failure. | 388 | * \return zero on success or a negative number on failure. |
@@ -419,11 +411,10 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request) | |||
419 | } | 411 | } |
420 | EXPORT_SYMBOL(drm_agp_free); | 412 | EXPORT_SYMBOL(drm_agp_free); |
421 | 413 | ||
422 | int drm_agp_free_ioctl(struct inode *inode, struct file *filp, | 414 | int drm_agp_free_ioctl(struct inode *inode, struct drm_file *file_priv, |
423 | unsigned int cmd, unsigned long arg) | 415 | unsigned int cmd, unsigned long arg) |
424 | { | 416 | { |
425 | struct drm_file *priv = filp->private_data; | 417 | struct drm_device *dev = file_priv->head->dev; |
426 | struct drm_device *dev = priv->head->dev; | ||
427 | struct drm_agp_buffer request; | 418 | struct drm_agp_buffer request; |
428 | 419 | ||
429 | if (copy_from_user | 420 | if (copy_from_user |