Re: [PATCH 15/35] drm/i915: Remove all *_pipes flags from modeset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 21, 2015 at 05:13:04PM +0300, Ander Conselvan de Oliveira wrote:
> @@ -11548,26 +11479,36 @@ intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes)
>  		if (!intel_encoder->base.crtc)
>  			continue;
>  
> -		intel_crtc = to_intel_crtc(intel_encoder->base.crtc);
> +		for_each_crtc_in_state(state, crtc, crtc_state, i)
> +			if (crtc == intel_encoder->base.crtc)
> +				break;
>  
> -		if (prepare_pipes & (1 << intel_crtc->pipe))
> +		if (crtc != intel_encoder->base.crtc)
> +			continue;
> +
> +		if (crtc_state->enable && needs_modeset(crtc_state))
>  			intel_encoder->connectors_active = false;

This makes the compiler gasp, and even if the compiler is wrong, the
code isn't perhaps the most clear - and this pattern gets repeated.

For example,

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 067b1dee1b90..3b049cdbb7e5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11859,15 +11859,15 @@ intel_modeset_update_state(struct drm_atomic_state *state)
                if (!intel_encoder->base.crtc)
                        continue;
 
-               for_each_crtc_in_state(state, crtc, crtc_state, i)
-                       if (crtc == intel_encoder->base.crtc)
-                               break;
+               for_each_crtc_in_state(state, crtc, crtc_state, i) {
+                       if (crtc != intel_encoder->base.crtc)
+                               continue;
 
-               if (crtc != intel_encoder->base.crtc)
-                       continue;
+                       if (crtc_state->enable && needs_modeset(crtc_state))
+                               intel_encoder->connectors_active = false;
 
-               if (crtc_state->enable && needs_modeset(crtc_state))
-                       intel_encoder->connectors_active = false;
+                       break;
+               }
        }
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux