static int mdp3_ctrl_reset_cmd(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdp3_dma *mdp3_dma;
	struct mdss_panel_data *panel;
	struct mdp3_notification vsync_client;

	pr_debug("mdp3_ctrl_reset_cmd\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_reset no device");
		return -ENODEV;
	}

	panel = mdp3_session->panel;
	mdp3_dma = mdp3_session->dma;
	mutex_lock(&mdp3_session->lock);

	vsync_client = mdp3_dma->vsync_client;

	rc = mdp3_dma->stop(mdp3_dma, mdp3_session->intf);
	if (rc) {
		pr_err("fail to stop the MDP3 dma\n");
		goto reset_error;
	}

	rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to attach dma iommu\n");
		goto reset_error;
	}

	mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	mdp3_ctrl_dma_init(mfd, mdp3_dma);

	if (vsync_client.handler)
		mdp3_dma->vsync_enable(mdp3_dma, &vsync_client);

	if (mfd->fbi->screen_base)
		rc = mdp3_dma->start(mdp3_dma, mdp3_session->intf);
	else
		mdp3_session->first_commit = true;

reset_error:
	mutex_unlock(&mdp3_session->lock);
	return rc;
}
Пример #2
0
static int mdp3_ctrl_reset(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdp3_dma *mdp3_dma;
	struct mdss_panel_data *panel;
	struct mdp3_notification vsync_client;

	pr_debug("mdp3_ctrl_reset\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_reset no device");
		return -ENODEV;
	}

	if (mfd->panel.type == MIPI_CMD_PANEL) {
		rc = mdp3_ctrl_reset_cmd(mfd);
		return rc;
	}

	panel = mdp3_session->panel;
	mdp3_dma = mdp3_session->dma;
	mutex_lock(&mdp3_session->lock);

	vsync_client = mdp3_dma->vsync_client;
	if (panel && panel->set_backlight)
		panel->set_backlight(panel, 0);

	rc = panel->event_handler(panel, MDSS_EVENT_PANEL_OFF, NULL);
	if (rc)
		pr_err("fail to turn off panel\n");

	rc = mdp3_dma->stop(mdp3_dma, mdp3_session->intf);
	if (rc) {
		pr_err("fail to stop the MDP3 dma %d\n", rc);
		goto reset_error;
	}

	rc = mdp3_put_mdp_dsi_clk();
	if (rc) {
		pr_err("fail to release mdp clocks\n");
		goto reset_error;
	}

	rc = panel->event_handler(panel, MDSS_EVENT_BLANK, NULL);
	if (rc) {
		pr_err("fail to blank the panel\n");
		goto reset_error;
	}

	rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to attach dma iommu\n");
		goto reset_error;
	}

	rc = panel->event_handler(panel, MDSS_EVENT_UNBLANK, NULL);
	if (rc) {
		pr_err("fail to unblank the panel\n");
		goto reset_error;
	}

	rc = panel->event_handler(panel, MDSS_EVENT_PANEL_ON, NULL);
	if (rc) {
		pr_err("fail to turn on the panel\n");
		goto reset_error;
	}

	rc = mdp3_get_mdp_dsi_clk();
	if (rc) {
		pr_err("fail to turn on mdp clks\n");
		goto reset_error;
	}

	mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	mdp3_ctrl_dma_init(mfd, mdp3_dma);

	if (vsync_client.handler)
		mdp3_dma->vsync_enable(mdp3_dma, &vsync_client);

	mdp3_session->first_commit = true;
	mdp3_session->in_splash_screen = 0;

reset_error:
	mutex_unlock(&mdp3_session->lock);
	return rc;
}
Пример #3
0
static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdss_panel_data *panel;

	pr_debug("mdp3_ctrl_on\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_on no device");
		return -ENODEV;
	}
	mutex_lock(&mdp3_session->lock);
	if (mdp3_session->status) {
		pr_debug("fb%d is on already", mfd->index);
		goto on_error;
	}

	if (mdp3_session->intf->active) {
		pr_debug("continuous splash screen, initialized already\n");
		goto on_error;
	}

	mdp3_enable_regulator(true);
	mdp3_ctrl_notifier_register(mdp3_session,
		&mdp3_session->mfd->mdp_sync_pt_data.notifier);

	/* request bus bandwidth before DSI DMA traffic */
	rc = mdp3_ctrl_res_req_bus(mfd, 1);
	if (rc) {
		pr_err("fail to request bus resource\n");
		goto on_error;
	}

	panel = mdp3_session->panel;
	if (panel->event_handler) {
		rc = panel->event_handler(panel, MDSS_EVENT_UNBLANK, NULL);
		rc |= panel->event_handler(panel, MDSS_EVENT_PANEL_ON, NULL);
	}
	if (rc) {
		pr_err("fail to turn on the panel\n");
		goto on_error;
	}
	rc = mdp3_ctrl_res_req_clk(mfd, 1);
	if (rc) {
		pr_err("fail to request mdp clk resource\n");
		goto on_error;
	}

	rc = mdp3_ctrl_dma_init(mfd, mdp3_session->dma);
	if (rc) {
		pr_err("dma init failed\n");
		goto on_error;
	}

	rc = mdp3_ppp_init();
	if (rc) {
		pr_err("ppp init failed\n");
		goto on_error;
	}

	rc = mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	if (rc) {
		pr_err("display interface init failed\n");
		goto on_error;
	}
	mdp3_session->clk_on = 1;

	mdp3_session->first_commit = true;

on_error:
	if (!rc)
		mdp3_session->status = 1;
	mutex_unlock(&mdp3_session->lock);
	return rc;
}
Пример #4
0
static int mdp3_ctrl_reset(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdp3_dma *mdp3_dma;
	struct mdss_panel_data *panel;
	struct mdp3_notification vsync_client;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;

	pr_debug("mdp3_ctrl_reset\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_reset no device");
		return -ENODEV;
	}

	if (mfd->panel.type == MIPI_CMD_PANEL) {
		rc = mdp3_ctrl_reset_cmd(mfd);
		return rc;
	}

	panel = mdp3_session->panel;
	mdp3_dma = mdp3_session->dma;
	mutex_lock(&mdp3_session->lock);
	mutex_lock(&mdp3_session->offlock);

	vsync_client = mdp3_dma->vsync_client;

	rc = mdp3_dma->stop(mdp3_dma, mdp3_session->intf);
	if (rc) {
		pr_err("fail to stop the MDP3 dma\n");
		goto reset_error;
	}

	rc = mdp3_put_mdp_dsi_clk();
	if (rc) {
		pr_err("fail to release mdp clocks\n");
		goto reset_error;
	}

	rc = panel->event_handler(panel, MDSS_EVENT_BLANK, NULL);
	if (rc) {
		pr_err("fail to blank the panel\n");
		goto reset_error;
	}

	rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to attach dma iommu\n");
		goto reset_error;
	}

	rc = panel->event_handler(panel, MDSS_EVENT_UNBLANK, NULL);
	if (rc) {
		pr_err("fail to unblank the panel\n");
		goto reset_error;
	}

	rc = mdp3_get_mdp_dsi_clk();
	if (rc) {
		pr_err("fail to turn on mdp clks\n");
		goto reset_error;
	}

	mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	mdp3_ctrl_dma_init(mfd, mdp3_dma);

	if (vsync_client.handler)
		mdp3_dma->vsync_enable(mdp3_dma, &vsync_client);

	ctrl_pdata = container_of(panel, struct mdss_dsi_ctrl_pdata,
			panel_data);
	if (ctrl_pdata && ctrl_pdata->cont_splash_on)
		ctrl_pdata->cont_splash_on(panel);

	panel->panel_info.cont_splash_esd_rdy = true;

reset_error:
	mutex_unlock(&mdp3_session->offlock);
	mutex_unlock(&mdp3_session->lock);
	return rc;
}
static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdss_panel_data *panel;

	pr_debug("mdp3_ctrl_on\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_on no device");
		return -ENODEV;
	}
	mutex_lock(&mdp3_session->lock);
	if (mdp3_session->status) {
		pr_debug("fb%d is on already", mfd->index);
		goto on_error;
	}

	rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to attach MDP DMA SMMU\n");
		goto on_error;
	}

	/* request bus bandwidth before DSI DMA traffic */
	rc = mdp3_ctrl_res_req_bus(mfd, 1);
	if (rc) {
		pr_err("fail to request bus resource\n");
		goto on_error;
	}

	panel = mdp3_session->panel;
	if (panel->event_handler)
		rc = panel->event_handler(panel, MDSS_EVENT_PANEL_ON, NULL);
	if (rc) {
		pr_err("fail to turn on the panel\n");
		goto on_error;
	}
	rc = mdp3_ctrl_res_req_clk(mfd, 1);
	if (rc) {
		pr_err("fail to request mdp clk resource\n");
		goto on_error;
	}

	rc = mdp3_ctrl_dma_init(mfd, mdp3_session->dma);
	if (rc) {
		pr_err("dma init failed\n");
		goto on_error;
	}

	rc = mdp3_ppp_init();
	if (rc) {
		pr_err("ppp init failed\n");
		goto on_error;
	}

	rc = mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	if (rc) {
		pr_err("display interface init failed\n");
		goto on_error;
	}

	rc = mdp3_session->dma->start(mdp3_session->dma, mdp3_session->intf);
	if (rc) {
		pr_err("fail to start the MDP display interface\n");
		goto on_error;
	}

on_error:
	if (!rc)
		mdp3_session->status = 1;

	mutex_unlock(&mdp3_session->lock);
	return rc;
}
Пример #6
0
static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
{
	int rc = 0;
	struct mdp3_session_data *mdp3_session;
	struct mdss_panel_data *panel;

	pr_info("mdp3_ctrl_on++\n");
	mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
	if (!mdp3_session || !mdp3_session->panel || !mdp3_session->dma ||
		!mdp3_session->intf) {
		pr_err("mdp3_ctrl_on no device");
		return -ENODEV;
	}
	mutex_lock(&mdp3_session->lock);
	if (mdp3_session->status) {
		pr_debug("fb%d is on already", mfd->index);
		goto on_error;
	}

	if (mdp3_session->intf->active) {
		pr_debug("continuous splash screen, initialized already\n");
		goto on_error;
	}

	mdp3_batfet_ctrl(true);

	rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to attach MDP DMA SMMU\n");
		goto on_error;
	}

	/* request bus bandwidth before DSI DMA traffic */
	rc = mdp3_ctrl_res_req_bus(mfd, 1);
	if (rc) {
		pr_err("fail to request bus resource\n");
		goto on_error;
	}

	panel = mdp3_session->panel;
	if (panel->event_handler) {
		rc = panel->event_handler(panel, MDSS_EVENT_UNBLANK, NULL);
		rc |= panel->event_handler(panel, MDSS_EVENT_PANEL_ON, NULL);
	}
	if (rc) {
		pr_err("fail to turn on the panel\n");
		goto on_error;
	}
	rc = mdp3_ctrl_res_req_clk(mfd, 1);
	if (rc) {
		pr_err("fail to request mdp clk resource\n");
		goto on_error;
	}

	mdp3_irq_register();

	rc = mdp3_ctrl_dma_init(mfd, mdp3_session->dma);
	if (rc) {
		pr_err("dma init failed\n");
		goto on_error;
	}

	rc = mdp3_ppp_init();
	if (rc) {
		pr_err("ppp init failed\n");
		goto on_error;
	}

	rc = mdp3_ctrl_intf_init(mfd, mdp3_session->intf);
	if (rc) {
		pr_err("display interface init failed\n");
		goto on_error;
	}

	mdp3_session->clk_on = 1;
	pr_debug("mdp3_ctrl_on dma start\n");
	if (mfd->fbi->screen_base) {
		rc = mdp3_session->dma->start(mdp3_session->dma,
						mdp3_session->intf);
		if (rc) {
			pr_err("fail to start the MDP display interface\n");
			goto on_error;
		}
	} else {
		mdp3_session->first_commit = true;
	}
	pr_info("mdp3_ctrl_on--\n");

on_error:
	if (!rc)
		mdp3_session->status = 1;
	mutex_unlock(&mdp3_session->lock);
	return rc;
}