From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Chen, Guchun" <Guchun.Chen@amd.com>,
"Kuehling, Felix" <Felix.Kuehling@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Zhang, Hawking" <Hawking.Zhang@amd.com>,
"Koenig, Christian" <Christian.Koenig@amd.com>,
"Yang, Philip" <Philip.Yang@amd.com>
Subject: Re: [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case
Date: Thu, 3 Aug 2023 10:28:27 +0200 [thread overview]
Message-ID: <b0915726-a8e5-18e7-1b5e-264bb7198c32@gmail.com> (raw)
In-Reply-To: <DM5PR12MB246900DA95D6365824B536A5F138A@DM5PR12MB2469.namprd12.prod.outlook.com>
Yeah, perfectly fine for me. I was out of office for a few days as well.
Christian.
Am 18.07.23 um 04:16 schrieb Chen, Guchun:
> [Public]
>
> Thank you for review, Felix.
>
> Hi Christian,
>
> I forgot to add your RB in patch 2/patch3 when posting this series for review. I will add it back when pushing. Hope it's fine to you.
>
> Regards,
> Guchun
>
>> -----Original Message-----
>> From: Kuehling, Felix <Felix.Kuehling@amd.com>
>> Sent: Monday, July 17, 2023 10:58 PM
>> To: Chen, Guchun <Guchun.Chen@amd.com>; amd-
>> gfx@lists.freedesktop.org; Deucher, Alexander
>> <Alexander.Deucher@amd.com>; Zhang, Hawking
>> <Hawking.Zhang@amd.com>; Koenig, Christian
>> <Christian.Koenig@amd.com>; Yang, Philip <Philip.Yang@amd.com>
>> Subject: Re: [PATCH 4/4] drm/amdgpu: use a macro to define no xcp
>> partition case
>>
>> On 2023-07-16 22:26, Guchun Chen wrote:
>>> ~0 as no xcp partition is used in several places, so improve its
>>> definition by a macro for code consistency.
>>>
>>> Suggested-by: Christian König <christian.koenig@amd.com>
>>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>> The series is
>>
>> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
>>
>>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++-
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 4 ++--
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h | 2 ++
>>> drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c | 4 ++--
>>> 4 files changed, 8 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> index a7f314ddd173..d34c3ef8f3ed 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> @@ -1709,7 +1709,8 @@ int
>> amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
>>> alloc_flags |= (flags &
>> KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC) ?
>>> AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED : 0;
>>> }
>>> - xcp_id = fpriv->xcp_id == ~0 ? 0 : fpriv->xcp_id;
>>> + xcp_id = fpriv->xcp_id == AMDGPU_XCP_NO_PARTITION ?
>>> + 0 : fpriv->xcp_id;
>>> } else if (flags & KFD_IOC_ALLOC_MEM_FLAGS_GTT) {
>>> domain = alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
>>> alloc_flags = 0;
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>>> index d175e862f222..9c9cca129498 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>>> @@ -363,7 +363,7 @@ int amdgpu_xcp_open_device(struct
>> amdgpu_device *adev,
>>> if (!adev->xcp_mgr)
>>> return 0;
>>>
>>> - fpriv->xcp_id = ~0;
>>> + fpriv->xcp_id = AMDGPU_XCP_NO_PARTITION;
>>> for (i = 0; i < MAX_XCP; ++i) {
>>> if (!adev->xcp_mgr->xcp[i].ddev)
>>> break;
>>> @@ -381,7 +381,7 @@ int amdgpu_xcp_open_device(struct
>> amdgpu_device *adev,
>>> }
>>> }
>>>
>>> - fpriv->vm.mem_id = fpriv->xcp_id == ~0 ? -1 :
>>> + fpriv->vm.mem_id = fpriv->xcp_id == AMDGPU_XCP_NO_PARTITION ?
>> -1 :
>>> adev->xcp_mgr->xcp[fpriv->xcp_id].mem_id;
>>> return 0;
>>> }
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h
>>> index 0f8026d64ea5..9a1036aeec2a 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.h
>>> @@ -37,6 +37,8 @@
>>> #define AMDGPU_XCP_FL_NONE 0
>>> #define AMDGPU_XCP_FL_LOCKED (1 << 0)
>>>
>>> +#define AMDGPU_XCP_NO_PARTITION (~0)
>>> +
>>> struct amdgpu_fpriv;
>>>
>>> enum AMDGPU_XCP_IP_BLOCK {
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
>>> b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
>>> index 16471b81a1f5..72b629a78c62 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
>>> @@ -68,7 +68,7 @@ static void aqua_vanjaram_set_xcp_id(struct
>> amdgpu_device *adev,
>>> enum AMDGPU_XCP_IP_BLOCK ip_blk;
>>> uint32_t inst_mask;
>>>
>>> - ring->xcp_id = ~0;
>>> + ring->xcp_id = AMDGPU_XCP_NO_PARTITION;
>>> if (adev->xcp_mgr->mode == AMDGPU_XCP_MODE_NONE)
>>> return;
>>>
>>> @@ -177,7 +177,7 @@ static int aqua_vanjaram_select_scheds(
>>> u32 sel_xcp_id;
>>> int i;
>>>
>>> - if (fpriv->xcp_id == ~0) {
>>> + if (fpriv->xcp_id == AMDGPU_XCP_NO_PARTITION) {
>>> u32 least_ref_cnt = ~0;
>>>
>>> fpriv->xcp_id = 0;
next prev parent reply other threads:[~2023-08-03 8:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 2:26 [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition Guchun Chen
2023-07-17 2:26 ` [PATCH 2/4] drm/amdgpu: fix slab-out-of-bounds issue in amdgpu_vm_pt_create Guchun Chen
2023-07-17 2:26 ` [PATCH 3/4] drm/amdgpu/vm: use the same xcp_id from root PD Guchun Chen
2023-07-17 2:26 ` [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case Guchun Chen
2023-07-17 14:58 ` Felix Kuehling
2023-07-18 2:16 ` Chen, Guchun
2023-08-03 8:28 ` Christian König [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-07-18 5:13 [PATCH 1/4] drm/amdgpu: Allocate root PD on correct partition Guchun Chen
2023-07-18 5:13 ` [PATCH 4/4] drm/amdgpu: use a macro to define no xcp partition case Guchun Chen
2023-08-08 6:30 ` Christian König
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=b0915726-a8e5-18e7-1b5e-264bb7198c32@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Alexander.Deucher@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=Guchun.Chen@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Philip.Yang@amd.com \
--cc=amd-gfx@lists.freedesktop.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