Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-13 14:59:58 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-15 11:46:07 +0200
commit5935cd64b2f3ad86c3996ac98eafdb5101227075 (patch)
treedcef77de27f7ded58522108a91e3c082161f3be0
parenta6fe947129779004fa3d421bd5cbf88ab7fc593c (diff)
drm/tegra: gem: Fix CPU-cache maintenance for BO's allocated
using get_pages() (bsc#1111666).
-rw-r--r--patches.drm/drm-tegra-gem-Fix-CPU-cache-maintenance-for-BO-s-all.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.drm/drm-tegra-gem-Fix-CPU-cache-maintenance-for-BO-s-all.patch b/patches.drm/drm-tegra-gem-Fix-CPU-cache-maintenance-for-BO-s-all.patch
new file mode 100644
index 0000000000..b0c6589de2
--- /dev/null
+++ b/patches.drm/drm-tegra-gem-Fix-CPU-cache-maintenance-for-BO-s-all.patch
@@ -0,0 +1,55 @@
+From 61b51fb51c01a519a249d28ec55c6513a13be5a3 Mon Sep 17 00:00:00 2001
+From: Dmitry Osipenko <digetx@gmail.com>
+Date: Thu, 7 Mar 2019 01:55:19 +0300
+Subject: [PATCH] drm/tegra: gem: Fix CPU-cache maintenance for BO's allocated using get_pages()
+Git-commit: 61b51fb51c01a519a249d28ec55c6513a13be5a3
+Patch-mainline: v5.2-rc1
+References: bsc#1111666
+
+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: bd43c9f0fa1f ("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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/tegra/gem.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
+index 4f80100ff5f3..4cce11fd8836 100644
+--- a/drivers/gpu/drm/tegra/gem.c
++++ b/drivers/gpu/drm/tegra/gem.c
+@@ -204,7 +204,7 @@ static void tegra_bo_free(struct drm_device *drm, struct tegra_bo *bo)
+ {
+ if (bo->pages) {
+ dma_unmap_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
+- DMA_BIDIRECTIONAL);
++ DMA_FROM_DEVICE);
+ drm_gem_put_pages(&bo->gem, bo->pages, true, true);
+ sg_free_table(bo->sgt);
+ kfree(bo->sgt);
+@@ -230,7 +230,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)
+ }
+
+ err = dma_map_sg(drm->dev, bo->sgt->sgl, bo->sgt->nents,
+- DMA_BIDIRECTIONAL);
++ DMA_FROM_DEVICE);
+ if (err == 0) {
+ err = -EFAULT;
+ goto free_sgt;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 9b874d5b29..d6df8504d6 100644
--- a/series.conf
+++ b/series.conf
@@ -45669,6 +45669,7 @@
patches.drm/drm-doc-Drop-content-type-from-the-legacy-kms-proper.patch
patches.drm/drm-fb-helper-generic-Call-drm_client_add-after-setu.patch
patches.drm/drm-vmwgfx-Remove-set-but-not-used-variable-restart.patch
+ patches.drm/drm-tegra-gem-Fix-CPU-cache-maintenance-for-BO-s-all.patch
patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-for-A.patch
patches.drivers/ALSA-hda-realtek-Support-low-power-consumption-ALC256.patch