[Intel-gfx] [PATCH 1/5] drm/i915: Use new atomic iterator macros in ddi

Daniel Vetter daniel at ffwll.ch
Mon Mar 13 08:40:42 UTC 2017


On Thu, Mar 09, 2017 at 03:52:01PM +0100, Maarten Lankhorst wrote:
> Use for_each_new_connector_in_state instead of for_each_connector_in_state.
> Also make the function static, it's only used inside intel_ddi.c
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>

On the topic of static, intel_ddi.h exports _waayaaay_ too much stuff to
intel_display.c. With a slight bit of refactoring we should be able to
condense this down to a few hooks, maybe even just the hooks we use for
encoders (since ddi is an encoder, as signified by the various !dsi checks
we now have).

Anyway, different rant, this looks reasonable.

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 4 ++--
>  drivers/gpu/drm/i915/intel_drv.h | 2 --
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 04676760e6fd..4da81d4ae166 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -837,7 +837,7 @@ intel_ddi_get_crtc_encoder(struct intel_crtc *crtc)
>  	return ret;
>  }
>  
> -struct intel_encoder *
> +static struct intel_encoder *
>  intel_ddi_get_crtc_new_encoder(struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
> @@ -850,7 +850,7 @@ intel_ddi_get_crtc_new_encoder(struct intel_crtc_state *crtc_state)
>  
>  	state = crtc_state->base.state;
>  
> -	for_each_connector_in_state(state, connector, connector_state, i) {
> +	for_each_new_connector_in_state(state, connector, connector_state, i) {
>  		if (connector_state->crtc != crtc_state->base.crtc)
>  			continue;
>  
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 578f7d20501f..937623ff6d7c 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1239,8 +1239,6 @@ bool intel_ddi_is_audio_enabled(struct drm_i915_private *dev_priv,
>  				 struct intel_crtc *intel_crtc);
>  void intel_ddi_get_config(struct intel_encoder *encoder,
>  			  struct intel_crtc_state *pipe_config);
> -struct intel_encoder *
> -intel_ddi_get_crtc_new_encoder(struct intel_crtc_state *crtc_state);
>  
>  void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder);
>  void intel_ddi_clock_get(struct intel_encoder *encoder,
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list