[Intel-xe] [PATCH] drm/xe/display: Use acpi_target_system_state only if ACPI_SLEEP is enabled
Jani Nikula
jani.nikula at linux.intel.com
Mon Sep 4 10:12:02 UTC 2023
On Fri, 01 Sep 2023, Francois Dugast <francois.dugast at intel.com> wrote:
> This fixes the build when ACPI_SLEEP is disabled.
What is the build failure exactly? It's usually helpful to copy-paste
the error in the commit message.
acpi_target_system_state() should evaluate to ACPI_STATE_S0 for
CONFIG_ACPI_SLEEP=n, and the changes here would be unnecessary.
Most likely the problem is CONFIG_ACPI=n leading to <acpi/acpi_bus.h>
not being included at all, and the function not being present. Directly
including <acpi/acpi_bus.h> would be the cleaner fix.
BR,
Jani.
>
> Signed-off-by: Francois Dugast <francois.dugast at intel.com>
> ---
> drivers/gpu/drm/xe/xe_display.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
> index b6b547c4877c..54f52b6d702d 100644
> --- a/drivers/gpu/drm/xe/xe_display.c
> +++ b/drivers/gpu/drm/xe/xe_display.c
> @@ -331,7 +331,12 @@ static void intel_suspend_encoders(struct xe_device *xe)
>
> void xe_display_pm_suspend(struct xe_device *xe)
> {
> - bool s2idle = acpi_target_system_state() < ACPI_STATE_S3;
> + bool s2idle;
> +#if IS_ENABLED(CONFIG_ACPI_SLEEP)
> + s2idle = acpi_target_system_state() < ACPI_STATE_S3;
> +#else
> + s2idle = true;
> +#endif
> if (!xe->info.enable_display)
> return;
>
> @@ -360,7 +365,12 @@ void xe_display_pm_suspend(struct xe_device *xe)
>
> void xe_display_pm_suspend_late(struct xe_device *xe)
> {
> - bool s2idle = acpi_target_system_state() < ACPI_STATE_S3;
> + bool s2idle;
> +#if IS_ENABLED(CONFIG_ACPI_SLEEP)
> + s2idle = acpi_target_system_state() < ACPI_STATE_S3;
> +#else
> + s2idle = true;
> +#endif
> if (!xe->info.enable_display)
> return;
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-xe
mailing list