All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/4] amdgpu: fix 32bit VA manager max address
@ 2018-01-07  9:11 Christian König
       [not found] ` <20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Christian König @ 2018-01-07  9:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

The range is exclusive not inclusive.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index eb4b2745..d7077184 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -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);
 
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH libdrm 2/4] headers: sync up amdgpu_drm.h with drm-next
       [not found] ` <20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-07  9:11   ` Christian König
  2018-01-07  9:11   ` [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2 Christian König
  2018-01-07  9:11   ` [PATCH libdrm 4/4] test/amdgpu: fix compiler warnings Christian König
  2 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2018-01-07  9:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Sync up amdgpu changes from drm-next.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 include/drm/amdgpu_drm.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index 919248fb..a023b476 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -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 {
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
       [not found] ` <20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-01-07  9:11   ` [PATCH libdrm 2/4] headers: sync up amdgpu_drm.h with drm-next Christian König
@ 2018-01-07  9:11   ` Christian König
       [not found]     ` <20180107091135.2373-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-01-07  9:11   ` [PATCH libdrm 4/4] test/amdgpu: fix compiler warnings Christian König
  2 siblings, 1 reply; 8+ messages in thread
From: Christian König @ 2018-01-07  9:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM.

v2: keep the 32bit range working.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 amdgpu/amdgpu_device.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index d7077184..a0d01727 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH libdrm 4/4] test/amdgpu: fix compiler warnings
       [not found] ` <20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-01-07  9:11   ` [PATCH libdrm 2/4] headers: sync up amdgpu_drm.h with drm-next Christian König
  2018-01-07  9:11   ` [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2 Christian König
@ 2018-01-07  9:11   ` Christian König
  2 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2018-01-07  9:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

SWAP_32() should mask first and then shift.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 tests/amdgpu/basic_tests.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 474a679c..9c918951 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -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
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
       [not found]     ` <20180107091135.2373-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-08 17:23       ` Marek Olšák
       [not found]         ` <CAAxE2A6-ujqNkgAfAyMb+Z3wSTB0FcFBuiXB6SU3GuFVQkJSxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2018-02-03  2:02       ` Marek Olšák
  1 sibling, 1 reply; 8+ messages in thread
From: Marek Olšák @ 2018-01-08 17:23 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx mailing list

Can we put the 32-bit address space higher? E.g. high bits = 0xfffffff0 ?

Marek

On Sun, Jan 7, 2018 at 10:11 AM, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
> Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM.
>
> v2: keep the 32bit range working.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  amdgpu/amdgpu_device.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
> index d7077184..a0d01727 100644
> --- a/amdgpu/amdgpu_device.c
> +++ b/amdgpu/amdgpu_device.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
       [not found]         ` <CAAxE2A6-ujqNkgAfAyMb+Z3wSTB0FcFBuiXB6SU3GuFVQkJSxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-01-08 20:37           ` Marek Olšák
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Olšák @ 2018-01-08 20:37 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx mailing list

Actually, 0xffff8000 is fine.

For the series:

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Marek
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
       [not found]     ` <20180107091135.2373-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  2018-01-08 17:23       ` Marek Olšák
@ 2018-02-03  2:02       ` Marek Olšák
       [not found]         ` <CAAxE2A5K+mh0rvfjrmDpUsUhWewNofnXkqxfJijTgLfzzv4TwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Marek Olšák @ 2018-02-03  2:02 UTC (permalink / raw)
  To: Christian König; +Cc: amd-gfx mailing list

Hi 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

On Sun, Jan 7, 2018 at 10:11 AM, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
> Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM.
>
> v2: keep the 32bit range working.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  amdgpu/amdgpu_device.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
> index d7077184..a0d01727 100644
> --- a/amdgpu/amdgpu_device.c
> +++ b/amdgpu/amdgpu_device.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2
       [not found]         ` <CAAxE2A5K+mh0rvfjrmDpUsUhWewNofnXkqxfJijTgLfzzv4TwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-02-03  9:57           ` Christian König
  0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2018-02-03  9:57 UTC (permalink / raw)
  To: Marek Olšák; +Cc: amd-gfx mailing list

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:
> Hi 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
>
> On Sun, Jan 7, 2018 at 10:11 AM, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM.
>>
>> v2: keep the 32bit range working.
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   amdgpu/amdgpu_device.c | 18 ++++++++++++++----
>>   1 file changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
>> index d7077184..a0d01727 100644
>> --- a/amdgpu/amdgpu_device.c
>> +++ b/amdgpu/amdgpu_device.c
>> @@ -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
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-03  9:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-07  9:11 [PATCH libdrm 1/4] amdgpu: fix 32bit VA manager max address Christian König
     [not found] ` <20180107091135.2373-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-07  9:11   ` [PATCH libdrm 2/4] headers: sync up amdgpu_drm.h with drm-next Christian König
2018-01-07  9:11   ` [PATCH libdrm 3/4] amdgpu: use the high VA range if possible v2 Christian König
     [not found]     ` <20180107091135.2373-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-08 17:23       ` Marek Olšák
     [not found]         ` <CAAxE2A6-ujqNkgAfAyMb+Z3wSTB0FcFBuiXB6SU3GuFVQkJSxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-08 20:37           ` Marek Olšák
2018-02-03  2:02       ` Marek Olšák
     [not found]         ` <CAAxE2A5K+mh0rvfjrmDpUsUhWewNofnXkqxfJijTgLfzzv4TwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-03  9:57           ` Christian König
2018-01-07  9:11   ` [PATCH libdrm 4/4] test/amdgpu: fix compiler warnings Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.