[Intel-gfx] [PATCH] drm/i915: Use for_each_pipe() when possible

Daniel Vetter daniel at ffwll.ch
Thu Jul 11 21:53:24 CEST 2013


On Thu, Jul 11, 2013 at 08:10:54PM +0100, Damien Lespiau wrote:
> Came accross two open coding of for_each_pipe(), might as well use the
> macro.
> 
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
Queued for -next, thanks for the patch.
-Daniel
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 218bc93..d426c0c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1111,7 +1111,7 @@ static void assert_planes_disabled(struct drm_i915_private *dev_priv,
>  	}
>  
>  	/* Need to check both planes against the pipe */
> -	for (i = 0; i < INTEL_INFO(dev)->num_pipes; i++) {
> +	for_each_pipe(i) {
>  		reg = DSPCNTR(i);
>  		val = I915_READ(reg);
>  		cur_pipe = (val & DISPPLANE_SEL_PIPE_MASK) >>
> @@ -9524,7 +9524,7 @@ void intel_modeset_init(struct drm_device *dev)
>  		      INTEL_INFO(dev)->num_pipes,
>  		      INTEL_INFO(dev)->num_pipes > 1 ? "s" : "");
>  
> -	for (i = 0; i < INTEL_INFO(dev)->num_pipes; i++) {
> +	for_each_pipe(i) {
>  		intel_crtc_init(dev, i);
>  		for (j = 0; j < dev_priv->num_plane; j++) {
>  			ret = intel_plane_init(dev, i, j);
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list