@@ -284,14 +284,14 @@ static void sun8i_mixer_commit(struct sunxi_engine *engine,
284284 h = drm_rect_height (& plane_state -> dst );
285285
286286 DRM_DEBUG_DRIVER (" plane %d: chan=%d ovl=%d en=%d zpos=%d x=%d y=%d w=%d h=%d\n" ,
287- plane -> base .id , layer -> channel , layer -> overlay ,
287+ plane -> base .id , layer -> index , layer -> overlay ,
288288 enable , zpos , x , y , w , h );
289289
290290 if (!enable )
291291 continue ;
292292
293293 /* Route layer to pipe based on zpos */
294- route |= layer -> channel << SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT (zpos );
294+ route |= layer -> index << SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT (zpos );
295295 pipe_en |= SUN8I_MIXER_BLEND_PIPE_CTL_EN (zpos );
296296
297297 regmap_write (bld_regs ,
@@ -318,6 +318,7 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
318318 struct sun8i_mixer * mixer = engine_to_sun8i_mixer (engine );
319319 int plane_cnt = mixer -> cfg -> ui_num + mixer -> cfg -> vi_num ;
320320 enum drm_plane_type type ;
321+ unsigned int phy_index ;
321322 int i ;
322323
323324 planes = devm_kcalloc (drm -> dev , plane_cnt , sizeof (* planes ), GFP_KERNEL );
@@ -332,9 +333,13 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
332333 else
333334 type = DRM_PLANE_TYPE_OVERLAY ;
334335
336+ phy_index = i ;
337+ if (mixer -> cfg -> de_type == SUN8I_MIXER_DE33 )
338+ phy_index = mixer -> cfg -> map [i ];
339+
335340 layer = sun8i_vi_layer_init_one (drm , mixer , type ,
336341 mixer -> engine .regs , i ,
337- plane_cnt );
342+ phy_index , plane_cnt );
338343 if (IS_ERR (layer )) {
339344 dev_err (drm -> dev ,
340345 "Couldn't initialize overlay plane\n" );
@@ -353,9 +358,13 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm,
353358 else
354359 type = DRM_PLANE_TYPE_OVERLAY ;
355360
361+ phy_index = index ;
362+ if (mixer -> cfg -> de_type == SUN8I_MIXER_DE33 )
363+ phy_index = mixer -> cfg -> map [index ];
364+
356365 layer = sun8i_ui_layer_init_one (drm , mixer , type ,
357366 mixer -> engine .regs , index ,
358- plane_cnt );
367+ phy_index , plane_cnt );
359368 if (IS_ERR (layer )) {
360369 dev_err (drm -> dev , "Couldn't initialize %s plane\n" ,
361370 i ? "overlay" : "primary" );
0 commit comments