]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dma_buf: remove device parameter from attach callback v2
authorChristian König <christian.koenig@amd.com>
Mon, 28 May 2018 09:47:52 +0000 (11:47 +0200)
committerChristian König <easy2remember.chk@googlemail.com>
Wed, 20 Jun 2018 13:59:34 +0000 (15:59 +0200)
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/
drivers/dma-buf/dma-buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
drivers/gpu/drm/drm_prime.c
drivers/gpu/drm/udl/udl_dmabuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_prime.c
drivers/media/common/videobuf2/videobuf2-dma-contig.c
drivers/media/common/videobuf2/videobuf2-dma-sg.c
drivers/media/common/videobuf2/videobuf2-vmalloc.c
include/drm/drm_prime.h
include/linux/dma-buf.h

index 4c45e31258f0431dc33e8a966a9a0b4244ab0b1f..50771063c617abab26afc3b771b24b26024a54b3 100644 (file)
@@ -568,7 +568,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
        mutex_lock(&dmabuf->lock);
 
        if (dmabuf->ops->attach) {
-               ret = dmabuf->ops->attach(dmabuf, dev, attach);
+               ret = dmabuf->ops->attach(dmabuf, attach);
                if (ret)
                        goto err_attach;
        }
index 4b584cb75bf45a7af3a6ac22b652f0358d82bda2..bbbb4f9578db723bd87deff650547af8eae346d2 100644 (file)
@@ -127,7 +127,6 @@ amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
 }
 
 static int amdgpu_gem_map_attach(struct dma_buf *dma_buf,
-                                struct device *target_dev,
                                 struct dma_buf_attachment *attach)
 {
        struct drm_gem_object *obj = dma_buf->priv;
@@ -135,7 +134,7 @@ static int amdgpu_gem_map_attach(struct dma_buf *dma_buf,
        struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
        long r;
 
-       r = drm_gem_map_attach(dma_buf, target_dev, attach);
+       r = drm_gem_map_attach(dma_buf, attach);
        if (r)
                return r;
 
index 397b46b337399952fb2a143146294cc818deb49d..0055d919070cd16e33fa42ba96bcc333b3ff608a 100644 (file)
@@ -186,7 +186,6 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri
 /**
  * drm_gem_map_attach - dma_buf attach implementation for GEM
  * @dma_buf: buffer to attach device to
- * @target_dev: not used
  * @attach: buffer attachment data
  *
  * 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
  *
  * Returns 0 on success, negative error code on failure.
  */
-int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev,
+int drm_gem_map_attach(struct dma_buf *dma_buf,
                       struct dma_buf_attachment *attach)
 {
        struct drm_prime_attachment *prime_attach;
index 0a20695eb120e80bd448db9bfa540fcc42817c93..91ae60309d3e91231da70a1a8387d30f32a8495c 100644 (file)
@@ -29,7 +29,6 @@ struct udl_drm_dmabuf_attachment {
 };
 
 static int udl_attach_dma_buf(struct dma_buf *dmabuf,
-                             struct device *dev,
                              struct dma_buf_attachment *attach)
 {
        struct udl_drm_dmabuf_attachment *udl_attach;
index 0d42a46521fc1cc5c8083722fe03239d64ae3d87..fbffb37ccf42e6d547878c96eb581197093bec0a 100644 (file)
@@ -40,7 +40,6 @@
  */
 
 static int vmw_prime_map_attach(struct dma_buf *dma_buf,
-                               struct device *target_dev,
                                struct dma_buf_attachment *attach)
 {
        return -ENOSYS;
index f1178f6f434d0f76d419845d8789d87095ed355a..12d0072c52c2881241c18460a0524c8f8584c306 100644 (file)
@@ -222,7 +222,7 @@ struct vb2_dc_attachment {
        enum dma_data_direction dma_dir;
 };
 
-static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev,
+static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf,
        struct dma_buf_attachment *dbuf_attach)
 {
        struct vb2_dc_attachment *attach;
index 753ed3138dcc8bd77bacda888fa09ed849e09f69..cf94765e593fbc6643269809de385b621e677f50 100644 (file)
@@ -371,7 +371,7 @@ struct vb2_dma_sg_attachment {
        enum dma_data_direction dma_dir;
 };
 
-static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev,
+static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf,
        struct dma_buf_attachment *dbuf_attach)
 {
        struct vb2_dma_sg_attachment *attach;
index 359fb9804d160426ab037133e2102b979833ecff..cdec023a918df613d1a7763dc4eb0f6db5a4ca28 100644 (file)
@@ -209,7 +209,7 @@ struct vb2_vmalloc_attachment {
        enum dma_data_direction dma_dir;
 };
 
-static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, struct device *dev,
+static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf,
        struct dma_buf_attachment *dbuf_attach)
 {
        struct vb2_vmalloc_attachment *attach;
index 4d5f5d6cf6a686d73264baa1e2806c9c71097cb6..ef338151cea8d91b567de84957e514f86fd53e35 100644 (file)
@@ -82,7 +82,7 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,
 struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev,
                                      struct dma_buf_export_info *exp_info);
 void drm_gem_dmabuf_release(struct dma_buf *dma_buf);
-int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev,
+int drm_gem_map_attach(struct dma_buf *dma_buf,
                       struct dma_buf_attachment *attach);
 void drm_gem_map_detach(struct dma_buf *dma_buf,
                        struct dma_buf_attachment *attach);
index 88917fa796e44a2cc5ac960d951e99c747152ad7..c0ad5bf61188e401adbcc25e74f2b0d8640c249d 100644 (file)
@@ -55,11 +55,11 @@ struct dma_buf_ops {
         * @attach:
         *
         * This is called from dma_buf_attach() to make sure that a given
-        * &device can access the provided &dma_buf. Exporters which support
-        * buffer objects in special locations like VRAM or device-specific
-        * carveout areas should check whether the buffer could be move to
-        * system memory (or directly accessed by the provided device), and
-        * otherwise need to fail the attach operation.
+        * &dma_buf_attachment.dev can access the provided &dma_buf. Exporters
+        * which support buffer objects in special locations like VRAM or
+        * device-specific carveout areas should check whether the buffer could
+        * be move to system memory (or directly accessed by the provided
+        * device), and otherwise need to fail the attach operation.
         *
         * The exporter should also in general check whether the current
         * allocation fullfills the DMA constraints of the new device. If this
@@ -77,8 +77,7 @@ struct dma_buf_ops {
         * to signal that backing storage is already allocated and incompatible
         * with the requirements of requesting device.
         */
-       int (*attach)(struct dma_buf *, struct device *,
-                     struct dma_buf_attachment *);
+       int (*attach)(struct dma_buf *, struct dma_buf_attachment *);
 
        /**
         * @detach: