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)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 05:54:19 +0000 (13:54 +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 e72b620..e913d69 100644 (file)
@@ -780,8 +780,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)) {