On 7/23/2021 6:18 PM, Pratik Vishwakarma wrote:
[Why]
User might change the suspend behaviour from OS.

[How]
Check with pm for target suspend state and set s0ix
flag only for s2idle state.

v2: User might change default suspend state, use target state
Suggested-by: Lijo Lazar <lijo.la...@amd.com>
Signed-off-by: Pratik Vishwakarma <pratik.vishwaka...@amd.com>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 84a1b4bc9bb4..bf59bb263816 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -1042,7 +1042,7 @@ bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device 
*adev)
  #if defined(CONFIG_AMD_PMC) || defined(CONFIG_AMD_PMC_MODULE)
        if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
                if (adev->flags & AMD_IS_APU)
-                       return true;
+                       return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;

Not sure if this is the right place, the name _is_s0ix_supported() gives the sense of a static check - whether the feature is supported.

pm_suspend_target_state is a dynamic one - actual suspend state to which transition happens. Ex: s0ix may be supported, but user may choose suspend to RAM.

Maybe rename to is_s0ix_transition? Will let Alex to comment as he added this function originally.

Thanks,
Lijo

        }
  #endif
        return false;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to