aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch
new file mode 100644
index 00000000..5eb1f985
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3306-drm-amdgpu-limit-the-VM-address-space-with-older-VCE.patch
@@ -0,0 +1,55 @@
+From a636a9eed605f25ece90cb6479bc6f82080374f2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Mon, 29 Jan 2018 16:03:50 +0100
+Subject: [PATCH 3306/4131] drm/amdgpu: limit the VM address space with older
+ VCE FW versions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Older VCE FW versions are buggy and can't work with 48bit address
+spaces.
+
+RFC: Should we limit the address space or just reject loading the older
+VCE firmware?
+
+Change-Id: I9e8cb4218e3c87aa28156510a8db936bbda3be8b
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++++
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 2 ++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+index 04a2219..2608e5a 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+@@ -621,6 +621,11 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
+
+ vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
+ vm_size -= AMDGPU_VA_RESERVED_SIZE;
++
++ /* Older VCE FW versions are buggy and can handle only 40bits */
++ if (adev->vce.fw_version < AMDGPU_VCE_FW_53_45)
++ vm_size = min(vm_size, 1ULL << 40);
++
+ dev_info.virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
+ dev_info.virtual_address_max =
+ min(vm_size, AMDGPU_VA_HOLE_START);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
+index 0fd378a..7178126 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
+@@ -30,6 +30,8 @@
+ #define AMDGPU_VCE_HARVEST_VCE0 (1 << 0)
+ #define AMDGPU_VCE_HARVEST_VCE1 (1 << 1)
+
++#define AMDGPU_VCE_FW_53_45 ((53 << 24) | (45 << 16))
++
+ struct amdgpu_vce {
+ struct amdgpu_bo *vcpu_bo;
+ uint64_t gpu_addr;
+--
+2.7.4
+