Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / include / drm / drm_crtc.h
index 3f0c6909dda17f9ec14959353a440da171a87ca6..9c37e6bd301c8ddcf92066fabb06ca4eca43dda3 100644 (file)
@@ -827,6 +827,7 @@ enum drm_plane_type {
 /**
  * struct drm_plane - central DRM plane control structure
  * @dev: DRM device this plane belongs to
+ * @parent: this plane share some resources with parent plane.
  * @head: for list management
  * @base: base mode object
  * @possible_crtcs: pipes this plane can be bound to
@@ -844,6 +845,7 @@ enum drm_plane_type {
  */
 struct drm_plane {
        struct drm_device *dev;
+       struct drm_plane *parent;
        struct list_head head;
 
        struct drm_modeset_lock mutex;
@@ -1074,6 +1076,8 @@ struct drm_mode_config {
         */
        int num_overlay_plane;
        int num_total_plane;
+       int num_share_plane;
+       int num_share_overlay_plane;
        struct list_head plane_list;
 
        int num_crtc;
@@ -1094,6 +1098,10 @@ struct drm_mode_config {
 
        struct mutex blob_lock;
 
+       /* pointers to share properties */
+       struct drm_property *prop_share_id;
+       struct drm_property *prop_share_flags;
+
        /* pointers to standard properties */
        struct list_head property_blob_list;
        struct drm_property *edid_property;
@@ -1183,11 +1191,13 @@ struct drm_prop_enum_list {
        char *name;
 };
 
-extern int drm_crtc_init_with_planes(struct drm_device *dev,
-                                    struct drm_crtc *crtc,
-                                    struct drm_plane *primary,
-                                    struct drm_plane *cursor,
-                                    const struct drm_crtc_funcs *funcs);
+extern __printf(6, 7)
+int drm_crtc_init_with_planes(struct drm_device *dev,
+                             struct drm_crtc *crtc,
+                             struct drm_plane *primary,
+                             struct drm_plane *cursor,
+                             const struct drm_crtc_funcs *funcs,
+                             const char *name, ...);
 extern void drm_crtc_cleanup(struct drm_crtc *crtc);
 extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
 
@@ -1233,10 +1243,11 @@ void drm_bridge_mode_set(struct drm_bridge *bridge,
 void drm_bridge_pre_enable(struct drm_bridge *bridge);
 void drm_bridge_enable(struct drm_bridge *bridge);
 
-extern int drm_encoder_init(struct drm_device *dev,
-                           struct drm_encoder *encoder,
-                           const struct drm_encoder_funcs *funcs,
-                           int encoder_type);
+extern __printf(5, 6)
+int drm_encoder_init(struct drm_device *dev,
+                    struct drm_encoder *encoder,
+                    const struct drm_encoder_funcs *funcs,
+                    int encoder_type, const char *name, ...);
 
 /**
  * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
@@ -1251,19 +1262,28 @@ static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
        return !!(encoder->possible_crtcs & drm_crtc_mask(crtc));
 }
 
-extern int drm_universal_plane_init(struct drm_device *dev,
-                                   struct drm_plane *plane,
-                                   unsigned long possible_crtcs,
-                                   const struct drm_plane_funcs *funcs,
-                                   const uint32_t *formats,
-                                   unsigned int format_count,
-                                   enum drm_plane_type type);
+extern __printf(8, 9)
+int drm_universal_plane_init(struct drm_device *dev,
+                            struct drm_plane *plane,
+                            unsigned long possible_crtcs,
+                            const struct drm_plane_funcs *funcs,
+                            const uint32_t *formats,
+                            unsigned int format_count,
+                            enum drm_plane_type type,
+                            const char *name, ...);
 extern int drm_plane_init(struct drm_device *dev,
                          struct drm_plane *plane,
                          unsigned long possible_crtcs,
                          const struct drm_plane_funcs *funcs,
                          const uint32_t *formats, unsigned int format_count,
                          bool is_primary);
+extern int drm_share_plane_init(struct drm_device *dev, struct drm_plane *plane,
+                               struct drm_plane *parent,
+                               unsigned long possible_crtcs,
+                               const struct drm_plane_funcs *funcs,
+                               const uint32_t *formats,
+                               unsigned int format_count,
+                               enum drm_plane_type type);
 extern void drm_plane_cleanup(struct drm_plane *plane);
 extern unsigned int drm_plane_index(struct drm_plane *plane);
 extern struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);