[Intel-gfx] [PATCH 2/2] drm/i915: Switch intel_connector_needs_modeset() to drm types

Jani Nikula jani.nikula at linux.intel.com
Tue Nov 1 10:55:00 UTC 2022


On Mon, 31 Oct 2022, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> intel_connector_needs_modeset() currently uses a mix of drm_
> and intel_ types. But it doesn't actually need anything from
> the intel_ stuff, so seems better to switch the whole thing
> over to the drm_ types. Should help anyone who wants to steal
> it as well :)

I kind of get the point, but it goes against what we tell everyone to
do. :(

OTOH if this were drm_connector_needs_modeset() somewhere in drm, it
would be a whole different matter.


BR,
Jani.



>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_atomic.c  | 11 +++++------
>  drivers/gpu/drm/i915/display/intel_atomic.h  |  2 +-
>  drivers/gpu/drm/i915/display/intel_display.c |  4 ++--
>  drivers/gpu/drm/i915/display/intel_dp.c      |  2 +-
>  drivers/gpu/drm/i915/display/intel_dp_mst.c  |  2 +-
>  5 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
> index 6621aa245caf..f3fe2889bde3 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> @@ -175,18 +175,17 @@ intel_digital_connector_duplicate_state(struct drm_connector *connector)
>   * @connector: the connector
>   */
>  bool
> -intel_connector_needs_modeset(struct intel_atomic_state *state,
> +intel_connector_needs_modeset(struct drm_atomic_state *state,
>  			      struct drm_connector *connector)
>  {
>  	const struct drm_connector_state *old_conn_state, *new_conn_state;
>  
> -	old_conn_state = drm_atomic_get_old_connector_state(&state->base, connector);
> -	new_conn_state = drm_atomic_get_new_connector_state(&state->base, connector);
> +	old_conn_state = drm_atomic_get_old_connector_state(state, connector);
> +	new_conn_state = drm_atomic_get_new_connector_state(state, connector);
>  
>  	return old_conn_state->crtc != new_conn_state->crtc ||
> -	       (new_conn_state->crtc &&
> -		drm_atomic_crtc_needs_modeset(drm_atomic_get_new_crtc_state(&state->base,
> -									    new_conn_state->crtc)));
> +		(new_conn_state->crtc &&
> +		 drm_atomic_crtc_needs_modeset(drm_atomic_get_new_crtc_state(state, new_conn_state->crtc)));
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.h b/drivers/gpu/drm/i915/display/intel_atomic.h
> index 1dc439983dd9..8829b6f58aee 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.h
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.h
> @@ -33,7 +33,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
>  					 struct drm_atomic_state *state);
>  struct drm_connector_state *
>  intel_digital_connector_duplicate_state(struct drm_connector *connector);
> -bool intel_connector_needs_modeset(struct intel_atomic_state *state,
> +bool intel_connector_needs_modeset(struct drm_atomic_state *state,
>  				   struct drm_connector *connector);
>  bool intel_any_crtc_needs_modeset(struct intel_atomic_state *state);
>  struct intel_digital_connector_state *
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 2d91c59a827d..1a16625ce058 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1517,7 +1517,7 @@ static void intel_encoders_update_prepare(struct intel_atomic_state *state)
>  		struct intel_encoder *encoder;
>  		struct intel_crtc *crtc;
>  
> -		if (!intel_connector_needs_modeset(state, connector))
> +		if (!intel_connector_needs_modeset(&state->base, connector))
>  			continue;
>  
>  		intel_connector = to_intel_connector(connector);
> @@ -1546,7 +1546,7 @@ static void intel_encoders_update_complete(struct intel_atomic_state *state)
>  		struct intel_encoder *encoder;
>  		struct intel_crtc *crtc;
>  
> -		if (!intel_connector_needs_modeset(state, connector))
> +		if (!intel_connector_needs_modeset(&state->base, connector))
>  			continue;
>  
>  		intel_connector = to_intel_connector(connector);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 7400d6b4c587..7c740463e9b6 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5028,7 +5028,7 @@ static int intel_dp_connector_atomic_check(struct drm_connector *conn,
>  	if (DISPLAY_VER(dev_priv) < 9)
>  		return 0;
>  
> -	if (!intel_connector_needs_modeset(state, conn))
> +	if (!intel_connector_needs_modeset(&state->base, conn))
>  		return 0;
>  
>  	if (conn->has_tile) {
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index cd4e61026d98..1220776eafc3 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -269,7 +269,7 @@ intel_dp_mst_atomic_master_trans_check(struct intel_connector *connector,
>  	if (DISPLAY_VER(dev_priv) < 12)
>  		return  0;
>  
> -	if (!intel_connector_needs_modeset(state, &connector->base))
> +	if (!intel_connector_needs_modeset(&state->base, &connector->base))
>  		return 0;
>  
>  	drm_connector_list_iter_begin(&dev_priv->drm, &connector_list_iter);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list