}
post_wr_buf->vframe->di_pulldown |= 0x08;
- if (combing_fix_en)
+ if (di_pre_stru.combing_fix_en)
cur_lev = adaptive_combing_fixing(
di_pre_stru.mtn_status,
glb_field_mot_num,
u32 rls_timeout;
u32 afbc_busy;
u32 is_afbc_mode;
+ bool flg_1080i = false;
if (di_blocking || !atomic_read(&de_devp->mem_flag))
return 0;
} else {
/*********************************/
if ((di_buf->vframe->width >= 1920) &&
- (di_buf->vframe->height >= 1080) &&
- is_meson_tl1_cpu()) {
- if (combing_fix_en) {
- combing_fix_en = false;
- fix_tl1_1080i_sawtooth_patch();
- }
- } else
- combing_fix_en = true;
+ (di_buf->vframe->height >= 1080))
+ flg_1080i = true;
/*********************************/
if (
recovery_flag++;
return 0;
}
+ if (is_meson_tl1_cpu() &&
+ combing_fix_en &&
+ flg_1080i) {
+ di_pre_stru.combing_fix_en = false;
+ fix_tl1_1080i_sawtooth_patch();
+ } else {
+ di_pre_stru.combing_fix_en = combing_fix_en;
+ }
+
+ if (di_pre_stru.combing_fix_en) {
+ if (flg_1080i)
+ com_patch_pre_sw_set(1);
+ else
+ com_patch_pre_sw_set(0);
+ }
return 1;
}
bool retry_en;
unsigned int retry_index;
unsigned int retry_cnt;
+ /*****************/
+ bool combing_fix_en;
};
struct di_post_stru_s {
di_pre_stru_p->bypass_pre ? "true" : "false");
seq_printf(seq, "%-25s = %s\n", "invert_flag",
di_pre_stru_p->invert_flag ? "true" : "false");
+ seq_printf(seq, "%-25s = %s\n", "combing_fix_en",
+ di_pre_stru_p->combing_fix_en ? "true" : "false");
return 0;
}
};
static unsigned int combing_bias_motion_setting[MAX_NUM_DI_REG] = {
- 0x00202015,
- 0x1A1A3A62,
- 0x15200101,
- 0x01200440,
- 0x74200D0D,
- 0x0D5A1520,
- 0x0A0A0201,
- 0x1A1A2662,
- 0x0D200302,
- 0x02020606,
- 0x05080344,
- 0x40020a04,
+ 0x00202015, /* 0 */
+ 0x1A1A3A62, /* 1 */
+ 0x15200101, /* 2 */
+ 0x01200440, /* 3 */
+ 0x74200D0D, /* 4 */
+ 0x0D5A1520, /* 5 */
+ 0x0A0A0201, /* 6 */
+ 0x1A1A2662, /* 7 */
+ 0x0D200302, /* 8 */
+ 0x02020606, /* 9 */
+ 0x05080344, /* 10 */
+ 0x40020a04, /* 11 */
/*idea from mingliang.dong & vlsi zheng.bao begin*/
0x0001FF12, /* 0x0001ff0c */
0x00200204, /* 0x00400204 */
};
static unsigned int combing_very_motion_setting[MAX_NUM_DI_REG] = {
- 0x00202015,
- 0x1A1A3A62,
- 0x15200101,
- 0x01200440,
- 0x74200D0D,
- 0x0D5A1520,
- 0x0A0A0201,
- 0x1A1A2662,
- 0x0D200302,
- 0x02020606,
- 0x05080344,
+ 0x00202015, /* 0 */
+ 0x1A1A3A62, /* 1 */
+ 0x15200101, /* 2 */
+ 0x01200440, /* 3 */
+ 0x74200D0D, /* 4 */
+ 0x0D5A1520, /* 5 */
+ 0x0A0A0201, /* 6 */
+ 0x1A1A2662, /* 7 */
+ 0x0D200302, /* 8 */
+ 0x02020606, /* 9 */
+ 0x05080344, /* 10 */
/*idea from mingliang.dong & vlsi zheng.bao begin*/
0x60000404, /* 0x40020a04*/
0x0001FF12, /* 0x0001ff0c */
/*idea from mingliang.dong & vlsi zheng.bao end*/
0x00000131
};
+
+/**************************************************
+ *
+ **************************************************/
+static const unsigned int combing_bias_p_1080i[] = {
+ /**/
+ 0x40020a04, /* 11 */
+ /*idea from mingliang.dong & vlsi zheng.bao begin*/
+ 0x0001ff0c,
+ 0x00400204,
+ 0x00016404,
+};
+
+static const unsigned int combing_bias_p_ori[] = {
+ /**/
+ 0x40020a04, /* 11 */
+ /*idea from mingliang.dong & vlsi zheng.bao begin*/
+ 0x0001FF12, /* 0x0001ff0c */
+ 0x00200204, /* 0x00400204 */
+ 0x00012002, /* 0x00016404 */
+};
+
+static const unsigned int combing_very_p_1080i[] = {
+ /*idea from mingliang.dong & vlsi zheng.bao begin*/
+ 0x40020a04,
+ 0x0001ff0c,
+ 0x00400204,
+ 0x00016404,
+ /*idea from mingliang.dong & vlsi zheng.bao end*/
+
+};
+
+static const unsigned int combing_very_p_ori[] = {
+ /*idea from mingliang.dong & vlsi zheng.bao begin*/
+ 0x60000404, /* 0x40020a04*/
+ 0x0001FF12, /* 0x0001ff0c */
+ 0x00200204, /* 0x00400204 */
+ 0x00012002, /* 0x00016404 */
+ /*idea from mingliang.dong & vlsi zheng.bao end*/
+};
+
+static unsigned int di_mtn_p_mode;
+
+void com_patch_pre_sw_set(unsigned int mode)
+{
+ unsigned int *p1, *p2;
+ /*mode is 0: ori*/
+ /*mode is 1: 1080i*/
+ if (mode == di_mtn_p_mode)
+ return;
+
+ p1 = &combing_bias_motion_setting[11];
+ p2 = &combing_very_motion_setting[11];
+ if (mode == 0) {
+ memcpy(p1, &combing_bias_p_ori[0],
+ sizeof(combing_bias_p_ori));
+ memcpy(p2, &combing_very_p_ori[0],
+ sizeof(combing_very_p_ori));
+ di_mtn_p_mode = 0;
+ } else if (mode == 1) {
+ memcpy(p1, &combing_bias_p_1080i[0],
+ sizeof(combing_bias_p_1080i));
+ memcpy(p2, &combing_very_p_1080i[0],
+ sizeof(combing_very_p_1080i));
+ di_mtn_p_mode = 1;
+ }
+}
+
/*special for resolution test file*/
static unsigned int combing_resolution_setting[MAX_NUM_DI_REG] = {
0x00202015,
if (is_meson_tl1_cpu() || is_meson_tm2_cpu()) {/*from VLSI yanling.liu*/
combing_glbmot_radprat[0] = 30;
}
+ di_mtn_p_mode = 0;
}
void adpative_combing_exit(void)
{
.fix_tl1_1080i_sawtooth_patch = fix_tl1_1080i_sawtooth_patch,
.adaptive_combing_fixing = adaptive_combing_fixing,
.adpative_combing_config = adpative_combing_config,
+ .com_patch_pre_sw_set = com_patch_pre_sw_set,
/*.module_para = dim_seq_file_module_para_mtn,*/
};
int bit_mode);
void adpative_combing_exit(void);
extern void mtn_int_combing_glbmot(void);
+void com_patch_pre_sw_set(unsigned int mode);
#endif
enum vframe_source_type_e src_type,
bool prog,
enum tvin_sig_fmt_e fmt);
+ void (*com_patch_pre_sw_set)(unsigned int mode);
int (*module_para)(struct seq_file *seq);
};
overturn,
ppre->di_inp_buf->vframe);
/*if (combing_fix_en)*/
- if (dimp_get(eDI_MP_combing_fix_en)) {
+ /*if (dimp_get(eDI_MP_combing_fix_en)) {*/
+ if (ppre->combing_fix_en) {
tmp_cur_lev /*cur_lev*/
= get_ops_mtn()->adaptive_combing_fixing(
ppre->mtn_status,
struct di_post_stru_s *ppost = get_post_stru(channel);
struct di_dev_s *de_devp = get_dim_de_devp();
int cfg_prog_proc = dimp_get(eDI_MP_prog_proc_config);
+ bool flg_1080i = false;
if (di_blocking || !dip_cma_st_is_ready(channel))
return 0;
}
} else {
/*********************************/
- if ((di_buf->vframe->width >= 1920) &&
- (di_buf->vframe->height >= 1080) &&
- is_meson_tl1_cpu()) {
- /*if (combing_fix_en) {*/
- if (dimp_get(eDI_MP_combing_fix_en)) {
- /*combing_fix_en = false;*/
- dimp_set(eDI_MP_combing_fix_en, 0);
- get_ops_mtn()->fix_tl1_1080i_sawtooth_patch();
- }
- } else {
- /*combing_fix_en = true;*/
- dimp_set(eDI_MP_combing_fix_en, 1);
- }
-
+ if ((di_buf->vframe->width >= 1920) &&
+ (di_buf->vframe->height >= 1080))
+ flg_1080i = true;
/*********************************/
+
if (!ppre->di_chan2_buf_dup_p) {
ppre->field_count_for_cont = 0;
/* ignore contp2rd and contprd */
recovery_flag++;
return 0;
}
+ if (is_meson_tl1_cpu() &&
+ di_mpr(combing_fix_en) &&
+ flg_1080i) {
+ ppre->combing_fix_en = false;
+ get_ops_mtn()->fix_tl1_1080i_sawtooth_patch();
+ } else {
+ ppre->combing_fix_en = di_mpr(combing_fix_en);
+ }
+
+ if (ppre->combing_fix_en) {
+ if (flg_1080i)
+ get_ops_mtn()->com_patch_pre_sw_set(1);
+ else
+ get_ops_mtn()->com_patch_pre_sw_set(0);
+ }
return 1;
}
unsigned long irq_time[2];
/* combing adaptive */
struct combing_status_s *mtn_status;
+ bool combing_fix_en;
};
struct di_post_stru_s {
eDI_MP_SUB_DI_B,
eDI_MP_force_prog, /*force_prog bool*/
- eDI_MP_combing_fix_en, /*combing_fix_en bool*/
+ edi_mp_combing_fix_en, /*combing_fix_en bool*/
eDI_MP_cur_lev, /*cur_lev*/
eDI_MP_pps_dstw, /*pps_dstw*/
eDI_MP_pps_dsth, /*pps_dsth*/
return get_datal()->mp_uit[idx];
}
+#define di_mpr(x) dimp_get(edi_mp_##x)
+
/******************************************
* mm
*****************************************/
eDI_MP_SUB_DI_B, 0},
[eDI_MP_force_prog] = {"bool:force_prog:1",
eDI_MP_force_prog, 1},
- [eDI_MP_combing_fix_en] = {"bool:combing_fix_en,def:1",
- eDI_MP_combing_fix_en, 1},
+ [edi_mp_combing_fix_en] = {"bool:combing_fix_en,def:1",
+ edi_mp_combing_fix_en, 1},
[eDI_MP_cur_lev] = {"int cur_lev,def:2",
eDI_MP_cur_lev, 2},
[eDI_MP_pps_dstw] = {"pps_dstw:int",