Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add s0i3 capacity check for s0i3 routine (v2)

add amdgpu_acpi_is_s0ix_supported() to check the platform
whether support s0i3.

v2: fix empty function parameters warning (void)

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Prike Liang and committed by
Alex Deucher
4cd078dc fec3124d

+16
+2
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 1311 1311 1312 1312 void amdgpu_acpi_get_backlight_caps(struct amdgpu_device *adev, 1313 1313 struct amdgpu_dm_backlight_caps *caps); 1314 + bool amdgpu_acpi_is_s0ix_supported(void); 1314 1315 #else 1315 1316 static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; } 1316 1317 static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { } 1318 + static inline bool amdgpu_acpi_is_s0ix_supported(void) { return false; } 1317 1319 #endif 1318 1320 1319 1321 int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
+14
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
··· 27 27 #include <linux/power_supply.h> 28 28 #include <linux/pm_runtime.h> 29 29 #include <acpi/video.h> 30 + #include <acpi/actbl.h> 30 31 31 32 #include <drm/drm_crtc_helper.h> 32 33 #include "amdgpu.h" ··· 894 893 { 895 894 unregister_acpi_notifier(&adev->acpi_nb); 896 895 kfree(adev->atif); 896 + } 897 + 898 + /** 899 + * amdgpu_acpi_is_s0ix_supported 900 + * 901 + * returns true if supported, false if not. 902 + */ 903 + bool amdgpu_acpi_is_s0ix_supported(void) 904 + { 905 + if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) 906 + return true; 907 + 908 + return false; 897 909 }