amvecm: fix lc enable/disable not follow pq.db [1/1]
authorBencheng Jing <bencheng.jing@amlogic.com>
Wed, 10 Apr 2019 09:41:22 +0000 (17:41 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 11 Apr 2019 01:55:27 +0000 (18:55 -0700)
PD#TV-4358

Problem:
lc enable/disable not follow pq.db

Solution:
check the db reg vlaue,then adjust lc_en

Verify:
TL1

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

index 5247bdc..25f1767 100644 (file)
@@ -30,6 +30,7 @@
 #include "amcm_regmap.h"
 #include <linux/amlogic/media/amdolbyvision/dolby_vision.h>
 #include "amcsc.h"
+#include "local_contrast.h"
 
 #define pr_amcm_dbg(fmt, args...)\
        do {\
@@ -244,6 +245,14 @@ void am_set_regmap(struct am_regs_s *p)
                        } else {
                                if (p->am_reg[i].addr == 0x1d26)
                                        break;
+                               if (p->am_reg[i].addr == SRSHARP1_LC_TOP_CTRL) {
+                                       temp =
+                                       (p->am_reg[i].val & p->am_reg[i].mask)
+                                               >> 4;
+                                       temp &= 0x1;
+                                       if (!temp && lc_en)
+                                               lc_en = 0;
+                               }
                                if (pq_reg_wr_rdma)
                                        VSYNC_WR_MPEG_REG(p->am_reg[i].addr,
                                        (aml_read_vcbus(p->am_reg[i].addr) &