ANDROID: dma-buf: Add support for mapping buffers with DMA attributes

When mapping the memory represented by a dma-buf into a device's
address space, it might be desireable to map the memory with
certain DMA attributes. Thus, introduce the dma_mapping_attrs
field in the dma_buf_attachment structure so that when
the memory is mapped with dma_buf_map_attachment, it is mapped
with the desired DMA attributes.

Bug: 133508579
Test: ion-unit-tests
Change-Id: Ib2e5bafdc02ae31a58ce96a82d77cc508dd71bd4
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Sandeep Patil <sspatil@google.com>
This commit is contained in:
Isaac J. Manjarres
2019-06-19 15:37:13 -07:00
committed by Sandeep Patil
parent 36b51b44c1
commit f57c5b53d9

View File

@@ -384,6 +384,8 @@ struct dma_buf {
* @sgt: cached mapping.
* @dir: direction of cached mapping.
* @priv: exporter specific attachment data.
* @dma_map_attrs: DMA attributes to be used when the exporter maps the buffer
* through dma_buf_map_attachment.
*
* This structure holds the attachment information between the dma_buf buffer
* and its user device(s). The list contains one attachment struct per device
@@ -401,6 +403,7 @@ struct dma_buf_attachment {
struct sg_table *sgt;
enum dma_data_direction dir;
void *priv;
unsigned long dma_map_attrs;
};
/**