vdin: dv 444 low-latency need convert to 422 [1/1]

PD#SWPL-138069

Problem:
dv 444 low-latency not convert to 422 will abnormal

Solution:
dv 444 low-latency need convert to 422

Verify:
t5w

Change-Id: Iff9d00a31d135334feb5bc5943f82426768f5e31
Signed-off-by: qiang.liu <qiang.liu@amlogic.com>
This commit is contained in:
qiang.liu
2023-08-28 16:31:22 +08:00
committed by Luan Yuan
parent b6a60af2fe
commit 26daf0d8f3
6 changed files with 43 additions and 7 deletions
+9 -3
View File
@@ -770,9 +770,15 @@ void vdin_get_format_convert(struct vdin_dev_s *devp)
/*rx will tunneled to 444*/
format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
} else if (devp->prop.color_format == TVIN_RGB444) {
format_convert = VDIN_FORMAT_CONVERT_RGB_RGB;
if (vdin_dv_is_not_std_source_led(devp))
format_convert = VDIN_FORMAT_CONVERT_BRG_YUV422;
else
format_convert = VDIN_FORMAT_CONVERT_RGB_RGB;
} else {
format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
if (vdin_dv_is_not_std_source_led(devp))
format_convert = VDIN_FORMAT_CONVERT_YUV_YUV422;
else
format_convert = VDIN_FORMAT_CONVERT_YUV_YUV444;
}
}
#endif
@@ -1949,7 +1955,7 @@ void vdin_set_matrix(struct vdin_dev_s *devp)
} else {
matrix_sel = VDIN_SEL_MATRIX0;
}
if (!devp->dv.dv_flag) {
if (!devp->dv.dv_flag || vdin_dv_is_not_std_source_led(devp)) {
devp->csc_idx = vdin_set_color_matrix(matrix_sel,
devp->addr_offset,
devp->fmt_info_p,
+8 -2
View File
@@ -882,6 +882,10 @@ static void vdin_vf_init(struct vdin_dev_s *devp)
vf->flag |= VFRAME_FLAG_GAME_MODE;
if (devp->vdin_pc_mode)
vf->flag |= VFRAME_FLAG_PC_MODE;
if (vdin_dv_is_not_std_source_led(devp) || devp->debug.bypass_tunnel)
vf->type_ext |= VIDTYPE_EXT_BYPASS_DETUNNEL;
else
vf->type_ext &= ~VIDTYPE_EXT_BYPASS_DETUNNEL;
scan_mode = devp->fmt_info_p->scan_mode;
if ((scan_mode == TVIN_SCAN_MODE_INTERLACED &&
(!(devp->parm.flag & TVIN_PARM_FLAG_2D_TO_3D) &&
@@ -1282,7 +1286,8 @@ int vdin_start_dec(struct vdin_dev_s *devp)
vdin_dolby_addr_alloc(devp, devp->vfp->size);
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
if (vdin_is_dolby_signal_in(devp) &&
devp->index == devp->dv.dv_path_idx) {
devp->index == devp->dv.dv_path_idx &&
!vdin_dv_is_not_std_source_led(devp)) {
/* config dolby vision */
vdin_dolby_config(devp);
#ifndef VDIN_BRINGUP_NO_VF
@@ -1587,7 +1592,8 @@ void vdin_stop_dec(struct vdin_dev_s *devp)
vdin_set_def_wr_canvas(devp);
if (devp->work_mode == VDIN_WORK_MD_NORMAL) {
if (devp->dv.dv_config && devp->index == devp->dv.dv_path_idx) {
if (devp->dv.dv_config && devp->index == devp->dv.dv_path_idx &&
!vdin_dv_is_not_std_source_led(devp)) {
devp->dv.dv_config = 0;
vf_unreg_provider(&devp->dv.dv_vf_provider);
pr_info("vdin%d provider: dv unreg\n", devp->index);
+2 -1
View File
@@ -212,7 +212,8 @@ enum vdin_hw_ver_e {
/* 20230725: notify fps change event when not game mode */
/* 20230727: drop the first frame for vdin1 was not write finished */
/* 20230803: pc and game mode switch optimization */
#define VDIN_VER_V1 "20230803: pc and game mode switch optimization"
/* 20231013: dv 444 low-latency need convert to 422 */
#define VDIN_VER_V1 "20231013: dv 444 low-latency need convert to 422"
enum vdin_irq_flg_e {
VDIN_IRQ_FLG_NO_END = 1,
+18
View File
@@ -296,3 +296,21 @@ bool vdin_dv_not_manual_game(struct vdin_dev_s *devp)
else
return false;
}
/* some device force send dv 444 source-led need convert to 422 and bypass detunnel
* return value:
* true: dv is not standard source-led
* false: dv is yuv422/420 12bit source-led
*/
bool vdin_dv_is_not_std_source_led(struct vdin_dev_s *devp)
{
if (devp->dv.dv_flag &&
(devp->dv.low_latency || devp->prop.latency.allm_mode ||
devp->vrr_data.vrr_mode) &&
((devp->prop.color_format == TVIN_RGB444 ||
devp->prop.color_format == TVIN_YUV444) ||
devp->prop.colordepth == 8))
return true;
else
return false;
}
+5 -1
View File
@@ -30,6 +30,7 @@ irqreturn_t vdin_wrmif2_dv_meta_wr_done_isr(int irq, void *dev_id);
bool vdin_dv_is_need_tunnel(struct vdin_dev_s *devp);
bool vdin_dv_is_visf_data(struct vdin_dev_s *devp);
bool vdin_dv_not_manual_game(struct vdin_dev_s *devp);
bool vdin_dv_is_not_std_source_led(struct vdin_dev_s *devp);
#else
static inline bool vdin_dv_is_need_tunnel(struct vdin_dev_s *devp)
{
@@ -46,6 +47,9 @@ static inline bool vdin_dv_not_manual_game(struct vdin_dev_s *devp)
return false;
}
static inline bool vdin_dv_is_not_std_source_led(struct vdin_dev_s *devp)
{
return false;
}
#endif
#endif
+1
View File
@@ -64,6 +64,7 @@
#define VIDTYPE_EXT_VDIN_SCATTER 0x1
#define VIDTYPE_EXT_MOSAIC_22 0x2
#define VIDTYPE_EXT_BYPASS_DETUNNEL 0x4
#define DISP_RATIO_FORCECONFIG 0x80000000
#define DISP_RATIO_FORCE_NORMALWIDE 0x40000000