[2/7] drm/i915: Try to stop sink crc calculation on error.
diff mbox

Message ID 1437694550-5667-1-git-send-email-rodrigo.vivi@intel.com
State New
Headers show

Commit Message

Rodrigo Vivi July 23, 2015, 11:35 p.m. UTC
Right now if we face any kind of error sink crc calculation
stays enabled.

So, let's give a shot and try to stop it anyway if it got enabled.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Rafael Antognolli July 24, 2015, 6:19 p.m. UTC | #1
On Thu, Jul 23, 2015 at 04:35:45PM -0700, Rodrigo Vivi wrote:
> Right now if we face any kind of error sink crc calculation
> stays enabled.
> 
> So, let's give a shot and try to stop it anyway if it got enabled.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index f1b9f93..70a4a37 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3994,7 +3994,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
>  
>  	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0) {
>  		ret = -EIO;
> -		goto out;
> +		goto stop;
>  	}
>  
>  	test_crc_count = buf & DP_TEST_COUNT_MASK;
> @@ -4003,7 +4003,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
>  		if (drm_dp_dpcd_readb(&intel_dp->aux,
>  				      DP_TEST_SINK_MISC, &buf) < 0) {
>  			ret = -EIO;
> -			goto out;
> +			goto stop;
>  		}
>  		intel_wait_for_vblank(dev, intel_crtc->pipe);
>  	} while (--attempts && (buf & DP_TEST_COUNT_MASK) == test_crc_count);
> @@ -4011,14 +4011,15 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
>  	if (attempts == 0) {
>  		DRM_DEBUG_KMS("Panel is unable to calculate CRC after 6 vblanks\n");
>  		ret = -ETIMEDOUT;
> -		goto out;
> +		goto stop;
>  	}
>  
>  	if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) {
>  		ret = -EIO;
> -		goto out;
> +		goto stop;
>  	}
>  
> +stop:
>  	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {
>  		ret = -EIO;
>  		goto out;

Nice cleanup on exit.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>


--
Rafael

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f1b9f93..70a4a37 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3994,7 +3994,7 @@  int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
 
 	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0) {
 		ret = -EIO;
-		goto out;
+		goto stop;
 	}
 
 	test_crc_count = buf & DP_TEST_COUNT_MASK;
@@ -4003,7 +4003,7 @@  int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
 		if (drm_dp_dpcd_readb(&intel_dp->aux,
 				      DP_TEST_SINK_MISC, &buf) < 0) {
 			ret = -EIO;
-			goto out;
+			goto stop;
 		}
 		intel_wait_for_vblank(dev, intel_crtc->pipe);
 	} while (--attempts && (buf & DP_TEST_COUNT_MASK) == test_crc_count);
@@ -4011,14 +4011,15 @@  int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
 	if (attempts == 0) {
 		DRM_DEBUG_KMS("Panel is unable to calculate CRC after 6 vblanks\n");
 		ret = -ETIMEDOUT;
-		goto out;
+		goto stop;
 	}
 
 	if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) {
 		ret = -EIO;
-		goto out;
+		goto stop;
 	}
 
+stop:
 	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {
 		ret = -EIO;
 		goto out;