]> 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)
commite012fe79ca13af8e8121f2a48630043c22fe91b3
tree51042243cb6553794e3632d6f6af6ecb1b5bb07c
parent53508738a61abb221cfc43185da84224720963bb
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: f01c96abb735 ("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