From: Mark Yao Date: Tue, 25 Jul 2017 10:10:42 +0000 (+0800) Subject: drm/rockchip: vop: fix background color X-Git-Tag: release-20171130_firefly~4^2~110 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0a3e4581f0ce66169df0fb32daccb6daa03f39aa;p=firefly-linux-kernel-4.4.55.git drm/rockchip: vop: fix background color Change-Id: Idbd43b4456df80e2243ce09c3bc69d8be6e0af6a 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 079e3651ae01..2c6c65e9036d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1771,9 +1771,18 @@ static void vop_crtc_enable(struct drm_crtc *crtc) s->output_mode == ROCKCHIP_OUT_MODE_YUV420 ? 1 : 0); VOP_CTRL_SET(vop, overlay_mode, is_yuv_output(s->bus_format)); VOP_CTRL_SET(vop, dsp_out_yuv, is_yuv_output(s->bus_format)); - VOP_CTRL_SET(vop, dsp_background, - is_yuv_output(s->bus_format) ? 0x20010200 : 0); + /* + * Background color is 10bit depth if vop version >= 3.5 + */ + if (!is_yuv_output(s->bus_format)) + val = 0; + else if (VOP_MAJOR(vop->data->version) == 3 && + VOP_MINOR(vop->data->version) >= 5) + val = 0x20010200; + else + val = 0x801080; + VOP_CTRL_SET(vop, dsp_background, val); VOP_CTRL_SET(vop, htotal_pw, (htotal << 16) | hsync_len); val = hact_st << 16; val |= hact_end;