return ERR_PTR(-ENOMEM);
 
        for (i = 0; i < mixer->cfg->vi_num; i++) {
-               struct sun8i_vi_layer *layer;
+               struct sun8i_layer *layer;
 
                layer = sun8i_vi_layer_init_one(drm, mixer, i);
                if (IS_ERR(layer)) {
        }
 
        for (i = 0; i < mixer->cfg->ui_num; i++) {
-               struct sun8i_ui_layer *layer;
+               struct sun8i_layer *layer;
 
                layer = sun8i_ui_layer_init_one(drm, mixer, i);
                if (IS_ERR(layer)) {
 
 #include <linux/clk.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
+#include <drm/drm_plane.h>
 
 #include "sunxi_engine.h"
 
        struct clk                      *mod_clk;
 };
 
+struct sun8i_layer {
+       struct drm_plane        plane;
+       struct sun8i_mixer      *mixer;
+       int                     channel;
+       int                     overlay;
+};
+
+static inline struct sun8i_layer *
+plane_to_sun8i_layer(struct drm_plane *plane)
+{
+       return container_of(plane, struct sun8i_layer, plane);
+}
+
 static inline struct sun8i_mixer *
 engine_to_sun8i_mixer(struct sunxi_engine *engine)
 {
 
 {
        struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
                                                                                 plane);
-       struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
        struct drm_crtc *crtc = new_plane_state->crtc;
        struct drm_crtc_state *crtc_state;
        int min_scale, max_scale;
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
 
                                                                           plane);
        struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
                                                                           plane);
-       struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
        DRM_FORMAT_MOD_INVALID
 };
 
-struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
-                                              struct sun8i_mixer *mixer,
-                                              int index)
+struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
+                                           struct sun8i_mixer *mixer,
+                                           int index)
 {
        enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
        int channel = mixer->cfg->vi_num + index;
-       struct sun8i_ui_layer *layer;
+       struct sun8i_layer *layer;
        unsigned int plane_cnt;
        int ret;
 
 
 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_COMBINED     ((2) << 1)
 
 struct sun8i_mixer;
+struct sun8i_layer;
 
-struct sun8i_ui_layer {
-       struct drm_plane        plane;
-       struct sun8i_mixer      *mixer;
-       int                     channel;
-       int                     overlay;
-};
-
-static inline struct sun8i_ui_layer *
-plane_to_sun8i_ui_layer(struct drm_plane *plane)
-{
-       return container_of(plane, struct sun8i_ui_layer, plane);
-}
-
-struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
-                                              struct sun8i_mixer *mixer,
-                                              int index);
+struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
+                                           struct sun8i_mixer *mixer,
+                                           int index);
 #endif /* _SUN8I_UI_LAYER_H_ */
 
 {
        struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
                                                                                 plane);
-       struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
        struct drm_crtc *crtc = new_plane_state->crtc;
        struct drm_crtc_state *crtc_state;
        int min_scale, max_scale;
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_vi_layer(plane);
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
 
                                                                           plane);
        struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
                                                                           plane);
-       struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
+       struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
        DRM_FORMAT_MOD_INVALID
 };
 
-struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
-                                              struct sun8i_mixer *mixer,
-                                              int index)
+struct sun8i_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
+                                           struct sun8i_mixer *mixer,
+                                           int index)
 {
        enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
        u32 supported_encodings, supported_ranges;
        unsigned int plane_cnt, format_count;
-       struct sun8i_vi_layer *layer;
+       struct sun8i_layer *layer;
        const u32 *formats;
        int ret;
 
 
 #define SUN8I_MIXER_CHAN_VI_DS_M(x)                    ((x) << 0)
 
 struct sun8i_mixer;
+struct sun8i_layer;
 
-struct sun8i_vi_layer {
-       struct drm_plane        plane;
-       struct sun8i_mixer      *mixer;
-       int                     channel;
-       int                     overlay;
-};
-
-static inline struct sun8i_vi_layer *
-plane_to_sun8i_vi_layer(struct drm_plane *plane)
-{
-       return container_of(plane, struct sun8i_vi_layer, plane);
-}
-
-struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
-                                              struct sun8i_mixer *mixer,
-                                              int index);
+struct sun8i_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
+                                           struct sun8i_mixer *mixer,
+                                           int index);
 #endif /* _SUN8I_VI_LAYER_H_ */