amvecm: match uboot sdr2hdr function [1/1]
authorMingLiang Dong <mingliang.dong@amlogic.com>
Fri, 12 Apr 2019 03:03:27 +0000 (23:03 -0400)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 05:55:36 +0000 (13:55 +0800)
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 9f8162d..078a35b 100644 (file)
@@ -61,6 +61,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 {\
@@ -5433,6 +5434,12 @@ static ssize_t amvecm_lc_store(struct class *cls,
        return count;
 }
 
+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)
@@ -5461,6 +5468,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;