summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_encoder.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-08-31 18:09:04 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-09-19 15:03:46 +0200
commitafb21ea63d815d05f6081ee3efef6772a16317eb (patch)
treed0dbbad659da899e64778ae531efc11857fd6237 /include/drm/drm_encoder.h
parentdrm: cleanup drm_core_{init,exit}() (diff)
downloadlinux-afb21ea63d815d05f6081ee3efef6772a16317eb.tar.xz
linux-afb21ea63d815d05f6081ee3efef6772a16317eb.zip
drm: Move a few macros away from drm_crtc.h
Now that there's less stuff in there I noticed that I overlooked them. Sprinkle some docs over them while at it. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160831160913.12991-2-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm/drm_encoder.h')
-rw-r--r--include/drm/drm_encoder.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h
index fce0203094f7..387e33a4d6ee 100644
--- a/include/drm/drm_encoder.h
+++ b/include/drm/drm_encoder.h
@@ -224,4 +224,26 @@ static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
void drm_encoder_cleanup(struct drm_encoder *encoder);
+/**
+ * drm_for_each_encoder_mask - iterate over encoders specified by bitmask
+ * @encoder: the loop cursor
+ * @dev: the DRM device
+ * @encoder_mask: bitmask of encoder indices
+ *
+ * Iterate over all encoders specified by bitmask.
+ */
+#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \
+ list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \
+ for_each_if ((encoder_mask) & (1 << drm_encoder_index(encoder)))
+
+/**
+ * drm_for_each_encoder - iterate over all encoders
+ * @encoder: the loop cursor
+ * @dev: the DRM device
+ *
+ * Iterate over all encoders of @dev.
+ */
+#define drm_for_each_encoder(encoder, dev) \
+ list_for_each_entry(encoder, &(dev)->mode_config.encoder_list, head)
+
#endif