Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-03 14:21:47 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-03 14:22:15 +0200
commit79caec472624b0db76196dfc0a777a4bcc5d1d7a (patch)
tree4a5029736222a7354465d3fba2b409ada6e4cbcd
parentbf9c74ae1465355ff9615f2a0f7ef1031b26e725 (diff)
drm/amdgpu: Remove VRAM from shared bo domains (bsc#1051510).
-rw-r--r--patches.drivers/drm-amdgpu-Remove-VRAM-from-shared-bo-domains48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.drivers/drm-amdgpu-Remove-VRAM-from-shared-bo-domains b/patches.drivers/drm-amdgpu-Remove-VRAM-from-shared-bo-domains
new file mode 100644
index 0000000000..6a453439b3
--- /dev/null
+++ b/patches.drivers/drm-amdgpu-Remove-VRAM-from-shared-bo-domains
@@ -0,0 +1,48 @@
+From 9b3f217faf48603c91d4ca44a18e6ff74c3c1c0c Mon Sep 17 00:00:00 2001
+From: Samuel Li <Samuel.Li@amd.com>
+Date: Wed, 18 Apr 2018 16:26:18 -0400
+Subject: [PATCH] drm/amdgpu: Remove VRAM from shared bo domains.
+Mime-version: 1.0
+Content-type: text/plain; charset=UTF-8
+Content-transfer-encoding: 8bit
+Git-commit: 9b3f217faf48603c91d4ca44a18e6ff74c3c1c0c
+Patch-mainline: v4.18-rc1
+References: bsc#1051510
+
+This fixes an issue introduced by change "allow framebuffer in GART
+memory as well" which could lead to a shared buffer ending up
+pinned in vram. Use GTT if it is included in the domain, otherwise
+return an error.
+
+Signed-off-by: Samuel Li <Samuel.Li@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+index feece0a491a3..1985c08413c6 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+@@ -694,8 +694,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
+ return -EINVAL;
+
+ /* A shared bo cannot be migrated to VRAM */
+- if (bo->prime_shared_count && (domain == AMDGPU_GEM_DOMAIN_VRAM))
+- return -EINVAL;
++ if (bo->prime_shared_count) {
++ if (domain & AMDGPU_GEM_DOMAIN_GTT)
++ domain = AMDGPU_GEM_DOMAIN_GTT;
++ else
++ return -EINVAL;
++ }
+
+ if (bo->pin_count) {
+ uint32_t mem_type = bo->tbo.mem.mem_type;
+--
+2.18.0
+
diff --git a/series.conf b/series.conf
index ab20b47c23..e0808709cf 100644
--- a/series.conf
+++ b/series.conf
@@ -14654,6 +14654,7 @@
patches.drivers/drm-i915-Don-t-request-a-bug-report-for-unsafe-modul
patches.drivers/drm-amdgpu-Add-APU-support-in-vi_set_uvd_clocks
patches.drivers/drm-amdgpu-Add-APU-support-in-vi_set_vce_clocks
+ patches.drivers/drm-amdgpu-Remove-VRAM-from-shared-bo-domains
patches.drivers/0001-drm-tegra-Acquire-a-reference-to-the-IOVA-cache.patch
patches.drivers/0001-gpu-host1x-Acquire-a-reference-to-the-IOVA-cache.patch
patches.drivers/drm-exynos-dsi-mask-frame-done-interrupt