[4/7] drm/i915: Avoid confusion between DP and TRANS_DP_CTL in DP .get_config()
diff mbox

Message ID 1436184606-18729-5-git-send-email-ville.syrjala@linux.intel.com
State New
Headers show

Commit Message

Ville Syrjala July 6, 2015, 12:10 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use a separate variable for the TRANS_DP_CTL value instead of reusing
'tmp' that otherwise contains the DP port register value.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Sivakumar Thulasimani July 7, 2015, 8:14 a.m. UTC | #1
Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>



On 7/6/2015 5:40 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Use a separate variable for the TRANS_DP_CTL value instead of reusing
> 'tmp' that otherwise contains the DP port register value.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/intel_dp.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3dd4342..b6ba02e 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2245,13 +2245,14 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
>   	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
>   
>   	if (HAS_PCH_CPT(dev) && port != PORT_A) {
> -		tmp = I915_READ(TRANS_DP_CTL(crtc->pipe));
> -		if (tmp & TRANS_DP_HSYNC_ACTIVE_HIGH)
> +		u32 trans_dp = I915_READ(TRANS_DP_CTL(crtc->pipe));
> +
> +		if (trans_dp & TRANS_DP_HSYNC_ACTIVE_HIGH)
>   			flags |= DRM_MODE_FLAG_PHSYNC;
>   		else
>   			flags |= DRM_MODE_FLAG_NHSYNC;
>   
> -		if (tmp & TRANS_DP_VSYNC_ACTIVE_HIGH)
> +		if (trans_dp & TRANS_DP_VSYNC_ACTIVE_HIGH)
>   			flags |= DRM_MODE_FLAG_PVSYNC;
>   		else
>   			flags |= DRM_MODE_FLAG_NVSYNC;

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3dd4342..b6ba02e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2245,13 +2245,14 @@  static void intel_dp_get_config(struct intel_encoder *encoder,
 	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
 
 	if (HAS_PCH_CPT(dev) && port != PORT_A) {
-		tmp = I915_READ(TRANS_DP_CTL(crtc->pipe));
-		if (tmp & TRANS_DP_HSYNC_ACTIVE_HIGH)
+		u32 trans_dp = I915_READ(TRANS_DP_CTL(crtc->pipe));
+
+		if (trans_dp & TRANS_DP_HSYNC_ACTIVE_HIGH)
 			flags |= DRM_MODE_FLAG_PHSYNC;
 		else
 			flags |= DRM_MODE_FLAG_NHSYNC;
 
-		if (tmp & TRANS_DP_VSYNC_ACTIVE_HIGH)
+		if (trans_dp & TRANS_DP_VSYNC_ACTIVE_HIGH)
 			flags |= DRM_MODE_FLAG_PVSYNC;
 		else
 			flags |= DRM_MODE_FLAG_NVSYNC;