bool _s5p_vlayer_set_csc_coef(unsigned long buf_in) { s5p_video_csc_coef *coef = (s5p_video_csc_coef *)buf_in; s5p_tv_vp_err verr; if (coef->csc_coeff < VPROC_CSC_Y2Y_COEF || coef->csc_coeff > VPROC_CSC_CR2CR_COEF) { VLAYERPRINTK("(ERR) : invalid csc_coeff(%d)\n\r", coef->csc_coeff); return false; } if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_init_csc_coef(coef->csc_coeff, coef->coeff); if (verr != VPROC_NO_ERROR) return false; verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; s5ptv_status.vl_csc_coef_default = false; return true; }
bool _s5p_vlayer_set_poly_filter_coef(unsigned long buf_in) { s5p_video_poly_filter_coef *coef = (s5p_video_poly_filter_coef *)buf_in; s5p_tv_vp_err verr; if (coef->poly_coeff < VPROC_POLY8_Y0_LL || (coef->poly_coeff > VPROC_POLY8_Y3_HH && coef->poly_coeff < VPROC_POLY4_Y0_LL) || coef->poly_coeff > VPROC_POLY4_C1_HH) { VLAYERPRINTK("(ERR) : invalid poly_coeff(%d)\n\r", coef->poly_coeff); return false; } if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_init_poly_filter_coef(coef->poly_coeff, coef->ch0, coef->ch1, coef->ch2, coef->ch3); if (verr != VPROC_NO_ERROR) return false; verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; s5ptv_status.vl_poly_filter_default = false; return true; }
bool _s5p_vlayer_set_img_size(unsigned long buf_in) { s5p_img_size *size = (s5p_img_size *)buf_in; s5p_tv_vp_err verr; s5ptv_status.vl_basic_param.img_width = size->img_width; s5ptv_status.vl_basic_param.img_height = size->img_height; if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_set_img_size(size->img_width, size->img_height); if (verr != VPROC_NO_ERROR) return false; verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; VLAYERPRINTK("()\n\r"); return true; }
bool s5p_vlayer_set_img_size(unsigned long buf_in) { struct s5p_img_size *size = (struct s5p_img_size *)buf_in; enum s5p_tv_vp_err verr; VLAYERPRINTK("()\n"); g_s5ptv_status.vl_basic_param.img_width = size->img_width; g_s5ptv_status.vl_basic_param.img_height = size->img_height; if (s5p_vlayer_wait_previous_update()) { pr_err("%s::s5p_vlayer_wait_previous_update() fail\n", __func__); return false; } verr = s5p_vp_set_img_size(size->img_width, size->img_height); if (verr != VPROC_NO_ERROR) { pr_err("%s::s5p_vp_set_img_size() fail\n", __func__); return false; } verr = s5p_vp_update(); if (verr != VPROC_NO_ERROR) { pr_err("%s::s5p_vp_update() fail\n", __func__); return false; } return true; }
bool _s5p_vlayer_set_brightness_contrast_control(unsigned long buf_in) { u32 intc; u32 slope; enum s5p_vp_line_eq eq_num; enum s5p_tv_vp_err verr; struct s5p_vl_bright_contrast_ctrl *ctrl = (struct s5p_vl_bright_contrast_ctrl *)buf_in; if (ctrl->eq_num > VProc_LINE_EQ_7 || ctrl->eq_num < VProc_LINE_EQ_0) { VLAYERPRINTK("(ERR) : invalid eq_num(%d)\n\r", ctrl->eq_num); return false; } memcpy((void *)&(s5ptv_status.vl_bc_control[ctrl->eq_num]), (const void *)ctrl, sizeof(struct s5p_vl_csc_ctrl)); eq_num = s5ptv_status.vl_bc_control[ctrl->eq_num].eq_num; intc = s5ptv_status.vl_bc_control[ctrl->eq_num].intc; slope = s5ptv_status.vl_bc_control[ctrl->eq_num].slope; if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_set_brightness_contrast_control(eq_num, intc, slope); if (verr != VPROC_NO_ERROR) return false; verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_init_param(unsigned long buf_in) { s5p_tv_status *st = &s5ptv_status; bool i_mode, o_mode; /* 0 for interlaced, 1 for progressive */ switch (st->tvout_param.disp_mode) { case TVOUT_480P_60_16_9: case TVOUT_480P_60_4_3: case TVOUT_576P_50_16_9: case TVOUT_576P_50_4_3: #ifdef CONFIG_CPU_S5PV210 case TVOUT_480P_59: st->vl_csc_type = VPROC_CSC_SD_HD; break; case TVOUT_1080I_50: case TVOUT_1080I_60: case TVOUT_1080P_50: case TVOUT_1080P_30: case TVOUT_1080P_60: case TVOUT_720P_59: case TVOUT_1080I_59: case TVOUT_1080P_59: #endif case TVOUT_720P_50: case TVOUT_720P_60: st->vl_csc_type = VPROC_CSC_HD_SD; break; default: break; } st->vl_csc_control.csc_en = false; i_mode = check_input_mode(st->src_color); o_mode = check_output_mode(st->tvout_param.disp_mode, st->tvout_param.out_mode); /* check o_mode */ if (i_mode == INTERLACED) { /* i to i : line skip 1, ipc 0, auto toggle 0 */ if (o_mode == INTERLACED) { st->vl_op_mode.line_skip = true; st->vl2d_ipc = false; st->vl_op_mode.toggle_id = false; } else { /* i to p : line skip 1, ipc 1, auto toggle 0 */ st->vl_op_mode.line_skip = true; st->vl2d_ipc = true; st->vl_op_mode.toggle_id = false; } } else { /* p to i : line skip 1, ipc 0, auto toggle 0 */ if (o_mode == INTERLACED) { st->vl_op_mode.line_skip = true; st->vl2d_ipc = false; st->vl_op_mode.toggle_id = false; } else { /* p to p : line skip 0, ipc 0, auto toggle 0 */ st->vl_op_mode.line_skip = false; st->vl2d_ipc = false; st->vl_op_mode.toggle_id = false; } } st->vl_op_mode.mem_mode = ((st->src_color == VPROC_SRC_COLOR_NV12) || st->src_color == VPROC_SRC_COLOR_NV12IW) ? VPROC_LINEAR_MODE : VPROC_2D_TILE_MODE; /* st->vl_op_mode.chroma_exp = (pro) ? VPROC_USING_C_TOP : VPROC_USING_C_TOP_BOTTOM; */ st->vl_op_mode.chroma_exp = 0; /* use only top y addr */ _s5p_vlayer_calc_inner_values(); if (st->vl_mode) { VLAYERPRINTK("(ERR) : Default values are already updated\n\r"); return true; } /* Initialize Video Layer Parameters to Default Values */ st->vl_src_x_fact_step = 0; st->field_id = VPROC_TOP_FIELD; st->vl_rate = VPROC_PIXEL_PER_RATE_1_1; st->vl_poly_filter_default = true; st->vl_bypass_post_process = false; st->vl_saturation = 0x80; st->vl_sharpness.th_noise = 0; st->vl_sharpness.sharpness = VPROC_SHARPNESS_NO; st->us_vl_brightness = 0x00; st->vl_contrast = 0x80; st->vl_bright_offset = 0x00; st->vl_csc_control.sub_y_offset_en = false; st->vl_csc_coef_default = true; st->vl_bc_control[0].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[1].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[2].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[3].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[4].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[5].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[6].eq_num = VProc_LINE_EQ_7 + 1; st->vl_bc_control[7].eq_num = VProc_LINE_EQ_7 + 1; st->vl_mode = true; return true; }