コード例 #1
0
/* 3D side by side */
void mdp4_dsi_video_3d_sbys(struct msm_fb_data_type *mfd,
                            struct msmfb_overlay_3d *r3d)
{
    struct fb_info *fbi;
    unsigned int buf_offset;
    int bpp;
    uint8 *buf = NULL;
    int cndx = 0;
    struct vsycn_ctrl *vctrl;
    struct mdp4_overlay_pipe *pipe;

    vctrl = &vsync_ctrl_db[cndx];
    pipe = vctrl->base_pipe;

    if (vctrl->base_pipe == NULL)
        return;

    pipe = vctrl->base_pipe;
    pipe->is_3d = r3d->is_3d;
    pipe->src_height_3d = r3d->height;
    pipe->src_width_3d = r3d->width;

    if (pipe->is_3d)
        mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_SIDE_BY_SIDE);
    else
        mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_NONE);

    fbi = mfd->fbi;

    bpp = fbi->var.bits_per_pixel / 8;
    buf = (uint8 *) fbi->fix.smem_start;
    buf_offset = calc_fb_offset(mfd, fbi, bpp);

    if (pipe->is_3d) {
        pipe->src_height = pipe->src_height_3d;
        pipe->src_width = pipe->src_width_3d;
        pipe->src_h = pipe->src_height_3d;
        pipe->src_w = pipe->src_width_3d;
        pipe->dst_h = pipe->src_height_3d;
        pipe->dst_w = pipe->src_width_3d;
        pipe->srcp0_ystride = msm_fb_line_length(0,
                              pipe->src_width, bpp);
    } else {
        /* 2D */
        pipe->src_height = fbi->var.yres;
        pipe->src_width = fbi->var.xres;
        pipe->src_h = fbi->var.yres;
        pipe->src_w = fbi->var.xres;
        pipe->dst_h = fbi->var.yres;
        pipe->dst_w = fbi->var.xres;
        pipe->srcp0_ystride = fbi->fix.line_length;
    }

    pipe->src_y = 0;
    pipe->src_x = 0;
    pipe->dst_y = 0;
    pipe->dst_x = 0;

    if (mfd->map_buffer) {
        pipe->srcp0_addr = (unsigned int)mfd->map_buffer->iova[0] + \
                           buf_offset;
        pr_debug("start 0x%lx srcp0_addr 0x%x\n", mfd->
                 map_buffer->iova[0], pipe->srcp0_addr);
    } else {
        pipe->srcp0_addr = (uint32)(buf + buf_offset);
    }

    mdp4_overlay_rgb_setup(pipe);

    mdp4_overlayproc_cfg(pipe);

    mdp4_overlay_dmap_xy(pipe);

    mdp4_overlay_dmap_cfg(mfd, 1);

    mdp4_overlay_reg_flush(pipe, 1);

    mdp4_mixer_stage_up(pipe, 0);

    mdp4_mixer_stage_commit(pipe->mixer_num);

    mb();
}
コード例 #2
0
/* 3D side by side */
void mdp4_dsi_video_3d_sbys(struct msm_fb_data_type *mfd,
				struct msmfb_overlay_3d *r3d)
{
	struct fb_info *fbi;
	struct mdp4_overlay_pipe *pipe;
	int bpp;
	uint8 *buf = NULL;

	if (dsi_pipe == NULL)
		return;

	dsi_pipe->is_3d = r3d->is_3d;
	dsi_pipe->src_height_3d = r3d->height;
	dsi_pipe->src_width_3d = r3d->width;

	pipe = dsi_pipe;

	if (pipe->is_3d)
		mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_SIDE_BY_SIDE);
	else
		mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_NONE);

	fbi = mfd->fbi;

	bpp = fbi->var.bits_per_pixel / 8;
	buf = (uint8 *) fbi->fix.smem_start;
	buf += fbi->var.xoffset * bpp +
		fbi->var.yoffset * fbi->fix.line_length;

	if (pipe->is_3d) {
		pipe->src_height = pipe->src_height_3d;
		pipe->src_width = pipe->src_width_3d;
		pipe->src_h = pipe->src_height_3d;
		pipe->src_w = pipe->src_width_3d;
		pipe->dst_h = pipe->src_height_3d;
		pipe->dst_w = pipe->src_width_3d;
		pipe->srcp0_ystride = msm_fb_line_length(0,
					pipe->src_width, bpp);
	} else {
		 /* 2D */
		pipe->src_height = fbi->var.yres;
		pipe->src_width = fbi->var.xres;
		pipe->src_h = fbi->var.yres;
		pipe->src_w = fbi->var.xres;
		pipe->dst_h = fbi->var.yres;
		pipe->dst_w = fbi->var.xres;
		pipe->srcp0_ystride = fbi->fix.line_length;
	}

	pipe->src_y = 0;
	pipe->src_x = 0;
	pipe->dst_y = 0;
	pipe->dst_x = 0;
	pipe->srcp0_addr = (uint32)buf;

	mdp4_overlay_rgb_setup(pipe);

	mdp4_overlayproc_cfg(pipe);

	mdp4_overlay_dmap_xy(pipe);

	mdp4_overlay_dmap_cfg(mfd, 1);

	mdp4_mixer_stage_up(pipe);

	mb();

	/* wait for vsycn */
	mdp4_overlay_dsi_video_vsync_push(mfd, pipe);
}
コード例 #3
0
/* 3D side by side */
void mdp4_dsi_cmd_3d_sbys(struct msm_fb_data_type *mfd,
                          struct msmfb_overlay_3d *r3d)
{
    struct fb_info *fbi;
    struct mdp4_overlay_pipe *pipe;
    int bpp;
    uint8 *src = NULL;

    if (dsi_pipe == NULL)
        return;

    dsi_pipe->is_3d = r3d->is_3d;
    dsi_pipe->src_height_3d = r3d->height;
    dsi_pipe->src_width_3d = r3d->width;

    pipe = dsi_pipe;

    if (pipe->is_3d)
        mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_SIDE_BY_SIDE);
    else
        mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_NONE);

    if (mfd->panel_power_on)
        mdp4_dsi_cmd_dma_busy_wait(mfd);

    fbi = mfd->fbi;
    if (pipe->is_3d) {
        bpp = fbi->var.bits_per_pixel / 8;
        pipe->src_height = pipe->src_height_3d;
        pipe->src_width = pipe->src_width_3d;
        pipe->src_h = pipe->src_height_3d;
        pipe->src_w = pipe->src_width_3d;
        pipe->dst_h = pipe->src_height_3d;
        pipe->dst_w = pipe->src_width_3d;
        pipe->srcp0_ystride = msm_fb_line_length(0,
                              pipe->src_width, bpp);
    } else {
        /* 2D */
        pipe->src_height = fbi->var.yres;
        pipe->src_width = fbi->var.xres;
        pipe->src_h = fbi->var.yres;
        pipe->src_w = fbi->var.xres;
        pipe->dst_h = fbi->var.yres;
        pipe->dst_w = fbi->var.xres;
        pipe->srcp0_ystride = fbi->fix.line_length;
    }
    pipe->src_y = 0;
    pipe->src_x = 0;
    pipe->dst_y = 0;
    pipe->dst_x = 0;
    pipe->srcp0_addr = (uint32)src;

    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);

    mdp4_overlay_rgb_setup(pipe);

    mdp4_mixer_stage_up(pipe);

    mdp4_overlayproc_cfg(pipe);

    mdp4_overlay_dmap_xy(pipe);

    mdp4_overlay_dmap_cfg(mfd, 0);

    /* MDP cmd block disable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
}
コード例 #4
0
/* 3D side by side */
void mdp4_dsi_cmd_3d_sbys(struct msm_fb_data_type *mfd,
				struct msmfb_overlay_3d *r3d)
{
	struct fb_info *fbi;
	int bpp;
	uint8 *src = NULL;
	int cndx = 0;
	struct vsycn_ctrl *vctrl;
	struct mdp4_overlay_pipe *pipe;

	vctrl = &vsync_ctrl_db[cndx];
	pipe = vctrl->base_pipe;

	if (pipe == NULL)
		return;

	if (pipe->pipe_used == 0 ||
			pipe->mixer_stage != MDP4_MIXER_STAGE_BASE) {
		pr_err("%s: NOT baselayer\n", __func__);
		return;
	}

	pipe->is_3d = r3d->is_3d;
	pipe->src_height_3d = r3d->height;
	pipe->src_width_3d = r3d->width;

	if (pipe->is_3d)
		mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_SIDE_BY_SIDE);
	else
		mdp4_overlay_panel_3d(pipe->mixer_num, MDP4_3D_NONE);

	fbi = mfd->fbi;
	if (pipe->is_3d) {
		bpp = fbi->var.bits_per_pixel / 8;
		pipe->src_height = pipe->src_height_3d;
		pipe->src_width = pipe->src_width_3d;
		pipe->src_h = pipe->src_height_3d;
		pipe->src_w = pipe->src_width_3d;
		pipe->dst_h = pipe->src_height_3d;
		pipe->dst_w = pipe->src_width_3d;
		pipe->srcp0_ystride = msm_fb_line_length(0,
					pipe->src_width, bpp);
	} else {
		 /* 2D */
		pipe->src_height = fbi->var.yres;
		pipe->src_width = fbi->var.xres;
		pipe->src_h = fbi->var.yres;
		pipe->src_w = fbi->var.xres;
		pipe->dst_h = fbi->var.yres;
		pipe->dst_w = fbi->var.xres;
		pipe->srcp0_ystride = fbi->fix.line_length;
	}
	pipe->src_y = 0;
	pipe->src_x = 0;
	pipe->dst_y = 0;
	pipe->dst_x = 0;
	pipe->srcp0_addr = (uint32)src;

	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
	mdp_clk_ctrl(1);

	mdp4_overlay_rgb_setup(pipe);

	mdp4_overlay_reg_flush(pipe, 1);

	mdp4_mixer_stage_up(pipe, 0);

	mdp4_overlayproc_cfg(pipe);

	mdp4_overlay_dmap_xy(pipe);

	mdp4_overlay_dmap_cfg(mfd, 0);

	mdp4_mixer_stage_commit(pipe->mixer_num);
	/* MDP cmd block disable */
	mdp_clk_ctrl(0);
	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
}