AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] dma_buf: remove device parameter from attach callback
@ 2018-06-01 12:00 Christian König
       [not found] ` <20180601120020.11520-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Christian König @ 2018-06-01 12:00 UTC (permalink / raw)
  To: linaro-mm-sig, linux-media, dri-devel, amd-gfx

The device parameter is completely unused because it is available in the
attachment structure as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/dma-buf/dma-buf.c                             | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c             | 3 +--
 drivers/gpu/drm/drm_prime.c                           | 3 +--
 drivers/gpu/drm/udl/udl_dmabuf.c                      | 1 -
 drivers/gpu/drm/vmwgfx/vmwgfx_prime.c                 | 1 -
 drivers/media/common/videobuf2/videobuf2-dma-contig.c | 2 +-
 drivers/media/common/videobuf2/videobuf2-dma-sg.c     | 2 +-
 drivers/media/common/videobuf2/videobuf2-vmalloc.c    | 2 +-
 include/drm/drm_prime.h                               | 2 +-
 include/linux/dma-buf.h                               | 3 +--
 10 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index d78d5fc173dc..e99a8d19991b 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,
 	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;
 	}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
index 4683626b065f..f1500f1ec0f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
@@ -133,7 +133,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;
@@ -141,7 +140,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;
 
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 7856a9b3f8a8..4a3a232fea67 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
 /**
  * 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;
diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dmabuf.c
index 2867ed155ff6..5fdc8bdc2026 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 {
 };
 
 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;
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 @@
  */
 
 static int vmw_prime_map_attach(struct dma_buf *dma_buf,
-				struct device *target_dev,
 				struct dma_buf_attachment *attach)
 {
 	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 {
 	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;
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 {
 	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;
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
index 3a7c80cd1a17..298ffb9ecdae 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 {
 	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;
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,
 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);
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 085db2fee2d7..346caf77937f 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -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:
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2018-06-25  7:46 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-01 12:00 [PATCH 1/5] dma_buf: remove device parameter from attach callback Christian König
     [not found] ` <20180601120020.11520-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-06-01 12:00   ` [PATCH 2/5] dma-buf: remove kmap_atomic interface Christian König
     [not found]     ` <20180601120020.11520-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-06-18  8:18       ` Daniel Vetter
2018-06-19 14:47         ` Christian König
2018-06-19 15:35           ` Daniel Vetter
     [not found]             ` <CAKMK7uEvhMF92ifA=7xQ=9GR3NofZNExCDTHZTtikmujJTZ89A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-20 12:46               ` Christian König
     [not found]                 ` <c0552d8a-1c64-c99b-6ef8-83e253c49d30-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-20 12:52                   ` Daniel Vetter
     [not found]                     ` <CAKMK7uHHZn=H6px-yiXy7tVmmQy6GHrwGtG+B7or1ThsrriFDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-20 14:04                       ` Christian König
     [not found]                         ` <5d337ffc-6c4c-dafb-abb2-151d9d4aeaea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-20 14:21                           ` Christian König
     [not found]                             ` <3994b9d0-85fe-6495-5528-282f7b46a53f-5C7GfCeVMHo@public.gmane.org>
2018-06-21  6:26                               ` Daniel Vetter
     [not found]                                 ` <CAKMK7uFbvuikxSMgzquzXgcyVVonhWu3HNfrOR2s7RGB7k21ow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-21  6:30                                   ` Daniel Vetter
     [not found]                                     ` <CAKMK7uG7dtj136GAg6E9rVHm4dAg0a-A6EA=911fBi8YpVDbcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-21 10:59                                       ` Christian König
2018-06-20  6:10           ` Sumit Semwal
     [not found]             ` <CAO_48GG=whv7R5J1E-xHdZJYFsfYwgnyDq8CzKZktro60m1c+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-06-20  6:22               ` Christian König
2018-06-01 12:00   ` [PATCH 3/5] dma-buf: lock the reservation object during (un)map_dma_buf Christian König
     [not found]     ` <20180601120020.11520-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-06-18  8:22       ` Daniel Vetter
     [not found]         ` <20180618082224.GW3438-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-06-18 12:43           ` Christian König
2018-06-01 12:00   ` [PATCH 4/5] dma-buf: add dma_buf_(un)map_attachment_locked variants Christian König
2018-06-18  8:27     ` Daniel Vetter
2018-06-01 12:00   ` [PATCH 5/5] drm/amdgpu: add independent DMA-buf export v3 Christian König
     [not found]     ` <20180601120020.11520-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-06-18  8:28       ` Daniel Vetter
     [not found]         ` <20180618082857.GY3438-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-06-22 13:39           ` Christian König
     [not found]             ` <64382bf8-9539-6fa5-3f95-a3b627e4684d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-25  7:46               ` Daniel Vetter
2018-06-01 12:11   ` [PATCH 1/5] dma_buf: remove device parameter from attach callback Christian König
     [not found]     ` <651a24e0-ac58-e5cb-d95f-c9a88bf552dc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-01 14:02       ` Michel Dänzer
     [not found]         ` <df02be8b-530e-b691-35f1-ed657d71a508-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-01 15:17           ` Christian König
     [not found]             ` <64e8f2dd-5b09-397f-05ac-67646dfb5394-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-01 15:30               ` Michel Dänzer
2018-06-06 11:24   ` Christian König
2018-06-18  8:14   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox