drm/amd/display: Guard ACPI calls with CONFIG_ACPI
Subsystems (2)
PATCH v2 1/1 drm/amd/display: Guard ACPI calls with CONFIG_ACPI
From: Leo Li <[email protected]>
To fix CONFIG_ACPI disabled build error.
v2: Instead of ifdef-ing inside function, define a no-op stub for amdgpu_acpi_get_backlight_caps when CONFIG_ACPI=n
Fixes ec6f30c776ad ("drm/amd/display: Set default brightness according to ACPI")
Signed-off-by Leo Li <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -1576,6 +1576,7 @@ static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev, u8 dev_state, bool drv_state) { return 0; }static inline int amdgpu_acpi_smart_shift_update (struct drm_device *dev,enum amdgpu_ss ss_state) {return 0 ; } +static inline void amdgpu_acpi_get_backlight_caps (struct amdgpu_dm_backlight_caps *caps) { }#endif #if defined(CONFIG_ACPI ) && defined(CONFIG_SUSPEND )
Signature · 1 line
2.45.1
Quoted 18 lines · On 6/10/2024 10:58, [email protected] wrote:
From: Leo Li <[email protected]>
To fix
CONFIG_ACPIdisabled build error.v2: Instead of ifdef-ing inside function, define a no-op stub for
amdgpu_acpi_get_backlight_capswhenCONFIG_ACPI=nFixes ec6f30c776ad ("drm/amd/display: Set default brightness according to ACPI")Signed-off-by Leo Li <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu.h static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev, · line 1582
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-0@@ -1576,6 +1576,7 @@ static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev, u8 dev_state, bool drv_state) { return 0; }static inline int amdgpu_acpi_smart_shift_update (struct drm_device *dev,enum amdgpu_ss ss_state) {return 0 ; } +static inline void amdgpu_acpi_get_backlight_caps (struct amdgpu_dm_backlight_caps *caps) { }#endif #if defined(CONFIG_ACPI ) && defined(CONFIG_SUSPEND )
Reviewed-by Mario Limonciello <[email protected]>