]> git.baikalelectronics.ru Git - kernel.git/commit
drm/cma: Use dma_mmap_writecombine() to mmap buffer
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 2 Mar 2014 19:09:48 +0000 (20:09 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 4 Apr 2014 00:13:32 +0000 (10:13 +1000)
commit9aaf528abe1bd7abfb8f454d90412fb559b51e3c
tree2f1dee6ada64ee6f592dd65b51b651f61fd38532
parentd72a6f49a8cfa27ef932b23e7788f75ecf1a46e1
drm/cma: Use dma_mmap_writecombine() to mmap buffer

The GEM CMA helpers uses a custom mmap implementation based on
remap_pfn_range(). While this works when the buffer DMA and physical
addresses are identical, it fails to take IOMMU into account and tries
to mmap the buffer to userspace using the DMA virtual address instead of
the physical address. This results in mapping random physical pages when
the device is behind an IOMMU.

Use the DMA mapping dma_mmap_writecombine() function instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_gem_cma_helper.c