[Intel-gfx] [PATCH 1/3] drm: Drop crtc argument from __drm_atomic_helper_crtc_destroy_state

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon May 9 11:47:58 UTC 2016


Hi Daniel,

Thank you for the patch.

On Friday 06 May 2016 10:32:28 Daniel Vetter wrote:
> It's unused, and really this helper should only look at the state
> structure and nothing else.
> 
> v2: Rebase on top of rockchip changes
> 
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Thierry Reding <thierry.reding at gmail.com>
> Cc: Eric Anholt <eric at anholt.net>
> Cc: Mark Yao <mark.yao at rock-chips.com>
> Acked-by: Thierry Reding <thierry.reding at gmail.com>
> Acked-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
>  drivers/gpu/drm/drm_atomic_helper.c            | 8 +++-----
>  drivers/gpu/drm/drm_crtc.c                     | 4 ++--
>  drivers/gpu/drm/i915/intel_display.c           | 4 ++--
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c    | 2 +-
>  drivers/gpu/drm/tegra/dc.c                     | 4 ++--
>  drivers/gpu/drm/vc4/vc4_crtc.c                 | 2 +-
>  include/drm/drm_atomic_helper.h                | 3 +--
>  8 files changed, 13 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index
> 8df0aaf98725..cf23a755f777 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -430,7 +430,7 @@ static void atmel_hlcdc_crtc_destroy_state(struct
> drm_crtc *crtc, struct atmel_hlcdc_crtc_state *state;
> 
>  	state = drm_crtc_state_to_atmel_hlcdc_crtc_state(s);
> -	__drm_atomic_helper_crtc_destroy_state(crtc, s);
> +	__drm_atomic_helper_crtc_destroy_state(s);
>  	kfree(state);
>  }
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c index 997fd21e5388..137bb51269c2
> 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2511,7 +2511,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_dpms);
>  void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc)
>  {
>  	if (crtc->state)
> -		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
> +		__drm_atomic_helper_crtc_destroy_state(crtc->state);
> 
>  	kfree(crtc->state);
>  	crtc->state = kzalloc(sizeof(*crtc->state), GFP_KERNEL);
> @@ -2576,15 +2576,13 @@
> EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
> 
>  /**
>   * __drm_atomic_helper_crtc_destroy_state - release CRTC state
> - * @crtc: CRTC object
>   * @state: CRTC state object to release
>   *
>   * Releases all resources stored in the CRTC state without actually freeing
> * the memory of the CRTC state. This is useful for drivers that subclass
> the * CRTC state.
>   */
> -void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
> -					    struct drm_crtc_state *state)
> +void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state)
>  {
>  	drm_property_unreference_blob(state->mode_blob);
>  	drm_property_unreference_blob(state->degamma_lut);
> @@ -2604,7 +2602,7 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state);
> void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
>  					  struct drm_crtc_state *state)
>  {
> -	__drm_atomic_helper_crtc_destroy_state(crtc, state);
> +	__drm_atomic_helper_crtc_destroy_state(state);
>  	kfree(state);
>  }
>  EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 1e7692a10c83..cde9b5af7553 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -897,7 +897,7 @@ int drm_connector_init(struct drm_device *dev,
>  	struct ida *connector_ida =
>  		&drm_connector_enum_list[connector_type].ida;
> 
> -	drm_modeset_lock_all(dev);
> +	mutex_lock(&config->mutex);

Is this related to $SUBJECT ?

Apart from that,

Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> 
>  	ret = drm_mode_object_get_reg(dev, &connector->base,
>  				      DRM_MODE_OBJECT_CONNECTOR,
> @@ -967,7 +967,7 @@ out_put:
>  		drm_mode_object_unregister(dev, &connector->base);
> 
>  out_unlock:
> -	drm_modeset_unlock_all(dev);
> +	mutex_unlock(&config->mutex);
> 
>  	return ret;
>  }
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c index 45c218db86be..699f8d979986
> 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12910,7 +12910,7 @@ verify_crtc_state(struct drm_crtc *crtc,
>  	bool active;
> 
>  	old_state = old_crtc_state->state;
> -	__drm_atomic_helper_crtc_destroy_state(crtc, old_crtc_state);
> +	__drm_atomic_helper_crtc_destroy_state(old_crtc_state);
>  	pipe_config = to_intel_crtc_state(old_crtc_state);
>  	memset(pipe_config, 0, sizeof(*pipe_config));
>  	pipe_config->base.crtc = crtc;
> @@ -15746,7 +15746,7 @@ static void intel_modeset_readout_hw_state(struct
> drm_device *dev) struct intel_crtc_state *crtc_state = crtc->config;
>  		int pixclk = 0;
> 
> -		__drm_atomic_helper_crtc_destroy_state(&crtc->base, &crtc_state->base);
> +		__drm_atomic_helper_crtc_destroy_state(&crtc_state->base);
>  		memset(crtc_state, 0, sizeof(*crtc_state));
>  		crtc_state->base.crtc = &crtc->base;
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index
> bf55cda356ba..80d0f95820c4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1065,7 +1065,7 @@ static void vop_crtc_destroy_state(struct drm_crtc
> *crtc, {
>  	struct rockchip_crtc_state *s = to_rockchip_crtc_state(state);
> 
> -	__drm_atomic_helper_crtc_destroy_state(crtc, &s->base);
> +	__drm_atomic_helper_crtc_destroy_state(&s->base);
>  	kfree(s);
>  }
> 
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 3b85a31b625d..39902bbfb3ce 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -998,7 +998,7 @@ static void tegra_crtc_reset(struct drm_crtc *crtc)
>  	struct tegra_dc_state *state;
> 
>  	if (crtc->state)
> -		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
> +		__drm_atomic_helper_crtc_destroy_state(crtc->state);
> 
>  	kfree(crtc->state);
>  	crtc->state = NULL;
> @@ -1034,7 +1034,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc
> *crtc) static void tegra_crtc_atomic_destroy_state(struct drm_crtc *crtc,
> struct drm_crtc_state *state)
>  {
> -	__drm_atomic_helper_crtc_destroy_state(crtc, state);
> +	__drm_atomic_helper_crtc_destroy_state(state);
>  	kfree(state);
>  }
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
> index 231356f42a04..904d0754ad78 100644
> --- a/drivers/gpu/drm/vc4/vc4_crtc.c
> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
> @@ -650,7 +650,7 @@ static void vc4_crtc_destroy_state(struct drm_crtc
> *crtc,
> 
>  	}
> 
> -	__drm_atomic_helper_crtc_destroy_state(crtc, state);
> +	__drm_atomic_helper_crtc_destroy_state(state);
>  }
> 
>  static const struct drm_crtc_funcs vc4_crtc_funcs = {
> diff --git a/include/drm/drm_atomic_helper.h
> b/include/drm/drm_atomic_helper.h index 03642878bc51..5abbe1259a2a 100644
> --- a/include/drm/drm_atomic_helper.h
> +++ b/include/drm/drm_atomic_helper.h
> @@ -117,8 +117,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct
> drm_crtc *crtc, struct drm_crtc_state *state);
>  struct drm_crtc_state *
>  drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
> -void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
> -					    struct drm_crtc_state *state);
> +void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
>  void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
>  					  struct drm_crtc_state *state);

-- 
Regards,

Laurent Pinchart



More information about the Intel-gfx mailing list