From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: zhoucm1 <zhoucm1-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: christian.koenig-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH libdrm 1/4] amdgpu: add bo from user memory to handle table
Date: Tue, 7 Aug 2018 17:54:30 +0800 [thread overview]
Message-ID: <5B696C56.9030403@amd.com> (raw)
In-Reply-To: <a3b83620-72e5-76ea-5005-04f71c46f7c3-5C7GfCeVMHo@public.gmane.org>
On 08/07/2018 03:51 PM, zhoucm1 wrote:
>
>
> On 2018年08月07日 15:26, Junwei Zhang wrote:
>> When create bo from user memory, add it to handle table
>> for future query.
>>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>> ---
>> amdgpu/amdgpu_bo.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
>> index 422c7c9..b24e698 100644
>> --- a/amdgpu/amdgpu_bo.c
>> +++ b/amdgpu/amdgpu_bo.c
>> @@ -556,7 +556,16 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
>> bo->alloc_size = size;
>> bo->handle = args.handle;
>> - *buf_handle = bo;
>> + pthread_mutex_lock(&bo->dev->bo_table_mutex);
>> + r = handle_table_insert(&bo->dev->bo_handles, bo->handle, bo);
>> + pthread_mutex_unlock(&bo->dev->bo_table_mutex);
>> +
>> + pthread_mutex_init(&bo->cpu_access_mutex, NULL);
> This line is nothing with patch itself, please separate from it.
We may not add it for user mem bo, not sure if user would access that bo by cpu mapping.
so add that at the same time.
Do you mean add it in another patch?
Jerry
>
> Regards,
> David Zhou
>> +
>> + if (r)
>> + amdgpu_bo_free(bo);
>> + else
>> + *buf_handle = bo;
>> return r;
>> }
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-08-07 9:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 7:26 [PATCH libdrm 1/4] amdgpu: add bo from user memory to handle table Junwei Zhang
[not found] ` <1533626820-7701-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-07 7:26 ` [PATCH libdrm 2/4] amdgpu: add count for " Junwei Zhang
2018-08-07 7:26 ` [PATCH libdrm 3/4] amdgpu: add a function to find bo by cpu mapping Junwei Zhang
[not found] ` <1533626820-7701-3-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-07 7:55 ` zhoucm1
[not found] ` <543dd2f7-861a-c56e-f743-3c1c87602034-5C7GfCeVMHo@public.gmane.org>
2018-08-07 9:30 ` Christian König
[not found] ` <8fb413b3-811a-f984-a9b2-3dcd89b55bd7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-07 10:18 ` zhoucm1
2018-08-07 8:20 ` Christian König
[not found] ` <b0ec5154-45a3-4b58-cc7f-1fa5916e552a-5C7GfCeVMHo@public.gmane.org>
2018-08-07 8:28 ` Zhang, Jerry (Junwei)
[not found] ` <5B695839.4050604-5C7GfCeVMHo@public.gmane.org>
2018-08-07 9:33 ` Christian König
[not found] ` <83000f07-20bf-dd0f-4898-3558e626c9d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-07 9:52 ` Zhang, Jerry (Junwei)
[not found] ` <5B696BD1.6060707-5C7GfCeVMHo@public.gmane.org>
2018-08-07 9:59 ` Christian König
[not found] ` <f41dc914-3ae3-2bda-a987-476154f3fea1-5C7GfCeVMHo@public.gmane.org>
2018-08-07 10:23 ` Zhang, Jerry (Junwei)
[not found] ` <5B69733C.4050707-5C7GfCeVMHo@public.gmane.org>
2018-08-07 11:30 ` Christian König
2018-08-07 11:35 ` Christian König
2018-08-07 7:27 ` [PATCH libdrm 4/4] tests/amdgpu: add test for finding bo by CPU mapping Junwei Zhang
2018-08-07 7:51 ` [PATCH libdrm 1/4] amdgpu: add bo from user memory to handle table zhoucm1
[not found] ` <a3b83620-72e5-76ea-5005-04f71c46f7c3-5C7GfCeVMHo@public.gmane.org>
2018-08-07 9:54 ` Zhang, Jerry (Junwei) [this message]
[not found] ` <5B696C56.9030403-5C7GfCeVMHo@public.gmane.org>
2018-08-07 10:01 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2018-08-08 4:08 Junwei Zhang
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=5B696C56.9030403@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
--cc=zhoucm1-5C7GfCeVMHo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.