From f00295ae3a4e97f28a63e6baa0c36f25e8dad362 Mon Sep 17 00:00:00 2001 From: Xuhua Zhang Date: Thu, 20 Dec 2018 20:16:06 +0800 Subject: [PATCH] tvin: vdin: fix afbce 4k yuv444 display error [1/1] PD#SWPL-3429 Problem: vdin output format is afbce 4k yuv444,it display ghost shadow of image Solution: add afbce comb control Verify: x301 Change-Id: I168f13994a4929bd227ba70b006f259ac0726238 Signed-off-by: Xuhua Zhang --- drivers/amlogic/media/video_sink/video.c | 3 +++ drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c | 6 ++++-- include/linux/amlogic/media/vfm/vframe.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 5ea36e8..b235972 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -3183,6 +3183,9 @@ static void viu_set_dcu(struct vpp_frame_par_s *frame_par, struct vframe_s *vf) if (vf && (vf->source_type != VFRAME_SOURCE_TYPE_HDMI)) r |= (1 << 19); /* dos_uncomp */ + + if (type & VIDTYPE_COMB_MODE) + r |= (1 << 20); } VSYNC_WR_MPEG_REG(AFBC_ENABLE, r); diff --git a/drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c b/drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c index fa4b161..43291a8 100644 --- a/drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c +++ b/drivers/amlogic/media/vin/tvin/vdin/vdin_ctl.c @@ -4040,9 +4040,11 @@ u32 vdin_get_curr_field_type(struct vdin_dev_s *devp) } format_convert = devp->format_convert; if ((format_convert == VDIN_FORMAT_CONVERT_YUV_YUV444) || - (format_convert == VDIN_FORMAT_CONVERT_RGB_YUV444)) + (format_convert == VDIN_FORMAT_CONVERT_RGB_YUV444)) { type |= VIDTYPE_VIU_444; - else if ((format_convert == VDIN_FORMAT_CONVERT_YUV_YUV422) || + if (devp->afbce_mode == 1) + type |= VIDTYPE_COMB_MODE; + } else if ((format_convert == VDIN_FORMAT_CONVERT_YUV_YUV422) || (format_convert == VDIN_FORMAT_CONVERT_RGB_YUV422)) type |= VIDTYPE_VIU_422; else if (devp->prop.dest_cfmt == TVIN_NV21) { diff --git a/include/linux/amlogic/media/vfm/vframe.h b/include/linux/amlogic/media/vfm/vframe.h index 2a62b67..1ca5c71 100644 --- a/include/linux/amlogic/media/vfm/vframe.h +++ b/include/linux/amlogic/media/vfm/vframe.h @@ -46,6 +46,7 @@ #define VIDTYPE_SCATTER 0x400000 #define VIDTYPE_VD2 0x800000 #define VIDTYPE_COMPRESS_LOSS 0x1000000 +#define VIDTYPE_COMB_MODE 0x2000000 #define DISP_RATIO_FORCECONFIG 0x80000000 #define DISP_RATIO_FORCE_NORMALWIDE 0x40000000 -- 2.7.4