[Intel-gfx] [PATCH 16/31] drm/i915: split up intel_modeset_check_state

Damien Lespiau damien.lespiau at intel.com
Wed Jun 12 15:33:51 CEST 2013


On Wed, Jun 05, 2013 at 01:34:18PM +0200, Daniel Vetter wrote:
> Simply grew too large and neede to be split up into parts.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Reviewed-by: Damien Lespiau <damien.lespiau at intel.com>

-- 
Damien

> ---
>  drivers/gpu/drm/i915/intel_display.c | 44 +++++++++++++++++++++++++++++-------
>  1 file changed, 36 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 95ed27b..c42b87b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8062,16 +8062,10 @@ intel_pipe_config_compare(struct drm_device *dev,
>  	return true;
>  }
>  
> -void
> -intel_modeset_check_state(struct drm_device *dev)
> +static void
> +check_connector_state(struct drm_device *dev)
>  {
> -	drm_i915_private_t *dev_priv = dev->dev_private;
> -	struct intel_crtc *crtc;
> -	struct intel_encoder *encoder;
>  	struct intel_connector *connector;
> -	struct intel_crtc_config pipe_config;
> -	struct intel_dpll_hw_state dpll_hw_state;
> -	int i;
>  
>  	list_for_each_entry(connector, &dev->mode_config.connector_list,
>  			    base.head) {
> @@ -8082,6 +8076,13 @@ intel_modeset_check_state(struct drm_device *dev)
>  		WARN(&connector->new_encoder->base != connector->base.encoder,
>  		     "connector's staged encoder doesn't match current encoder\n");
>  	}
> +}
> +
> +static void
> +check_encoder_state(struct drm_device *dev)
> +{
> +	struct intel_encoder *encoder;
> +	struct intel_connector *connector;
>  
>  	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
>  			    base.head) {
> @@ -8133,6 +8134,15 @@ intel_modeset_check_state(struct drm_device *dev)
>  		     tracked_pipe, pipe);
>  
>  	}
> +}
> +
> +static void
> +check_crtc_state(struct drm_device *dev)
> +{
> +	drm_i915_private_t *dev_priv = dev->dev_private;
> +	struct intel_crtc *crtc;
> +	struct intel_encoder *encoder;
> +	struct intel_crtc_config pipe_config;
>  
>  	list_for_each_entry(crtc, &dev->mode_config.crtc_list,
>  			    base.head) {
> @@ -8184,6 +8194,15 @@ intel_modeset_check_state(struct drm_device *dev)
>  					       "[sw state]");
>  		}
>  	}
> +}
> +
> +static void
> +check_shared_dpll_state(struct drm_device *dev)
> +{
> +	drm_i915_private_t *dev_priv = dev->dev_private;
> +	struct intel_crtc *crtc;
> +	struct intel_dpll_hw_state dpll_hw_state;
> +	int i;
>  
>  	for (i = 0; i < dev_priv->num_shared_dpll; i++) {
>  		struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i];
> @@ -8221,6 +8240,15 @@ intel_modeset_check_state(struct drm_device *dev)
>  	}
>  }
>  
> +void
> +intel_modeset_check_state(struct drm_device *dev)
> +{
> +	check_connector_state(dev);
> +	check_encoder_state(dev);
> +	check_crtc_state(dev);
> +	check_shared_dpll_state(dev);
> +}
> +
>  static int __intel_set_mode(struct drm_crtc *crtc,
>  			    struct drm_display_mode *mode,
>  			    int x, int y, struct drm_framebuffer *fb)
> -- 
> 1.7.11.7
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



More information about the Intel-gfx mailing list