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_irq.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_irq.c')
-rw-r--r-- | drivers/char/drm/drm_irq.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c index 871d2fde09b3..9fdc2953c73f 100644 --- a/drivers/char/drm/drm_irq.c +++ b/drivers/char/drm/drm_irq.c | |||
@@ -41,7 +41,7 @@ | |||
41 | * Get interrupt from bus id. | 41 | * Get interrupt from bus id. |
42 | * | 42 | * |
43 | * \param inode device inode. | 43 | * \param inode device inode. |
44 | * \param filp file pointer. | 44 | * \param file_priv DRM file private. |
45 | * \param cmd command. | 45 | * \param cmd command. |
46 | * \param arg user argument, pointing to a drm_irq_busid structure. | 46 | * \param arg user argument, pointing to a drm_irq_busid structure. |
47 | * \return zero on success or a negative number on failure. | 47 | * \return zero on success or a negative number on failure. |
@@ -50,11 +50,10 @@ | |||
50 | * This IOCTL is deprecated, and will now return EINVAL for any busid not equal | 50 | * This IOCTL is deprecated, and will now return EINVAL for any busid not equal |
51 | * to that of the device that this DRM instance attached to. | 51 | * to that of the device that this DRM instance attached to. |
52 | */ | 52 | */ |
53 | int drm_irq_by_busid(struct inode *inode, struct file *filp, | 53 | int drm_irq_by_busid(struct inode *inode, struct drm_file *file_priv, |
54 | unsigned int cmd, unsigned long arg) | 54 | unsigned int cmd, unsigned long arg) |
55 | { | 55 | { |
56 | struct drm_file *priv = filp->private_data; | 56 | struct drm_device *dev = file_priv->head->dev; |
57 | struct drm_device *dev = priv->head->dev; | ||
58 | struct drm_irq_busid __user *argp = (void __user *)arg; | 57 | struct drm_irq_busid __user *argp = (void __user *)arg; |
59 | struct drm_irq_busid p; | 58 | struct drm_irq_busid p; |
60 | 59 | ||
@@ -187,18 +186,17 @@ EXPORT_SYMBOL(drm_irq_uninstall); | |||
187 | * IRQ control ioctl. | 186 | * IRQ control ioctl. |
188 | * | 187 | * |
189 | * \param inode device inode. | 188 | * \param inode device inode. |
190 | * \param filp file pointer. | 189 | * \param file_priv DRM file private. |
191 | * \param cmd command. | 190 | * \param cmd command. |
192 | * \param arg user argument, pointing to a drm_control structure. | 191 | * \param arg user argument, pointing to a drm_control structure. |
193 | * \return zero on success or a negative number on failure. | 192 | * \return zero on success or a negative number on failure. |
194 | * | 193 | * |
195 | * Calls irq_install() or irq_uninstall() according to \p arg. | 194 | * Calls irq_install() or irq_uninstall() according to \p arg. |
196 | */ | 195 | */ |
197 | int drm_control(struct inode *inode, struct file *filp, | 196 | int drm_control(struct inode *inode, struct drm_file *file_priv, |
198 | unsigned int cmd, unsigned long arg) | 197 | unsigned int cmd, unsigned long arg) |
199 | { | 198 | { |
200 | struct drm_file *priv = filp->private_data; | 199 | struct drm_device *dev = file_priv->head->dev; |
201 | struct drm_device *dev = priv->head->dev; | ||
202 | struct drm_control ctl; | 200 | struct drm_control ctl; |
203 | 201 | ||
204 | /* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */ | 202 | /* if we haven't irq we fallback for compatibility reasons - this used to be a separate function in drm_dma.h */ |
@@ -227,7 +225,7 @@ int drm_control(struct inode *inode, struct file *filp, | |||
227 | * Wait for VBLANK. | 225 | * Wait for VBLANK. |
228 | * | 226 | * |
229 | * \param inode device inode. | 227 | * \param inode device inode. |
230 | * \param filp file pointer. | 228 | * \param file_priv DRM file private. |
231 | * \param cmd command. | 229 | * \param cmd command. |
232 | * \param data user argument, pointing to a drm_wait_vblank structure. | 230 | * \param data user argument, pointing to a drm_wait_vblank structure. |
233 | * \return zero on success or a negative number on failure. | 231 | * \return zero on success or a negative number on failure. |
@@ -244,8 +242,7 @@ int drm_control(struct inode *inode, struct file *filp, | |||
244 | */ | 242 | */ |
245 | int drm_wait_vblank(DRM_IOCTL_ARGS) | 243 | int drm_wait_vblank(DRM_IOCTL_ARGS) |
246 | { | 244 | { |
247 | struct drm_file *priv = filp->private_data; | 245 | struct drm_device *dev = file_priv->head->dev; |
248 | struct drm_device *dev = priv->head->dev; | ||
249 | union drm_wait_vblank __user *argp = (void __user *)data; | 246 | union drm_wait_vblank __user *argp = (void __user *)data; |
250 | union drm_wait_vblank vblwait; | 247 | union drm_wait_vblank vblwait; |
251 | struct timeval now; | 248 | struct timeval now; |