blob: 7e5ca0aa13f6f6884ce54bf94df33877e1e5a18c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
From 43d2cc7496340eea3f96cb3c3cf66139e0878f3c Mon Sep 17 00:00:00 2001
From: Hai Nguyen Pham <hai.pham.ud@renesas.com>
Date: Tue, 26 Mar 2019 15:56:30 +0700
Subject: [PATCH] mmngr_drv: mmngrbuf: Take care of any migration of
scatterlist
MMNGRBUF should take care of any migration of scatterlist for
all (shared) users of the DMA buffer. Although we only care about
DMA addresses at the moment, this will benefit the DRM system that
uses the buffer allocated by MMNGR directly.
Initialize the scatterlist entry so that it can be happily traversed.
Signed-off-by: Hai Nguyen Pham <hai.pham.ud@renesas.com>
---
mmngr_drv/mmngrbuf/mmngrbuf-module/files/mmngrbuf/drv/mmngr_buf_drv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mmngr_drv/mmngrbuf/mmngrbuf-module/files/mmngrbuf/drv/mmngr_buf_drv.c b/mmngr_drv/mmngrbuf/mmngrbuf-module/files/mmngrbuf/drv/mmngr_buf_drv.c
index fe3db08..d9189e9 100644
--- a/mmngr_drv/mmngrbuf/mmngrbuf-module/files/mmngrbuf/drv/mmngr_buf_drv.c
+++ b/mmngr_drv/mmngrbuf/mmngrbuf-module/files/mmngrbuf/drv/mmngr_buf_drv.c
@@ -256,6 +256,9 @@ static struct sg_table *dmabuf_map_dma_buf(struct dma_buf_attachment *attach,
return NULL;
}
+ sg_set_page(sgt->sgl, pfn_to_page(PFN_DOWN(priv->hard_addr)),
+ priv->size, offset_in_page(priv->hard_addr));
+
sg_dma_address(sgt->sgl) = priv->hard_addr;
sg_dma_len(sgt->sgl) = priv->size;
--
2.7.4
|