diff options
author | Eric Anholt <eric@anholt.net> | 2007-08-25 20:23:09 +1000 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-15 10:38:20 +1000 |
commit | 6c340eac0285f3d62406d2d902d0e96fbf2a5dc0 (patch) | |
tree | a92039951cb7eaced306cfff2bad6af0ac5257ad /drivers/char/drm/mga_dma.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/mga_dma.c')
-rw-r--r-- | drivers/char/drm/mga_dma.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c index 0f23760eb62..95ff450239d 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) drm_mga_init_t init; int err; - LOCK_TEST_WITH_RETURN(dev, filp); + LOCK_TEST_WITH_RETURN(dev, file_priv); DRM_COPY_FROM_USER_IOCTL(init, (drm_mga_init_t __user *) data, sizeof(init)); @@ -1042,7 +1042,7 @@ int mga_dma_flush(DRM_IOCTL_ARGS) drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; struct drm_lock lock; - LOCK_TEST_WITH_RETURN(dev, filp); + LOCK_TEST_WITH_RETURN(dev, file_priv); DRM_COPY_FROM_USER_IOCTL(lock, (struct drm_lock __user *) data, sizeof(lock)); @@ -1077,7 +1077,7 @@ int mga_dma_reset(DRM_IOCTL_ARGS) DRM_DEVICE; drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; - LOCK_TEST_WITH_RETURN(dev, filp); + LOCK_TEST_WITH_RETURN(dev, file_priv); return mga_do_dma_reset(dev_priv); } @@ -1086,7 +1086,8 @@ int mga_dma_reset(DRM_IOCTL_ARGS) * DMA buffer management */ -static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm_dma * d) +static int mga_dma_get_buffers(struct drm_device * dev, + struct drm_file *file_priv, struct drm_dma * d) { struct drm_buf *buf; int i; @@ -1096,7 +1097,7 @@ static int mga_dma_get_buffers(DRMFILE filp, struct drm_device * dev, struct drm if (!buf) return -EAGAIN; - buf->filp = filp; + buf->file_priv = file_priv; if (DRM_COPY_TO_USER(&d->request_indices[i], &buf->idx, sizeof(buf->idx))) @@ -1119,7 +1120,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS) struct drm_dma d; int ret = 0; - LOCK_TEST_WITH_RETURN(dev, filp); + LOCK_TEST_WITH_RETURN(dev, file_priv); DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d)); @@ -1144,7 +1145,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS) d.granted_count = 0; if (d.request_count) { - ret = mga_dma_get_buffers(filp, dev, &d); + ret = mga_dma_get_buffers(dev, file_priv, &d); } DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d)); |