summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-09-14 14:58:24 +0200
committerChristian König <christian.koenig@amd.com>2018-09-18 14:53:30 +0200
commitc40bd3cbf8002edec94ef7d6275db192b4ecc53b (patch)
tree6130ec317c06bd9eb44a7451fe94a17e09f79667 /amdgpu
parent28328298ca94344538a0d7f41350810f086900ee (diff)
downloadlibdrm-c40bd3cbf8002edec94ef7d6275db192b4ecc53b.tar.gz
libdrm-c40bd3cbf8002edec94ef7d6275db192b4ecc53b.tar.bz2
libdrm-c40bd3cbf8002edec94ef7d6275db192b4ecc53b.zip
amdgpu: remove invalid check in amdgpu_bo_alloc
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 <christian.koenig@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_bo.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 6a95929c..34904e38 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. */