]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Fix for GEM buffers with write-combine memory
authorPaul Cercueil <paul@crapouillou.net>
Thu, 27 May 2021 23:03:34 +0000 (00:03 +0100)
committerPaul Cercueil <paul@crapouillou.net>
Fri, 28 May 2021 08:47:53 +0000 (09:47 +0100)
commit368c13eab2957a6b3e73c93f63c20b54e33c430e
tree51042243cb6553794e3632d6f6af6ecb1b5bb07c
parent354939bd7f767191437a7ea28c96dbe5cf8f68c3
drm: Fix for GEM buffers with write-combine memory

The previous commit wrongly assumed that dma_mmap_wc() could be replaced
by pgprot_writecombine() + dma_mmap_pages(). It did work on my setup,
but did not work everywhere.

Use dma_mmap_wc() when the buffer has the write-combine cache attribute,
and dma_mmap_pages() when it has the non-coherent cache attribute.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fixes: 28b5afd08d80 ("drm: Add support for GEM buffers backed by non-coherent memory")
Link: https://patchwork.freedesktop.org/patch/msgid/20210527230334.151947-1-paul@crapouillou.net
drivers/gpu/drm/drm_gem_cma_helper.c