author | Jihong Sui <jihong.sui@amlogic.com> | 2019-07-17 07:15:44 (GMT) |
---|---|---|
committer | Tao Zeng <tao.zeng@amlogic.com> | 2019-08-07 07:30:15 (GMT) |
commit | 4d2679a7a0a325e0fb0f1fa7d4a465c8cf762b9a (patch) | |
tree | 74f89fb531dee33dbc9d8d96135703c16a0e0e83 | |
parent | 3d42fbd16792b7166c8f78868fec8fdbba4c9bf8 (diff) | |
download | common-4d2679a7a0a325e0fb0f1fa7d4a465c8cf762b9a.zip common-4d2679a7a0a325e0fb0f1fa7d4a465c8cf762b9a.tar.gz common-4d2679a7a0a325e0fb0f1fa7d4a465c8cf762b9a.tar.bz2 |
deinterlace: add pulldown info to vframe. [1/2]
PD#SWPL-11389
Problem:
PQ need work around for 1080i(based on VLSI's suggestions)
co-work with yanling/mingliang
Solution:
add pulldown information to vframe;
u32 di_pulldown:
-bit 3: interlace
-bit 2: flmxx
-bit 1: flm22
-bit 0: flm32
Verify:
TL1
Change-Id: I9ff06ffa7aaa9516a3e64cec9768272499678fd5
Signed-off-by: Jihong Sui <jihong.sui@amlogic.com>
-rw-r--r-- | drivers/amlogic/media/deinterlace/deinterlace.c | 14 | ||||
-rw-r--r-- | drivers/amlogic/media/deinterlace/deinterlace_dbg.c | 1 | ||||
-rw-r--r-- | drivers/amlogic/media/deinterlace/pulldown_drv.c | 8 | ||||
-rw-r--r-- | include/linux/amlogic/media/vfm/vframe.h | 8 |
4 files changed, 28 insertions, 3 deletions
diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 49f7159..9e5568d 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.c +++ b/drivers/amlogic/media/deinterlace/deinterlace.c @@ -3520,6 +3520,7 @@ static void pre_de_done_buf_config(void) struct di_buf_s *post_wr_buf = NULL; unsigned int glb_frame_mot_num = 0; unsigned int glb_field_mot_num = 0; + unsigned int pull_down_info = 0; ddbg_mod_save(eDI_DBG_MOD_PRE_DONEB, 0, di_pre_stru.in_seq);/*dbg*/ if (di_pre_stru.di_wr_buf) { @@ -3542,13 +3543,22 @@ static void pre_de_done_buf_config(void) di_pre_stru.di_post_wr_buf = di_pre_stru.di_wr_buf; post_wr_buf = di_pre_stru.di_post_wr_buf; + if (post_wr_buf) + post_wr_buf->vframe->di_pulldown = 0; + if (post_wr_buf && !di_pre_stru.cur_prog_flag) { read_pulldown_info(&glb_frame_mot_num, &glb_field_mot_num); - if (pulldown_enable) - pulldown_detection(&post_wr_buf->pd_config, + if (pulldown_enable) { + pull_down_info = pulldown_detection( + &post_wr_buf->pd_config, di_pre_stru.mtn_status, overturn, di_pre_stru.di_inp_buf->vframe); + post_wr_buf->vframe->di_pulldown + = pull_down_info; + + } + post_wr_buf->vframe->di_pulldown |= 0x08; if (combing_fix_en) cur_lev = adaptive_combing_fixing( di_pre_stru.mtn_status, diff --git a/drivers/amlogic/media/deinterlace/deinterlace_dbg.c b/drivers/amlogic/media/deinterlace/deinterlace_dbg.c index 41fb852..5d9d3af 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace_dbg.c +++ b/drivers/amlogic/media/deinterlace/deinterlace_dbg.c @@ -874,6 +874,7 @@ void dump_vframe(struct vframe_s *vf) vf->process_fun, vf->private_data); pr_info("pixel_ratio %d list %p\n", vf->pixel_ratio, &vf->list); + pr_info("di_pulldown 0x%x\n", vf->di_pulldown); } void print_di_buf(struct di_buf_s *di_buf, int format) diff --git a/drivers/amlogic/media/deinterlace/pulldown_drv.c b/drivers/amlogic/media/deinterlace/pulldown_drv.c index be3efc8..bdee815 100644 --- a/drivers/amlogic/media/deinterlace/pulldown_drv.c +++ b/drivers/amlogic/media/deinterlace/pulldown_drv.c @@ -119,6 +119,7 @@ unsigned int pulldown_detection(struct pulldown_detected_s *res, unsigned int flm22_surenum = flm22_sure_num; int difflag = 2; bool flm32 = false, flm22 = false, flmxx = false; + unsigned int pulldown_info; read_pulldown_info(&glb_frame_mot_num, &glb_field_mot_num); @@ -335,7 +336,12 @@ unsigned int pulldown_detection(struct pulldown_detected_s *res, res->regs[1].blend_mode = 0; } } - return 0; + + pulldown_info = flm32 ? 1 : 0; + pulldown_info |= flm22 ? 0x02 : 0; + pulldown_info |= flmxx ? 0x04 : 0; + + return pulldown_info; } unsigned char pulldown_init(unsigned short width, unsigned short height) diff --git a/include/linux/amlogic/media/vfm/vframe.h b/include/linux/amlogic/media/vfm/vframe.h index 7dbf432..009d49e 100644 --- a/include/linux/amlogic/media/vfm/vframe.h +++ b/include/linux/amlogic/media/vfm/vframe.h @@ -423,6 +423,14 @@ struct vframe_s { u32 sar_width; u32 sar_height; + /***************** + * di pulldown info + * bit 3: interlace + * bit 2: flmxx + * bit 1: flm22 + * bit 0: flm32 + *****************/ + u32 di_pulldown; } /*vframe_t */; #if 0 |