[Intel-gfx] [PATCH 1/2] drm/i915: Make for_each_plane() take dev_priv as argument

Chris Wilson chris at chris-wilson.co.uk
Sat Feb 28 13:04:44 PST 2015


On Sat, Feb 28, 2015 at 02:54:08PM +0000, Damien Lespiau wrote:
> Implicit usage of local variables in macros isn't exactly the greatest
> thing in the world, especially when that variable is the drm device and
> we want to move towards a broader use of the i915 device structure.
> 
> Let's make for_each_plane() take dev_priv as its first argument then.
> 
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>

Both patches are Reviewed-by: Chris Wilson <chris-wilson.co.uk>

Just a quick question...

> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index e07a1cb..c204e30 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -223,8 +223,10 @@ enum hpd_pin {
>  
>  #define for_each_pipe(__dev_priv, __p) \
>  	for ((__p) = 0; (__p) < INTEL_INFO(__dev_priv)->num_pipes; (__p)++)
> -#define for_each_plane(pipe, p) \
> -	for ((p) = 0; (p) < INTEL_INFO(dev)->num_sprites[(pipe)] + 1; (p)++)
> +#define for_each_plane(__dev_priv, __pipe, __p)				\
> +	for ((__p) = 0;							\
> +	     (__p) < INTEL_INFO(__dev_priv)->num_sprites[(__pipe)] + 1;	\
> +	     (__p)++)
>  #define for_each_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)

Is num_sprites explained anywhere? In particular the plane = num_sprites+1?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list