]> git.baikalelectronics.ru Git - kernel.git/commit
drm/tegra: gem: Fix CPU-cache maintenance for BO's allocated using get_pages()
authorDmitry Osipenko <digetx@gmail.com>
Wed, 6 Mar 2019 22:55:19 +0000 (01:55 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 18 Apr 2019 09:48:09 +0000 (11:48 +0200)
commite89b9a4278d1f345ca323cb44b1915e80845cb53
tree5707e7222b4a94dc6dfdc7b13244c2ef3ae9daab
parenta44e04dd0ed68a0a5d903762314ff16bd160b948
drm/tegra: gem: Fix CPU-cache maintenance for BO's allocated using get_pages()

The allocated pages need to be invalidated in CPU caches. On ARM32 the
DMA_BIDIRECTIONAL flag only ensures that data is written-back to DRAM and
the data stays in CPU cache lines. While the DMA_FROM_DEVICE flag ensures
that the corresponding CPU cache lines are getting invalidated and nothing
more, that's exactly what is needed for a newly allocated pages.

This fixes randomly failing rendercheck tests on Tegra30 using the
Opentegra driver for tests that use small-sized pixmaps (10x10 and less,
i.e. 1-2 memory pages) because apparently CPU reads out stale data from
caches and/or that data is getting evicted to DRAM at the time of HW job
execution.

Fixes: 9c177ca62205 ("drm/tegra: gem: Map pages via the DMA API")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/gem.c