Example #1
0
int s5p_mixer_set_grp_layer_src_pos(enum s5p_mixer_layer layer,
				    u32 src_offs_x, u32 src_offs_y, u32 span,
				    u32 width, u32 height)
{
	tvout_dbg("%d, %d, %d, %d, %d, %d\n", layer, span, width, height, \
							src_offs_x, src_offs_y);

	switch (layer) {
	case MIXER_GPR0_LAYER:
		writel(S5P_MXR_GRP_SPAN(span),
			mixer_base + S5P_MXR_GRAPHIC0_SPAN);
		writel(S5P_MXR_GRP_WIDTH(width) | S5P_MXR_GRP_HEIGHT(height),
		       mixer_base + S5P_MXR_GRAPHIC0_WH);
		writel(S5P_MXR_GRP_STARTX(src_offs_x) |
			S5P_MXR_GRP_STARTY(src_offs_y),
		       mixer_base + S5P_MXR_GRAPHIC0_SXY);
		break;

	case MIXER_GPR1_LAYER:
		writel(S5P_MXR_GRP_SPAN(span),
			mixer_base + S5P_MXR_GRAPHIC1_SPAN);
		writel(S5P_MXR_GRP_WIDTH(width) | S5P_MXR_GRP_HEIGHT(height),
		       mixer_base + S5P_MXR_GRAPHIC1_WH);
		writel(S5P_MXR_GRP_STARTX(src_offs_x) |
			S5P_MXR_GRP_STARTY(src_offs_y),
		       mixer_base + S5P_MXR_GRAPHIC1_SXY);
		break;

	default:
		tvout_err(" invalid layer parameter = %d\n", layer);
		return -1;
	}

	return 0;
}
enum s5p_tv_vmx_err __s5p_vm_set_grp_layer_size(enum s5p_tv_vmx_layer layer,
					u32 span,
					u32 width,
					u32 height,
					u32 src_offs_x,
					u32 src_offs_y)
{
	VMPRINTK("%d, %d, %d, %d, %d, %d)\n\r", layer, span, width, height,
		 src_offs_x, src_offs_y);

	switch (layer) {

	case VM_GPR0_LAYER:
		writel(S5P_MXR_GRP_SPAN(span),
			mixer_base + S5P_MXR_GRAPHIC0_SPAN);
		writel(S5P_MXR_GRP_WIDTH(width) | S5P_MXR_GRP_HEIGHT(height),
		       mixer_base + S5P_MXR_GRAPHIC0_WH);
		writel(S5P_MXR_GRP_STARTX(src_offs_x) |
			S5P_MXR_GRP_STARTY(src_offs_y),
		       mixer_base + S5P_MXR_GRAPHIC0_SXY);
		VMPRINTK("0x%x, 0x%x, 0x%x\n\r",
			readl(mixer_base + S5P_MXR_GRAPHIC0_SPAN),
			readl(mixer_base + S5P_MXR_GRAPHIC0_WH),
			readl(mixer_base + S5P_MXR_GRAPHIC0_SXY));
		break;

	case VM_GPR1_LAYER:
		writel(S5P_MXR_GRP_SPAN(span),
			mixer_base + S5P_MXR_GRAPHIC1_SPAN);
		writel(S5P_MXR_GRP_WIDTH(width) | S5P_MXR_GRP_HEIGHT(height),
		       mixer_base + S5P_MXR_GRAPHIC1_WH);
		writel(S5P_MXR_GRP_STARTX(src_offs_x) |
			S5P_MXR_GRP_STARTY(src_offs_y),
		       mixer_base + S5P_MXR_GRAPHIC1_SXY);
		VMPRINTK("0x%x, 0x%x, 0x%x\n\r",
			readl(mixer_base + S5P_MXR_GRAPHIC1_SPAN),
			readl(mixer_base + S5P_MXR_GRAPHIC1_WH),
			readl(mixer_base + S5P_MXR_GRAPHIC1_SXY));
		break;

	default:
		VMPRINTK(" invalid layer parameter = %d\n\r", layer);
		return S5P_TV_VMX_ERR_INVALID_PARAM;
		break;
	}

	return VMIXER_NO_ERROR;
}