diff mbox series

[4/4] drm/xe/display: Reduce and streamline d3cold display sequence

Message ID 20240903223803.380711-5-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/xe/display: Clean-up PM sequences | expand

Commit Message

Rodrigo Vivi Sept. 3, 2024, 10:38 p.m. UTC
When going to d3cold we surely don't need to flush commits,
nor handle fbdev. So, clean this up a bit.

Also move the opregion call to make the function more symmetric.

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/display/xe_display.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Gupta, Anshuman Sept. 4, 2024, 5:39 a.m. UTC | #1
On 2024-09-04 at 04:08:03 +0530, Rodrigo Vivi wrote:
> When going to d3cold we surely don't need to flush commits,
> nor handle fbdev. So, clean this up a bit.
> 
> Also move the opregion call to make the function more symmetric.
> 
> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/xe/display/xe_display.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index daf9b9baa88a..3fd3e74f1310 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -310,9 +310,6 @@ static void xe_display_to_d3cold(struct xe_device *xe)
>  	 * properly.
>  	 */
>  	intel_power_domains_disable(xe);
> -	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
How do we make sure fbconsole doesn't use vram to blink the cursor ?

Thanks,
Anshuman.
> -
> -	xe_display_flush_cleanup_work(xe);
>  
>  	intel_dp_mst_suspend(xe);
>  
> @@ -329,18 +326,15 @@ static void xe_display_from_d3cold(struct xe_device *xe)
>  
>  	intel_dmc_resume(xe);
>  
> -	drm_mode_config_reset(&xe->drm);
> -
>  	intel_display_driver_init_hw(xe);
> +
> +	intel_opregion_resume(display);
> +
>  	intel_hpd_init(xe);
>  
>  	/* MST sideband requires HPD interrupts enabled */
>  	intel_dp_mst_resume(xe);
>  
> -	intel_opregion_resume(display);
> -
> -	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
> -
>  	intel_power_domains_enable(xe);
>  }
>  
> -- 
> 2.46.0
>
Rodrigo Vivi Sept. 4, 2024, 3:24 p.m. UTC | #2
On Wed, Sep 04, 2024 at 11:09:24AM +0530, Anshuman Gupta wrote:
> On 2024-09-04 at 04:08:03 +0530, Rodrigo Vivi wrote:
> > When going to d3cold we surely don't need to flush commits,
> > nor handle fbdev. So, clean this up a bit.
> > 
> > Also move the opregion call to make the function more symmetric.
> > 
> > Cc: Imre Deak <imre.deak@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/xe/display/xe_display.c | 12 +++---------
> >  1 file changed, 3 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> > index daf9b9baa88a..3fd3e74f1310 100644
> > --- a/drivers/gpu/drm/xe/display/xe_display.c
> > +++ b/drivers/gpu/drm/xe/display/xe_display.c
> > @@ -310,9 +310,6 @@ static void xe_display_to_d3cold(struct xe_device *xe)
> >  	 * properly.
> >  	 */
> >  	intel_power_domains_disable(xe);
> > -	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
> How do we make sure fbconsole doesn't use vram to blink the cursor ?

Good question, but that's not the point.
The point is, if the fbconsole is there blinking the cursor, we are
100% sure that this runtime suspend call here won't ever happen.

If we reach to this point. The fbconsole is not active and doesn't need
to be suspended.

> 
> Thanks,
> Anshuman.
> > -
> > -	xe_display_flush_cleanup_work(xe);
> >  
> >  	intel_dp_mst_suspend(xe);
> >  
> > @@ -329,18 +326,15 @@ static void xe_display_from_d3cold(struct xe_device *xe)
> >  
> >  	intel_dmc_resume(xe);
> >  
> > -	drm_mode_config_reset(&xe->drm);
> > -
> >  	intel_display_driver_init_hw(xe);
> > +
> > +	intel_opregion_resume(display);
> > +
> >  	intel_hpd_init(xe);
> >  
> >  	/* MST sideband requires HPD interrupts enabled */
> >  	intel_dp_mst_resume(xe);
> >  
> > -	intel_opregion_resume(display);
> > -
> > -	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
> > -
> >  	intel_power_domains_enable(xe);
> >  }
> >  
> > -- 
> > 2.46.0
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index daf9b9baa88a..3fd3e74f1310 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -310,9 +310,6 @@  static void xe_display_to_d3cold(struct xe_device *xe)
 	 * properly.
 	 */
 	intel_power_domains_disable(xe);
-	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
-
-	xe_display_flush_cleanup_work(xe);
 
 	intel_dp_mst_suspend(xe);
 
@@ -329,18 +326,15 @@  static void xe_display_from_d3cold(struct xe_device *xe)
 
 	intel_dmc_resume(xe);
 
-	drm_mode_config_reset(&xe->drm);
-
 	intel_display_driver_init_hw(xe);
+
+	intel_opregion_resume(display);
+
 	intel_hpd_init(xe);
 
 	/* MST sideband requires HPD interrupts enabled */
 	intel_dp_mst_resume(xe);
 
-	intel_opregion_resume(display);
-
-	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
-
 	intel_power_domains_enable(xe);
 }