diff options
| author | Christian König <christian.koenig@amd.com> | 2018-05-28 05:47:52 -0400 |
|---|---|---|
| committer | Christian König <easy2remember.chk@googlemail.com> | 2018-06-20 09:59:34 -0400 |
| commit | a19741e5e5a9f1f02f8e3c037bde7d73d4bfae9c (patch) | |
| tree | d8bb44f202176642279338f7815a251bb44d6d33 | |
| parent | 2227a7a219fdd2b925b1e861f36255efd149ff6d (diff) | |
dma_buf: remove device parameter from attach callback v2
The device parameter is completely unused because it is available in the
attachment structure as well.
v2: fix kerneldoc as well
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/226643/
| -rw-r--r-- | drivers/dma-buf/dma-buf.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_prime.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/udl/udl_dmabuf.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 1 | ||||
| -rw-r--r-- | drivers/media/common/videobuf2/videobuf2-dma-contig.c | 2 | ||||
| -rw-r--r-- | drivers/media/common/videobuf2/videobuf2-dma-sg.c | 2 | ||||
| -rw-r--r-- | drivers/media/common/videobuf2/videobuf2-vmalloc.c | 2 | ||||
| -rw-r--r-- | include/drm/drm_prime.h | 2 | ||||
| -rw-r--r-- | include/linux/dma-buf.h | 13 |
10 files changed, 13 insertions, 18 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 4c45e31258f0..50771063c617 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c | |||
| @@ -568,7 +568,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | |||
| 568 | mutex_lock(&dmabuf->lock); | 568 | mutex_lock(&dmabuf->lock); |
| 569 | 569 | ||
| 570 | if (dmabuf->ops->attach) { | 570 | if (dmabuf->ops->attach) { |
| 571 | ret = dmabuf->ops->attach(dmabuf, dev, attach); | 571 | ret = dmabuf->ops->attach(dmabuf, attach); |
| 572 | if (ret) | 572 | if (ret) |
| 573 | goto err_attach; | 573 | goto err_attach; |
| 574 | } | 574 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c index 4b584cb75bf4..bbbb4f9578db 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | |||
| @@ -127,7 +127,6 @@ error: | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, | 129 | static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, |
| 130 | struct device *target_dev, | ||
| 131 | struct dma_buf_attachment *attach) | 130 | struct dma_buf_attachment *attach) |
| 132 | { | 131 | { |
| 133 | struct drm_gem_object *obj = dma_buf->priv; | 132 | struct drm_gem_object *obj = dma_buf->priv; |
| @@ -135,7 +134,7 @@ static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, | |||
| 135 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); | 134 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); |
| 136 | long r; | 135 | long r; |
| 137 | 136 | ||
| 138 | r = drm_gem_map_attach(dma_buf, target_dev, attach); | 137 | r = drm_gem_map_attach(dma_buf, attach); |
| 139 | if (r) | 138 | if (r) |
| 140 | return r; | 139 | return r; |
| 141 | 140 | ||
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 397b46b33739..0055d919070c 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c | |||
| @@ -186,7 +186,6 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri | |||
| 186 | /** | 186 | /** |
| 187 | * drm_gem_map_attach - dma_buf attach implementation for GEM | 187 | * drm_gem_map_attach - dma_buf attach implementation for GEM |
| 188 | * @dma_buf: buffer to attach device to | 188 | * @dma_buf: buffer to attach device to |
| 189 | * @target_dev: not used | ||
| 190 | * @attach: buffer attachment data | 189 | * @attach: buffer attachment data |
| 191 | * | 190 | * |
| 192 | * Allocates &drm_prime_attachment and calls &drm_driver.gem_prime_pin for | 191 | * Allocates &drm_prime_attachment and calls &drm_driver.gem_prime_pin for |
| @@ -195,7 +194,7 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri | |||
| 195 | * | 194 | * |
| 196 | * Returns 0 on success, negative error code on failure. | 195 | * Returns 0 on success, negative error code on failure. |
| 197 | */ | 196 | */ |
| 198 | int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, | 197 | int drm_gem_map_attach(struct dma_buf *dma_buf, |
| 199 | struct dma_buf_attachment *attach) | 198 | struct dma_buf_attachment *attach) |
| 200 | { | 199 | { |
| 201 | struct drm_prime_attachment *prime_attach; | 200 | struct drm_prime_attachment *prime_attach; |
diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dmabuf.c index 0a20695eb120..91ae60309d3e 100644 --- a/drivers/gpu/drm/udl/udl_dmabuf.c +++ b/drivers/gpu/drm/udl/udl_dmabuf.c | |||
| @@ -29,7 +29,6 @@ struct udl_drm_dmabuf_attachment { | |||
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | static int udl_attach_dma_buf(struct dma_buf *dmabuf, | 31 | static int udl_attach_dma_buf(struct dma_buf *dmabuf, |
| 32 | struct device *dev, | ||
| 33 | struct dma_buf_attachment *attach) | 32 | struct dma_buf_attachment *attach) |
| 34 | { | 33 | { |
| 35 | struct udl_drm_dmabuf_attachment *udl_attach; | 34 | struct udl_drm_dmabuf_attachment *udl_attach; |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c b/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c index 0d42a46521fc..fbffb37ccf42 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | */ | 40 | */ |
| 41 | 41 | ||
| 42 | static int vmw_prime_map_attach(struct dma_buf *dma_buf, | 42 | static int vmw_prime_map_attach(struct dma_buf *dma_buf, |
| 43 | struct device *target_dev, | ||
| 44 | struct dma_buf_attachment *attach) | 43 | struct dma_buf_attachment *attach) |
| 45 | { | 44 | { |
| 46 | return -ENOSYS; | 45 | return -ENOSYS; |
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index f1178f6f434d..12d0072c52c2 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c | |||
| @@ -222,7 +222,7 @@ struct vb2_dc_attachment { | |||
| 222 | enum dma_data_direction dma_dir; | 222 | enum dma_data_direction dma_dir; |
| 223 | }; | 223 | }; |
| 224 | 224 | ||
| 225 | static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev, | 225 | static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, |
| 226 | struct dma_buf_attachment *dbuf_attach) | 226 | struct dma_buf_attachment *dbuf_attach) |
| 227 | { | 227 | { |
| 228 | struct vb2_dc_attachment *attach; | 228 | struct vb2_dc_attachment *attach; |
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index 753ed3138dcc..cf94765e593f 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c | |||
| @@ -371,7 +371,7 @@ struct vb2_dma_sg_attachment { | |||
| 371 | enum dma_data_direction dma_dir; | 371 | enum dma_data_direction dma_dir; |
| 372 | }; | 372 | }; |
| 373 | 373 | ||
| 374 | static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev, | 374 | static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, |
| 375 | struct dma_buf_attachment *dbuf_attach) | 375 | struct dma_buf_attachment *dbuf_attach) |
| 376 | { | 376 | { |
| 377 | struct vb2_dma_sg_attachment *attach; | 377 | struct vb2_dma_sg_attachment *attach; |
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index 359fb9804d16..cdec023a918d 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c | |||
| @@ -209,7 +209,7 @@ struct vb2_vmalloc_attachment { | |||
| 209 | enum dma_data_direction dma_dir; | 209 | enum dma_data_direction dma_dir; |
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev, | 212 | static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, |
| 213 | struct dma_buf_attachment *dbuf_attach) | 213 | struct dma_buf_attachment *dbuf_attach) |
| 214 | { | 214 | { |
| 215 | struct vb2_vmalloc_attachment *attach; | 215 | struct vb2_vmalloc_attachment *attach; |
diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h index 4d5f5d6cf6a6..ef338151cea8 100644 --- a/include/drm/drm_prime.h +++ b/include/drm/drm_prime.h | |||
| @@ -82,7 +82,7 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev, | |||
| 82 | struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, | 82 | struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, |
| 83 | struct dma_buf_export_info *exp_info); | 83 | struct dma_buf_export_info *exp_info); |
| 84 | void drm_gem_dmabuf_release(struct dma_buf *dma_buf); | 84 | void drm_gem_dmabuf_release(struct dma_buf *dma_buf); |
| 85 | int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev, | 85 | int drm_gem_map_attach(struct dma_buf *dma_buf, |
| 86 | struct dma_buf_attachment *attach); | 86 | struct dma_buf_attachment *attach); |
| 87 | void drm_gem_map_detach(struct dma_buf *dma_buf, | 87 | void drm_gem_map_detach(struct dma_buf *dma_buf, |
| 88 | struct dma_buf_attachment *attach); | 88 | struct dma_buf_attachment *attach); |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 88917fa796e4..c0ad5bf61188 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
| @@ -55,11 +55,11 @@ struct dma_buf_ops { | |||
| 55 | * @attach: | 55 | * @attach: |
| 56 | * | 56 | * |
| 57 | * This is called from dma_buf_attach() to make sure that a given | 57 | * This is called from dma_buf_attach() to make sure that a given |
| 58 | * &device can access the provided &dma_buf. Exporters which support | 58 | * &dma_buf_attachment.dev can access the provided &dma_buf. Exporters |
| 59 | * buffer objects in special locations like VRAM or device-specific | 59 | * which support buffer objects in special locations like VRAM or |
| 60 | * carveout areas should check whether the buffer could be move to | 60 | * device-specific carveout areas should check whether the buffer could |
| 61 | * system memory (or directly accessed by the provided device), and | 61 | * be move to system memory (or directly accessed by the provided |
| 62 | * otherwise need to fail the attach operation. | 62 | * device), and otherwise need to fail the attach operation. |
| 63 | * | 63 | * |
| 64 | * The exporter should also in general check whether the current | 64 | * The exporter should also in general check whether the current |
| 65 | * allocation fullfills the DMA constraints of the new device. If this | 65 | * allocation fullfills the DMA constraints of the new device. If this |
| @@ -77,8 +77,7 @@ struct dma_buf_ops { | |||
| 77 | * to signal that backing storage is already allocated and incompatible | 77 | * to signal that backing storage is already allocated and incompatible |
| 78 | * with the requirements of requesting device. | 78 | * with the requirements of requesting device. |
| 79 | */ | 79 | */ |
| 80 | int (*attach)(struct dma_buf *, struct device *, | 80 | int (*attach)(struct dma_buf *, struct dma_buf_attachment *); |
| 81 | struct dma_buf_attachment *); | ||
| 82 | 81 | ||
| 83 | /** | 82 | /** |
| 84 | * @detach: | 83 | * @detach: |
