From: Mark Yao Date: Tue, 21 Jun 2016 06:30:19 +0000 (+0800) Subject: drm/rockchip: set unused layer with top zpos X-Git-Tag: firefly_0821_release~2259 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7589135587c7875f2e353207bdc4eba8b5201a45;p=firefly-linux-kernel-4.4.55.git drm/rockchip: set unused layer with top zpos Hardware limited, we should keep all unused layer same with the same zpos, otherwise, would get display abnormal. Change-Id: I417a6a14731148a89f0372cc028e43a94b56e4d3 Signed-off-by: Mark Yao --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 181c582a71a4..15c907ab3821 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1096,6 +1096,7 @@ static int vop_crtc_atomic_check(struct drm_crtc *crtc, struct drm_device *dev = crtc->dev; struct rockchip_crtc_state *s = to_rockchip_crtc_state(state); struct vop *vop = to_vop(crtc); + const struct vop_data *vop_data = vop->data; struct drm_plane *plane; struct vop_zpos *pzpos; int dsp_layer_sel = 0; @@ -1134,6 +1135,15 @@ static int vop_crtc_atomic_check(struct drm_crtc *crtc, sort(pzpos, cnt, sizeof(pzpos[0]), vop_zpos_cmp, NULL); + WARN_ON(vop_data->win_size < cnt); + for (i = 0; i < (vop_data->win_size - cnt); i++) { + dsp_layer_sel <<= 2; + /* + * after sort, pzpos[0] is the top zpos layer. + */ + dsp_layer_sel |= pzpos[0].win_id; + } + for (i = 0; i < cnt; i++) { struct vop_zpos *zpos = &pzpos[i];