diff mbox

drm/i915/psr: Fix register name mess up.

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

Commit Message

Dhinakaran Pandiyan Dec. 20, 2017, 4:35 a.m. UTC
Commit 77affa31722b ("drm/i915/psr: Fix compiler warnings for
hsw_psr_disable()") swapped status and control registers while fixing
indentation. The _ctl at the end of the status register name must have to
led to this.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Dhinakaran Pandiyan Dec. 20, 2017, 6:46 a.m. UTC | #1
On Tuesday, December 19, 2017 8:35:20 PM PST Dhinakaran Pandiyan wrote:
> Commit 77affa31722b ("drm/i915/psr: Fix compiler warnings for
> hsw_psr_disable()") swapped status and control registers while fixing
> indentation. The _ctl at the end of the status register name must have to
> led to this.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Fixes: 77affa31722b ("drm/i915/psr: Fix compiler warnings for hsw_psr_disable()")
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_psr.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c
> b/drivers/gpu/drm/i915/intel_psr.c index 095e0a5a8574..863650366425 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -580,7 +580,7 @@ static void hsw_psr_disable(struct intel_dp *intel_dp,
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> 
>  	if (dev_priv->psr.active) {
> -		i915_reg_t psr_ctl;
> +		i915_reg_t psr_status;
>  		u32 psr_status_mask;
> 
>  		if (dev_priv->psr.aux_frame_sync)
> @@ -589,24 +589,24 @@ static void hsw_psr_disable(struct intel_dp *intel_dp,
> 0);
> 
>  		if (dev_priv->psr.psr2_support) {
> -			psr_ctl = EDP_PSR2_CTL;
> +			psr_status = EDP_PSR2_STATUS_CTL;
>  			psr_status_mask = EDP_PSR2_STATUS_STATE_MASK;
> 
> -			I915_WRITE(psr_ctl,
> -				   I915_READ(psr_ctl) &
> +			I915_WRITE(EDP_PSR2_CTL,
> +				   I915_READ(EDP_PSR2_CTL) &
>  				   ~(EDP_PSR2_ENABLE | EDP_SU_TRACK_ENABLE));
> 
>  		} else {
> -			psr_ctl = EDP_PSR_STATUS_CTL;
> +			psr_status = EDP_PSR_STATUS_CTL;
>  			psr_status_mask = EDP_PSR_STATUS_STATE_MASK;
> 
> -			I915_WRITE(psr_ctl,
> -				   I915_READ(psr_ctl) & ~EDP_PSR_ENABLE);
> +			I915_WRITE(EDP_PSR_CTL,
> +				   I915_READ(EDP_PSR_CTL) & ~EDP_PSR_ENABLE);
>  		}
> 
>  		/* Wait till PSR is idle */
>  		if (intel_wait_for_register(dev_priv,
> -					    psr_ctl, psr_status_mask, 0,
> +					    psr_status, psr_status_mask, 0,
>  					    2000))
>  			DRM_ERROR("Timed out waiting for PSR Idle State\n");
Chris Wilson Dec. 20, 2017, 9:24 a.m. UTC | #2
Quoting Dhinakaran Pandiyan (2017-12-20 04:35:20)
> Commit 77affa31722b ("drm/i915/psr: Fix compiler warnings for
> hsw_psr_disable()") swapped status and control registers while fixing
> indentation. The _ctl at the end of the status register name must have to
> led to this.

My bad. https://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/

So what does STATUS_CTL control? That seems to be a bad name, does bspec
really call it that?

References: https://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Chris Wilson Dec. 20, 2017, 9:27 a.m. UTC | #3
Quoting Dhinakaran Pandiyan (2017-12-20 06:46:51)
> On Tuesday, December 19, 2017 8:35:20 PM PST Dhinakaran Pandiyan wrote:
> > Commit 77affa31722b ("drm/i915/psr: Fix compiler warnings for
> > hsw_psr_disable()") swapped status and control registers while fixing
> > indentation. The _ctl at the end of the status register name must have to
> > led to this.
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Fixes: 77affa31722b ("drm/i915/psr: Fix compiler warnings for hsw_psr_disable()")
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

Pushed, thanks for fixing up my mistake.
-Chris
Dhinakaran Pandiyan Dec. 20, 2017, 7:40 p.m. UTC | #4
On Wed, 2017-12-20 at 09:24 +0000, Chris Wilson wrote:
> Quoting Dhinakaran Pandiyan (2017-12-20 04:35:20)

> > Commit 77affa31722b ("drm/i915/psr: Fix compiler warnings for

> > hsw_psr_disable()") swapped status and control registers while fixing

> > indentation. The _ctl at the end of the status register name must have to

> > led to this.

> 

> My bad. https://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/


Yeah, took me several rounds of checking to ensure I changed it
correctly.

> So what does STATUS_CTL control? That seems to be a bad name, does bspec

> really call it that?


So I looked it up, it doesn't. I'll send a patch soon.
-DK

> 

> References: https://www.mrc-cbu.cam.ac.uk/people/matt.davis/cmabridge/

> > Cc: Chris Wilson <chris@chris-wilson.co.uk>

> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

> -Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 095e0a5a8574..863650366425 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -580,7 +580,7 @@  static void hsw_psr_disable(struct intel_dp *intel_dp,
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	if (dev_priv->psr.active) {
-		i915_reg_t psr_ctl;
+		i915_reg_t psr_status;
 		u32 psr_status_mask;
 
 		if (dev_priv->psr.aux_frame_sync)
@@ -589,24 +589,24 @@  static void hsw_psr_disable(struct intel_dp *intel_dp,
 					0);
 
 		if (dev_priv->psr.psr2_support) {
-			psr_ctl = EDP_PSR2_CTL;
+			psr_status = EDP_PSR2_STATUS_CTL;
 			psr_status_mask = EDP_PSR2_STATUS_STATE_MASK;
 
-			I915_WRITE(psr_ctl,
-				   I915_READ(psr_ctl) &
+			I915_WRITE(EDP_PSR2_CTL,
+				   I915_READ(EDP_PSR2_CTL) &
 				   ~(EDP_PSR2_ENABLE | EDP_SU_TRACK_ENABLE));
 
 		} else {
-			psr_ctl = EDP_PSR_STATUS_CTL;
+			psr_status = EDP_PSR_STATUS_CTL;
 			psr_status_mask = EDP_PSR_STATUS_STATE_MASK;
 
-			I915_WRITE(psr_ctl,
-				   I915_READ(psr_ctl) & ~EDP_PSR_ENABLE);
+			I915_WRITE(EDP_PSR_CTL,
+				   I915_READ(EDP_PSR_CTL) & ~EDP_PSR_ENABLE);
 		}
 
 		/* Wait till PSR is idle */
 		if (intel_wait_for_register(dev_priv,
-					    psr_ctl, psr_status_mask, 0,
+					    psr_status, psr_status_mask, 0,
 					    2000))
 			DRM_ERROR("Timed out waiting for PSR Idle State\n");