dolby: fix 5008 crc error [1/1]
authoryao liu <yao.liu@amlogic.com>
Fri, 28 Jun 2019 02:07:23 +0000 (10:07 +0800)
committerYao Liu <yao.liu@amlogic.com>
Mon, 15 Jul 2019 12:07:46 +0000 (05:07 -0700)
PD#SWPL-10487

Problem:
1.tb39 new case 5008, dm version is 3,
core3 raw_metadata overflow
2.core3 raw_metadata 207 overwrite core3 clkgate_ctrl
and core3 swap_ctrl0 andsawp_ctrl1 reg.

Solution:
1.Increase raw_metadata size to 512
2.Force dv_mode to DOLBY_VISION_OUTPUT_MODE_IPT, output
ipt444 12bit for 5008.
3.Dont set core3 metadata reg when scramble disabled or
metedata size > 204

Verify:
verified on sm1

Change-Id: I459736eb42eb14fe3fe0dc054eb6693c88967741
Signed-off-by: yao liu <yao.liu@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.h

index 97662d8..1d2c43a 100644 (file)
@@ -2497,19 +2497,30 @@ static int dolby_core3_set(
                                p_core3_dm_regs[i]);
        /* from addr 0x18 */
 
-       count = md_count;
-       for (i = 0; i < count; i++) {
+       if (scramble_en) {
+               if (md_count > 204) {
+                       pr_dolby_error("core3 metadata size %d > 204 !\n",
+                               md_count);
+               } else {
+                       count = md_count;
+                       for (i = 0; i < count; i++) {
 #ifdef FORCE_HDMI_META
-               if ((i == 20) && (p_core3_md_regs[i] == 0x5140a3e))
-                       VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START + 0x24 + i,
-                               (p_core3_md_regs[i] & 0xffffff00) | 0x80);
-               else
+                               if ((i == 20) &&
+                                       (p_core3_md_regs[i] == 0x5140a3e))
+                                       VSYNC_WR_DV_REG(
+                                       DOLBY_CORE3_REG_START + 0x24 + i,
+                                       (p_core3_md_regs[i] &
+                                       0xffffff00) | 0x80);
+                               else
 #endif
-               VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START + 0x24 + i,
-                       p_core3_md_regs[i]);
+                               VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START +
+                                       0x24 + i, p_core3_md_regs[i]);
+                       }
+                       for (; i < 30; i++)
+                               VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START +
+                                       0x24 + i, 0);
+               }
        }
-       for (; i < 30; i++)
-               VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START + 0x24 + i, 0);
 
        /* from addr 0x90 */
        /* core3 metadata program done */
@@ -5321,10 +5332,12 @@ int dolby_vision_parse_metadata(
                                &src_format,
                                &ret_flags);
                        if (ret_flags && req.dv_enhance_exist
-                               && (frame_count == 0))
+                               && (frame_count == 0)) {
                                vf_notify_provider_by_name("dvbldec",
                                        VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL,
                                        (void *)&req);
+                               pr_info("bypass mel\n");
+                       }
                        if (ret_flags == 1) {
                                mel_flag = true;
                        }
@@ -5529,7 +5542,7 @@ int dolby_vision_parse_metadata(
                &current_mode, check_format)) {
                if (!dolby_vision_wait_init)
                        dolby_vision_set_toggle_flag(1);
-               pr_dolby_dbg("[dolby_vision_parse_metadata] output change from %d to %d\n",
+               pr_info("[dolby_vision_parse_metadata] output change from %d to %d\n",
                        dolby_vision_mode, current_mode);
                dolby_vision_mode = current_mode;
                if (is_dolby_vision_stb_mode())
index 05daa68..b3da1b5 100644 (file)
@@ -372,7 +372,7 @@ struct dm_lut_ipcore_s {
 
 /** @brief hdmi metadata for IPCORE 3 */
 struct md_reister_ipcore_3_s {
-       uint32_t raw_metadata[128];
+       uint32_t raw_metadata[512];
        uint32_t size;
 };