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_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/drm_dma.c')
-rw-r--r-- | drivers/char/drm/drm_dma.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/drm/drm_dma.c b/drivers/char/drm/drm_dma.c index 802fbdbfe1b3..7a8e2fba4678 100644 --- a/drivers/char/drm/drm_dma.c +++ b/drivers/char/drm/drm_dma.c | |||
@@ -136,7 +136,7 @@ void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf) | |||
136 | 136 | ||
137 | buf->waiting = 0; | 137 | buf->waiting = 0; |
138 | buf->pending = 0; | 138 | buf->pending = 0; |
139 | buf->filp = NULL; | 139 | buf->file_priv = NULL; |
140 | buf->used = 0; | 140 | buf->used = 0; |
141 | 141 | ||
142 | if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) | 142 | if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) |
@@ -148,11 +148,12 @@ void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf) | |||
148 | /** | 148 | /** |
149 | * Reclaim the buffers. | 149 | * Reclaim the buffers. |
150 | * | 150 | * |
151 | * \param filp file pointer. | 151 | * \param file_priv DRM file private. |
152 | * | 152 | * |
153 | * Frees each buffer associated with \p filp not already on the hardware. | 153 | * Frees each buffer associated with \p file_priv not already on the hardware. |
154 | */ | 154 | */ |
155 | void drm_core_reclaim_buffers(struct drm_device *dev, struct file *filp) | 155 | void drm_core_reclaim_buffers(struct drm_device *dev, |
156 | struct drm_file *file_priv) | ||
156 | { | 157 | { |
157 | struct drm_device_dma *dma = dev->dma; | 158 | struct drm_device_dma *dma = dev->dma; |
158 | int i; | 159 | int i; |
@@ -160,7 +161,7 @@ void drm_core_reclaim_buffers(struct drm_device *dev, struct file *filp) | |||
160 | if (!dma) | 161 | if (!dma) |
161 | return; | 162 | return; |
162 | for (i = 0; i < dma->buf_count; i++) { | 163 | for (i = 0; i < dma->buf_count; i++) { |
163 | if (dma->buflist[i]->filp == filp) { | 164 | if (dma->buflist[i]->file_priv == file_priv) { |
164 | switch (dma->buflist[i]->list) { | 165 | switch (dma->buflist[i]->list) { |
165 | case DRM_LIST_NONE: | 166 | case DRM_LIST_NONE: |
166 | drm_free_buffer(dev, dma->buflist[i]); | 167 | drm_free_buffer(dev, dma->buflist[i]); |