amvecm: fix local constrast open failed [1/1]
authorBencheng Jing <bencheng.jing@amlogic.com>
Mon, 17 Jun 2019 11:35:46 +0000 (19:35 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 20 Jun 2019 10:57:50 +0000 (03:57 -0700)
PD#TV-6846

Problem:
local constrast open failed

Solution:
if the register in db is enbale,set lc_en to 1

Verify:
TL1

Change-Id: Id0bde987d3a45056a86dfe2e758d82a509611b10
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/amcm.c

index 1177a77..25d5821 100644 (file)
@@ -245,6 +245,13 @@ void am_set_regmap(struct am_regs_s *p)
                        } else {
                                if (p->am_reg[i].addr == 0x1d26)
                                        break;
+                       /*if the bit 4 of SRSHARP1_LC_TOP_CTRL is 1,
+                        *it means that lc is enable in db,
+                        *so need to change lc_en to 1;
+                        *else if the bit 4 of SRSHARP1_LC_TOP_CTRL is 0,
+                        *it means that lc is disable in db,
+                        *so need to change lc_en to 0
+                        */
                                if (p->am_reg[i].addr == SRSHARP1_LC_TOP_CTRL) {
                                        temp =
                                        (p->am_reg[i].val & p->am_reg[i].mask)
@@ -252,6 +259,8 @@ void am_set_regmap(struct am_regs_s *p)
                                        temp &= 0x1;
                                        if (!temp && lc_en)
                                                lc_en = 0;
+                                       else if (!lc_en && temp)
+                                               lc_en = 1;
                                }
                                if (pq_reg_wr_rdma)
                                        VSYNC_WR_MPEG_REG(p->am_reg[i].addr,