Skip to contentSkip to conversation

drm/amdgpu: limit the VM address space with older VCE FW versions

PATCH In review Christian König 2 participants 2 messages Jan 29, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: limit the VM address space with older VCE FW versions

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?

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 2 ++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +5 -0
index 431038885778..51a4b08546f2 100644
@@ -581,6 +581,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);
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h +2 -0
index 0fd378ae92c3..71781267ee4c 100644
@@ -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;
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180129150544.1558-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Monday, January 29, 2018 10:05 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: limit the VM address space with older VCE FW versions

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?

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 +++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 2 ++
 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +5 -0
index 431038885778..51a4b08546f2 100644
@@ -581,6 +581,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);
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h +2 -0
index 0fd378ae92c3..71781267ee4c 100644
@@ -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.14.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx