Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e871e6fd authored by Sandeep Panda's avatar Sandeep Panda
Browse files

msm: mdss: make panel status check and dfps update exclusive



Since on some platforms DSI_CMD_OFFSET register has become
double buffered, so dynamic fps update and DSI DMA command
transfer can not happen at the same time. This changes makes
panel status check which in turn does a DSI DMA transfer, and
dfps update mutually exclusive.

Change-Id: If8591c55d31669dbf3f565db041c04bcd6cb616a
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent d7ac7905
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2713,10 +2713,7 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
		rc = mdss_dsi_reconfig(pdata, mode);
		break;
	case MDSS_EVENT_DSI_PANEL_STATUS:
		if (ctrl_pdata->check_status)
			rc = ctrl_pdata->check_status(ctrl_pdata);
		else
			rc = true;
		rc = mdss_dsi_check_panel_status(ctrl_pdata, arg);
		break;
	case MDSS_EVENT_PANEL_TIMING_SWITCH:
		rc = mdss_dsi_panel_timing_switch(ctrl_pdata, arg);
+1 −0
Original line number Diff line number Diff line
@@ -704,6 +704,7 @@ void mdss_dsi_cfg_lane_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
void mdss_dsi_set_reg(struct mdss_dsi_ctrl_pdata *ctrl, int off,
	u32 mask, u32 val);
int mdss_dsi_phy_pll_reset_status(struct mdss_dsi_ctrl_pdata *ctrl);
int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg);

static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
{
+30 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -39,6 +39,35 @@ static uint32_t interval = STATUS_CHECK_INTERVAL_MS;
static int32_t dsi_status_disable = DSI_STATUS_CHECK_INIT;
struct dsi_status_data *pstatus_data;

int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg)
{
	struct mdss_mdp_ctl *ctl = NULL;
	struct msm_fb_data_type *mfd = arg;
	int ret = 0;

	if (!mfd)
		return -EINVAL;

	ctl = mfd_to_ctl(mfd);

	if (!ctl || !ctrl)
		return -EINVAL;

	mutex_lock(&ctl->offlock);
	/*
	 * if check_status method is not defined
	 * then no need to fail this function,
	 * instead return a positive value.
	 */
	if (ctrl->check_status)
		ret = ctrl->check_status(ctrl);
	else
		ret = 1;
	mutex_unlock(&ctl->offlock);

	return ret;
}

/*
 * check_dsi_ctrl_status() - Reads MFD structure and
 * calls platform specific DSI ctrl Status function.
+1 −1
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ static ssize_t mdss_fb_get_panel_status(struct device *dev,
		ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n", "suspend");
	} else {
		panel_status = mdss_fb_send_panel_event(mfd,
				MDSS_EVENT_DSI_PANEL_STATUS, NULL);
				MDSS_EVENT_DSI_PANEL_STATUS, mfd);
		ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n",
			panel_status > 0 ? "alive" : "dead");
	}