[Intel-gfx] [PATCH 2/5] drm/core: Add drm_for_each_encoder_mask, v2.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jan 7 01:59:19 PST 2016
This is similar to the other drm_for_each_*_mask functions.
Changes since v1:
- Use for_each_if
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
include/drm/drm_crtc.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fd2ace4a18de..c0226f945d62 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -2153,6 +2153,17 @@ struct drm_mode_config {
list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
for_each_if ((plane_mask) & (1 << drm_plane_index(plane)))
+/**
+ * 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)))
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
#define obj_to_connector(x) container_of(x, struct drm_connector, base)
--
2.1.0
More information about the Intel-gfx
mailing list