From 5d2ec14fba36bd8d19058d0e97dbe62da8188029 Mon Sep 17 00:00:00 2001 From: Yi Zhou Date: Tue, 27 Nov 2018 10:31:16 +0800 Subject: [PATCH] dv: fix the flickered problem [1/1] PD#SWPL-1207 Problem: fix the filckered problem when playing transition video in sdr tv Solution: when dv core2 don't run, the reset can't be executed Verify: r321 Change-Id: I719325f1722589e02a40d46442258b0d1e3feb17 Signed-off-by: Yi Zhou --- .../enhancement/amdolby_vision/amdolby_vision.c | 22 ++++++++++++++++------ drivers/amlogic/media/osd/osd_hw.c | 11 +++++++++++ .../amlogic/media/amdolbyvision/dolby_vision.h | 2 ++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index 56c7232..f95d717 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -292,6 +292,10 @@ MODULE_PARM_DESC(dolby_vision_graphic_min, "\n dolby_vision_graphic_min\n"); module_param(dolby_vision_graphic_max, uint, 0664); MODULE_PARM_DESC(dolby_vision_graphic_max, "\n dolby_vision_graphic_max\n"); +/*these two parameters form OSD*/ +static unsigned int osd_graphic_width = 1920; +static unsigned int osd_graphic_height = 1080; + static unsigned int dv_cert_graphic_width = 1920; static unsigned int dv_cert_graphic_height = 1080; module_param(dv_cert_graphic_width, uint, 0664); @@ -1763,8 +1767,7 @@ static int dolby_core2_set( VSYNC_WR_MPEG_REG(DOLBY_CORE2A_CLKGATE_CTRL, 0); VSYNC_WR_MPEG_REG(DOLBY_CORE2A_SWAP_CTRL0, 0); - if (is_meson_gxm() || - is_meson_g12() || reset) { + if (is_meson_gxm() || is_meson_g12() || reset) { VSYNC_WR_MPEG_REG(DOLBY_CORE2A_SWAP_CTRL1, ((hsize + g_htotal_add) << 16) | (vsize + g_vtotal_add + g_vsize_add)); @@ -2058,6 +2061,13 @@ static int dolby_core3_set( return 0; } +void update_graphic_width_height(unsigned int width, + unsigned int height) +{ + osd_graphic_width = width; + osd_graphic_height = height; +} + static void apply_stb_core_settings( int enable, unsigned int mask, bool reset, u32 frame_size, u8 pps_state) @@ -2070,15 +2080,15 @@ static void apply_stb_core_settings( #else u32 core1_dm_count = 24; #endif - u32 graphics_w = 1920; - u32 graphics_h = 1080; + u32 graphics_w = osd_graphic_width; + u32 graphics_h = osd_graphic_height; if (is_dolby_vision_stb_mode() && (dolby_vision_flags & FLAG_CERTIFICAION)) { graphics_w = dv_cert_graphic_width; graphics_h = dv_cert_graphic_height; } - if (is_meson_txlx_package_962E() + if (is_meson_txlx_stbmode() || force_stb_mode) { if ((vinfo->width >= 1920) && (vinfo->height >= 1080) && @@ -2096,7 +2106,7 @@ static void apply_stb_core_settings( g_vpotch = 0x20; } if (mask & 1) { - if (is_meson_txlx_package_962E() + if (is_meson_txlx_stbmode() || force_stb_mode) { stb_dolby_core1_set( 27, 173, 256 * 5, diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index b342ff0..7f66ea5 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -53,6 +53,10 @@ #ifdef CONFIG_AMLOGIC_MEDIA_VIDEO #include #endif +#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION +#include +#endif + /* Local Headers */ #include "osd_canvas.h" #include "osd_prot.h" @@ -7862,6 +7866,10 @@ static void osd_basic_update_disp_geometry(u32 index) VSYNCOSD_WR_MPEG_REG( DOLBY_CORE2A_SWAP_CTRL2, (buffer_w << 16) | (buffer_h + 0)); + +#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION + update_graphic_width_height(buffer_w, buffer_h); +#endif } data32 = VSYNCOSD_RD_MPEG_REG(osd_reg->osd_ctrl_stat); data32 &= ~0x1ff008;//0x1ff00e; @@ -7986,6 +7994,9 @@ static void osd1_basic_update_disp_geometry(void) VSYNCOSD_WR_MPEG_REG( DOLBY_CORE2A_SWAP_CTRL2, (buffer_w << 16) | (buffer_h + 0)); +#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION + update_graphic_width_height(buffer_w, buffer_h); +#endif } if (osd_hw.osd_afbcd[OSD1].enable && !osd_afbc_dec_enable && diff --git a/include/linux/amlogic/media/amdolbyvision/dolby_vision.h b/include/linux/amlogic/media/amdolbyvision/dolby_vision.h index bdb5638..370c010 100644 --- a/include/linux/amlogic/media/amdolbyvision/dolby_vision.h +++ b/include/linux/amlogic/media/amdolbyvision/dolby_vision.h @@ -51,5 +51,7 @@ extern int enable_rgb_to_yuv_matrix_for_dvll( int32_t on, uint32_t *coeff_orig, uint32_t bits); extern bool is_dovi_frame(struct vframe_s *vf); +extern void update_graphic_width_height(unsigned int width, + unsigned int height); #endif -- 2.7.4