android: ion: add fixups to ion exynos extension
The purpose of the exynos extension is to attach addtional
improvements to ION. The first improvment is the elimination of
dma-mapping overhead.
dma_map_sg() and dma_unmap_sg() maps the given memory to the address
space of the given device. The mapping can be translation table update
if the device has iommu. It may allocate swiotlb buffer if the device
does not have iommu and the address space of the device is smaller
than the physical address space. dma_map_sg() and dma_unmap_sg() also
maintain CPU caches to ensure memory coherency.
The purpose of calls to dma_map_sg() and dma_unmap_sg() in
ion_map_dma_buf() and ion_unmap_dma_buf(), respectively is just
ensuring cache coherency in Exynos SoCs. We have another approach to
map the physical memory to the device address space, ion_iovmm_map().
But replacing dma_map_sg() with dma_sync_sg_for_device() does not work
because dma_sync_sg_for_device() needs dma_address fields to be
initialized by dma_map_sg().
This is the first step to replacing dma_map_sg() with
dma_sync_sg_for_device() in ion_map_dma_buf().
Buffer allocation now involves dma_map_sg() to assign dma_address
fields of ion_buffer.sg_table. dma_unmap_sg() is called by
ion_buffer_destroy().
Then we can finally use dma_sync_sg_for_device() in ion_map_dma_buf().
Change-Id: I8b439eddc0b3722a297ea395aa7e6f3ebc00b294
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>