lkml.org 
[lkml]   [2021]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 026/104] drm/amdgpu: Check pmops for desired suspend state
    Date
    From: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>

    commit 91e273712ab8dd8c31924ac7714b21e011137e98 upstream.

    [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
    v3: squash in build fix

    Suggested-by: Lijo Lazar <Lijo.Lazar@amd.com>
    Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
    +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
    @@ -26,6 +26,7 @@
    #include <linux/slab.h>
    #include <linux/power_supply.h>
    #include <linux/pm_runtime.h>
    +#include <linux/suspend.h>
    #include <acpi/video.h>
    #include <acpi/actbl.h>

    @@ -906,7 +907,7 @@ bool amdgpu_acpi_is_s0ix_supported(struc
    #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;
    }
    #endif
    return false;

    \
     
     \ /
      Last update: 2021-08-02 16:13    [W:4.069 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site