<div dir="ltr">Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com">rodrigo.vivi@intel.com</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 4:27 AM, Damien Lespiau <span dir="ltr"><<a href="mailto:damien.lespiau@intel.com" target="_blank">damien.lespiau@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It can be handy to get the number of planes for this pipe, ie including<br>
the primary plane to loop over them. Introduce a little function to do<br>
so.<br>
<br>
Signed-off-by: Damien Lespiau <<a href="mailto:damien.lespiau@intel.com">damien.lespiau@intel.com</a>><br>
---<br>
 drivers/gpu/drm/i915/intel_drv.h | 8 ++++++++<br>
 1 file changed, 8 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h<br>
index d727d20..3239e58 100644<br>
--- a/drivers/gpu/drm/i915/intel_drv.h<br>
+++ b/drivers/gpu/drm/i915/intel_drv.h<br>
@@ -721,6 +721,14 @@ hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)<br>
        return container_of(intel_hdmi, struct intel_digital_port, hdmi);<br>
 }<br>
<br>
+/*<br>
+ * Returns the number of planes for this pipe, ie the number of sprites + 1<br>
+ * (primary plane). This doesn't count the cursor plane then.<br>
+ */<br>
+static inline unsigned int intel_num_planes(struct intel_crtc *crtc)<br>
+{<br>
+       return INTEL_INFO(crtc->base.dev)->num_sprites[crtc->pipe] + 1;<br>
+}<br>
<br>
 /* i915_irq.c */<br>
 bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Rodrigo Vivi</div><div>Blog: <a href="http://blog.vivi.eng.br" target="_blank">http://blog.vivi.eng.br</a></div><div> </div>
</div>