amvecm: ioctrl get hist ave error [1/1]
authorMingLiang Dong <mingliang.dong@amlogic.com>
Wed, 9 Jan 2019 09:22:26 +0000 (04:22 -0500)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 11 Jan 2019 01:36:08 +0000 (17:36 -0800)
PD#TV-1950

Problem:
VPP_IN_H_V_SIZE register is removed on TL1

Solution:
use preblend size to config hist stts size

Verify:
verify on TL1

Change-Id: I0afc9fd45f69318b2ebd42424aee20e60400d809
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/amvecm.c

index f5f7517..f37cbc0 100644 (file)
@@ -783,8 +783,14 @@ void vpp_get_vframe_hist_info(struct vframe_s *vf)
        unsigned int hist_height, hist_width;
        u64 divid;
 
-       hist_height = READ_VPP_REG_BITS(VPP_IN_H_V_SIZE, 0, 13);
-       hist_width = READ_VPP_REG_BITS(VPP_IN_H_V_SIZE, 16, 13);
+       if (get_cpu_type() == MESON_CPU_MAJOR_ID_TL1) {
+               /*TL1 remove VPP_IN_H_V_SIZE register*/
+               hist_width = READ_VPP_REG_BITS(VPP_PREBLEND_H_SIZE, 0, 13);
+               hist_height = READ_VPP_REG_BITS(VPP_PREBLEND_H_SIZE, 16, 13);
+       } else {
+               hist_height = READ_VPP_REG_BITS(VPP_IN_H_V_SIZE, 0, 13);
+               hist_width = READ_VPP_REG_BITS(VPP_IN_H_V_SIZE, 16, 13);
+       }
 
        if ((hist_height != pre_hist_height) ||
                (hist_width != pre_hist_width)) {