All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] lib/scatterlist: add sg_set_dma_addr() helper
@ 2018-03-25 10:59 ` Christian König
  0 siblings, 0 replies; 161+ messages in thread
From: Christian König @ 2018-03-25 10:59 UTC (permalink / raw)
  To: linaro-mm-sig, linux-media, dri-devel, amd-gfx, linux-kernel

Use this function to set an sg entry to point to device resources mapped
using dma_map_resource(). The page pointer is set to NULL and only the DMA
address, length and offset values are valid.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 include/linux/scatterlist.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 22b2131bcdcd..f944ee4e482c 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -149,6 +149,29 @@ static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
 	sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
 }
 
+/**
+ * sg_set_dma_addr - Set sg entry to point at specified dma address
+ * @sg:		 SG entry
+ * @address:	 DMA address to set
+ * @len:	 Length of data
+ * @offset:	 Offset into page
+ *
+ * Description:
+ *   Use this function to set an sg entry to point to device resources mapped
+ *   using dma_map_resource(). The page pointer is set to NULL and only the DMA
+ *   address, length and offset values are valid.
+ *
+ **/
+static inline void sg_set_dma_addr(struct scatterlist *sg, dma_addr_t address,
+				   unsigned int len, unsigned int offset)
+{
+	sg_set_page(sg, NULL, len, offset);
+	sg->dma_address = address;
+#ifdef CONFIG_NEED_SG_DMA_LENGTH
+	sg->dma_length = len;
+#endif
+}
+
 /*
  * Loop over each sg element, following the pointer to a new list if necessary
  */
-- 
2.14.1

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

end of thread, other threads:[~2018-05-04 12:45 UTC | newest]

Thread overview: 161+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-25 10:59 [PATCH 1/8] lib/scatterlist: add sg_set_dma_addr() helper Christian König
2018-03-25 10:59 ` Christian König
2018-03-25 10:59 ` [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() Christian König
2018-03-25 10:59   ` Christian König
2018-03-28 12:38   ` Christoph Hellwig
2018-03-28 15:07     ` Christian König
2018-03-28 15:07       ` Christian König
2018-03-28 15:47       ` Logan Gunthorpe
2018-03-28 16:02         ` Christian König
2018-03-28 16:02           ` Christian König
2018-03-28 16:25           ` Logan Gunthorpe
2018-03-28 18:28             ` Christian König
2018-03-28 18:28               ` Christian König
2018-03-28 18:57               ` Logan Gunthorpe
2018-03-28 19:44                 ` Christian König
2018-03-28 19:44                   ` Christian König
2018-03-28 19:53                   ` Logan Gunthorpe
2018-03-29 11:44                     ` Christian König
2018-03-29 15:45                       ` Logan Gunthorpe
2018-03-29 16:10                         ` Christian König
2018-03-29 16:10                           ` Christian König
2018-03-29 16:25                           ` Logan Gunthorpe
2018-03-29 18:15                             ` Christian König
2018-03-29 18:15                               ` Christian König
2018-03-30  1:58                             ` Jerome Glisse
2018-03-30  1:58                               ` Jerome Glisse
2018-03-30  6:33                               ` Christoph Hellwig
2018-03-30  6:33                                 ` Christoph Hellwig
2018-03-30 15:25                                 ` Jerome Glisse
2018-03-30 18:46                               ` Logan Gunthorpe
2018-03-30 19:45                                 ` Jerome Glisse
2018-03-30 19:45                                   ` Jerome Glisse
2018-04-02 17:02                                   ` Logan Gunthorpe
2018-04-02 17:20                                     ` Jerome Glisse
2018-04-02 17:20                                       ` Jerome Glisse
2018-04-02 17:37                                       ` Logan Gunthorpe
2018-04-02 19:16                                         ` Jerome Glisse
2018-04-02 19:16                                           ` Jerome Glisse
2018-04-02 19:32                                           ` Logan Gunthorpe
2018-04-02 19:45                                             ` Jerome Glisse
2018-04-02 19:45                                               ` Jerome Glisse
     [not found]                     ` <CADnq5_P-z=Noos_jaME9_CERri3C-m2hPPvx2bArr36O=1FnrA@mail.gmail.com>
2018-03-29 14:37                       ` Alex Deucher
2018-03-29 14:37                         ` Alex Deucher
2018-03-25 10:59 ` [PATCH 3/8] PCI: Add pci_peer_traffic_supported() Christian König
2018-03-25 10:59   ` Christian König
2018-03-25 10:59 ` [PATCH 4/8] dma-buf: add peer2peer flag Christian König
2018-03-25 10:59   ` Christian König
2018-03-29  6:57   ` Daniel Vetter
2018-03-29  6:57     ` Daniel Vetter
2018-03-29 11:34     ` Christian König
2018-03-29 11:34       ` Christian König
2018-04-03  9:09       ` Daniel Vetter
2018-04-03  9:09         ` Daniel Vetter
2018-04-03 17:06         ` Jerome Glisse
2018-04-03 17:06           ` Jerome Glisse
2018-04-03 18:08           ` Daniel Vetter
2018-04-03 18:08             ` Daniel Vetter
2018-04-16 12:39             ` Christoph Hellwig
2018-04-16 12:39               ` Christoph Hellwig
2018-04-16 13:38               ` Daniel Vetter
2018-04-16 13:38                 ` Daniel Vetter
2018-04-19  8:16                 ` Christoph Hellwig
2018-04-19  8:16                   ` Christoph Hellwig
2018-04-20  7:13                   ` Daniel Vetter
2018-04-20  7:13                     ` Daniel Vetter
2018-04-20  8:58                     ` Christian König
2018-04-20  8:58                       ` Christian König
2018-04-20 10:17                       ` Christoph Hellwig
2018-04-20 10:17                         ` Christoph Hellwig
2018-04-20 10:44                         ` Christian König
2018-04-20 10:44                           ` Christian König
2018-04-20 12:46                           ` Christoph Hellwig
2018-04-20 15:21                             ` [Linaro-mm-sig] " Daniel Vetter
2018-04-24 18:48                               ` Christoph Hellwig
2018-04-24 18:48                                 ` Christoph Hellwig
2018-04-24 19:32                                 ` Daniel Vetter
2018-04-24 19:32                                   ` Daniel Vetter
2018-04-25  5:48                                   ` Christoph Hellwig
2018-04-25  5:48                                     ` Christoph Hellwig
2018-04-25  6:10                                     ` Alex Deucher
2018-04-25  6:10                                       ` Alex Deucher
2018-04-25  6:13                                     ` Daniel Vetter
2018-04-25  6:13                                       ` Daniel Vetter
2018-04-25  6:23                                       ` Daniel Vetter
2018-04-25  6:23                                         ` Daniel Vetter
2018-04-25  6:43                                         ` Christoph Hellwig
2018-04-25  6:43                                           ` Christoph Hellwig
2018-04-25  7:02                                           ` Daniel Vetter
2018-04-25  7:02                                             ` Daniel Vetter
2018-04-25  7:09                                             ` Christoph Hellwig
2018-04-25  7:09                                               ` Christoph Hellwig
2018-04-25  7:30                                               ` Daniel Vetter
2018-04-25  7:30                                                 ` Daniel Vetter
2018-04-25  7:56                                                 ` Thierry Reding
2018-04-25  7:56                                                   ` Thierry Reding
2018-04-25  8:55                                                   ` Christoph Hellwig
2018-04-25  8:55                                                     ` Christoph Hellwig
2018-04-25  7:43                                               ` Thierry Reding
2018-04-25  7:43                                                 ` Thierry Reding
2018-04-25  7:41                                           ` Thierry Reding
2018-04-25  7:41                                             ` Thierry Reding
2018-04-25  8:54                                             ` noveau vs arm dma ops Christoph Hellwig
2018-04-25  8:54                                               ` Christoph Hellwig
2018-04-25  8:54                                               ` Christoph Hellwig
2018-04-25  9:25                                               ` Russell King - ARM Linux
2018-04-25  9:25                                                 ` Russell King - ARM Linux
2018-04-25 10:04                                               ` Daniel Vetter
2018-04-25 10:04                                                 ` Daniel Vetter
2018-04-25 10:04                                                 ` Daniel Vetter
2018-04-25 15:33                                                 ` Christoph Hellwig
2018-04-25 15:33                                                   ` Christoph Hellwig
2018-04-25 15:33                                                   ` Christoph Hellwig
2018-04-25 21:35                                                   ` Daniel Vetter
2018-04-25 21:35                                                     ` Daniel Vetter
2018-04-25 21:35                                                     ` Daniel Vetter
2018-04-25 23:26                                                     ` Russell King - ARM Linux
2018-04-25 23:26                                                       ` Russell King - ARM Linux
2018-04-26  9:17                                                       ` Daniel Vetter
2018-04-26  9:17                                                         ` Daniel Vetter
2018-04-26  9:17                                                         ` Daniel Vetter
2018-04-26  9:09                                                     ` Christoph Hellwig
2018-04-26  9:09                                                       ` Christoph Hellwig
2018-04-26  9:09                                                       ` Christoph Hellwig
2018-04-26  9:45                                                       ` Daniel Vetter
2018-04-26  9:45                                                         ` Daniel Vetter
2018-04-26  9:45                                                         ` Daniel Vetter
2018-04-26 11:12                                                       ` Russell King - ARM Linux
2018-04-26 11:12                                                         ` Russell King - ARM Linux
2018-04-25 22:54                                                   ` Russell King - ARM Linux
2018-04-25 22:54                                                     ` Russell King - ARM Linux
2018-04-26  9:13                                                     ` Christoph Hellwig
2018-04-26  9:13                                                       ` Christoph Hellwig
2018-04-26  9:13                                                       ` Christoph Hellwig
2018-04-26  9:20                                                     ` [Linaro-mm-sig] " Daniel Vetter
2018-04-26  9:20                                                       ` Daniel Vetter
2018-04-26  9:20                                                       ` Daniel Vetter
2018-04-26  9:24                                                       ` Christoph Hellwig
2018-04-26  9:24                                                         ` Christoph Hellwig
2018-04-26  9:24                                                         ` Christoph Hellwig
2018-04-26  9:39                                                         ` Daniel Vetter
2018-04-26  9:39                                                           ` Daniel Vetter
2018-04-26  9:39                                                           ` Daniel Vetter
2018-04-25  6:24                                       ` [Linaro-mm-sig] [PATCH 4/8] dma-buf: add peer2peer flag Alex Deucher
2018-04-25  6:24                                         ` Alex Deucher
2018-04-25  6:41                                         ` Christoph Hellwig
2018-04-25  6:41                                           ` Christoph Hellwig
2018-04-25 17:44                                           ` Alex Deucher
2018-04-25 17:44                                             ` Alex Deucher
2018-04-25 18:38                                             ` Dan Williams
2018-04-25 18:38                                               ` Dan Williams
2018-05-04 12:45                                             ` Lucas Stach
2018-03-25 10:59 ` [PATCH 5/8] drm/amdgpu: print DMA-buf status in debugfs Christian König
2018-03-25 10:59   ` Christian König
2018-03-25 10:59 ` [PATCH 6/8] drm/amdgpu: note that we can handle peer2peer DMA-buf Christian König
2018-03-25 10:59   ` Christian König
2018-03-25 10:59 ` [PATCH 7/8] drm/amdgpu: add amdgpu_gem_attach Christian König
2018-03-25 10:59   ` Christian König
2018-03-25 11:00 ` [PATCH 8/8] drm/amdgpu: add support for exporting VRAM using DMA-buf Christian König
2018-03-25 11:00   ` Christian König
2018-03-28 12:37 ` [PATCH 1/8] lib/scatterlist: add sg_set_dma_addr() helper Christoph Hellwig
2018-03-28 12:37   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.