From f77c2c96af9c6e883c6742f61b6584516221e14e Mon Sep 17 00:00:00 2001 From: Dezhi Kong Date: Mon, 2 Sep 2019 19:53:09 +0800 Subject: [PATCH] csc: add vinfo check for csc process [1/1] PD#SWPL-13491 Problem: After plugging and unplugging HDMITX, the panel screen color display is abnormal for dual display platform. Solution: add vinfo->mode check for csc process, avoid process null and invalid vinfo case. Verify: verify by AC202(sm1) Change-Id: I54c54adcf2a0fc9a02e35b0ef24a720a55a8781a Signed-off-by: Dezhi Kong --- drivers/amlogic/media/enhancement/amvecm/amcsc.c | 10 ++++++---- drivers/amlogic/media/enhancement/amvecm/amcsc_pip.c | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amvecm/amcsc.c b/drivers/amlogic/media/enhancement/amvecm/amcsc.c index f1278c8..af39cbe 100644 --- a/drivers/amlogic/media/enhancement/amvecm/amcsc.c +++ b/drivers/amlogic/media/enhancement/amvecm/amcsc.c @@ -6839,8 +6839,7 @@ static void video_process( if (get_cpu_type() >= MESON_CPU_MAJOR_ID_G12A) { if (vinfo->viu_color_fmt != COLOR_FMT_RGB444) mtx_setting(POST2_MTX, MATRIX_NULL, MTX_OFF); - else if (!(vinfo->mode == VMODE_NULL || - vinfo->mode == VMODE_INVALID)) + else mtx_setting(POST2_MTX, MATRIX_YUV709_RGB, MTX_ON); } @@ -6921,7 +6920,8 @@ static int vpp_matrix_update( int hdmi_scs_type_changed = 0; bool hdr10p_meta_updated = false; - if (vinfo == NULL) + if (!vinfo || vinfo->mode == VMODE_NULL || + vinfo->mode == VMODE_INVALID) return 0; /* Tx hdr information */ @@ -7053,7 +7053,9 @@ int amvecm_matrix_process( int ret; if ((get_cpu_type() < MESON_CPU_MAJOR_ID_GXTVBB) || - is_meson_gxl_package_905M2() || (csc_en == 0)) + is_meson_gxl_package_905M2() || (csc_en == 0) || + !vinfo || vinfo->mode == VMODE_NULL || + vinfo->mode == VMODE_INVALID) return 0; if (reload_mtx) { diff --git a/drivers/amlogic/media/enhancement/amvecm/amcsc_pip.c b/drivers/amlogic/media/enhancement/amvecm/amcsc_pip.c index ade3e0f..ff5f23b 100644 --- a/drivers/amlogic/media/enhancement/amvecm/amcsc_pip.c +++ b/drivers/amlogic/media/enhancement/amvecm/amcsc_pip.c @@ -883,8 +883,7 @@ void video_post_process( if (get_cpu_type() >= MESON_CPU_MAJOR_ID_G12A) { if (vinfo->viu_color_fmt != COLOR_FMT_RGB444) mtx_setting(POST2_MTX, MATRIX_NULL, MTX_OFF); - else if (!(vinfo->mode == VMODE_NULL || - vinfo->mode == VMODE_INVALID)) + else mtx_setting(POST2_MTX, MATRIX_YUV709_RGB, MTX_ON); } -- 2.7.4