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;
}
enum s5p_tv_vp_err s5p_vp_init_layer(
	u32 top_y_addr,
	u32 top_c_addr,
	u32 bottom_y_addr,
	u32 bottom_c_addr,
	enum s5p_endian_type src_img_endian,
	u32 img_width,
	u32 img_height,
	u32 src_off_x,
	u32 src_x_fract_step,
	u32 src_off_y,
	u32 src_width,
	u32 src_height,
	u32 dst_off_x,
	u32 dst_off_y,
	u32 dst_width,
	u32 dst_height,
	bool ipc_2d)
{
	enum s5p_tv_vp_err ret = VPROC_NO_ERROR;

	VPPRINTK("src_img_endian(%d)\n", src_img_endian);

	writel(1, g_vp_base + S5P_VP_ENDIAN_MODE);

	ret = s5p_vp_set_top_field_address(top_y_addr, top_c_addr);
	if (ret != VPROC_NO_ERROR) {
		pr_err("s5p_vp_set_top_field_address(%d, %d) fail\n",
			top_y_addr, top_c_addr);
		return ret;
	}

	ret = s5p_vp_set_bottom_field_address(bottom_y_addr, bottom_c_addr);
	if (ret != VPROC_NO_ERROR) {
		pr_err("s5p_vp_set_bottom_field_address(%d, %d) fail\n",
			bottom_y_addr, bottom_c_addr);
		return ret;
	}

	ret = s5p_vp_set_img_size(img_width, img_height);
	if (ret != VPROC_NO_ERROR) {
		pr_err("s5p_vp_set_img_size(%d, %d) fail\n",
			img_width, img_height);
		return ret;
	}

	s5p_vp_set_src_position(src_off_x, src_x_fract_step, src_off_y);
	s5p_vp_set_dest_position(dst_off_x, dst_off_y);
	s5p_vp_set_src_dest_size(src_width, src_height, dst_width,
				dst_height, ipc_2d);

	VPPRINTK("S5P_VP_ENDIAN_MODE(0x%08x)\n", readl(g_vp_base + S5P_VP_ENDIAN_MODE));

	return ret;
}
Exemplo n.º 3
0
int s5p_vp_init_layer(u32 top_y_addr,
			u32 top_c_addr,
			u32 bottom_y_addr,
			u32 bottom_c_addr,
			enum s5p_tv_endian src_img_endian,
			u32 img_width,
			u32 img_height,
			u32 src_off_x,
			u32 src_x_fract_step,
			u32 src_off_y,
			u32 src_width,
			u32 src_height,
			u32 dst_off_x,
			u32 dst_off_y,
			u32 dst_width,
			u32 dst_height,
			bool ipc_2d)
{
	int error = 0;

	VPPRINTK("%d\n\r", src_img_endian);

	writel(1, vp_base + S5P_VP_ENDIAN_MODE);

	error = s5p_vp_set_top_field_address(top_y_addr, top_c_addr);

	if (error != 0)
		return error;

	error = s5p_vp_set_bottom_field_address(bottom_y_addr,
		bottom_c_addr);

	if (error != 0)
		return error;

	error = s5p_vp_set_img_size(img_width, img_height);

	if (error != 0)
		return error;

	s5p_vp_set_src_position(src_off_x, src_x_fract_step, src_off_y);

	s5p_vp_set_dest_position(dst_off_x, dst_off_y);

	s5p_vp_set_src_dest_size(src_width, src_height, dst_width,
		dst_height, ipc_2d);

	return error;
}