aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch')
-rw-r--r--common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch b/common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch
new file mode 100644
index 00000000..09de10a5
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0963-drm-amdgpu-limit-visible-vram-if-it-s-smaller-than-t.patch
@@ -0,0 +1,53 @@
+From ba292094acaf34426b115c3aa7799666791c04d9 Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexander.deucher@amd.com>
+Date: Wed, 9 Dec 2015 15:36:40 -0500
+Subject: [PATCH 0963/1050] drm/amdgpu: limit visible vram if it's smaller than
+ the BAR
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In some cases the amount of vram may be less than the BAR size,
+if so, limit visible vram to the amount of actual vram, not the
+BAR size.
+
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 4 ++++
+ drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+index ed8abb5..dababe4 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+@@ -370,6 +370,10 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
+ adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+ adev->mc.visible_vram_size = adev->mc.aper_size;
+
++ /* In case the PCI BAR is larger than the actual amount of vram */
++ if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
++ adev->mc.visible_vram_size = adev->mc.real_vram_size;
++
+ /* unless the user had overridden it, set the gart
+ * size equal to the 1024 or vram, whichever is larger.
+ */
+diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+index da6505d..adc25f8 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+@@ -476,6 +476,10 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
+ adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+ adev->mc.visible_vram_size = adev->mc.aper_size;
+
++ /* In case the PCI BAR is larger than the actual amount of vram */
++ if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
++ adev->mc.visible_vram_size = adev->mc.real_vram_size;
++
+ /* unless the user had overridden it, set the gart
+ * size equal to the 1024 or vram, whichever is larger.
+ */
+--
+1.9.1
+