mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
msm: kgsl: Call dma_buf_unmap_attachment() early
When we import an ION buffer, we call the dma_buf_map_attachment(). The intent is to not map it to the dma device(which in this case is the KGSl device), but to only get the sg_table. Once we have the sg_table we later map the physical pages to the GPU SMMU manually and not by using the dma device ops. The ION driver as part of the partial cache maintenance requires that all the sg_tables of the attached devices to the buffer have a single segment. This creates a problem for KGSL since in this case the kgsl is a dummy device, so the buffer for KGSL always has multiple segments. This patch calls the dma_buf_unmap_attachment() as soon we get a hold of the sg_table as doing so a) we don't need the buffer to be mapped to a dummy device, b) removes the buffer from the cache maintenance constraints of the ION driver. Change-Id: I0675e62c4a27b4e368d53ea6310c9244b687baa6 Signed-off-by: Sharat Masetty <smasetty@codeaurora.org> Signed-off-by: Puranam V G Tejaswi <pvgtejas@codeaurora.org>
This commit is contained in:
parent
5168327a4f
commit
0e47811b36
1 changed files with 2 additions and 2 deletions
|
|
@ -315,8 +315,6 @@ static void kgsl_destroy_ion(struct kgsl_dma_buf_meta *meta)
|
|||
{
|
||||
if (meta != NULL) {
|
||||
remove_dmabuf_list(meta);
|
||||
dma_buf_unmap_attachment(meta->attach, meta->table,
|
||||
DMA_BIDIRECTIONAL);
|
||||
dma_buf_detach(meta->dmabuf, meta->attach);
|
||||
dma_buf_put(meta->dmabuf);
|
||||
kfree(meta);
|
||||
|
|
@ -2859,6 +2857,8 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
|
|||
goto out;
|
||||
}
|
||||
|
||||
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
|
||||
|
||||
meta->table = sg_table;
|
||||
entry->priv_data = meta;
|
||||
entry->memdesc.sgt = sg_table;
|
||||
|
|
|
|||
Loading…
Reference in a new issue