[Intel-xe] [PATCH] drm/xe/display: Use acpi_target_system_state only if ACPI_SLEEP is enabled

Francois Dugast francois.dugast at intel.com
Tue Sep 5 14:46:14 UTC 2023


On Fri, Sep 01, 2023 at 04:18:20PM -0400, Rodrigo Vivi wrote:
> On Fri, Sep 01, 2023 at 04:03:00PM +0000, Francois Dugast wrote:
> > This fixes the build when ACPI_SLEEP is disabled.
> > 
> > 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;
> 
> what about:
> 
> s2idle = IS_ENABLED(CONFIG_ACPI_SLEEP) ?
>          acpi_target_system_state() < ACPI_STATE_S3 : true;
> 
> ?

Unfortunately this does not solve the build issue as acpi_target_system_state()
is not present when building with CONFIG_ACPI_SLEEP=n.

> 
> > +#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;
> 
> since there's duplication maybe even add to a static function?

Sure, will do in v2.

> 
> > +#else
> > +	s2idle = true;
> > +#endif
> >  	if (!xe->info.enable_display)
> >  		return;
> >  
> > -- 
> > 2.34.1
> > 


More information about the Intel-xe mailing list