From c40bd3cbf8002edec94ef7d6275db192b4ecc53b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Fri, 14 Sep 2018 14:58:24 +0200 Subject: [PATCH] amdgpu: remove invalid check in amdgpu_bo_alloc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The heap is checked by the kernel and not libdrm, to make it even worse it prevented allocating resources other than VRAM and GTT. Signed-off-by: Christian König Reviewed-by: Junwei Zhang Reviewed-by: Alex Deucher --- amdgpu/amdgpu_bo.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index 6a95929..34904e3 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -74,19 +74,14 @@ int amdgpu_bo_alloc(amdgpu_device_handle dev, amdgpu_bo_handle *buf_handle) { union drm_amdgpu_gem_create args; - unsigned heap = alloc_buffer->preferred_heap; - int r = 0; - - /* It's an error if the heap is not specified */ - if (!(heap & (AMDGPU_GEM_DOMAIN_GTT | AMDGPU_GEM_DOMAIN_VRAM))) - return -EINVAL; + int r; memset(&args, 0, sizeof(args)); args.in.bo_size = alloc_buffer->alloc_size; args.in.alignment = alloc_buffer->phys_alignment; /* Set the placement. */ - args.in.domains = heap; + args.in.domains = alloc_buffer->preferred_heap; args.in.domain_flags = alloc_buffer->flags; /* Allocate the buffer with the preferred heap. */ -- 2.7.4