static dev_t di_devno;
static struct class *di_clsp;
-static const char version_s[] = "2018-02-11a";
+static const char version_s[] = "2018-07-17a";
static int bypass_state = 1;
static int bypass_all;
if (di_sema_init_flag == 0)
return;
- if (idx != 'p')
- log_buffer_state((idx == 'i') ? "irq" : ((idx == 'p') ?
- "put" : ((idx == 'r') ? "rdy" : "oth")));
+ log_buffer_state((idx == 'i') ? "irq" : ((idx == 'p') ?
+ "put" : ((idx == 'r') ? "rdy" : "oth")));
/* tasklet_hi_schedule(&di_pre_tasklet); */
tasklet_schedule(&di_pre_tasklet);
struct vframe_s *post_vf = NULL;
char *buf_orig, *ps, *token;
char *parm[3] = { NULL };
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
struct file *filp = NULL;
loff_t pos = 0;
void *buff = NULL;
mm_segment_t old_fs;
- if (!buf)
- return len;
buf_orig = kstrdup(buf, GFP_KERNEL);
ps = buf_orig;
strcat(delim1, delim2);
buff = (void *)phys_to_virt(dump_adr);
else
buff = ioremap(dump_adr, nr_size);
- if (buff == NULL)
+ if (IS_ERR_OR_NULL(buff))
pr_err("%s: ioremap error.\n", __func__);
vfs_write(filp, buff, nr_size, &pos);
/* pr_dbg("di_chan2_buf_dup_p:\n nr:%u,mtn:%u,cnt:%u\n",
pr_info("%s: RECEIVER_FORCE_UNREG return\n",
__func__);
return 0;
- di_pre_stru.force_unreg_req_flag = 1;
-
- trigger_pre_di_process(TRIGGER_PRE_BY_FORCE_UNREG);
- di_pre_stru.unreg_req_flag_cnt = 0;
- while (di_pre_stru.force_unreg_req_flag) {
- usleep_range(1000, 1001);
- di_pr_info("%s:unreg_req_flag_cnt:%d!!!\n",
- __func__, di_pre_stru.unreg_req_flag_cnt);
- if (di_pre_stru.unreg_req_flag_cnt++ >
- di_reg_unreg_cnt) {
- di_pre_stru.unreg_req_flag_cnt = 0;
- di_pr_info("%s:unreg_reg_flag timeout!!!\n",
- __func__);
- break;
- }
- }
}
return 0;
}
pr_err("[DI] set pq parm errors\n");
return -EFAULT;
}
+ if (tmp_pq_s.table_len >= TABLE_LEN_MAX) {
+ pr_err("[DI] load 0x%x wrong pq table_len.\n",
+ tmp_pq_s.table_len);
+ return -EFAULT;
+ }
tab_flag = TABLE_NAME_DI | TABLE_NAME_NR | TABLE_NAME_MCDI |
TABLE_NAME_DEBLOCK | TABLE_NAME_DEMOSQUITO;
if (tmp_pq_s.table_name & tab_flag) {
#define ZOOM_BITS 20
#define PHASE_BITS 16
+static enum f2v_vphase_type_e top_conv_type = F2V_P2P;
+static enum f2v_vphase_type_e bot_conv_type = F2V_P2P;
+static unsigned int prehsc_en;
+static unsigned int prevsc_en;
+
static const unsigned char f2v_420_in_pos_luma[F2V_TYPE_MAX] = {
0, 2, 0, 2, 0, 0, 0, 2, 0};
//static const unsigned char f2v_420_in_pos_chroma[F2V_TYPE_MAX] = {
/*
* patch 1: inp scaler 0: di wr scaler
*/
+
void di_pps_config(unsigned char path, int src_w, int src_h,
int dst_w, int dst_h)
{
- enum f2v_vphase_type_e top_conv_type = F2V_P2P;
- enum f2v_vphase_type_e bot_conv_type = F2V_P2P;
struct pps_f2v_vphase_s vphase;
int i;
int hsc_en = 0, vsc_en = 0;
- int prehsc_en = 0, prevsc_en = 0;
int vsc_double_line_mode;
unsigned int p_src_w, p_src_h;
unsigned int vert_phase_step, horz_phase_step;
static void parse_cmd_params(char *buf_orig, char **parm)
{
char *ps, *token;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
unsigned int n = 0;
return len;
}
-static nr4_param_t nr4_params[30];
+static nr4_param_t nr4_params[NR4_PARAMS_NUM];
static void nr4_params_init(struct NR4_PARM_s *nr4_parm_p)
{
nr4_params[0].name = "prm_nr4_srch_stp";
nr4_params[5].addr = &(nr4_parm_p->sw_nr4_scene_change_flg[1]);
nr4_params[6].name = "sw_nr4_scene_change_flg[2]";
nr4_params[6].addr = &(nr4_parm_p->sw_nr4_scene_change_flg[2]);
- nr4_params[7].name = "sw_nr4_scene_change_flg[3]";
- nr4_params[7].addr = &(nr4_parm_p->sw_nr4_scene_change_flg[3]);
- nr4_params[8].name = "sw_nr4_sad2gain_en";
- nr4_params[8].addr = &(nr4_parm_p->sw_nr4_sad2gain_en);
- nr4_params[9].name = "sw_nr4_sad2gain_lut[0]";
- nr4_params[9].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[0]);
- nr4_params[10].name = "sw_nr4_sad2gain_lut[1]";
- nr4_params[10].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[1]);
- nr4_params[11].name = "sw_nr4_sad2gain_lut[2]";
- nr4_params[11].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[2]);
- nr4_params[12].name = "sw_nr4_sad2gain_lut[3]";
- nr4_params[12].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[3]);
- nr4_params[13].name = "sw_nr4_sad2gain_lut[4]";
- nr4_params[13].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[4]);
- nr4_params[14].name = "sw_nr4_sad2gain_lut[5]";
- nr4_params[14].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[5]);
- nr4_params[15].name = "sw_nr4_sad2gain_lut[6]";
- nr4_params[15].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[6]);
- nr4_params[16].name = "sw_nr4_sad2gain_lut[7]";
- nr4_params[16].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[7]);
- nr4_params[17].name = "sw_nr4_sad2gain_lut[8]";
- nr4_params[17].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[8]);
- nr4_params[18].name = "sw_nr4_sad2gain_lut[9]";
- nr4_params[18].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[9]);
- nr4_params[19].name = "sw_nr4_sad2gain_lut[10]";
- nr4_params[19].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[10]);
- nr4_params[20].name = "sw_nr4_sad2gain_lut11]";
- nr4_params[20].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[11]);
- nr4_params[21].name = "sw_nr4_sad2gain_lut[12]";
- nr4_params[21].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[12]);
- nr4_params[22].name = "sw_nr4_sad2gain_lut13]";
- nr4_params[22].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[13]);
- nr4_params[23].name = "sw_nr4_sad2gain_lut[14]";
- nr4_params[23].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[14]);
- nr4_params[24].name = "sw_nr4_sad2gain_lut[15]";
- nr4_params[24].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[15]);
- nr4_params[25].name = "nr4_debug";
- nr4_params[25].addr = &(nr4_parm_p->nr4_debug);
+ nr4_params[7].name = "sw_nr4_sad2gain_en";
+ nr4_params[7].addr = &(nr4_parm_p->sw_nr4_sad2gain_en);
+ nr4_params[8].name = "sw_nr4_sad2gain_lut[0]";
+ nr4_params[8].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[0]);
+ nr4_params[9].name = "sw_nr4_sad2gain_lut[1]";
+ nr4_params[9].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[1]);
+ nr4_params[10].name = "sw_nr4_sad2gain_lut[2]";
+ nr4_params[10].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[2]);
+ nr4_params[11].name = "sw_nr4_sad2gain_lut[3]";
+ nr4_params[11].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[3]);
+ nr4_params[12].name = "sw_nr4_sad2gain_lut[4]";
+ nr4_params[12].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[4]);
+ nr4_params[13].name = "sw_nr4_sad2gain_lut[5]";
+ nr4_params[13].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[5]);
+ nr4_params[14].name = "sw_nr4_sad2gain_lut[6]";
+ nr4_params[14].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[6]);
+ nr4_params[15].name = "sw_nr4_sad2gain_lut[7]";
+ nr4_params[15].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[7]);
+ nr4_params[16].name = "sw_nr4_sad2gain_lut[8]";
+ nr4_params[16].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[8]);
+ nr4_params[17].name = "sw_nr4_sad2gain_lut[9]";
+ nr4_params[17].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[9]);
+ nr4_params[18].name = "sw_nr4_sad2gain_lut[10]";
+ nr4_params[18].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[10]);
+ nr4_params[19].name = "sw_nr4_sad2gain_lut11]";
+ nr4_params[19].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[11]);
+ nr4_params[20].name = "sw_nr4_sad2gain_lut[12]";
+ nr4_params[20].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[12]);
+ nr4_params[21].name = "sw_nr4_sad2gain_lut13]";
+ nr4_params[21].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[13]);
+ nr4_params[22].name = "sw_nr4_sad2gain_lut[14]";
+ nr4_params[22].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[14]);
+ nr4_params[23].name = "sw_nr4_sad2gain_lut[15]";
+ nr4_params[23].addr = &(nr4_parm_p->sw_nr4_sad2gain_lut[15]);
+ nr4_params[24].name = "nr4_debug";
+ nr4_params[24].addr = &(nr4_parm_p->nr4_debug);
};
buf_orig = kstrdup(buff, GFP_KERNEL);
parse_cmd_params(buf_orig, (char **)(&parm));
- for (i = 0; i < 30; i++) {
- if (IS_ERR_OR_NULL(nr4_params[i].name))
+ for (i = 0; i < NR4_PARAMS_NUM; i++) {
+ if (IS_ERR_OR_NULL(nr4_params[i].name) ||
+ IS_ERR_OR_NULL(nr4_params[i].addr))
continue;
if (!strcmp(parm[0], nr4_params[i].name)) {
if (parm[1]) {
pr_err("DI: input value error.\n");
*(nr4_params[i].addr) = value;
}
+ pr_info(" %d\n", *(nr4_params[i].addr));
}
}
ssize_t len = 0;
int i = 0;
- for (i = 0; i < 30; i++) {
- if (IS_ERR_OR_NULL(nr4_params[i].name))
+ for (i = 0; i < NR4_PARAMS_NUM; i++) {
+ if (IS_ERR_OR_NULL(nr4_params[i].name) ||
+ IS_ERR_OR_NULL(nr4_params[i].addr))
continue;
len += sprintf(buff+len, "%s=%d.\n",
nr4_params[i].name, *(nr4_params[i].addr));