static void mdp4_overlay_setup_pipe_addr(struct msm_fb_data_type *mfd,
			struct mdp4_overlay_pipe *pipe)
{
	MDPIBUF *iBuf = &mfd->ibuf;
	struct fb_info *fbi;
	int bpp;
	uint8 *src;

	/* whole screen for base layer */
	src = (uint8 *) iBuf->buf;
	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;
}
/* 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();
}
/* 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);
}
void mdp4_overlay_update_dsi_cmd(struct msm_fb_data_type *mfd)
{
    MDPIBUF *iBuf = &mfd->ibuf;
    uint8 *src;
    int ptype;
    struct mdp4_overlay_pipe *pipe;
    struct msm_fb_data_type *tmp_dsi_mfd;
    int bpp;
    int ret;

    if (mfd->key != MFD_KEY)
        return;

    tmp_dsi_mfd = dsi_mfd;
    dsi_mfd = mfd;		/* keep it */

    /* MDP cmd block enable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);

    if (unlikely(dsi_pipe == NULL)) {
        ptype = mdp4_overlay_format2type(mfd->fb_imgType);
        if (unlikely(ptype < 0)) {
            printk(KERN_ERR "%s: format2type failed\n", __func__);
            mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
            dsi_mfd = tmp_dsi_mfd;
            return;
        }
        pipe = mdp4_overlay_pipe_alloc(ptype, MDP4_MIXER0);
        if (unlikely(pipe == NULL)) {
            printk(KERN_ERR "%s: pipe_alloc failed\n", __func__);
            mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
            dsi_mfd = tmp_dsi_mfd;
            return;
        }
        pipe->pipe_used++;
        pipe->mixer_stage  = MDP4_MIXER_STAGE_BASE;
        pipe->mixer_num  = MDP4_MIXER0;
        pipe->src_format = mfd->fb_imgType;
        mdp4_overlay_panel_mode(pipe->mixer_num, MDP4_PANEL_DSI_CMD);
        ret = mdp4_overlay_format2pipe(pipe);
        if (ret < 0)
            printk(KERN_INFO "%s: format2type failed\n", __func__);

        init_timer(&dsi_clock_timer);
        dsi_clock_timer.function = dsi_clock_tout;
        dsi_clock_timer.data = (unsigned long) mfd;;
        dsi_clock_timer.expires = 0xffffffff;
        add_timer(&dsi_clock_timer);
        tout_expired = jiffies;

        dsi_pipe = pipe; /* keep it */

        mdp4_init_writeback_buf(mfd, MDP4_MIXER0);
        pipe->ov_blt_addr = 0;
        pipe->dma_blt_addr = 0;

    } else {
        pipe = dsi_pipe;
    }
    /*
     * configure dsi stream id
     * dma_p = 0, dma_s = 1
     */
    MDP_OUTP(MDP_BASE + 0x000a0, 0x10);
    /* disable dsi trigger */
    MDP_OUTP(MDP_BASE + 0x000a4, 0x00);
    /* whole screen for base layer */
    src = (uint8 *) iBuf->buf;


    {
        struct fb_info *fbi;

        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;
    }


    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);

    mdp4_mipi_vsync_enable(mfd, pipe, 0);

    /* MDP cmd block disable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);

    wmb();
}
예제 #5
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);
}
/* 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);
}
예제 #7
0
void mdp4_overlay_update_dsi_cmd(struct msm_fb_data_type *mfd)
{
	MDPIBUF *iBuf = &mfd->ibuf;
	uint8 *src;
	int ptype;
	struct mdp4_overlay_pipe *pipe;
	int bpp;
	int ret;

	if (mfd->key != MFD_KEY)
		return;

	dsi_mfd = mfd;		/* keep it */

	/* MDP cmd block enable */
	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);

	if (dsi_pipe == NULL) {
		ptype = mdp4_overlay_format2type(mfd->fb_imgType);
		if (ptype < 0)
			printk(KERN_INFO "%s: format2type failed\n", __func__);
		pipe = mdp4_overlay_pipe_alloc(ptype, MDP4_MIXER0, 0);
		if (pipe == NULL)
			printk(KERN_INFO "%s: pipe_alloc failed\n", __func__);
		pipe->pipe_used++;
		pipe->mixer_stage  = MDP4_MIXER_STAGE_BASE;
		pipe->mixer_num  = MDP4_MIXER0;
		pipe->src_format = mfd->fb_imgType;
		mdp4_overlay_panel_mode(pipe->mixer_num, MDP4_PANEL_DSI_CMD);
		ret = mdp4_overlay_format2pipe(pipe);
		if (ret < 0)
			printk(KERN_INFO "%s: format2type failed\n", __func__);
#ifdef DSI_CLK_CTRL
		init_timer(&dsi_clock_timer);
		dsi_clock_timer.function = dsi_clock_tout;
		dsi_clock_timer.data = (unsigned long) mfd;;
		dsi_clock_timer.expires = HZ;
#endif
		dsi_pipe = pipe; /* keep it */

#ifdef OVERLAY_BLT_EMBEDDED
		{
			char *src;
			struct fb_info *fbi;
			int bpp, off;


			fbi = mfd->fbi;
			bpp = fbi->var.bits_per_pixel / 8;
			src = (uint8 *) iBuf->buf;
			pipe->blt_base = (ulong) iBuf->buf;
			off = ALIGN(fbi->var.xres, 32) * fbi->var.yres
						* bpp * 2;
			off += (1920 * 1080 * 2 * 1); /* hdmi */
			pipe->blt_base += off;

			pr_info("%s: base=%x offset=%x\n",
				__func__, (int) pipe->blt_base, (int)off);

		}
#endif

		/*
		 * configure dsi stream id
		 * dma_p = 0, dma_s = 1
		 */
		MDP_OUTP(MDP_BASE + 0x000a0, 0x10);
		/* enable dsi trigger on dma_p */
		MDP_OUTP(MDP_BASE + 0x000a4, 0x01);
	} else {
		pipe = dsi_pipe;
	}

	/* whole screen for base layer */
	src = (uint8 *) iBuf->buf;


	{
		struct fb_info *fbi;

		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;
	}


	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);

	mdp4_mipi_vsync_enable(mfd, pipe, 0);

	/* MDP cmd block disable */
	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);

	wmb();
}
예제 #8
0
void mdp4_dsi_cmd_3d(struct msm_fb_data_type *mfd, struct msmfb_overlay_3d *r3d)
{
    MDPIBUF *iBuf = &mfd->ibuf;
    struct fb_info *fbi;
    struct mdp4_overlay_pipe *pipe;
    int bpp;
    uint8 *src = NULL;

    if (r3d->is_3d == PADDING_ENABLE || r3d->is_3d == PADDING_DISABLE) {
        mfd->enable_uipadding = r3d->is_3d;

        if (r3d->is_3d == PADDING_DISABLE)
            mdp4_overlay_handle_padding(mfd, false);

        return;
    }

    if (dsi_pipe == NULL)
        return;

    PR_DISP_INFO("%s(%d) is3d %d pid=%d\n", __func__, __LINE__, r3d->is_3d, current->pid);

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

    src = (uint8 *) iBuf->buf;

    pipe = dsi_pipe;


#ifdef CONFIG_FB_MSM_MIPI_DSI
    if (mfd->panel_power_on)
        mdp4_dsi_cmd_dma_busy_wait(mfd, pipe);
    if (dsi_pipe->blt_addr)
        mdp4_dsi_blt_dmap_busy_wait(mfd);
#endif

    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;
    PR_DISP_DEBUG("%s(%d) is3d %d srcx %d srcy %d srcw %d srch %d dstx %d dsty %d dstw %d dsth %d ystride %d\n", __func__, __LINE__, pipe->is_3d,
                  pipe->src_x, pipe->src_y, pipe->src_w, pipe->src_h,
                  pipe->dst_x, pipe->dst_y, pipe->dst_w, pipe->dst_h, pipe->srcp0_ystride);

    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);

    mdp4_mipi_vsync_enable(mfd, pipe, 0);

    /* MDP cmd block disable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);

    wmb();
}
예제 #9
0
void mdp4_overlay_update_dsi_cmd(struct msm_fb_data_type *mfd)
{
    MDPIBUF *iBuf = &mfd->ibuf;
    struct fb_info *fbi;
    uint8 *src;
    int ptype;
    struct mdp4_overlay_pipe *pipe;
    int ret;
    int bpp;

    if (mfd->key != MFD_KEY)
        return;

    dsi_mfd = mfd;		/* keep it */

    /* MDP cmd block enable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);

    if (dsi_pipe == NULL) {
        ptype = mdp4_overlay_format2type(mfd->fb_imgType);
        if (ptype < 0)
            printk(KERN_INFO "%s: format2type failed\n", __func__);
        pipe = mdp4_overlay_pipe_alloc(ptype, MDP4_MIXER0, 0);
        if (pipe == NULL) {
            printk(KERN_INFO "%s: pipe_alloc failed\n", __func__);
            return;
        }
        pipe->pipe_used++;
        pipe->mixer_stage  = MDP4_MIXER_STAGE_BASE;
        pipe->mixer_num  = MDP4_MIXER0;
        pipe->src_format = mfd->fb_imgType;
        pipe->is_3d = 0;
        mdp4_overlay_panel_mode(pipe->mixer_num, MDP4_PANEL_DSI_CMD);
        ret = mdp4_overlay_format2pipe(pipe);
        if (ret < 0)
            printk(KERN_INFO "%s: format2type failed\n", __func__);

        dsi_pipe = pipe; /* keep it */

        fbi = mfd->fbi;
        bpp = fbi->var.bits_per_pixel / 8;
        src = (uint8 *) iBuf->buf;
        writeback_offset = mdp4_overlay_writeback_setup(
                               fbi, pipe, src, bpp);
#ifdef OVERLAY_BLT_EMBEDDED
        pipe->blt_base = mfd->blt_base;
        PR_DISP_INFO("%s: blt_base=%08x\n", __func__,
                     (uint32_t)pipe->blt_base);
#endif
        /*
         * configure dsi stream id
         * dma_p = 0, dma_s = 1
         */
        MDP_OUTP(MDP_BASE + 0x000a0, 0x10);
        /* enable dsi trigger on dma_p */
        MDP_OUTP(MDP_BASE + 0x000a4, 0x01);

        MDP_OUTP(MDP_BASE + 0x0021c, 0x10);
    } else {
        pipe = dsi_pipe;
    }

    /* whole screen for base layer */
    src = (uint8 *) iBuf->buf;

    {
        struct fb_info *fbi;

        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;
    }


    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);

    mdp4_mipi_vsync_enable(mfd, pipe, 0);

    /* MDP cmd block disable */
    mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);

    wmb();
}