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_dest_size(unsigned long buf_in) { u32 s_w = 0; u32 s_h = 0; u32 d_w = 0; u32 d_h = 0; bool ipc = false; s5p_img_size *size = (s5p_img_size *)buf_in; s5p_tv_vp_err verr; s5ptv_status.vl_basic_param.dest_width = size->img_width; s5ptv_status.vl_basic_param.dest_height = size->img_height; _s5p_vlayer_calc_inner_values(); s_w = s5ptv_status.vl_src_width; s_h = s5ptv_status.vl_src_height; d_w = s5ptv_status.vl_dest_width; d_h = s5ptv_status.vl_dest_height; ipc = s5ptv_status.vl2d_ipc; if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_src_dest_size(s_w, s_h, d_w, d_h, ipc); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return 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_dest_position(unsigned long buf_in) { u32 d_ox = 0; u32 d_oy = 0; s5p_img_offset *offset = (s5p_img_offset *)buf_in; s5p_tv_vp_err verr; s5ptv_status.vl_basic_param.dest_offset_x = offset->offset_x; s5ptv_status.vl_basic_param.dest_offset_y = offset->offset_y; _s5p_vlayer_calc_inner_values(); d_ox = s5ptv_status.vl_dest_offset_x; d_oy = s5ptv_status.vl_dest_offset_y; if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_dest_position(d_ox, d_oy); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_src_position(unsigned long buf_in) { struct s5p_img_offset *offset = (struct s5p_img_offset *)buf_in; enum s5p_tv_vp_err verr; s5ptv_status.vl_basic_param.src_offset_x = offset->offset_x; s5ptv_status.vl_basic_param.src_offset_y = offset->offset_y; _s5p_vlayer_calc_inner_values(); if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_src_position(s5ptv_status.vl_src_offset_x, s5ptv_status.vl_src_x_fact_step, s5ptv_status.vl_src_offset_y); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_bottom_address(unsigned long buf_in) { u32 t_y_addr = 0; u32 t_c_addr = 0; u32 b_y_addr = 0; u32 b_c_addr = 0; u32 img_width = s5ptv_status.vl_basic_param.img_width; struct s5p_video_img_address *addr = (struct s5p_video_img_address *)buf_in; enum s5p_tv_vp_err verr; enum s5p_vp_src_color s_color = s5ptv_status.src_color; if (s_color == VPROC_SRC_COLOR_NV12IW) { s5ptv_status.vl_basic_param.top_y_address = addr->y_address - img_width; s5ptv_status.vl_basic_param.top_c_address = addr->c_address - img_width; } _s5p_vlayer_calc_inner_values(); t_y_addr = s5ptv_status.vl_top_y_address; t_c_addr = s5ptv_status.vl_top_c_address; b_y_addr = s5ptv_status.vl_bottom_y_address; b_c_addr = s5ptv_status.vl_bottom_c_address; if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_set_bottom_field_address(b_y_addr, b_c_addr); if (verr != VPROC_NO_ERROR) return false; if (s5ptv_status.src_color == VPROC_SRC_COLOR_NV12IW) { verr = __s5p_vp_set_top_field_address(t_y_addr, t_c_addr); if (verr != VPROC_NO_ERROR) return false; } verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_top_address(unsigned long buf_in) { u32 t_y_addr = 0; u32 t_c_addr = 0; u32 b_y_addr = 0; u32 b_c_addr = 0; struct s5p_video_img_address *addr = (struct s5p_video_img_address *)buf_in; enum s5p_tv_vp_err verr; s5ptv_status.vl_basic_param.top_y_address = addr->y_address; s5ptv_status.vl_basic_param.top_c_address = addr->c_address; _s5p_vlayer_calc_inner_values(); t_y_addr = s5ptv_status.vl_top_y_address; t_c_addr = s5ptv_status.vl_top_c_address; b_y_addr = s5ptv_status.vl_bottom_y_address; b_c_addr = s5ptv_status.vl_bottom_c_address; if (_s5p_vlayer_wait_previous_update()) return false; verr = __s5p_vp_set_top_field_address(t_y_addr, t_c_addr); if (verr != VPROC_NO_ERROR) return false; if (check_input_mode(s5ptv_status.src_color) == INTERLACED) { __s5p_vp_set_field_id(s5ptv_status.field_id); verr = __s5p_vp_set_bottom_field_address(b_y_addr, b_c_addr); if (verr != VPROC_NO_ERROR) return false; } verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_contrast(unsigned long buf_in) { s5p_tv_vp_err verr; s5ptv_status.vl_contrast = (unsigned char)buf_in; if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_contrast(s5ptv_status.vl_contrast); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_field_id(unsigned long buf_in) { s5p_tv_vp_err verr; s5ptv_status.field_id = (s5p_vp_field)(buf_in); if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_field_id(s5ptv_status.field_id); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) return false; return true; }
bool _s5p_vlayer_set_brightness(unsigned long buf_in) { s5p_tv_vp_err verr; s5ptv_status.us_vl_brightness = (unsigned short)buf_in; if (_s5p_vlayer_wait_previous_update()) return false; __s5p_vp_set_brightness(s5ptv_status.us_vl_brightness); verr = __s5p_vp_update(); if (verr != VPROC_NO_ERROR) 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; }