static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd) { struct mdp3_session_data *mdp3_session; struct mdp3_img_data *data; int rc = 0; if (!mfd || !mfd->mdp.private1) return -EINVAL; mdp3_session = mfd->mdp.private1; if (!mdp3_session || !mdp3_session->dma) return -EINVAL; if (!mdp3_session->status) { pr_err("%s, display off!\n", __func__); return -EPERM; } mutex_lock(&mdp3_session->lock); data = mdp3_bufq_pop(&mdp3_session->bufq_in); if (data) { mdp3_session->dma->update(mdp3_session->dma, (void *)data->addr, mdp3_session->intf); mdp3_bufq_push(&mdp3_session->bufq_out, data); } if (mdp3_bufq_count(&mdp3_session->bufq_out) > 2) { data = mdp3_bufq_pop(&mdp3_session->bufq_out); mdp3_put_img(data); if (mfd->fbi->screen_base) mdp3_fbmem_free(mfd); } mutex_unlock(&mdp3_session->lock); mdss_fb_update_notify_update(mfd); return rc; }
static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd, struct mdp_display_commit *cmt_data) { struct mdp3_session_data *mdp3_session; struct mdp3_img_data *data; struct mdss_panel_info *panel_info; int rc = 0; bool reset_done = false; struct mdss_panel_data *panel; if (!mfd || !mfd->mdp.private1) return -EINVAL; panel_info = mfd->panel_info; mdp3_session = mfd->mdp.private1; if (!mdp3_session || !mdp3_session->dma) return -EINVAL; if (mdp3_bufq_count(&mdp3_session->bufq_in) == 0) { pr_debug("no buffer in queue yet\n"); return -EPERM; } panel = mdp3_session->panel; if (mdp3_session->in_splash_screen) { pr_debug("continuous splash screen, IOMMU not attached\n"); rc = mdp3_ctrl_reset(mfd); if (rc) { pr_err("fail to reset display\n"); return -EINVAL; } reset_done = true; } mutex_lock(&mdp3_session->lock); if (!mdp3_session->status) { pr_err("%s, display off!\n", __func__); mutex_unlock(&mdp3_session->lock); return -EPERM; } mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_BEGIN); data = mdp3_bufq_pop(&mdp3_session->bufq_in); if (data) { mdp3_ctrl_reset_countdown(mdp3_session, mfd); mdp3_ctrl_clk_enable(mfd, 1); rc = mdp3_session->dma->update(mdp3_session->dma, (void *)(int)data->addr, mdp3_session->intf); /* This is for the previous frame */ if (rc < 0) { mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_TIMEOUT); } else { if (mdp3_ctrl_get_intf_type(mfd) == MDP3_DMA_OUTPUT_SEL_DSI_VIDEO) { mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_DONE); } } mdp3_session->dma_active = 1; init_completion(&mdp3_session->dma_completion); mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_FLUSHED); mdp3_bufq_push(&mdp3_session->bufq_out, data); } if (mdp3_bufq_count(&mdp3_session->bufq_out) > 1) { mdp3_release_splash_memory(mfd); data = mdp3_bufq_pop(&mdp3_session->bufq_out); if (data) mdp3_put_img(data, MDP3_CLIENT_DMA_P); } if (mdp3_session->first_commit) { /*wait for one frame time to ensure frame is sent to panel*/ msleep(1000 / panel_info->mipi.frame_rate); mdp3_session->first_commit = false; } mdp3_session->vsync_before_commit = 0; if (reset_done && (panel && panel->set_backlight)) panel->set_backlight(panel, panel->panel_info.bl_max); mutex_unlock(&mdp3_session->lock); mdss_fb_update_notify_update(mfd); return 0; }
static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd, struct mdp_display_commit *cmt_data) { struct mdp3_session_data *mdp3_session; struct mdp3_img_data *data; struct mdss_panel_info *panel_info = mfd->panel_info; int rc = 0; bool reset_done = false; struct mdss_panel_data *panel; if (!mfd || !mfd->mdp.private1) return -EINVAL; mdp3_session = mfd->mdp.private1; if (!mdp3_session || !mdp3_session->dma) return -EINVAL; if (mdp3_bufq_count(&mdp3_session->bufq_in) == 0) { pr_debug("no buffer in queue yet\n"); return -EPERM; } panel = mdp3_session->panel; if (!mdp3_iommu_is_attached(MDP3_CLIENT_DMA_P)) { pr_debug("continuous splash screen, IOMMU not attached\n"); mdp3_ctrl_reset(mfd); reset_done = true; } mdp3_release_splash_memory(); mutex_lock(&mdp3_session->lock); if (!mdp3_session->status) { pr_err("%s, display off!\n", __func__); mutex_unlock(&mdp3_session->lock); return -EPERM; } data = mdp3_bufq_pop(&mdp3_session->bufq_in); if (data) { mdp3_ctrl_reset_countdown(mdp3_session, mfd); mdp3_ctrl_clk_enable(mfd, 1); mdp3_session->dma->update(mdp3_session->dma, (void *)data->addr, mdp3_session->intf); mdp3_bufq_push(&mdp3_session->bufq_out, data); } if (mdp3_bufq_count(&mdp3_session->bufq_out) > 2) { data = mdp3_bufq_pop(&mdp3_session->bufq_out); mdp3_put_img(data, MDP3_CLIENT_DMA_P); } if (mdp3_session->first_commit) { /*wait for one frame time to ensure frame is sent to panel*/ msleep(1000 / panel_info->mipi.frame_rate); mdp3_session->first_commit = false; } mdp3_session->vsync_before_commit = 0; if (reset_done && (panel && panel->set_backlight)){ #if defined(CONFIG_FB_MSM_MIPI_TIANMA_CMD_HVGA_PT) msleep(1); #endif panel->set_backlight(panel, panel->panel_info.bl_max); } mutex_unlock(&mdp3_session->lock); mdss_fb_update_notify_update(mfd); return rc; }