From d60dba956464ae8062844d5c8519997a7395cf0b Mon Sep 17 00:00:00 2001 From: yao liu Date: Thu, 1 Aug 2019 03:35:10 -0400 Subject: [PATCH] Dolby: Metadata Conformance test mismatch [1/1] PD#SWPL-11390 Problem: No 227/228/229/230 fail Solution: 1.Set video priotiry, to prevent num_ext_blocks is set to 0 2.Turn off osd, to make gmax=gmin=0 3.Update md_tool.exe to version 0.4.1 4.Add padding data 0 to 512 bytes for metadata By the way, fix some coverity check error Verify: sm1 Change-Id: I316e33bac3d84bb3bd7763031c28b33cfe7762ac Signed-off-by: yao liu --- .../amdolby_vision/amdolby_vision.c | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index 9bb386b74a18..7eeed2171724 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -261,6 +261,7 @@ static u32 core1_disp_hsize; static u32 core1_disp_vsize; static u32 vsync_count; #define FLAG_VSYNC_CNT 10 +#define MAX_CORE3_MD_SIZE 128 /*512byte*/ static bool is_osd_off; static bool force_reset_core2; @@ -2426,7 +2427,7 @@ static int dolby_core3_set( VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START + 0x24 + i, p_core3_md_regs[i]); } - for (; i < 30; i++) + for (; i < (MAX_CORE3_MD_SIZE + 1); i++) VSYNC_WR_DV_REG(DOLBY_CORE3_REG_START + 0x24 + i, 0); } @@ -2476,7 +2477,7 @@ static void apply_stb_core_settings( } if (is_meson_txlx_stbmode() || force_stb_mode) { - if ((vinfo->width >= 1920) && + if (vinfo && (vinfo->width >= 1920) && (vinfo->height >= 1080) && (vinfo->field_height >= 1080)) dma_start_line = 0x400; @@ -2484,7 +2485,7 @@ static void apply_stb_core_settings( dma_start_line = 0x180; /* adjust core2 setting to work around*/ /* fixing with 1080p24hz and 480p60hz */ - if ((vinfo->width < 1280) && + if (vinfo && (vinfo->width < 1280) && (vinfo->height < 720) && (vinfo->field_height < 720)) g_vpotch = 0x60; @@ -4075,6 +4076,9 @@ bool is_dovi_frame(struct vframe_s *vf) unsigned int size = 0; unsigned int type = 0; + if (!vf) + return false; + req.vf = vf; req.bot_flag = 0; req.aux_buf = NULL; @@ -5940,17 +5944,19 @@ int dolby_vision_wait_metadata(struct vframe_s *vf) return 1; } - req.vf = vf; - req.bot_flag = 0; - req.aux_buf = NULL; - req.aux_size = 0; - req.dv_enhance_exist = 0; + if (vf) { + req.vf = vf; + req.bot_flag = 0; + req.aux_buf = NULL; + req.aux_size = 0; + req.dv_enhance_exist = 0; - if (vf->source_type == VFRAME_SOURCE_TYPE_OTHERS) - vf_notify_provider_by_name("dvbldec", - VFRAME_EVENT_RECEIVER_GET_AUX_DATA, - (void *)&req); - if (req.dv_enhance_exist) { + if (vf->source_type == VFRAME_SOURCE_TYPE_OTHERS) + vf_notify_provider_by_name("dvbldec", + VFRAME_EVENT_RECEIVER_GET_AUX_DATA, + (void *)&req); + } + if (vf && req.dv_enhance_exist) { el_vf = dvel_vf_peek(); while (el_vf) { if (debug_dolby & 2)