diff options
author | Mark Yao <mark.yao@rock-chips.com> | 2015-12-15 09:08:43 +0800 |
---|---|---|
committer | Mark Yao <mark.yao@rock-chips.com> | 2015-12-28 09:01:41 +0800 |
commit | 1194fffbb102b1683bcbfc893df20bbf8a038468 (patch) | |
tree | 1ba24b57ca5850bba6c697d9cf44f0f20c2d593a /drivers/gpu/drm/rockchip/rockchip_drm_vop.h | |
parent | a67719d182291bf62c6093545b9af27f0431cbeb (diff) | |
download | op-kernel-dev-1194fffbb102b1683bcbfc893df20bbf8a038468.zip op-kernel-dev-1194fffbb102b1683bcbfc893df20bbf8a038468.tar.gz |
drm/rockchip: vop: spilt scale regsters
There are two version scale control register found on vop,
scale full version found on rk3288, support extension registers.
and scale little version found on rk3036, only support common scale.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Diffstat (limited to 'drivers/gpu/drm/rockchip/rockchip_drm_vop.h')
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h index cbb114a..071ff0b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h @@ -66,7 +66,8 @@ struct vop_intr { struct vop_reg clear; struct vop_reg status; }; -struct vop_scl_regs { + +struct vop_scl_extension { struct vop_reg cbcr_vsd_mode; struct vop_reg cbcr_vsu_mode; struct vop_reg cbcr_hsd_mode; @@ -87,8 +88,12 @@ struct vop_scl_regs { struct vop_reg bic_coe_sel; struct vop_reg cbcr_axi_gather_en; struct vop_reg yrgb_axi_gather_en; - struct vop_reg lb_mode; +}; + +struct vop_scl_regs { + const struct vop_scl_extension *ext; + struct vop_reg scale_yrgb_x; struct vop_reg scale_yrgb_y; struct vop_reg scale_cbcr_x; @@ -242,6 +247,11 @@ static inline uint16_t scl_cal_scale(int src, int dst, int shift) return ((src * 2 - 3) << (shift - 1)) / (dst - 1); } +static inline uint16_t scl_cal_scale2(int src, int dst) +{ + return ((src - 1) << 12) / (dst - 1); +} + #define GET_SCL_FT_BILI_DN(src, dst) scl_cal_scale(src, dst, 12) #define GET_SCL_FT_BILI_UP(src, dst) scl_cal_scale(src, dst, 16) #define GET_SCL_FT_BIC(src, dst) scl_cal_scale(src, dst, 16) |