diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-01-07 12:59:19 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-02-09 13:21:04 +0300 |
commit | ead8b665705a0926442fbd3f4dbccbec36e5b8f4 (patch) | |
tree | b72d277792e0fcaf9890fa0e80a3d776e15a08d1 /include/drm | |
parent | 47d7777f99da283ff0d6248dd9e83593cf06760c (diff) | |
download | linux-ead8b665705a0926442fbd3f4dbccbec36e5b8f4.tar.xz |
drm/core: Add drm_for_each_encoder_mask, v2.
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@linux.intel.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1452160762-30487-3-git-send-email-maarten.lankhorst@linux.intel.com
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 11 |
1 files changed, 11 insertions, 0 deletions
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) |