public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/3] amdgpu: remove invalid check in amdgpu_bo_alloc
@ 2018-09-14 13:09 Christian König
       [not found] ` <20180914130906.3853-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2018-09-14 13:09 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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>
---
 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 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. */
-- 
2.14.1

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

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

end of thread, other threads:[~2018-09-18  6:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-14 13:09 [PATCH libdrm 1/3] amdgpu: remove invalid check in amdgpu_bo_alloc Christian König
     [not found] ` <20180914130906.3853-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 13:09   ` [PATCH libdrm 2/3] test/amdgpu: add proper error handling Christian König
     [not found]     ` <20180914130906.3853-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-18  6:07       ` Zhang, Jerry(Junwei)
2018-09-14 13:09   ` [PATCH libdrm 3/3] test/amdgpu: add GDS, GWS and OA tests Christian König
     [not found]     ` <20180914130906.3853-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 13:54       ` Deucher, Alexander
2018-09-18  6:09       ` Zhang, Jerry(Junwei)
2018-09-18  6:08   ` [PATCH libdrm 1/3] amdgpu: remove invalid check in amdgpu_bo_alloc Zhang, Jerry(Junwei)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox