drm: Add sg_page_iter_dma_address()
authorFrançois Tigeot <ftigeot@wolfpond.org>
Mon, 4 May 2015 07:25:48 +0000 (09:25 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Mon, 4 May 2015 07:25:58 +0000 (09:25 +0200)
sys/dev/drm/include/linux/scatterlist.h

index 51f8b2c..947b892 100644 (file)
@@ -384,6 +384,12 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter,
        }
 }
 
+static inline dma_addr_t
+sg_page_iter_dma_address(struct sg_page_iter *spi)
+{
+       return spi->sg->address + (spi->sg_pgoffset << PAGE_SHIFT);
+}
+
 #define for_each_sg_page(sgl, iter, nents, pgoffset)                   \
        for (_sg_iter_init(sgl, iter, nents, pgoffset);                 \
             (iter)->sg; _sg_iter_next(iter))