amdgpu: fix 32bit VA manager max address
PATCH 1/4 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
@@ -265,7 +265,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): 20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
PATCH 2/4 headers: sync up amdgpu_drm.h with drm-next
Sync up amdgpu changes from drm-next.
--- include/drm/amdgpu_drm.h | 4 ++++ 1 file changed, 4 insertions(+)
include/drm/amdgpu_drm.h +4 -0
@@ -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
PATCH 3/4 amdgpu: use the high VA range if possible v2
In reply to a message not in the archiveRetire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM.
v2: keep the 32bit range working.
--- amdgpu/amdgpu_device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
amdgpu/amdgpu_device.c +14 -4
@@ -264,13 +264,23 @@ int amdgpu_device_initialize(int fd, goto cleanup; } - start = dev->dev_info.virtual_address_offset; - max =MIN2 (dev->dev_info.virtual_address_max,0x100000000ULL ); +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) { + start = dev->dev_info.high_va_offset; + max = dev->dev_info.high_va_max; + }else { + start = dev->dev_info.virtual_address_offset; + max = dev->dev_info.virtual_address_max; + } + + max =MIN2 (max, (start & ~0xffffffff ) +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 ); + start = max; +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) + max = dev->dev_info.high_va_max; +else + max = dev->dev_info.virtual_address_max;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
A message that is not in the archive (sent off-list or not yet received): 20180107091135.2373-3-christian.koenig-5C7GfCeVMHo@public.gmane.org
Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
Can we put the 32-bit address space higher? E.g. high bits = 0xfffffff0 ?
Marek
Quoted 44 lines · Christian König
Retire the low range on Vega10 this frees up everything below
0xffff800000000000for HMM.v2: keep the 32bit range working.
Signed-off-by Christian König <[email protected]>--- amdgpu/amdgpu_device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)amdgpu/amdgpu_device.c +14
-5@@ -264,13 +264,23 @@ int amdgpu_device_initialize(int fd, goto cleanup; } - start = dev->dev_info.virtual_address_offset; - max =MIN2 (dev->dev_info.virtual_address_max,0x100000000ULL ); +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) { + start = dev->dev_info.high_va_offset; + max = dev->dev_info.high_va_max; + }else { + start = dev->dev_info.virtual_address_offset; + max = dev->dev_info.virtual_address_max; + } + + max =MIN2 (max, (start & ~0xffffffff ) +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 ); + start = max; +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) + max = dev->dev_info.high_va_max; +else + max = dev->dev_info.virtual_address_max;amdgpu_vamgr_init (&dev->vamgr, start, max, dev->dev_info.virtual_address_alignment); --2.11.0
Quoted 4 lines
_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): CAAxE2A6-ujqNkgAfAyMb+Z3wSTB0FcFBuiXB6SU3GuFVQkJSxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Marek Olšák
Reviewed-byRe: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
Actually, 0xffff8000 is fine.
For the series:
Marek
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
In reply to a message not in the archiveHi Christian,
How does this work with 48-bit addresses that the 3D engine uses? It can't set 0xffff8000 for the high bits. It's trimmed to 0x8000.
Thanks,
Marek
Quoted 44 lines · Christian König
Retire the low range on Vega10 this frees up everything below
0xffff800000000000for HMM.v2: keep the 32bit range working.
Signed-off-by Christian König <[email protected]>--- amdgpu/amdgpu_device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)amdgpu/amdgpu_device.c +14
-5@@ -264,13 +264,23 @@ int amdgpu_device_initialize(int fd, goto cleanup; } - start = dev->dev_info.virtual_address_offset; - max =MIN2 (dev->dev_info.virtual_address_max,0x100000000ULL ); +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) { + start = dev->dev_info.high_va_offset; + max = dev->dev_info.high_va_max; + }else { + start = dev->dev_info.virtual_address_offset; + max = dev->dev_info.virtual_address_max; + } + + max =MIN2 (max, (start & ~0xffffffff ) +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 ); + start = max; +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) + max = dev->dev_info.high_va_max; +else + max = dev->dev_info.virtual_address_max;amdgpu_vamgr_init (&dev->vamgr, start, max, dev->dev_info.virtual_address_alignment); --2.11.0
Quoted 4 lines
_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): CAAxE2A5K+mh0rvfjrmDpUsUhWewNofnXkqxfJijTgLfzzv4TwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
Hi Marek,
it looks like the hardware sign extends bit 47 into bits 48-63. E.g. 0x8000 gets extended to 0xffff8000.
Christian.
Am 03.02.2018 um 03:02 schrieb Marek Olšák:
Quoted 51 lines
Hi Christian,
How does this work with 48-bit addresses that the 3D engine uses? It can't set
0xffff8000for the high bits. It's trimmed to0x8000.Thanks,
MarekQuoted 41 lines · Christian König
Retire the low range on Vega10 this frees up everything below
0xffff800000000000for HMM.v2: keep the 32bit range working.
Signed-off-by Christian König <[email protected]>--- amdgpu/amdgpu_device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)amdgpu/amdgpu_device.c +14
-4@@ -264,13 +264,23 @@ int amdgpu_device_initialize(int fd, goto cleanup; } - start = dev->dev_info.virtual_address_offset; - max =MIN2 (dev->dev_info.virtual_address_max,0x100000000ULL ); +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) { + start = dev->dev_info.high_va_offset; + max = dev->dev_info.high_va_max; + }else { + start = dev->dev_info.virtual_address_offset; + max = dev->dev_info.virtual_address_max; + } + + max =MIN2 (max, (start & ~0xffffffff ) +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 ); + start = max; +if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) + max = dev->dev_info.high_va_max; +else + max = dev->dev_info.virtual_address_max;amdgpu_vamgr_init (&dev->vamgr, start, max, dev->dev_info.virtual_address_alignment);
Quoted 7 lines
Quoted 7 lines
--
2.11.0_______________________________________________
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
PATCH 4/4 test/amdgpu: fix compiler warnings
In reply to a message not in the archiveSWAP_32() should mask first and then shift.
--- tests/amdgpu/basic_tests.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tests/amdgpu/basic_tests.c +4 -4
@@ -253,10 +253,10 @@ CU_TestInfo basic_tests[] = { -#define SWAP_32 (num) ((num>>24)&0xff) | \ - ((num<<8)&0xff0000) | \ - ((num>>8)&0xff00) | \ - ((num<<24)&0xff000000) +#define SWAP_32 (num) (((num & 0xff000000) >> 24) | \ + ((num & 0x0000ff00) << 8) | \ + ((num & 0x00ff0000) >> 8) | \ + ((num & 0x000000ff) << 24))/* Shader code
Signature · 6 lines
2.11.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx