drm: Add support for multiple plane types (v2)
[deliverable/linux.git] / include / drm / drm_crtc.h
index 27f828c9d7f282b92328be2e0b5146750e0cfb3f..3894f85dcdffc1b87c2317e4fd9f3b580e48cd74 100644 (file)
@@ -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__ */
This page took 0.050627 seconds and 5 git commands to generate.