Beispiel #1
0
static void _s5p_vlayer_calc_inner_values(void)
{
	s5p_tv_status *st = &s5ptv_status;
	s5p_vl_param *video = &(s5ptv_status.vl_basic_param);
	u8 o_mode, i_mode;

	u32 t_y_addr = video->top_y_address;
	u32 t_c_addr = video->top_c_address;
	u32 img_w = video->img_width;
	u32 s_ox = video->src_offset_x;
	u32 s_oy = video->src_offset_y;
	u32 d_ox = video->dest_offset_x;
	u32 d_oy = video->dest_offset_y;
	u32 s_w = video->src_width;
	u32 s_h = video->src_height;
	u32 d_w = video->dest_width;
	u32 d_h = video->dest_height;

	i_mode = check_input_mode(st->src_color);
	o_mode = check_output_mode(st->tvout_param.disp_mode,
				st->tvout_param.out_mode);

	st->vl_top_y_address = t_y_addr;
	st->vl_top_c_address = t_c_addr;

	if (st->src_color == VPROC_SRC_COLOR_NV12IW) {
		st->vl_bottom_y_address = t_y_addr + img_w;
		st->vl_bottom_c_address = t_c_addr + img_w;
	} else if (st->src_color == VPROC_SRC_COLOR_TILE_NV12IW) {
		st->vl_bottom_y_address = t_y_addr + 0x40;
		st->vl_bottom_c_address = t_c_addr + 0x40;
	}

	st->vl_src_offset_x = s_ox;
	st->vl_src_offset_y = s_oy;
	st->vl_src_width = s_w;
	st->vl_src_height = s_h;
	st->vl_dest_offset_x = d_ox;
	st->vl_dest_offset_y = d_oy;
	st->vl_dest_width = d_w;
	st->vl_dest_height = d_h;


	if (o_mode == INTERLACED) {
		st->vl_src_height 	= s_h / 2;
		st->vl_src_offset_y 	= s_oy / 2;
		st->vl_dest_height 	= d_h / 2;
		st->vl_dest_offset_y 	= d_oy / 2;
	} else {
		if (i_mode == INTERLACED) {
			st->vl_src_height 	= s_h / 2;
			st->vl_src_offset_y 	= s_oy / 2;
		}
	}
}
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;

	g_s5ptv_status.vl_basic_param.top_y_address = addr->y_address;
	g_s5ptv_status.vl_basic_param.top_c_address = addr->c_address;

	s5p_vlayer_calc_inner_values();

	t_y_addr = g_s5ptv_status.vl_top_y_address;
	t_c_addr = g_s5ptv_status.vl_top_c_address;
	b_y_addr = g_s5ptv_status.vl_bottom_y_address;
	b_c_addr = g_s5ptv_status.vl_bottom_c_address;

	if (s5p_vlayer_wait_previous_update()) {
		pr_err("%s::s5p_vlayer_wait_previous_update() fail\n",
			__func__);
		return false;
	}

	verr = s5p_vp_set_top_field_address(t_y_addr, t_c_addr);
	if (verr != VPROC_NO_ERROR) {
		pr_err("%s::s5p_vp_set_top_field_address() fail\n", __func__);
		return false;
	}

	if (check_input_mode(g_s5ptv_status.src_color) == INTERLACED) {
		s5p_vp_set_field_id(g_s5ptv_status.field_id);
		verr = s5p_vp_set_bottom_field_address(b_y_addr, b_c_addr);
		if (verr != VPROC_NO_ERROR) {
			pr_err("%s::s5p_vp_set_bottom_field_address() 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;
}
Beispiel #3
0
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;
	
	s5p_video_img_address *addr = (s5p_video_img_address*)buf_in;
	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;
}
Beispiel #4
0
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;
}