Skip to contentSkip to conversation

amdgpu: fix 32bit VA manager max address

PATCH New Christian König 1 participant 3 messages Nov 16, 2017 1 message not in the archive DRM drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 amdgpu: fix 32bit VA manager max address

The range is exclusive not inclusive.

---
 amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
amdgpu/amdgpu_device.c +1 -1
index 344e87ed..fa4ab0e7 100644
@@ -271,7 +271,7 @@ int amdgpu_device_initialize(int fd,
 	}
 
 	start = dev->dev_info.virtual_address_offset;
-	max = MIN2(dev->dev_info.virtual_address_max, 0xffffffff);
+	max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL);
 	amdgpu_vamgr_init(&dev->vamgr_32, start, max,
 			  dev->dev_info.virtual_address_alignment);
 
Signature · 6 lines
2.11.0

_______________________________________________
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): 20171116102459.10954-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/3 headers: sync up amdgpu_drm.h with proposed change

Sync up the not yet upstream change for the next patch.

---
 include/drm/amdgpu_drm.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/amdgpu_drm.h +4 -0
index 919248fb..a023b476 100644
@@ -869,6 +869,10 @@ struct drm_amdgpu_info_device {
 	__u32 _pad1;
 	/* always on cu bitmap */
 	__u32 cu_ao_bitmap[4][4];
+	/** Starting high virtual address for UMDs. */
+	__u64 high_va_offset;
+	/** The maximum high virtual address */
+	__u64 high_va_max;
 };
 
 struct drm_amdgpu_info_hw_ip {
Signature · 6 lines
2.11.0

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

PATCH 3/3 amdgpu: use the high VA range if possible

In reply to a message not in the archive

Retire the 32bit range and the low range on Vega10. AFAIK THe 32bit range was never used by any open source component and this frees up everything below 0xffff800000000000 for HMM.

---
 amdgpu/amdgpu_device.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
amdgpu/amdgpu_device.c +14 -7
index fa4ab0e7..6a7af011 100644
@@ -270,13 +270,20 @@ int amdgpu_device_initialize(int fd,
 		goto cleanup;
 	}
 
-	start = dev->dev_info.virtual_address_offset;
-	max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL);
-	amdgpu_vamgr_init(&dev->vamgr_32, start, max,
-			  dev->dev_info.virtual_address_alignment);
-
-	start = MAX2(dev->dev_info.virtual_address_offset, 0x100000000ULL);
-	max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL);
+	if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) {
+		amdgpu_vamgr_init(&dev->vamgr_32, 0, 0, 0);
+
+		start = dev->dev_info.high_va_offset;
+		max = dev->dev_info.high_va_max;
+	} else {
+		start = dev->dev_info.virtual_address_offset;
+		max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL);
+		amdgpu_vamgr_init(&dev->vamgr_32, start, max,
+				  dev->dev_info.virtual_address_alignment);
+
+		start = MAX2(dev->dev_info.virtual_address_offset, 0x100000000ULL);
+		max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL);
+	}
 	amdgpu_vamgr_init(&dev->vamgr, start, max,
 			  dev->dev_info.virtual_address_alignment);
 
Signature · 6 lines
2.11.0

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