AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
@ 2024-10-18 19:20 Alex Deucher
  2024-10-21 20:35 ` Deucher, Alexander
  2024-10-22  9:27 ` Lazar, Lijo
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Deucher @ 2024-10-18 19:20 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

It does not support fullscreen 3D.

Fixes: 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index accc96a03bd9..4b816c7e94fe 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
 	smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
 	smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-	if (smu->is_apu)
+	if (smu->is_apu ||
+	    (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
 	else
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
-- 
2.46.2


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

* Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
  2024-10-18 19:20 [PATCH] drm/amdgpu: handle default profile on GC 9.4.1 Alex Deucher
@ 2024-10-21 20:35 ` Deucher, Alexander
  2024-10-22  0:51   ` Feng, Kenneth
  2024-10-22  9:27 ` Lazar, Lijo
  1 sibling, 1 reply; 5+ messages in thread
From: Deucher, Alexander @ 2024-10-21 20:35 UTC (permalink / raw)
  To: amd-gfx@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

Ping?
________________________________
From: Deucher, Alexander <Alexander.Deucher@amd.com>
Sent: Friday, October 18, 2024 3:20 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes: 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index accc96a03bd9..4b816c7e94fe 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
         smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
         smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;

-       if (smu->is_apu)
+       if (smu->is_apu ||
+           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
         else
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
--
2.46.2


[-- Attachment #2: Type: text/html, Size: 3008 bytes --]

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

* RE: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
  2024-10-21 20:35 ` Deucher, Alexander
@ 2024-10-22  0:51   ` Feng, Kenneth
  2024-10-22 13:38     ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Feng, Kenneth @ 2024-10-22  0:51 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 2861 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Alex,
I have found another problem with the current code based on the default workload setting to 3D fullscreen.
For example, the default workload is set to 3D fullscreen first, but in boot, it's not applied yet.
Then a vcn ring test comes in, sets the workload mask to vcn workload + 3D fullscreen. After the setting,
Actually the workload mask is updated to vcn workload only. Then after the vcn ring test, the workload doesn't go
to 3D fullscreen workload. It goes to bootup workload(PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT).
Let me try to fix it by today and get back to you.
For this patch itself, it's ok.
Reviewed-by: Kenneth Feng kenneth.feng@amd.com<mailto:kenneth.feng@amd.com>



From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Deucher, Alexander
Sent: Tuesday, October 22, 2024 4:35 AM
To: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1


[AMD Official Use Only - AMD Internal Distribution Only]

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


[AMD Official Use Only - AMD Internal Distribution Only]

Ping?
________________________________
From: Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>
Sent: Friday, October 18, 2024 3:20 PM
To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com<mailto:Alexander.Deucher@amd.com>>
Subject: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes: 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com<mailto:alexander.deucher@amd.com>>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index accc96a03bd9..4b816c7e94fe 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
         smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
         smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;

-       if (smu->is_apu)
+       if (smu->is_apu ||
+           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
         else
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
--
2.46.2

[-- Attachment #2: Type: text/html, Size: 9114 bytes --]

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

* Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
  2024-10-18 19:20 [PATCH] drm/amdgpu: handle default profile on GC 9.4.1 Alex Deucher
  2024-10-21 20:35 ` Deucher, Alexander
@ 2024-10-22  9:27 ` Lazar, Lijo
  1 sibling, 0 replies; 5+ messages in thread
From: Lazar, Lijo @ 2024-10-22  9:27 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx



On 10/19/2024 12:50 AM, Alex Deucher wrote:
> It does not support fullscreen 3D.
> 
> Fixes: 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index accc96a03bd9..4b816c7e94fe 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
>  	smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
>  	smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
>  
> -	if (smu->is_apu)
> +	if (smu->is_apu ||
> +	    (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
>  		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];

It's better to make this check generic and check against availability of
3D workload profile.

is_workload_profile_available(profile_index)
 return smu->workload_map && smu->workload_map[index].valid_mapping .

Thanks,
Lijo

>  	else
>  		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];

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

* Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
  2024-10-22  0:51   ` Feng, Kenneth
@ 2024-10-22 13:38     ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2024-10-22 13:38 UTC (permalink / raw)
  To: Feng, Kenneth; +Cc: Deucher, Alexander, amd-gfx@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 3049 bytes --]

Please double check the COMPUTE profile set by KFD as well.

Thanks,

Alex

On Mon, Oct 21, 2024 at 9:18 PM Feng, Kenneth <Kenneth.Feng@amd.com> wrote:

> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hi Alex,
>
> I have found another problem with the current code based on the default
> workload setting to 3D fullscreen.
>
> For example, the default workload is set to 3D fullscreen first, but in
> boot, it’s not applied yet.
>
> Then a vcn ring test comes in, sets the workload mask to vcn workload + 3D
> fullscreen. After the setting,
>
> Actually the workload mask is updated to vcn workload only. Then after the
> vcn ring test, the workload doesn’t go
>
> to 3D fullscreen workload. It goes to bootup
> workload(PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT).
>
> Let me try to fix it by today and get back to you.
>
> For this patch itself, it’s ok.
>
> Reviewed-by: Kenneth Feng kenneth.feng@amd.com
>
>
>
>
>
>
>
> *From:* amd-gfx <amd-gfx-bounces@lists.freedesktop.org> *On Behalf Of *Deucher,
> Alexander
> *Sent:* Tuesday, October 22, 2024 4:35 AM
> *To:* amd-gfx@lists.freedesktop.org
> *Subject:* Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
>
>
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
>
>
> *Caution:* This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
>
>
> Ping?
> ------------------------------
>
> *From:* Deucher, Alexander <Alexander.Deucher@amd.com>
> *Sent:* Friday, October 18, 2024 3:20 PM
> *To:* amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
> *Cc:* Deucher, Alexander <Alexander.Deucher@amd.com>
> *Subject:* [PATCH] drm/amdgpu: handle default profile on GC 9.4.1
>
>
>
> It does not support fullscreen 3D.
>
> Fixes: 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile
> for dGPUs")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index accc96a03bd9..4b816c7e94fe 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block
> *ip_block)
>          smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
>          smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
>
> -       if (smu->is_apu)
> +       if (smu->is_apu ||
> +           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
>                  smu->workload_mask = 1 <<
> smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
>          else
>                  smu->workload_mask = 1 <<
> smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
> --
> 2.46.2
>

[-- Attachment #2: Type: text/html, Size: 7705 bytes --]

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

end of thread, other threads:[~2024-10-22 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 19:20 [PATCH] drm/amdgpu: handle default profile on GC 9.4.1 Alex Deucher
2024-10-21 20:35 ` Deucher, Alexander
2024-10-22  0:51   ` Feng, Kenneth
2024-10-22 13:38     ` Alex Deucher
2024-10-22  9:27 ` Lazar, Lijo

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