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>
Tue, 10 Sep 2019 01:07:45 +0000 (21:07 -0400)
PD#SWPL-11747

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 54e92fafca4eecef26e648b1cb0ed5af89891cbb..73c711afb154e12ae74001d7a970fc80c99d476f 100644 (file)
@@ -2397,19 +2397,29 @@ 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 */
@@ -5187,11 +5197,13 @@ int dolby_vision_parse_metadata(
                                &total_md_size,
                                &src_format,
                                &ret_flags);
-                       if (ret_flags && req.dv_enhance_exist
-                               && (frame_count == 0))
+                       if (ret_flags && req.dv_enhance_exist &&
+                           (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;
                        }
@@ -5396,7 +5408,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 7d991b4bcd46eda6fe10b827fc8a460942ebf9c4..313bbcbd9c76c165add80767bb289dd2b9fb43ed 100644 (file)
@@ -359,7 +359,7 @@ struct dm_lut_ipcore_s {
 
 /** @brief hdmi metadata for IPCORE 3 */
 struct md_reister_ipcore_3_s {
-       uint32_t raw_metadata[128];
+       u32 raw_metadata[512];
        uint32_t size;
 };