amvecm: match uboot sdr2hdr function [1/1]
authorMingLiang Dong <mingliang.dong@amlogic.com>
Fri, 12 Apr 2019 03:03:27 +0000 (23:03 -0400)
committerJianxin Pan <jianxin.pan@amlogic.com>
Sun, 21 Apr 2019 11:42:15 +0000 (04:42 -0700)
PD#OTT-2524

Problem:
enable sdr2hdr function, uboot logo have color change

Solution:
match uboot sdr2hdr function

Verify:
verify on G12A

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

index fb8924d..a28d72c 100644 (file)
@@ -63,6 +63,7 @@
 #include "vlock.h"
 #include "hdr/am_hdr10_plus.h"
 #include "local_contrast.h"
+#include "arch/vpp_hdr_regs.h"
 
 #define pr_amvecm_dbg(fmt, args...)\
        do {\
@@ -6224,6 +6225,12 @@ free_buf:
        return -EINVAL;
 }
 
+static void def_hdr_sdr_mode(void)
+{
+       if (((READ_VPP_REG(VD1_HDR2_CTRL) >> 13) & 0x1) &&
+               ((READ_VPP_REG(OSD1_HDR2_CTRL) >> 13) & 0x1))
+               sdr_mode = 2;
+}
 
 /* #if (MESON_CPU_TYPE == MESON_CPU_TYPE_MESONG9TV) */
 void init_pq_setting(void)
@@ -6252,6 +6259,9 @@ void init_pq_setting(void)
                        0x4000);
                WRITE_VPP_REG(SRSHARP0_SHARP_SR2_CBIC_VCOEF0 + sr_offset[0],
                        0x4000);
+
+               /*kernel sdr2hdr match uboot setting*/
+               def_hdr_sdr_mode();
        }
        return;