All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs
@ 2022-03-09 22:05 Mario Limonciello
  2022-03-10  5:28 ` Lazar, Lijo
  0 siblings, 1 reply; 5+ messages in thread
From: Mario Limonciello @ 2022-03-09 22:05 UTC (permalink / raw)
  To: amd-gfx; +Cc: Mario Limonciello

`smartshift_*_power` files are showing up on some OEM programs on
the APU instead of the dGPU.

Adjust the logic to the function `ss_power_attr_update`
to detect whether or not the attributes should be exported.

The existing checks that are dropped are already included in
`amdgpu_device_support_smart_shift`, so this can be simplified.
This causes attributes to not be shown on APUs.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index cbbbd4079249..ccd0648c6789 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct amdgpu_device *adev, struct amdgpu_device
 {
 	uint32_t ss_power, size;
 
-	if (!amdgpu_acpi_is_power_shift_control_supported())
-		*states = ATTR_STATE_UNSUPPORTED;
-	else if ((adev->flags & AMD_IS_PX) &&
-		 !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
 		*states = ATTR_STATE_UNSUPPORTED;
 	else if (amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_SS_APU_SHARE,
 		 (void *)&ss_power, &size))
-- 
2.34.1


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

* Re: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs
  2022-03-09 22:05 [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs Mario Limonciello
@ 2022-03-10  5:28 ` Lazar, Lijo
  2022-03-10 11:19   ` Sundararaju, Sathishkumar
  0 siblings, 1 reply; 5+ messages in thread
From: Lazar, Lijo @ 2022-03-10  5:28 UTC (permalink / raw)
  To: Mario Limonciello, amd-gfx



On 3/10/2022 3:35 AM, Mario Limonciello wrote:
> `smartshift_*_power` files are showing up on some OEM programs on
> the APU instead of the dGPU.
> 
> Adjust the logic to the function `ss_power_attr_update`
> to detect whether or not the attributes should be exported.
> 
> The existing checks that are dropped are already included in
> `amdgpu_device_support_smart_shift`, so this can be simplified.
> This causes attributes to not be shown on APUs.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index cbbbd4079249..ccd0648c6789 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct amdgpu_device *adev, struct amdgpu_device
>   {
>   	uint32_t ss_power, size;
>   
> -	if (!amdgpu_acpi_is_power_shift_control_supported())
> -		*states = ATTR_STATE_UNSUPPORTED;
> -	else if ((adev->flags & AMD_IS_PX) &&
> -		 !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> +	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
>   		*states = ATTR_STATE_UNSUPPORTED;

SS 1.0 attributes are supported on APU devices. Will this work on those?

Thanks,
Lijo

>   	else if (amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_SS_APU_SHARE,
>   		 (void *)&ss_power, &size))
> 

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

* RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs
  2022-03-10  5:28 ` Lazar, Lijo
@ 2022-03-10 11:19   ` Sundararaju, Sathishkumar
  2022-03-10 18:15     ` Limonciello, Mario
  0 siblings, 1 reply; 5+ messages in thread
From: Sundararaju, Sathishkumar @ 2022-03-10 11:19 UTC (permalink / raw)
  To: Lazar, Lijo, Limonciello, Mario, amd-gfx

[AMD Official Use Only]

This will fail to create the sysfs attributes for SS1.0.

Regards,
Sathish

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Lazar, Lijo
Sent: Thursday, March 10, 2022 10:58 AM
To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs



On 3/10/2022 3:35 AM, Mario Limonciello wrote:
> `smartshift_*_power` files are showing up on some OEM programs on the 
> APU instead of the dGPU.
> 
> Adjust the logic to the function `ss_power_attr_update` to detect 
> whether or not the attributes should be exported.
> 
> The existing checks that are dropped are already included in 
> `amdgpu_device_support_smart_shift`, so this can be simplified.
> This causes attributes to not be shown on APUs.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c 
> b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index cbbbd4079249..ccd0648c6789 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct amdgpu_device *adev, struct amdgpu_device
>   {
>   	uint32_t ss_power, size;
>   
> -	if (!amdgpu_acpi_is_power_shift_control_supported())
> -		*states = ATTR_STATE_UNSUPPORTED;
> -	else if ((adev->flags & AMD_IS_PX) &&
> -		 !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> +	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
>   		*states = ATTR_STATE_UNSUPPORTED;

SS 1.0 attributes are supported on APU devices. Will this work on those?

Thanks,
Lijo

>   	else if (amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_SS_APU_SHARE,
>   		 (void *)&ss_power, &size))
> 

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

* RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs
  2022-03-10 11:19   ` Sundararaju, Sathishkumar
@ 2022-03-10 18:15     ` Limonciello, Mario
  2022-03-11 20:22       ` Sundararaju, Sathishkumar
  0 siblings, 1 reply; 5+ messages in thread
From: Limonciello, Mario @ 2022-03-10 18:15 UTC (permalink / raw)
  To: Sundararaju, Sathishkumar, Lazar, Lijo, amd-gfx

[AMD Official Use Only]

I'm not familiar with SS 1.0 in this regard, can you explain why it would fail to make the attributes?
I would think the attributes should show up because of amdgpu_device_supports_smart_shift?
Or are the checks done in that function not sufficient for SS 1.0?

> -----Original Message-----
> From: Sundararaju, Sathishkumar <Sathishkumar.Sundararaju@amd.com>
> Sent: Thursday, March 10, 2022 05:19
> To: Lazar, Lijo <Lijo.Lazar@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for
> APUs
> 
> [AMD Official Use Only]
> 
> This will fail to create the sysfs attributes for SS1.0.
> 
> Regards,
> Sathish
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Lazar, Lijo
> Sent: Thursday, March 10, 2022 10:58 AM
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd-
> gfx@lists.freedesktop.org
> Subject: Re: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for
> APUs
> 
> 
> 
> On 3/10/2022 3:35 AM, Mario Limonciello wrote:
> > `smartshift_*_power` files are showing up on some OEM programs on the
> > APU instead of the dGPU.
> >
> > Adjust the logic to the function `ss_power_attr_update` to detect
> > whether or not the attributes should be exported.
> >
> > The existing checks that are dropped are already included in
> > `amdgpu_device_support_smart_shift`, so this can be simplified.
> > This causes attributes to not be shown on APUs.
> >
> > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > ---
> >   drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
> >   1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > index cbbbd4079249..ccd0648c6789 100644
> > --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > @@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct
> amdgpu_device *adev, struct amdgpu_device
> >   {
> >   	uint32_t ss_power, size;
> >
> > -	if (!amdgpu_acpi_is_power_shift_control_supported())
> > -		*states = ATTR_STATE_UNSUPPORTED;
> > -	else if ((adev->flags & AMD_IS_PX) &&
> > -
> !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> > +	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> >   		*states = ATTR_STATE_UNSUPPORTED;
> 
> SS 1.0 attributes are supported on APU devices. Will this work on those?
> 
> Thanks,
> Lijo
> 
> >   	else if (amdgpu_dpm_read_sensor(adev,
> AMDGPU_PP_SENSOR_SS_APU_SHARE,
> >   		 (void *)&ss_power, &size))
> >

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

* RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs
  2022-03-10 18:15     ` Limonciello, Mario
@ 2022-03-11 20:22       ` Sundararaju, Sathishkumar
  0 siblings, 0 replies; 5+ messages in thread
From: Sundararaju, Sathishkumar @ 2022-03-11 20:22 UTC (permalink / raw)
  To: Limonciello, Mario, Lazar, Lijo, amd-gfx

[AMD Official Use Only]

Hi Mario,

amdgpu_device_supports_smart_shift() is to check if the device is dGPU and platform supports smartshift. 
which would fail for iGPU and so the attr_update() will return unsupported, due to this on SS1.0 platform the entries won't be created.

Regards,
Sathish 

-----Original Message-----
From: Limonciello, Mario <Mario.Limonciello@amd.com> 
Sent: Thursday, March 10, 2022 11:45 PM
To: Sundararaju, Sathishkumar <Sathishkumar.Sundararaju@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org
Subject: RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs

[AMD Official Use Only]

I'm not familiar with SS 1.0 in this regard, can you explain why it would fail to make the attributes?
I would think the attributes should show up because of amdgpu_device_supports_smart_shift?
Or are the checks done in that function not sufficient for SS 1.0?

> -----Original Message-----
> From: Sundararaju, Sathishkumar <Sathishkumar.Sundararaju@amd.com>
> Sent: Thursday, March 10, 2022 05:19
> To: Lazar, Lijo <Lijo.Lazar@amd.com>; Limonciello, Mario 
> <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: RE: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files 
> for APUs
> 
> [AMD Official Use Only]
> 
> This will fail to create the sysfs attributes for SS1.0.
> 
> Regards,
> Sathish
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Lazar, Lijo
> Sent: Thursday, March 10, 2022 10:58 AM
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd- 
> gfx@lists.freedesktop.org
> Subject: Re: [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files 
> for APUs
> 
> 
> 
> On 3/10/2022 3:35 AM, Mario Limonciello wrote:
> > `smartshift_*_power` files are showing up on some OEM programs on 
> > the APU instead of the dGPU.
> >
> > Adjust the logic to the function `ss_power_attr_update` to detect 
> > whether or not the attributes should be exported.
> >
> > The existing checks that are dropped are already included in 
> > `amdgpu_device_support_smart_shift`, so this can be simplified.
> > This causes attributes to not be shown on APUs.
> >
> > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > ---
> >   drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
> >   1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > index cbbbd4079249..ccd0648c6789 100644
> > --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> > @@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct
> amdgpu_device *adev, struct amdgpu_device
> >   {
> >   	uint32_t ss_power, size;
> >
> > -	if (!amdgpu_acpi_is_power_shift_control_supported())
> > -		*states = ATTR_STATE_UNSUPPORTED;
> > -	else if ((adev->flags & AMD_IS_PX) &&
> > -
> !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> > +	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
> >   		*states = ATTR_STATE_UNSUPPORTED;
> 
> SS 1.0 attributes are supported on APU devices. Will this work on those?
> 
> Thanks,
> Lijo
> 
> >   	else if (amdgpu_dpm_read_sensor(adev,
> AMDGPU_PP_SENSOR_SS_APU_SHARE,
> >   		 (void *)&ss_power, &size))
> >

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

end of thread, other threads:[~2022-03-11 20:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 22:05 [PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs Mario Limonciello
2022-03-10  5:28 ` Lazar, Lijo
2022-03-10 11:19   ` Sundararaju, Sathishkumar
2022-03-10 18:15     ` Limonciello, Mario
2022-03-11 20:22       ` Sundararaju, Sathishkumar

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.