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

Commit c8c7eec2 authored by Abhijit Kulkarni's avatar Abhijit Kulkarni Committed by Abhijith Desai
Browse files

msm: mdss: idle power collapse notify



This fix adds notification of idle power collapse to user space
for cmd mode panels. Without this fix user space has no
knowledge of reprogramming the QSEED3 LUTs after idle power
collapse, this needs to be done with the user space knowledge
to keep it's LUT bank offset in sync with the HW used LUT bank
offset.

Change-Id: Ia1fbd07da8c8c854a74cf5dad62f5ec2d1fc962e
Signed-off-by: default avatarAbhijit Kulkarni <kabhijit@codeaurora.org>
parent cc99b783
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -892,6 +892,12 @@ static ssize_t mdss_fb_get_persist_mode(struct device *dev,
	return ret;
}

static ssize_t mdss_fb_idle_pc_notify(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	return scnprintf(buf, PAGE_SIZE, "idle power collapsed\n");
}

static DEVICE_ATTR(msm_fb_type, 0444, mdss_fb_get_type, NULL);
static DEVICE_ATTR(msm_fb_split, 0644, mdss_fb_show_split,
					mdss_fb_store_split);
@@ -912,6 +918,8 @@ static DEVICE_ATTR(measured_fps, 0664,
	mdss_fb_get_fps_info, NULL);
static DEVICE_ATTR(msm_fb_persist_mode, 0644,
	mdss_fb_get_persist_mode, mdss_fb_change_persist_mode);
static DEVICE_ATTR(idle_power_collapse, 0444, mdss_fb_idle_pc_notify, NULL);

static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_msm_fb_type.attr,
	&dev_attr_msm_fb_split.attr,
@@ -925,6 +933,7 @@ static struct attribute *mdss_fb_attrs[] = {
	&dev_attr_msm_fb_dfps_mode.attr,
	&dev_attr_measured_fps.attr,
	&dev_attr_msm_fb_persist_mode.attr,
	&dev_attr_idle_power_collapse.attr,
	NULL,
};

@@ -5174,3 +5183,18 @@ void mdss_fb_calc_fps(struct msm_fb_data_type *mfd)
		mfd->fps_info.frame_count = 0;
	}
}

void mdss_fb_idle_pc(struct msm_fb_data_type *mfd)
{
	struct mdss_overlay_private *mdp5_data;

	if (!mfd || mdss_fb_is_power_off(mfd))
		return;

	mdp5_data = mfd_to_mdp5_data(mfd);

	if ((mfd->panel_info->type == MIPI_CMD_PANEL) && mdp5_data) {
		pr_debug("Notify fb%d idle power collapsed\n", mfd->index);
		sysfs_notify(&mfd->fbi->dev->kobj, NULL, "idle_power_collapse");
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -473,4 +473,5 @@ void mdss_fb_report_panel_dead(struct msm_fb_data_type *mfd);
void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
						struct fb_var_screeninfo *var);
void mdss_fb_calc_fps(struct msm_fb_data_type *mfd);
void mdss_fb_idle_pc(struct msm_fb_data_type *mfd);
#endif /* MDSS_FB_H */
+17 −0
Original line number Diff line number Diff line
@@ -4889,6 +4889,22 @@ static int mdss_mdp_cx_ctrl(struct mdss_data_type *mdata, int enable)
	return rc;
}

/**
 * mdss_mdp_notify_idle_pc() - Notify fb driver of idle power collapse
 * @mdata: MDP private data
 *
 * This function is called if there are active overlays.
 */
static void mdss_mdp_notify_idle_pc(struct mdss_data_type *mdata)
{
	int i;

	for (i = 0; i < mdata->nctl; i++)
		if ((mdata->ctl_off[i].ref_cnt) &&
			!mdss_mdp_ctl_is_power_off(&mdata->ctl_off[i]))
			mdss_fb_idle_pc(mdata->ctl_off[i].mfd);
}

/**
 * mdss_mdp_footswitch_ctrl() - Disable/enable MDSS GDSC and CX/Batfet rails
 * @mdata: MDP private data
@@ -4943,6 +4959,7 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
				mdss_mdp_memory_retention_ctrl(MEM_RETAIN_ON,
					PERIPH_RETAIN_OFF);
				mdata->idle_pc = true;
				mdss_mdp_notify_idle_pc(mdata);
				pr_debug("idle pc. active overlays=%d\n",
					active_cnt);
			} else {