Skip to contentSkip to conversation

drm/amd/display: Guard ACPI calls with CONFIG_ACPI

PATCH In review [email protected] 2 participants 2 messages Jun 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
index 1f71c7b98d77..083f353cff6e 100644
@@ -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
Reviewed-by on v2 1/1
#1 lore raw
Quoted 18 lines · On 6/10/2024 10:58, [email protected] wrote:

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")
---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0 -0
index 1f71c7b98d77..083f353cff6e 100644

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)