[v2,03/13] drm/i915: Move check_digital_port_conflicts() earier
diff mbox series

Message ID 20191015193035.25982-4-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: Plane cdclk requirements and fp16 for gen4+
Related show

Commit Message

Ville Syrjälä Oct. 15, 2019, 7:30 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

check_digital_port_conflicts() is done needlessly late. Move it earlier.
This will be needed as later on we want to set any_ms=true a bit later
for non-modesets too and we can't call this guy without the
connection_mutex held.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Stanislav Lisovskiy Oct. 24, 2019, 10:28 a.m. UTC | #1
On Tue, 2019-10-15 at 22:30 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> check_digital_port_conflicts() is done needlessly late. Move it
> earlier.
> This will be needed as later on we want to set any_ms=true a bit
> later
> for non-modesets too and we can't call this guy without the
> connection_mutex held.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index a8444d9841c1..44bd4d15019b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -13456,11 +13456,6 @@ static int intel_modeset_checks(struct
> intel_atomic_state *state)
>  	struct intel_crtc *crtc;
>  	int ret, i;
>  
> -	if (!check_digital_port_conflicts(state)) {
> -		DRM_DEBUG_KMS("rejecting conflicting digital port
> configuration\n");
> -		return -EINVAL;
> -	}
> -
>  	/* keep the current setting */
>  	if (!state->cdclk.force_min_cdclk_changed)
>  		state->cdclk.force_min_cdclk = dev_priv-
> >cdclk.force_min_cdclk;
> @@ -13622,6 +13617,12 @@ static int intel_atomic_check(struct
> drm_device *dev,
>  			any_ms = true;
>  	}
>  
> +	if (any_ms && !check_digital_port_conflicts(state)) {
> +		DRM_DEBUG_KMS("rejecting conflicting digital port
> configuration\n");
> +		ret = EINVAL;
> +		goto fail;
> +	}
> +
>  	ret = drm_dp_mst_atomic_check(&state->base);
>  	if (ret)
>  		goto fail;

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index a8444d9841c1..44bd4d15019b 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -13456,11 +13456,6 @@  static int intel_modeset_checks(struct intel_atomic_state *state)
 	struct intel_crtc *crtc;
 	int ret, i;
 
-	if (!check_digital_port_conflicts(state)) {
-		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
-		return -EINVAL;
-	}
-
 	/* keep the current setting */
 	if (!state->cdclk.force_min_cdclk_changed)
 		state->cdclk.force_min_cdclk = dev_priv->cdclk.force_min_cdclk;
@@ -13622,6 +13617,12 @@  static int intel_atomic_check(struct drm_device *dev,
 			any_ms = true;
 	}
 
+	if (any_ms && !check_digital_port_conflicts(state)) {
+		DRM_DEBUG_KMS("rejecting conflicting digital port configuration\n");
+		ret = EINVAL;
+		goto fail;
+	}
+
 	ret = drm_dp_mst_atomic_check(&state->base);
 	if (ret)
 		goto fail;