diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-04-02 00:22:30 +0200 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-04-02 01:13:07 +0200 |
commit | e27dde3e1c5117149c50b89d688528e279756113 (patch) | |
tree | f8af6af4b70125256c657317b6192a7183ec8157 /include/drm | |
parent | Merge tag 'vmwgfx-next-2014-03-28' of git://people.freedesktop.org/~thomash/l... (diff) | |
download | linux-e27dde3e1c5117149c50b89d688528e279756113.tar.xz linux-e27dde3e1c5117149c50b89d688528e279756113.zip |
drm: Add support for multiple plane types (v2)
The DRM core currently only tracks "overlay"-style planes. Start
refactoring the plane handling to allow other plane types (primary and
cursor) to also be placed on the DRM plane list.
v2: Add drm_for_each_legacy_plane() iterator to smooth transition
of drivers with plane loops.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 27f828c9d7f2..3894f85dcdff 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -541,6 +541,12 @@ struct drm_plane_funcs { struct drm_property *property, uint64_t val); }; +enum drm_plane_type { + DRM_PLANE_TYPE_OVERLAY, + DRM_PLANE_TYPE_PRIMARY, + DRM_PLANE_TYPE_CURSOR, +}; + /** * drm_plane - central DRM plane control structure * @dev: DRM device this plane belongs to @@ -553,6 +559,7 @@ struct drm_plane_funcs { * @fb: currently bound fb * @funcs: helper functions * @properties: property tracking for this plane + * @type: type of plane (overlay, primary, cursor) */ struct drm_plane { struct drm_device *dev; @@ -570,6 +577,8 @@ struct drm_plane { const struct drm_plane_funcs *funcs; struct drm_object_properties properties; + + enum drm_plane_type type; }; /** @@ -732,7 +741,15 @@ struct drm_mode_config { struct list_head bridge_list; int num_encoder; struct list_head encoder_list; - int num_plane; + + /* + * Track # of overlay planes separately from # of total planes. By + * default we only advertise overlay planes to userspace; if userspace + * sets the "universal plane" capability bit, we'll go ahead and + * expose all planes. + */ + int num_overlay_plane; + int num_total_plane; struct list_head plane_list; int num_crtc; @@ -1036,4 +1053,9 @@ static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev, return mo ? obj_to_encoder(mo) : NULL; } +/* Plane list iterator for legacy (overlay only) planes. */ +#define drm_for_each_legacy_plane(plane, planelist) \ + list_for_each_entry(plane, planelist, head) \ + if (plane->type == DRM_PLANE_TYPE_OVERLAY) + #endif /* __DRM_CRTC_H__ */ |