diff mbox series

[3/3] drm/xe: Use the encoder suspend helper also used by the i915 driver

Message ID 20240617170356.4000251-3-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915: Move encoder suspend/shutdown helpers to intel_encoder.c | expand

Commit Message

Imre Deak June 17, 2024, 5:03 p.m. UTC
Use the suspend encoders helper which is also used by the i915 driver.
This fixes an issue in the xe driver where the encoder
suspend_complete() hook is not called and was an overlook when this hook
was added in

Commit b61fad5f7e5d ("drm/i915/tc: Call TypeC port flush_work/cleanup without modeset locks held")

for i915, but not added to the xe driver (which was still in a separate
source tree at the above point).

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/xe/display/xe_display.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

Comments

Rodrigo Vivi June 17, 2024, 5:44 p.m. UTC | #1
On Mon, Jun 17, 2024 at 08:03:56PM +0300, Imre Deak wrote:
> Use the suspend encoders helper which is also used by the i915 driver.
> This fixes an issue in the xe driver where the encoder
> suspend_complete() hook is not called and was an overlook when this hook
> was added in

I believe it is okay to stay in the same line and then break the commit
subject in the middle for the next line...

> 
> Commit b61fad5f7e5d ("drm/i915/tc: Call TypeC port flush_work/cleanup without modeset locks held")
> 

I wonder if we should have a fixes, but probably okay to skip it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> for i915, but not added to the xe driver (which was still in a separate
> source tree at the above point).
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/xe/display/xe_display.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index 78cccbe289475..8b83dcff72e17 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -23,6 +23,7 @@
>  #include "intel_display_types.h"
>  #include "intel_dmc.h"
>  #include "intel_dp.h"
> +#include "intel_encoder.h"
>  #include "intel_fbdev.h"
>  #include "intel_hdcp.h"
>  #include "intel_hotplug.h"
> @@ -270,21 +271,6 @@ void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
>  		gen11_de_irq_postinstall(xe);
>  }
>  
> -static void intel_suspend_encoders(struct xe_device *xe)
> -{
> -	struct drm_device *dev = &xe->drm;
> -	struct intel_encoder *encoder;
> -
> -	if (has_display(xe))
> -		return;
> -
> -	drm_modeset_lock_all(dev);
> -	for_each_intel_encoder(dev, encoder)
> -		if (encoder->suspend)
> -			encoder->suspend(encoder);
> -	drm_modeset_unlock_all(dev);
> -}
> -
>  static bool suspend_to_idle(void)
>  {
>  #if IS_ENABLED(CONFIG_ACPI_SLEEP)
> @@ -315,7 +301,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
>  
>  	intel_hpd_cancel_work(xe);
>  
> -	intel_suspend_encoders(xe);
> +	intel_encoder_suspend_all(&xe->display);
>  
>  	intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
>  
> -- 
> 2.43.3
>
Imre Deak June 17, 2024, 5:54 p.m. UTC | #2
On Mon, Jun 17, 2024 at 01:44:06PM -0400, Rodrigo Vivi wrote:
> On Mon, Jun 17, 2024 at 08:03:56PM +0300, Imre Deak wrote:
> > Use the suspend encoders helper which is also used by the i915 driver.
> > This fixes an issue in the xe driver where the encoder
> > suspend_complete() hook is not called and was an overlook when this hook
> > was added in
> 
> I believe it is okay to stay in the same line and then break the commit
> subject in the middle for the next line...

Ok, looks like done elsewhere as well, will reformat.

> > Commit b61fad5f7e5d ("drm/i915/tc: Call TypeC port flush_work/cleanup without modeset locks held")
> > 
> 
> I wonder if we should have a fixes, but probably okay to skip it.

I wasn't sure, since strictly the tree itself at the above commit didn't
have the issue. I suppose if needed this would need to be sent to 6.9
stable manually.

> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Thanks.

> 
> > for i915, but not added to the xe driver (which was still in a separate
> > source tree at the above point).
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/xe/display/xe_display.c | 18 ++----------------
> >  1 file changed, 2 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> > index 78cccbe289475..8b83dcff72e17 100644
> > --- a/drivers/gpu/drm/xe/display/xe_display.c
> > +++ b/drivers/gpu/drm/xe/display/xe_display.c
> > @@ -23,6 +23,7 @@
> >  #include "intel_display_types.h"
> >  #include "intel_dmc.h"
> >  #include "intel_dp.h"
> > +#include "intel_encoder.h"
> >  #include "intel_fbdev.h"
> >  #include "intel_hdcp.h"
> >  #include "intel_hotplug.h"
> > @@ -270,21 +271,6 @@ void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
> >  		gen11_de_irq_postinstall(xe);
> >  }
> >  
> > -static void intel_suspend_encoders(struct xe_device *xe)
> > -{
> > -	struct drm_device *dev = &xe->drm;
> > -	struct intel_encoder *encoder;
> > -
> > -	if (has_display(xe))
> > -		return;
> > -
> > -	drm_modeset_lock_all(dev);
> > -	for_each_intel_encoder(dev, encoder)
> > -		if (encoder->suspend)
> > -			encoder->suspend(encoder);
> > -	drm_modeset_unlock_all(dev);
> > -}
> > -
> >  static bool suspend_to_idle(void)
> >  {
> >  #if IS_ENABLED(CONFIG_ACPI_SLEEP)
> > @@ -315,7 +301,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> >  
> >  	intel_hpd_cancel_work(xe);
> >  
> > -	intel_suspend_encoders(xe);
> > +	intel_encoder_suspend_all(&xe->display);
> >  
> >  	intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
> >  
> > -- 
> > 2.43.3
> >
Rodrigo Vivi June 17, 2024, 6:03 p.m. UTC | #3
On Mon, Jun 17, 2024 at 08:54:13PM +0300, Imre Deak wrote:
> On Mon, Jun 17, 2024 at 01:44:06PM -0400, Rodrigo Vivi wrote:
> > On Mon, Jun 17, 2024 at 08:03:56PM +0300, Imre Deak wrote:
> > > Use the suspend encoders helper which is also used by the i915 driver.
> > > This fixes an issue in the xe driver where the encoder
> > > suspend_complete() hook is not called and was an overlook when this hook
> > > was added in
> > 
> > I believe it is okay to stay in the same line and then break the commit
> > subject in the middle for the next line...
> 
> Ok, looks like done elsewhere as well, will reformat.

nah, not needed. this is clear enough if checkpatch is not complainin no need
to change.

> 
> > > Commit b61fad5f7e5d ("drm/i915/tc: Call TypeC port flush_work/cleanup without modeset locks held")
> > > 
> > 
> > I wonder if we should have a fixes, but probably okay to skip it.
> 
> I wasn't sure, since strictly the tree itself at the above commit didn't
> have the issue. I suppose if needed this would need to be sent to 6.9
> stable manually.

good point!

thanks a lot,
Rodrigo.

> 
> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> Thanks.
> 
> > 
> > > for i915, but not added to the xe driver (which was still in a separate
> > > source tree at the above point).
> > > 
> > > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/display/xe_display.c | 18 ++----------------
> > >  1 file changed, 2 insertions(+), 16 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> > > index 78cccbe289475..8b83dcff72e17 100644
> > > --- a/drivers/gpu/drm/xe/display/xe_display.c
> > > +++ b/drivers/gpu/drm/xe/display/xe_display.c
> > > @@ -23,6 +23,7 @@
> > >  #include "intel_display_types.h"
> > >  #include "intel_dmc.h"
> > >  #include "intel_dp.h"
> > > +#include "intel_encoder.h"
> > >  #include "intel_fbdev.h"
> > >  #include "intel_hdcp.h"
> > >  #include "intel_hotplug.h"
> > > @@ -270,21 +271,6 @@ void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
> > >  		gen11_de_irq_postinstall(xe);
> > >  }
> > >  
> > > -static void intel_suspend_encoders(struct xe_device *xe)
> > > -{
> > > -	struct drm_device *dev = &xe->drm;
> > > -	struct intel_encoder *encoder;
> > > -
> > > -	if (has_display(xe))
> > > -		return;
> > > -
> > > -	drm_modeset_lock_all(dev);
> > > -	for_each_intel_encoder(dev, encoder)
> > > -		if (encoder->suspend)
> > > -			encoder->suspend(encoder);
> > > -	drm_modeset_unlock_all(dev);
> > > -}
> > > -
> > >  static bool suspend_to_idle(void)
> > >  {
> > >  #if IS_ENABLED(CONFIG_ACPI_SLEEP)
> > > @@ -315,7 +301,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> > >  
> > >  	intel_hpd_cancel_work(xe);
> > >  
> > > -	intel_suspend_encoders(xe);
> > > +	intel_encoder_suspend_all(&xe->display);
> > >  
> > >  	intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
> > >  
> > > -- 
> > > 2.43.3
> > >
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 78cccbe289475..8b83dcff72e17 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -23,6 +23,7 @@ 
 #include "intel_display_types.h"
 #include "intel_dmc.h"
 #include "intel_dp.h"
+#include "intel_encoder.h"
 #include "intel_fbdev.h"
 #include "intel_hdcp.h"
 #include "intel_hotplug.h"
@@ -270,21 +271,6 @@  void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
 		gen11_de_irq_postinstall(xe);
 }
 
-static void intel_suspend_encoders(struct xe_device *xe)
-{
-	struct drm_device *dev = &xe->drm;
-	struct intel_encoder *encoder;
-
-	if (has_display(xe))
-		return;
-
-	drm_modeset_lock_all(dev);
-	for_each_intel_encoder(dev, encoder)
-		if (encoder->suspend)
-			encoder->suspend(encoder);
-	drm_modeset_unlock_all(dev);
-}
-
 static bool suspend_to_idle(void)
 {
 #if IS_ENABLED(CONFIG_ACPI_SLEEP)
@@ -315,7 +301,7 @@  void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
 
 	intel_hpd_cancel_work(xe);
 
-	intel_suspend_encoders(xe);
+	intel_encoder_suspend_all(&xe->display);
 
 	intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);