diff options
author | Dave Airlie <airlied@redhat.com> | 2018-07-06 08:52:45 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-07-06 10:01:56 +1000 |
commit | a1c3b49523aeb89a7f5ffa852c29db9c4e5ac8dd (patch) | |
tree | 25119ff623073a26f79608c50cdd78a8e8b50078 /include/drm/drm_plane.h | |
parent | c5be9b54034339a7983a1167cdc80dc27fea1799 (diff) | |
parent | 968d72e6a5105a18fe17c0a8b4ef2951d0eb42dd (diff) | |
download | linux-a1c3b49523aeb89a7f5ffa852c29db9c4e5ac8dd.tar.bz2 |
Merge tag 'drm-misc-next-2018-07-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 4.19:
UAPI Changes:
v3d: add fourcc modicfier for fourcc for the Broadcom UIF format (Eric Anholt)
Cross-subsystem Changes:
console/fbcon: Add support for deferred console takeover (Hans de Goede)
Core Changes:
dma-fence clean up, improvements and docs (Daniel Vetter)
add mask function for crtc, plane, encoder and connector DRM objects(Ville Syrjälä)
Driver Changes:
pl111: add Nomadik LCDC variant (Linus Walleij)
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180704234641.GA3981@juma
Diffstat (limited to 'include/drm/drm_plane.h')
-rw-r--r-- | include/drm/drm_plane.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 7d4d6c7f0afd..cee9dfaaa740 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h @@ -639,10 +639,20 @@ void drm_plane_cleanup(struct drm_plane *plane); * Given a registered plane, return the index of that plane within a DRM * device's list of planes. */ -static inline unsigned int drm_plane_index(struct drm_plane *plane) +static inline unsigned int drm_plane_index(const struct drm_plane *plane) { return plane->index; } + +/** + * drm_plane_mask - find the mask of a registered plane + * @plane: plane to find mask for + */ +static inline u32 drm_plane_mask(const struct drm_plane *plane) +{ + return 1 << drm_plane_index(plane); +} + struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx); void drm_plane_force_disable(struct drm_plane *plane); @@ -678,7 +688,7 @@ static inline struct drm_plane *drm_plane_find(struct drm_device *dev, */ #define drm_for_each_plane_mask(plane, dev, plane_mask) \ list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ - for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) + for_each_if ((plane_mask) & drm_plane_mask(plane)) /** * drm_for_each_legacy_plane - iterate over all planes for legacy userspace |