diff mbox series

[RFC] drm/i915: Disable connector polling at runtime suspend

Message ID 20200717120425.20947-1-anshuman.gupta@intel.com (mailing list archive)
State New, archived
Headers show
Series [RFC] drm/i915: Disable connector polling at runtime suspend | expand

Commit Message

Gupta, Anshuman July 17, 2020, 12:04 p.m. UTC
While i915 device is in runtime suspend, DRM connector polling
causing device to wakeup from runtime suspend.
This harm overall cpu idle statistics, therefore
disabling polling while in runtime suspend.

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Chris Wilson July 17, 2020, 12:25 p.m. UTC | #1
Quoting Anshuman Gupta (2020-07-17 13:04:25)
> While i915 device is in runtime suspend, DRM connector polling
> causing device to wakeup from runtime suspend.
> This harm overall cpu idle statistics, therefore
> disabling polling while in runtime suspend.

So what about the devices where there is no hotplug interrupt during
runtime suspend? How should the device wake up when something is plugged
in? As I recall the transition to polling is only meant to occur on
those devices with no automatic wakeup.
-Chris
Imre Deak July 21, 2020, 1:32 p.m. UTC | #2
On Fri, Jul 17, 2020 at 05:34:25PM +0530, Anshuman Gupta wrote:
> While i915 device is in runtime suspend, DRM connector polling
> causing device to wakeup from runtime suspend.
> This harm overall cpu idle statistics, therefore
> disabling polling while in runtime suspend.

Before disabling polling we would need to enable hotplug interrupts
during the runtime suspended state. Also I haven't seen yet stats where
polling (which has a 10 sec period) have a significant effect on
idle residencies.

> Cc: Imre Deak <imre.deak@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5fd5af4bc855..1229c72f19c9 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1595,6 +1595,8 @@ static int intel_runtime_suspend(struct device *kdev)
>  
>  	disable_rpm_wakeref_asserts(rpm);
>  
> +	drm_kms_helper_poll_disable(&dev_priv->drm);
> +
>  	/*
>  	 * We are safe here against re-faults, since the fault handler takes
>  	 * an RPM reference.
> @@ -1699,6 +1701,8 @@ static int intel_runtime_resume(struct device *kdev)
>  	 */
>  	intel_gt_runtime_resume(&dev_priv->gt);
>  
> +	drm_kms_helper_poll_enable(&dev_priv->drm);
> +
>  	/*
>  	 * On VLV/CHV display interrupts are part of the display
>  	 * power well, so hpd is reinitialized from there. For
> -- 
> 2.26.2
>
Gupta, Anshuman July 21, 2020, 4:34 p.m. UTC | #3
On 2020-07-21 at 16:32:17 +0300, Imre Deak wrote:
> On Fri, Jul 17, 2020 at 05:34:25PM +0530, Anshuman Gupta wrote:
> > While i915 device is in runtime suspend, DRM connector polling
> > causing device to wakeup from runtime suspend.
> > This harm overall cpu idle statistics, therefore
> > disabling polling while in runtime suspend.
> 
> Before disabling polling we would need to enable hotplug interrupts
> during the runtime suspended state. Also I haven't seen yet stats where
IMHO whilst it is deepest display C state, HOTPLUG interrupt will be
disabled.
> polling (which has a 10 sec period) have a significant effect on
> idle residencies.
IMHO it can still affect the runtime s0ix.

Thanks,
Anshuman Gupta.

> 
> > Cc: Imre Deak <imre.deak@intel.com>
> > Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 5fd5af4bc855..1229c72f19c9 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -1595,6 +1595,8 @@ static int intel_runtime_suspend(struct device *kdev)
> >  
> >  	disable_rpm_wakeref_asserts(rpm);
> >  
> > +	drm_kms_helper_poll_disable(&dev_priv->drm);
> > +
> >  	/*
> >  	 * We are safe here against re-faults, since the fault handler takes
> >  	 * an RPM reference.
> > @@ -1699,6 +1701,8 @@ static int intel_runtime_resume(struct device *kdev)
> >  	 */
> >  	intel_gt_runtime_resume(&dev_priv->gt);
> >  
> > +	drm_kms_helper_poll_enable(&dev_priv->drm);
> > +
> >  	/*
> >  	 * On VLV/CHV display interrupts are part of the display
> >  	 * power well, so hpd is reinitialized from there. For
> > -- 
> > 2.26.2
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 5fd5af4bc855..1229c72f19c9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1595,6 +1595,8 @@  static int intel_runtime_suspend(struct device *kdev)
 
 	disable_rpm_wakeref_asserts(rpm);
 
+	drm_kms_helper_poll_disable(&dev_priv->drm);
+
 	/*
 	 * We are safe here against re-faults, since the fault handler takes
 	 * an RPM reference.
@@ -1699,6 +1701,8 @@  static int intel_runtime_resume(struct device *kdev)
 	 */
 	intel_gt_runtime_resume(&dev_priv->gt);
 
+	drm_kms_helper_poll_enable(&dev_priv->drm);
+
 	/*
 	 * On VLV/CHV display interrupts are part of the display
 	 * power well, so hpd is reinitialized from there. For