diff mbox

drm/i915/psr: Check if VBT says PSR can be enabled.

Message ID 20180509003524.3199-1-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan May 9, 2018, 12:35 a.m. UTC
Driver features data block has a boolean flag for PSR, use this to decide
whether PSR should be enabled on a platform. The module parameter can
still be used to override this.

Note: The feature currently remains disabled by default for all platforms
irrespective of what VBT says.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h   | 1 +
 drivers/gpu/drm/i915/intel_bios.c | 1 +
 drivers/gpu/drm/i915/intel_psr.c  | 7 +++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

Comments

Rodrigo Vivi May 9, 2018, 12:29 p.m. UTC | #1
On Tue, May 08, 2018 at 05:35:24PM -0700, Dhinakaran Pandiyan wrote:
> Driver features data block has a boolean flag for PSR, use this to decide
> whether PSR should be enabled on a platform. The module parameter can
> still be used to override this.
> 
> Note: The feature currently remains disabled by default for all platforms
> irrespective of what VBT says.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

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

> ---
>  drivers/gpu/drm/i915/i915_drv.h   | 1 +
>  drivers/gpu/drm/i915/intel_bios.c | 1 +
>  drivers/gpu/drm/i915/intel_psr.c  | 7 +++++--
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 04e27806e581..24c5e4765afd 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1073,6 +1073,7 @@ struct intel_vbt_data {
>  	} edp;
>  
>  	struct {
> +		bool enable;
>  		bool full_link;
>  		bool require_aux_wakeup;
>  		int idle_frames;
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 702d3fab97fc..54270bdde100 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -530,6 +530,7 @@ parse_driver_features(struct drm_i915_private *dev_priv,
>  	 */
>  	if (!driver->drrs_enabled)
>  		dev_priv->vbt.drrs_type = DRRS_NOT_SUPPORTED;
> +	dev_priv->vbt.psr.enable = driver->psr_enabled;
>  }
>  
>  static void
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 6233a322aac5..db27f2faa1de 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -1173,9 +1173,12 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
>  	if (!dev_priv->psr.sink_support)
>  		return;
>  
> -	/* Per platform default: all disabled. */
> -	if (i915_modparams.enable_psr == -1)
> +	if (i915_modparams.enable_psr == -1) {
> +		i915_modparams.enable_psr = dev_priv->vbt.psr.enable;
> +
> +		/* Per platform default: all disabled. */
>  		i915_modparams.enable_psr = 0;
> +	}
>  
>  	/* Set link_standby x link_off defaults */
>  	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
> -- 
> 2.14.1
>
Rodrigo Vivi May 9, 2018, 1:59 p.m. UTC | #2
On Wed, May 09, 2018 at 05:29:14AM -0700, Rodrigo Vivi wrote:
> On Tue, May 08, 2018 at 05:35:24PM -0700, Dhinakaran Pandiyan wrote:
> > Driver features data block has a boolean flag for PSR, use this to decide
> > whether PSR should be enabled on a platform. The module parameter can
> > still be used to override this.
> > 
> > Note: The feature currently remains disabled by default for all platforms
> > irrespective of what VBT says.
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

pushed to dinq. Thanks for the patch.

> 
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h   | 1 +
> >  drivers/gpu/drm/i915/intel_bios.c | 1 +
> >  drivers/gpu/drm/i915/intel_psr.c  | 7 +++++--
> >  3 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 04e27806e581..24c5e4765afd 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1073,6 +1073,7 @@ struct intel_vbt_data {
> >  	} edp;
> >  
> >  	struct {
> > +		bool enable;
> >  		bool full_link;
> >  		bool require_aux_wakeup;
> >  		int idle_frames;
> > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> > index 702d3fab97fc..54270bdde100 100644
> > --- a/drivers/gpu/drm/i915/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/intel_bios.c
> > @@ -530,6 +530,7 @@ parse_driver_features(struct drm_i915_private *dev_priv,
> >  	 */
> >  	if (!driver->drrs_enabled)
> >  		dev_priv->vbt.drrs_type = DRRS_NOT_SUPPORTED;
> > +	dev_priv->vbt.psr.enable = driver->psr_enabled;
> >  }
> >  
> >  static void
> > diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> > index 6233a322aac5..db27f2faa1de 100644
> > --- a/drivers/gpu/drm/i915/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > @@ -1173,9 +1173,12 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
> >  	if (!dev_priv->psr.sink_support)
> >  		return;
> >  
> > -	/* Per platform default: all disabled. */
> > -	if (i915_modparams.enable_psr == -1)
> > +	if (i915_modparams.enable_psr == -1) {
> > +		i915_modparams.enable_psr = dev_priv->vbt.psr.enable;
> > +
> > +		/* Per platform default: all disabled. */
> >  		i915_modparams.enable_psr = 0;
> > +	}
> >  
> >  	/* Set link_standby x link_off defaults */
> >  	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
> > -- 
> > 2.14.1
> > 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 04e27806e581..24c5e4765afd 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1073,6 +1073,7 @@  struct intel_vbt_data {
 	} edp;
 
 	struct {
+		bool enable;
 		bool full_link;
 		bool require_aux_wakeup;
 		int idle_frames;
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 702d3fab97fc..54270bdde100 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -530,6 +530,7 @@  parse_driver_features(struct drm_i915_private *dev_priv,
 	 */
 	if (!driver->drrs_enabled)
 		dev_priv->vbt.drrs_type = DRRS_NOT_SUPPORTED;
+	dev_priv->vbt.psr.enable = driver->psr_enabled;
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 6233a322aac5..db27f2faa1de 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -1173,9 +1173,12 @@  void intel_psr_init(struct drm_i915_private *dev_priv)
 	if (!dev_priv->psr.sink_support)
 		return;
 
-	/* Per platform default: all disabled. */
-	if (i915_modparams.enable_psr == -1)
+	if (i915_modparams.enable_psr == -1) {
+		i915_modparams.enable_psr = dev_priv->vbt.psr.enable;
+
+		/* Per platform default: all disabled. */
 		i915_modparams.enable_psr = 0;
+	}
 
 	/* Set link_standby x link_off defaults */
 	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))