drm/exynos: fix DMA_ATTR_NO_KERNEL_MAPPING usage
authorCarlo Caione <carlo@caione.org>
Wed, 4 Feb 2015 09:23:19 +0000 (10:23 +0100)
committerInki Dae <inki.dae@samsung.com>
Sat, 7 Feb 2015 07:38:41 +0000 (16:38 +0900)
commita5d7ac30fa9ffa923e3603309692a36e3b3b3ae1
tree6306790667cadc1cc34c5a5a5b39e7385863259a
parent129046c6ecb662e902a241bbbcb1da4206986370
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>
drivers/gpu/drm/exynos/exynos_drm_buf.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_drm_gem.h