From 7589135587c7875f2e353207bdc4eba8b5201a45 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Tue, 21 Jun 2016 14:30:19 +0800 Subject: [PATCH] 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 --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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]; -- 2.34.1