From 0a3e4581f0ce66169df0fb32daccb6daa03f39aa Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Tue, 25 Jul 2017 18:10:42 +0800 Subject: [PATCH] drm/rockchip: vop: fix background color Change-Id: Idbd43b4456df80e2243ce09c3bc69d8be6e0af6a Signed-off-by: Mark Yao --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; -- 2.34.1