summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-03-28 00:18:33 +0530
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-24 14:57:32 +0200
commit6af31a653d6c8e1708c27b7f32cafd5435b3bb90 (patch)
treee0887e8e104525cd74355ae6aac85519e4102122
parent84139d1e39265c20a79daace16ef4b6a9a644d9a (diff)
downloadlinux-stable-6af31a653d6c8e1708c27b7f32cafd5435b3bb90.tar.gz
linux-stable-6af31a653d6c8e1708c27b7f32cafd5435b3bb90.tar.bz2
linux-stable-6af31a653d6c8e1708c27b7f32cafd5435b3bb90.zip
drm/i915/skl: Introduce intel_num_planes()
It can be handy to get the number of planes for this pipe, ie including the primary plane to loop over them. Introduce a little function to do so. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 07ce04683c30..a09e4adda0bf 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -731,6 +731,14 @@ hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
return container_of(intel_hdmi, struct intel_digital_port, hdmi);
}
+/*
+ * Returns the number of planes for this pipe, ie the number of sprites + 1
+ * (primary plane). This doesn't count the cursor plane then.
+ */
+static inline unsigned int intel_num_planes(struct intel_crtc *crtc)
+{
+ return INTEL_INFO(crtc->base.dev)->num_sprites[crtc->pipe] + 1;
+}
/* i915_irq.c */
bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,