} else
val1 = 64;
DI_Wr_reg_bits(NR4_MCNR_MV_CTRL_REG, val1, 4, 8);
+ /*add for TL1------*/
+ if (nr4_param_p->sw_nr4_noise_ctrl_dm_en == 1) {
+ if (nr4_param_p->sw_nr4_noise_sel == 0) {
+ val2 = val1 >= nr4_param_p->sw_nr4_noise_thd ? 1 : 0;
+ } else {
+ val2 =
+ field_sad >= nr4_param_p->sw_nr4_noise_thd ? 1 : 0;
+ }
+
+ DI_Wr_reg_bits(DNR_DM_NR_BLND, val2, 24, 1);
+ }
+ /*------------------*/
/* scene change processing */
nr4_param_p->sw_nr4_scene_change_flg[0] =
nr4_param_p->sw_nr4_scene_change_flg[1];
DI_Wr_reg_bits(NR4_TOP_CTRL, 1, 0, 1);
else
DI_Wr_reg_bits(NR4_TOP_CTRL, 0, 0, 1);
+
+ /*fot TL1 **************/
+ if (nr4_param_p->sw_dm_scene_change_en == 1) {
+ val = field_sad >= nr4_param_p->sw_nr4_scene_change_thd2
+ && nr4_param_p->sw_nr4_field_sad[1]
+ >= nr4_param_p->sw_nr4_scene_change_thd2;
+
+ DI_Wr_reg_bits(DNR_DM_CTRL, val, 12, 1);
+ }
+ /***********************/
nr4_param_p->sw_nr4_field_sad[0] = nr4_param_p->sw_nr4_field_sad[1];
nr4_param_p->sw_nr4_field_sad[1] = field_sad;
}
#ifdef DNR_HV_SHIFT
int ro_hbof_stat_cnt[32], ro_vbof_stat_cnt[32], i = 0;
#endif
+ int ll, lr;
+
+ if (is_meson_tl1_cpu()) {
+ ll = Rd(DNR_RO_GBS_STAT_LR);
+ lr = Rd(DNR_RO_GBS_STAT_LL);
+ } else {
+ ll = Rd(DNR_RO_GBS_STAT_LL);
+ lr = Rd(DNR_RO_GBS_STAT_LR);
- if (ro_gbs_stat_lr != Rd(DNR_RO_GBS_STAT_LR) ||
- ro_gbs_stat_ll != Rd(DNR_RO_GBS_STAT_LL) ||
+ }
+ if (ro_gbs_stat_lr != lr ||
+ ro_gbs_stat_ll != ll ||
ro_gbs_stat_rr != Rd(DNR_RO_GBS_STAT_RR) ||
ro_gbs_stat_dif != Rd(DNR_RO_GBS_STAT_DIF) ||
ro_gbs_stat_cnt != Rd(DNR_RO_GBS_STAT_CNT)) {
- ro_gbs_stat_lr = Rd(DNR_RO_GBS_STAT_LR);
- ro_gbs_stat_ll = Rd(DNR_RO_GBS_STAT_LL);
+ ro_gbs_stat_lr = lr;
+ ro_gbs_stat_ll = ll;
ro_gbs_stat_rr = Rd(DNR_RO_GBS_STAT_RR);
ro_gbs_stat_dif = Rd(DNR_RO_GBS_STAT_DIF);
ro_gbs_stat_cnt = Rd(DNR_RO_GBS_STAT_CNT);
if (nr_param.frame_count == 5)
Wr_reg_bits(NR2_CUE_MODE, 7, 0, 4);
}
-
+void cue_int(void)
+{
+ if (cpu_after_eq(MESON_CPU_MAJOR_ID_G12A)) {
+ if (cue_en)
+ Wr_reg_bits(NR2_CUE_MODE, 3, 10, 2);
+ }
+}
static bool glb_fieldck_en = true;
module_param_named(glb_fieldck_en, glb_fieldck_en, bool, 0644);
nr4_params[24].name = "nr4_debug";
nr4_params[24].addr = &(nr4_parm_p->nr4_debug);
+ nr4_params[25].name = "sw_nr4_noise_thd";
+ nr4_params[25].addr = &(nr4_parm_p->sw_nr4_noise_thd);
+ nr4_params[26].name = "sw_nr4_noise_sel";
+ nr4_params[26].addr = &(nr4_parm_p->sw_nr4_noise_sel);
+ nr4_params[27].name = "sw_nr4_noise_ctrl_dm_en";
+ nr4_params[27].addr = &(nr4_parm_p->sw_nr4_noise_ctrl_dm_en);
+ nr4_params[28].name = "sw_nr4_scene_change_thd2";
+ nr4_params[28].addr = &(nr4_parm_p->sw_nr4_scene_change_thd2);
+ nr4_params[29].name = "sw_dm_scene_change_en";
+ nr4_params[29].addr = &(nr4_parm_p->sw_dm_scene_change_en);
+
};
static ssize_t nr4_param_store(struct device *dev,
nr4_parm_p->sw_nr4_sad2gain_lut[13] = 16;
nr4_parm_p->sw_nr4_sad2gain_lut[14] = 14;
nr4_parm_p->sw_nr4_sad2gain_lut[15] = 9;
+
+ if (is_meson_tl1_cpu()) {
+ nr4_parm_p->sw_nr4_noise_thd = 32;
+ nr4_parm_p->sw_nr4_noise_sel = 0;
+ nr4_parm_p->sw_nr4_noise_ctrl_dm_en = 0;
+ nr4_parm_p->sw_nr4_scene_change_thd2 = 80;
+ nr4_parm_p->sw_dm_scene_change_en = 0;
+ } else {
+ nr4_parm_p->sw_nr4_noise_thd = 32;
+ nr4_parm_p->sw_nr4_noise_sel = 0;
+ nr4_parm_p->sw_nr4_noise_ctrl_dm_en = 0;
+ nr4_parm_p->sw_nr4_scene_change_thd2 = 80;
+ nr4_parm_p->sw_dm_scene_change_en = 0;
+ }
}
static void cue_param_init(struct CUE_PARM_s *cue_parm_p)
int *addr;
};
-#define NR4_PARAMS_NUM 25
+#define NR4_PARAMS_NUM (30) //25
#define dnr_param_t struct nr_param_s
#define nr4_param_t struct nr_param_s
unsigned short width;
unsigned short height;
unsigned short border_offset;
+
+ unsigned int sw_nr4_noise_thd;//u8
+ /*u1, 0: use nr4 global gain, 1: use field sad;*/
+ unsigned int sw_nr4_noise_sel;
+ unsigned int sw_nr4_noise_ctrl_dm_en;//u1
+
+ /*u8, threshold for scene change*/
+ unsigned int sw_nr4_scene_change_thd2;
+ /*u1, enable dm scene change check*/
+ unsigned int sw_dm_scene_change_en;
};
struct CUE_PARM_s {
void nr_all_config(unsigned short nCol, unsigned short nRow,
unsigned short type);
bool set_nr_ctrl_reg_table(unsigned int addr, unsigned int value);
+
+extern void cue_int(void);
+
#endif