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

Commit e7b7253a authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: cleanup auto-refresh implementation



Auto-refresh is used on smart displays to refresh display without
SW intervention, similar to dumb displays. So when it is on, display
controller will automatically send new frame every time panel TE signal
is received. Now as per the HW implementation, disabling auto-refresh
requires that display controller is idle and there is no frame transfer
on-going. To achieve this, we need to follow certain disable sequence.
To implement this disable sequence, clean up current implementation and
introduce auto-refresh state machine.

Change-Id: Iac5d76b6431f7ef2fcd68114e19c5cb5fb02577d
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent d171201f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ struct mdss_data_type {
	u32 enable_bw_release;
	u32 enable_rotator_bw_release;
	u32 serialize_wait4pp;
	u32 wait4autorefresh;
	u32 lines_before_active;

	struct mdss_hw_settings *hw_settings;
+6 −7
Original line number Diff line number Diff line
@@ -265,6 +265,8 @@ struct mdss_mdp_ctl_intfs_ops {
	 */
	int (*reconfigure)(struct mdss_mdp_ctl *ctl,
			enum dynamic_switch_modes mode, bool pre);
	/* called before do any register programming  from commit thread */
	void (*pre_programming)(struct mdss_mdp_ctl *ctl);
};

struct mdss_mdp_ctl {
@@ -355,9 +357,6 @@ struct mdss_mdp_ctl {
	struct mdss_rect roi;
	struct mdss_rect roi_bkup;

	bool cmd_autorefresh_en;
	int autorefresh_frame_cnt;

	struct blocking_notifier_head notifier_head;

	void *priv_data;
@@ -1483,10 +1482,10 @@ void mdss_mdp_ctl_restore(bool locked);
int  mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl, bool is_recovery);
int mdss_mdp_wait_for_xin_halt(u32 xin_id, bool is_vbif_nrt);
void mdss_mdp_set_ot_limit(struct mdss_mdp_set_ot_params *params);
int mdss_mdp_cmd_set_autorefresh_mode(struct mdss_mdp_ctl *ctl,
		int frame_cnt);
int mdss_mdp_ctl_cmd_autorefresh_enable(struct mdss_mdp_ctl *ctl,
		int frame_cnt);
int mdss_mdp_cmd_set_autorefresh_mode(struct mdss_mdp_ctl *ctl, int frame_cnt);
int mdss_mdp_cmd_get_autorefresh_mode(struct mdss_mdp_ctl *ctl);
int mdss_mdp_ctl_cmd_set_autorefresh(struct mdss_mdp_ctl *ctl, int frame_cnt);
int mdss_mdp_ctl_cmd_get_autorefresh(struct mdss_mdp_ctl *ctl);
int mdss_mdp_pp_get_version(struct mdp_pp_feature_version *version);

struct mdss_mdp_ctl *mdss_mdp_ctl_alloc(struct mdss_data_type *mdata,
+11 −2
Original line number Diff line number Diff line
@@ -2390,19 +2390,28 @@ int mdss_mdp_block_mixer_destroy(struct mdss_mdp_mixer *mixer)
	return 0;
}

int mdss_mdp_ctl_cmd_autorefresh_enable(struct mdss_mdp_ctl *ctl,
		int frame_cnt)
int mdss_mdp_ctl_cmd_set_autorefresh(struct mdss_mdp_ctl *ctl, int frame_cnt)
{
	int ret = 0;

	if (ctl->panel_data->panel_info.type == MIPI_CMD_PANEL) {
		ret = mdss_mdp_cmd_set_autorefresh_mode(ctl, frame_cnt);
	} else {
		pr_err("Mode not supported for this panel\n");
		ret = -EINVAL;
	}

	return ret;
}

int mdss_mdp_ctl_cmd_get_autorefresh(struct mdss_mdp_ctl *ctl)
{
	if (ctl->panel_data->panel_info.type == MIPI_CMD_PANEL)
		return mdss_mdp_cmd_get_autorefresh_mode(ctl);
	else
		return 0;
}

int mdss_mdp_ctl_splash_finish(struct mdss_mdp_ctl *ctl, bool handoff)
{
	switch (ctl->panel_data->panel_info.type) {
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2016, 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
@@ -933,6 +933,8 @@ static struct debug_bus dbg_bus_8996[] = {
	{ 0x348, 20, 0},
	{ 0x348, 20, 1},
	{ 0x348, 20, 3},

	{ 0x418, 60, 0},
};

static struct vbif_debug_bus vbif_dbg_bus_8996[] = {
@@ -1420,6 +1422,8 @@ int mdss_mdp_debugfs_init(struct mdss_data_type *mdata)
			&mdss_debugfs_safe_stats_fops);
	debugfs_create_bool("serialize_wait4pp", 0644, mdd->root,
		(u32 *)&mdata->serialize_wait4pp);
	debugfs_create_bool("wait4autorefresh", 0644, mdd->root,
		(u32 *)&mdata->wait4autorefresh);
	debugfs_create_bool("enable_gate", 0644, mdd->root,
		(u32 *)&mdata->enable_gate);

+551 −133

File changed.

Preview size limit exceeded, changes collapsed.

Loading