drm/i915: Introduce a for_each_plane() macro
authorDamien Lespiau <damien.lespiau@intel.com>
Thu, 4 Sep 2014 11:27:43 +0000 (12:27 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 4 Sep 2014 14:15:52 +0000 (16:15 +0200)
Tired of copy/pasting things around.

v2: Rebase on top of the for_each_pipe() change adding dev_priv as first
    argument.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h

index 2f2afa5..0ea8558 100644 (file)
@@ -164,6 +164,8 @@ 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_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)
 
 #define for_each_crtc(dev, crtc) \