AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Felix Kuehling <felix.kuehling@amd.com>,
	amd-gfx@lists.freedesktop.org, Asad.Kamal@amd.com
Cc: Hawking.Zhang@amd.com, Alexander.Deucher@amd.com,
	Hao Zhou <hao.zhou@amd.com>
Subject: Re: [PATCH] drm/amdgpu: Use SPX as default in partition config
Date: Mon, 21 Oct 2024 19:37:02 +0530	[thread overview]
Message-ID: <d19b821d-4768-4338-98d1-40950956cbf4@amd.com> (raw)
In-Reply-To: <a4287c13-6006-4739-a2f3-8c14cd085f05@amd.com>



On 10/19/2024 12:46 AM, Felix Kuehling wrote:
> 
> On 2024-10-14 05:19, Lijo Lazar wrote:
>> In certain cases - ex: when a reset is required on initialization - XCP
>> manager won't have a valid partition mode. In such cases, use SPX as the
>> default selected mode for which partition configuration details are
>> populated.
>>
>> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
>> Reported-by: Hao Zhou <hao.zhou@amd.com>
>>
>> Fixes: c7de57033d9b ("drm/amdgpu: Add sysfs nodes to get xcp details")
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>> index 111bf897e72e..83a16918ea76 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
>> @@ -606,7 +606,7 @@ void amdgpu_xcp_cfg_sysfs_init(struct
>> amdgpu_device *adev)
>>   {
>>       struct amdgpu_xcp_res_details *xcp_res;
>>       struct amdgpu_xcp_cfg *xcp_cfg;
>> -    int i, r, j, rid;
>> +    int i, r, j, rid, mode;
>>         if (!adev->xcp_mgr)
>>           return;
>> @@ -625,11 +625,15 @@ void amdgpu_xcp_cfg_sysfs_init(struct
>> amdgpu_device *adev)
>>       if (r)
>>           goto err1;
>>   -    r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr,
>> xcp_cfg->xcp_mgr->mode, xcp_cfg);
>> +    mode = (xcp_cfg->xcp_mgr->mode ==
>> +        AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE) ?
>> +               AMDGPU_SPX_PARTITION_MODE :
>> +               xcp_cfg->xcp_mgr->mode;
> 
> Shouldn't this depend on the memory partition mode as well? You must
> have at least as many compute partitions as memory partitions because
> each compute partition can only use a single memory partition.

This is not dependent on the current/active compute partition mode. It
is to show the configuration (number of xccs, vcns, shared etc.)
supported for a partition mode. SPX is the default partition mode at
boot up. That is used as the default mode.

It's not a strict one-to-one, a compute partition may use other memory
partitions also non-coherently.

Thanks,
Lijo

> 
> Regards,
>   Felix
> 
> 
>> +    r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr, mode, xcp_cfg);
>>       if (r)
>>           goto err1;
>>   -    xcp_cfg->mode = xcp_cfg->xcp_mgr->mode;
>> +    xcp_cfg->mode = mode;
>>       for (i = 0; i < xcp_cfg->num_res; i++) {
>>           xcp_res = &xcp_cfg->xcp_res[i];
>>           rid = xcp_res->id;

  reply	other threads:[~2024-10-21 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  9:19 [PATCH] drm/amdgpu: Use SPX as default in partition config Lijo Lazar
2024-10-15  3:42 ` Kamal, Asad
2024-10-18 19:16 ` Felix Kuehling
2024-10-21 14:07   ` Lazar, Lijo [this message]
2024-10-21 19:25     ` Felix Kuehling
2024-10-22  4:38       ` Lazar, Lijo

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=d19b821d-4768-4338-98d1-40950956cbf4@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Asad.Kamal@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=felix.kuehling@amd.com \
    --cc=hao.zhou@amd.com \
    /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