radv/winsys: allow to allocate BOs in the 32-bit addr space
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 16 May 2018 13:34:52 +0000 (15:34 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 22 May 2018 13:53:13 +0000 (15:53 +0200)
This introduces a new flag called RADEON_FLAG_32BIT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_radeon_winsys.h
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c

index 7f19934ab80964aca3e5a4792c90f1fa84526206..2ebd18cf905998abef311b987c509436345364bc 100644 (file)
@@ -57,6 +57,7 @@ enum radeon_bo_flag { /* bitfield */
        RADEON_FLAG_IMPLICIT_SYNC = (1 << 5),
        RADEON_FLAG_NO_INTERPROCESS_SHARING = (1 << 6),
        RADEON_FLAG_READ_ONLY =     (1 << 7),
+       RADEON_FLAG_32BIT =         (1 << 8),
 };
 
 enum radeon_bo_usage { /* bitfield */
index f33cf02815c9cfd625aa1cfabcf1c5298bc17ad6..25764d93f6a0f0d928fda0cff63d68bb63c0ae41 100644 (file)
@@ -306,7 +306,8 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
 
        r = amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
                                  size, alignment, 0, &va, &va_handle,
-                                 AMDGPU_VA_RANGE_HIGH);
+                                 (flags & RADEON_FLAG_32BIT ? AMDGPU_VA_RANGE_32_BIT : 0) |
+                                  AMDGPU_VA_RANGE_HIGH);
        if (r)
                goto error_va_alloc;