From: Mark Yao Date: Thu, 20 Jul 2017 10:57:40 +0000 (+0800) Subject: drm/rockchip: vop: don't force enable post scale X-Git-Tag: release-20171130_firefly~4^2~128 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f1f1ef3ba5e5d85515553c1b2407517473ea940;p=firefly-linux-kernel-4.4.55.git drm/rockchip: vop: don't force enable post scale Vop would always report post buf empty error if enable post scale config with non-scale factor Change-Id: Ibc3f27c674195e6467471069488f14471927f709 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 8be416d99a84..079e3651ae01 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -2053,7 +2053,12 @@ static void vop_post_config(struct drm_crtc *crtc) val = scl_cal_scale2(vdisplay, vsize) << 16; val |= scl_cal_scale2(hdisplay, hsize); VOP_CTRL_SET(vop, post_scl_factor, val); - VOP_CTRL_SET(vop, post_scl_ctrl, 0x3); + +#define POST_HORIZONTAL_SCALEDOWN_EN(x) ((x) << 0) +#define POST_VERTICAL_SCALEDOWN_EN(x) ((x) << 1) + VOP_CTRL_SET(vop, post_scl_ctrl, + POST_HORIZONTAL_SCALEDOWN_EN(hdisplay != hsize) || + POST_VERTICAL_SCALEDOWN_EN(vdisplay != vsize)); if (mode->flags & DRM_MODE_FLAG_INTERLACE) { u16 vact_st_f1 = vtotal + vact_st + 1; u16 vact_end_f1 = vact_st_f1 + vsize;