diff mbox series

drm/i915/fdi: use -EAGAIN instead of local special return value

Message ID 20210930093229.28598-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/fdi: use -EAGAIN instead of local special return value | expand

Commit Message

Jani Nikula Sept. 30, 2021, 9:32 a.m. UTC
Using standard -EAGAIN should be perfectly fine instead of using a
special case value.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 11 +++++------
 drivers/gpu/drm/i915/display/intel_fdi.c     |  2 +-
 drivers/gpu/drm/i915/display/intel_fdi.h     |  1 -
 3 files changed, 6 insertions(+), 8 deletions(-)

Comments

Ville Syrjälä Sept. 30, 2021, 9:50 a.m. UTC | #1
On Thu, Sep 30, 2021 at 12:32:29PM +0300, Jani Nikula wrote:
> Using standard -EAGAIN should be perfectly fine instead of using a
> special case value.

Can't immediately spot any uses of -EAGAIN which would conflict here.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 11 +++++------
>  drivers/gpu/drm/i915/display/intel_fdi.c     |  2 +-
>  drivers/gpu/drm/i915/display/intel_fdi.h     |  1 -
>  3 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index a4453dd1bb51..db43334fb7d2 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7717,12 +7717,7 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
>  	ret = intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config);
>  	if (ret == -EDEADLK)
>  		return ret;
> -	if (ret < 0) {
> -		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
> -		return ret;
> -	}
> -
> -	if (ret == I915_DISPLAY_CONFIG_RETRY) {
> +	if (ret == -EAGAIN) {
>  		if (drm_WARN(&i915->drm, !retry,
>  			     "loop in pipe configuration computation\n"))
>  			return -EINVAL;
> @@ -7731,6 +7726,10 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
>  		retry = false;
>  		goto encoder_retry;
>  	}
> +	if (ret < 0) {
> +		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
> +		return ret;
> +	}
>  
>  	/* Dithering seems to not pass-through bits correctly when it should, so
>  	 * only enable it on 6bpc panels and when its not a compliance
> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
> index af01d1fa761e..6b780349371c 100644
> --- a/drivers/gpu/drm/i915/display/intel_fdi.c
> +++ b/drivers/gpu/drm/i915/display/intel_fdi.c
> @@ -176,7 +176,7 @@ int ilk_fdi_compute_config(struct intel_crtc *crtc,
>  	}
>  
>  	if (needs_recompute)
> -		return I915_DISPLAY_CONFIG_RETRY;
> +		return -EAGAIN;
>  
>  	return ret;
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.h b/drivers/gpu/drm/i915/display/intel_fdi.h
> index 61cb216a09f5..abd9f809d421 100644
> --- a/drivers/gpu/drm/i915/display/intel_fdi.h
> +++ b/drivers/gpu/drm/i915/display/intel_fdi.h
> @@ -11,7 +11,6 @@ struct intel_crtc;
>  struct intel_crtc_state;
>  struct intel_encoder;
>  
> -#define I915_DISPLAY_CONFIG_RETRY 1
>  int intel_fdi_link_freq(struct drm_i915_private *i915,
>  			const struct intel_crtc_state *pipe_config);
>  int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
> -- 
> 2.30.2
Jani Nikula Oct. 1, 2021, 8:55 a.m. UTC | #2
On Thu, 30 Sep 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Sep 30, 2021 at 12:32:29PM +0300, Jani Nikula wrote:
>> Using standard -EAGAIN should be perfectly fine instead of using a
>> special case value.
>
> Can't immediately spot any uses of -EAGAIN which would conflict here.
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks, pushed.

BR,
Jani.

>
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display.c | 11 +++++------
>>  drivers/gpu/drm/i915/display/intel_fdi.c     |  2 +-
>>  drivers/gpu/drm/i915/display/intel_fdi.h     |  1 -
>>  3 files changed, 6 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>> index a4453dd1bb51..db43334fb7d2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>> @@ -7717,12 +7717,7 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
>>  	ret = intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config);
>>  	if (ret == -EDEADLK)
>>  		return ret;
>> -	if (ret < 0) {
>> -		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
>> -		return ret;
>> -	}
>> -
>> -	if (ret == I915_DISPLAY_CONFIG_RETRY) {
>> +	if (ret == -EAGAIN) {
>>  		if (drm_WARN(&i915->drm, !retry,
>>  			     "loop in pipe configuration computation\n"))
>>  			return -EINVAL;
>> @@ -7731,6 +7726,10 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
>>  		retry = false;
>>  		goto encoder_retry;
>>  	}
>> +	if (ret < 0) {
>> +		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
>> +		return ret;
>> +	}
>>  
>>  	/* Dithering seems to not pass-through bits correctly when it should, so
>>  	 * only enable it on 6bpc panels and when its not a compliance
>> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
>> index af01d1fa761e..6b780349371c 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fdi.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fdi.c
>> @@ -176,7 +176,7 @@ int ilk_fdi_compute_config(struct intel_crtc *crtc,
>>  	}
>>  
>>  	if (needs_recompute)
>> -		return I915_DISPLAY_CONFIG_RETRY;
>> +		return -EAGAIN;
>>  
>>  	return ret;
>>  }
>> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.h b/drivers/gpu/drm/i915/display/intel_fdi.h
>> index 61cb216a09f5..abd9f809d421 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fdi.h
>> +++ b/drivers/gpu/drm/i915/display/intel_fdi.h
>> @@ -11,7 +11,6 @@ struct intel_crtc;
>>  struct intel_crtc_state;
>>  struct intel_encoder;
>>  
>> -#define I915_DISPLAY_CONFIG_RETRY 1
>>  int intel_fdi_link_freq(struct drm_i915_private *i915,
>>  			const struct intel_crtc_state *pipe_config);
>>  int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,
>> -- 
>> 2.30.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index a4453dd1bb51..db43334fb7d2 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -7717,12 +7717,7 @@  intel_modeset_pipe_config(struct intel_atomic_state *state,
 	ret = intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config);
 	if (ret == -EDEADLK)
 		return ret;
-	if (ret < 0) {
-		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
-		return ret;
-	}
-
-	if (ret == I915_DISPLAY_CONFIG_RETRY) {
+	if (ret == -EAGAIN) {
 		if (drm_WARN(&i915->drm, !retry,
 			     "loop in pipe configuration computation\n"))
 			return -EINVAL;
@@ -7731,6 +7726,10 @@  intel_modeset_pipe_config(struct intel_atomic_state *state,
 		retry = false;
 		goto encoder_retry;
 	}
+	if (ret < 0) {
+		drm_dbg_kms(&i915->drm, "CRTC fixup failed\n");
+		return ret;
+	}
 
 	/* Dithering seems to not pass-through bits correctly when it should, so
 	 * only enable it on 6bpc panels and when its not a compliance
diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
index af01d1fa761e..6b780349371c 100644
--- a/drivers/gpu/drm/i915/display/intel_fdi.c
+++ b/drivers/gpu/drm/i915/display/intel_fdi.c
@@ -176,7 +176,7 @@  int ilk_fdi_compute_config(struct intel_crtc *crtc,
 	}
 
 	if (needs_recompute)
-		return I915_DISPLAY_CONFIG_RETRY;
+		return -EAGAIN;
 
 	return ret;
 }
diff --git a/drivers/gpu/drm/i915/display/intel_fdi.h b/drivers/gpu/drm/i915/display/intel_fdi.h
index 61cb216a09f5..abd9f809d421 100644
--- a/drivers/gpu/drm/i915/display/intel_fdi.h
+++ b/drivers/gpu/drm/i915/display/intel_fdi.h
@@ -11,7 +11,6 @@  struct intel_crtc;
 struct intel_crtc_state;
 struct intel_encoder;
 
-#define I915_DISPLAY_CONFIG_RETRY 1
 int intel_fdi_link_freq(struct drm_i915_private *i915,
 			const struct intel_crtc_state *pipe_config);
 int ilk_fdi_compute_config(struct intel_crtc *intel_crtc,