diff options
author | Carlo Caione <carlo@caione.org> | 2015-02-04 04:23:19 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-02-07 02:38:41 -0500 |
commit | a5d7ac30fa9ffa923e3603309692a36e3b3b3ae1 (patch) | |
tree | 6306790667cadc1cc34c5a5a5b39e7385863259a /drivers/gpu/drm/exynos/exynos_drm_gem.h | |
parent | 129046c6ecb662e902a241bbbcb1da4206986370 (diff) |
drm/exynos: fix DMA_ATTR_NO_KERNEL_MAPPING usage
The Exynos DRM driver doesn't follow the correct API when dealing with
dma_{alloc, mmap, free}_attrs functions and the
DMA_ATTR_NO_KERNEL_MAPPING attribute.
When a IOMMU is not available and the DMA_ATTR_NO_KERNEL_MAPPING is
used, the driver should use the pointer returned by dma_alloc_attr() as
a cookie.
The Exynos DRM driver directly uses the non-requested virtual kernel
address returned by the DMA mapping subsystem. This just works now
because the non-IOMMU codepath doesn't obey DMA_ATTR_NO_KERNEL_MAPPING
but we need to fix it before fixing the DMA layer.
Signed-off-by: Carlo Caione <carlo@caione.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_gem.h')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h index ec58fe9c40df..308173cb4f0a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h | |||
@@ -22,6 +22,7 @@ | |||
22 | /* | 22 | /* |
23 | * exynos drm gem buffer structure. | 23 | * exynos drm gem buffer structure. |
24 | * | 24 | * |
25 | * @cookie: cookie returned by dma_alloc_attrs | ||
25 | * @kvaddr: kernel virtual address to allocated memory region. | 26 | * @kvaddr: kernel virtual address to allocated memory region. |
26 | * *userptr: user space address. | 27 | * *userptr: user space address. |
27 | * @dma_addr: bus address(accessed by dma) to allocated memory region. | 28 | * @dma_addr: bus address(accessed by dma) to allocated memory region. |
@@ -35,6 +36,7 @@ | |||
35 | * VM_PFNMAP or not. | 36 | * VM_PFNMAP or not. |
36 | */ | 37 | */ |
37 | struct exynos_drm_gem_buf { | 38 | struct exynos_drm_gem_buf { |
39 | void *cookie; | ||
38 | void __iomem *kvaddr; | 40 | void __iomem *kvaddr; |
39 | unsigned long userptr; | 41 | unsigned long userptr; |
40 | dma_addr_t dma_addr; | 42 | dma_addr_t dma_addr; |