diff mbox series

drm/i915/psr: Limit psr2 to skl+

Message ID 1532584957-8174-1-git-send-email-vathsala.nagaraju@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/psr: Limit psr2 to skl+ | expand

Commit Message

vathsala nagaraju July 26, 2018, 6:02 a.m. UTC
From: Vathsala Nagaraju <vathsala.nagaraju@intel.com>

PSR2 is supported from skl+.
So Limiting it to skl+.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Dhinakaran Pandiyan July 26, 2018, 6:47 a.m. UTC | #1
On Thu, 2018-07-26 at 11:32 +0530, vathsala nagaraju wrote:
> From: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> 
> PSR2 is supported from skl+.
> So Limiting it to skl+.

We restrict PSR2 to gen9+ in intel_psr_init_dpcd(), avoids a few extra
dpcd reads by checking early.


> 
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_psr.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c
> b/drivers/gpu/drm/i915/intel_psr.c
> index 4bd5768..cbbdfd2 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -387,7 +387,7 @@ static void hsw_activate_psr1(struct intel_dp
> *intel_dp)
>  	I915_WRITE(EDP_PSR_CTL, val);
>  }
>  
> -static void hsw_activate_psr2(struct intel_dp *intel_dp)
> +static void skl_activate_psr2(struct intel_dp *intel_dp)

Yeah, skl_ is appropriate here.

We should also change the function names to hsw_psr1_activate() and
skl_psr2_activate(), it has been annoying me that the activate
functions aren't named in the same fashion as psr_{enable, invalidate,
flush, disable}


>  {
>  	struct intel_digital_port *dig_port =
> dp_to_dig_port(intel_dp);
>  	struct drm_device *dev = dig_port->base.base.dev;
> @@ -516,7 +516,9 @@ void intel_psr_compute_config(struct intel_dp
> *intel_dp,
>  	}
>  
>  	crtc_state->has_psr = true;
> -	crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp,
> crtc_state);
> +	if (INTEL_GEN(dev_priv) >= 9)
> +		crtc_state->has_psr2 =
> intel_psr2_config_valid(intel_dp,
> +							       crtc_
> state);
>  	DRM_DEBUG_KMS("Enabling PSR%s\n", crtc_state->has_psr2 ? "2"
> : "");
>  }
>  
> @@ -534,7 +536,7 @@ static void intel_psr_activate(struct intel_dp
> *intel_dp)
>  
>  	/* psr1 and psr2 are mutually exclusive.*/
>  	if (dev_priv->psr.psr2_enabled)
> -		hsw_activate_psr2(intel_dp);
> +		skl_activate_psr2(intel_dp);
>  	else
>  		hsw_activate_psr1(intel_dp);
>
Rodrigo Vivi July 26, 2018, 11:56 p.m. UTC | #2
1;5202;0cOn Wed, Jul 25, 2018 at 11:47:21PM -0700, Dhinakaran Pandiyan wrote:
> On Thu, 2018-07-26 at 11:32 +0530, vathsala nagaraju wrote:
> > From: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> > 
> > PSR2 is supported from skl+.
> > So Limiting it to skl+.
> 
> We restrict PSR2 to gen9+ in intel_psr_init_dpcd(), avoids a few extra
> dpcd reads by checking early.
> 
> 
> > 
> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > Signed-off-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_psr.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_psr.c
> > b/drivers/gpu/drm/i915/intel_psr.c
> > index 4bd5768..cbbdfd2 100644
> > --- a/drivers/gpu/drm/i915/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > @@ -387,7 +387,7 @@ static void hsw_activate_psr1(struct intel_dp
> > *intel_dp)
> >  	I915_WRITE(EDP_PSR_CTL, val);
> >  }
> >  
> > -static void hsw_activate_psr2(struct intel_dp *intel_dp)
> > +static void skl_activate_psr2(struct intel_dp *intel_dp)
> 
> Yeah, skl_ is appropriate here.
> 
> We should also change the function names to hsw_psr1_activate() and
> skl_psr2_activate(), it has been annoying me that the activate
> functions aren't named in the same fashion as psr_{enable, invalidate,
> flush, disable}

maybe simply  intel_psr1_activate intel_psr2_activate?!

> 
> 
> >  {
> >  	struct intel_digital_port *dig_port =
> > dp_to_dig_port(intel_dp);
> >  	struct drm_device *dev = dig_port->base.base.dev;
> > @@ -516,7 +516,9 @@ void intel_psr_compute_config(struct intel_dp
> > *intel_dp,
> >  	}
> >  
> >  	crtc_state->has_psr = true;
> > -	crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp,
> > crtc_state);
> > +	if (INTEL_GEN(dev_priv) >= 9)
> > +		crtc_state->has_psr2 =
> > intel_psr2_config_valid(intel_dp,
> > +							       crtc_
> > state);
> >  	DRM_DEBUG_KMS("Enabling PSR%s\n", crtc_state->has_psr2 ? "2"
> > : "");
> >  }
> >  
> > @@ -534,7 +536,7 @@ static void intel_psr_activate(struct intel_dp
> > *intel_dp)
> >  
> >  	/* psr1 and psr2 are mutually exclusive.*/
> >  	if (dev_priv->psr.psr2_enabled)
> > -		hsw_activate_psr2(intel_dp);
> > +		skl_activate_psr2(intel_dp);
> >  	else
> >  		hsw_activate_psr1(intel_dp);
> >  
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 4bd5768..cbbdfd2 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -387,7 +387,7 @@  static void hsw_activate_psr1(struct intel_dp *intel_dp)
 	I915_WRITE(EDP_PSR_CTL, val);
 }
 
-static void hsw_activate_psr2(struct intel_dp *intel_dp)
+static void skl_activate_psr2(struct intel_dp *intel_dp)
 {
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = dig_port->base.base.dev;
@@ -516,7 +516,9 @@  void intel_psr_compute_config(struct intel_dp *intel_dp,
 	}
 
 	crtc_state->has_psr = true;
-	crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp, crtc_state);
+	if (INTEL_GEN(dev_priv) >= 9)
+		crtc_state->has_psr2 = intel_psr2_config_valid(intel_dp,
+							       crtc_state);
 	DRM_DEBUG_KMS("Enabling PSR%s\n", crtc_state->has_psr2 ? "2" : "");
 }
 
@@ -534,7 +536,7 @@  static void intel_psr_activate(struct intel_dp *intel_dp)
 
 	/* psr1 and psr2 are mutually exclusive.*/
 	if (dev_priv->psr.psr2_enabled)
-		hsw_activate_psr2(intel_dp);
+		skl_activate_psr2(intel_dp);
 	else
 		hsw_activate_psr1(intel_dp);