Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:48 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-15 10:24:12 +0100
commit3613cb3d8cda505704a874a1248a9da7f0f4495c (patch)
tree88e9744dc7de1e501af1bf5cfe1bbf5aeb30ae25
parentbc0debcf04a238d53343668dc267fee5c62382d4 (diff)
drm/vmwgfx: Fix setting of dma masks (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.9-041-drm-vmwgfx-Fix-setting-of-dma-masks.patch49
-rw-r--r--series.conf1
2 files changed, 50 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.9-041-drm-vmwgfx-Fix-setting-of-dma-masks.patch b/patches.kernel.org/4.20.9-041-drm-vmwgfx-Fix-setting-of-dma-masks.patch
new file mode 100644
index 0000000000..23901087c1
--- /dev/null
+++ b/patches.kernel.org/4.20.9-041-drm-vmwgfx-Fix-setting-of-dma-masks.patch
@@ -0,0 +1,49 @@
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Mon, 28 Jan 2019 10:31:33 +0100
+Subject: [PATCH] drm/vmwgfx: Fix setting of dma masks
+References: bnc#1012628
+Patch-mainline: 4.20.9
+Git-commit: 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b
+
+commit 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b upstream.
+
+Previously we set only the dma mask and not the coherent mask. Fix that.
+Also, for clarity, make sure both are initially set to 64 bits.
+
+Cc: <stable@vger.kernel.org>
+Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses")
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Deepak Rawat <drawat@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+index d7a2dfb8ee9b..ddf80935c4b9 100644
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+@@ -629,13 +629,16 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
+ static int vmw_dma_masks(struct vmw_private *dev_priv)
+ {
+ struct drm_device *dev = dev_priv->dev;
++ int ret = 0;
+
+- if (intel_iommu_enabled &&
++ ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
++ if (dev_priv->map_mode != vmw_dma_phys &&
+ (sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
+ DRM_INFO("Restricting DMA addresses to 44 bits.\n");
+- return dma_set_mask(dev->dev, DMA_BIT_MASK(44));
++ return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
+ }
+- return 0;
++
++ return ret;
+ }
+ #else
+ static int vmw_dma_masks(struct vmw_private *dev_priv)
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 47346510b3..b55172eac2 100644
--- a/series.conf
+++ b/series.conf
@@ -1123,6 +1123,7 @@
patches.kernel.org/4.20.9-038-drm-rockchip-rgb-update-SPDX-license-identifie.patch
patches.kernel.org/4.20.9-039-drm-amd-powerplay-Fix-missing-break-in-switch.patch
patches.kernel.org/4.20.9-040-drm-i915-always-return-something-on-DDI-clock-.patch
+ patches.kernel.org/4.20.9-041-drm-vmwgfx-Fix-setting-of-dma-masks.patch
########################################################
# Build fixes that apply to the vanilla kernel too.