public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry(Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH libdrm 1/3] amdgpu: remove invalid check in amdgpu_bo_alloc
Date: Tue, 18 Sep 2018 14:08:34 +0800	[thread overview]
Message-ID: <53a17718-e6e6-075f-2bc4-832b895f0b8b@amd.com> (raw)
In-Reply-To: <20180914130906.3853-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>

On 09/14/2018 09:09 PM, Christian König wrote:
> 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>

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

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

      parent reply	other threads:[~2018-09-18  6:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Zhang, Jerry(Junwei) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53a17718-e6e6-075f-2bc4-832b895f0b8b@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox