drm: Branch 'master' - 4 commits

[email protected] (Christian K??nig) Tue, 9 Jan 2018 16:15:43 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 amdgpu/amdgpu_device.c     |   18 ++++++++++++++----
 include/drm/amdgpu_drm.h   |    4 ++++
 tests/amdgpu/basic_tests.c |    8 ++++----
 3 files changed, 22 insertions(+), 8 deletions(-)

New commits:
commit de807d1a740effe60da62d07dcfeae7c01012d15
Author: Christian König <[email protected]>
Date:   Sun Jan 7 10:10:15 2018 +0100

    test/amdgpu: fix compiler warnings
    
    SWAP_32() should mask first and then shift.
    
    Signed-off-by: Christian König <[email protected]>
    Reviewed-by: Marek Olšák <[email protected]>

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
commit 07ea20d5beb24315b721adf83bbfa72ce016e146
Author: Christian König <[email protected]>
Date:   Tue Nov 7 15:31:45 2017 +0100

    amdgpu: use the high VA range if possible v2
    
    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 <[email protected]>
    Reviewed-by: Marek Olšák <[email protected]>

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);
 
commit 0a3c01f4ad6a09450e59008085c7bf8151aeb5c4
Author: Christian König <[email protected]>
Date:   Tue Nov 7 15:31:45 2017 +0100

    headers: sync up amdgpu_drm.h with drm-next
    
    Sync up amdgpu changes from drm-next.
    
    Signed-off-by: Christian König <[email protected]>
    Reviewed-by: Marek Olšák <[email protected]>

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 {
commit a8e436de5d444982e791470cfec505e6280c416a
Author: Christian König <[email protected]>
Date:   Thu Nov 2 18:54:59 2017 +0100

    amdgpu: fix 32bit VA manager max address
    
    The range is exclusive not inclusive.
    
    Signed-off-by: Christian König <[email protected]>
    Reviewed-by: Marek Olšák <[email protected]>

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);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

--
_______________________________________________
Dri-patches mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-patches