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

Commit 893b5d2a authored by Raviteja Tamatam's avatar Raviteja Tamatam Committed by Abhijith Desai
Browse files

msm: mdss: add additional debug code for timeout issues



Added debug code to analyze vbif and display data path
for debugging pingpong timeout issues.

Change-Id: Ice4b9dbeab96edeb90f665747479243dad55351a
Signed-off-by: default avatarRaviteja Tamatam <travitej@codeaurora.org>
Signed-off-by: default avatarAbhijith Desai <desaia@codeaurora.org>
parent 97e3b829
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include "mdss_dsi.h"
#include "mdss_mdp.h"
#include "mdss_debug.h"

/*
 * mdss_check_te_status() - Check the status of panel for TE based ESD.
@@ -155,6 +156,7 @@ void mdss_check_dsi_ctrl_status(struct work_struct *work, uint32_t interval)
		ctl->ops.wait_pingpong(ctl, NULL);

	pr_debug("%s: DSI ctrl wait for ping pong done\n", __func__);
	MDSS_XLOG(mipi->mode);

	mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
	ret = ctrl_pdata->check_status(ctrl_pdata);
+52 −1
Original line number Diff line number Diff line
@@ -93,6 +93,48 @@ static inline bool mdss_xlog_is_enabled(u32 flag)
		(flag == MDSS_XLOG_ALL && mdss_dbg_xlog.xlog_enable);
}

static void __halt_vbif_xin(void)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();

	pr_err("Halting VBIF-XIN\n");
	MDSS_VBIF_WRITE(mdata, MMSS_VBIF_XIN_HALT_CTRL0, 0xFFFFFFFF, false);
}

static void __halt_vbif_axi(void)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();

	pr_err("Halting VBIF-AXI\n");
	MDSS_VBIF_WRITE(mdata, MMSS_VBIF_AXI_HALT_CTRL0, 0xFFFFFFFF, false);
}

static void __dump_vbif_state(void)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	unsigned int reg_vbif_src_err, reg_vbif_err_info,
		reg_vbif_xin_halt_ctrl0, reg_vbif_xin_halt_ctrl1,
		reg_vbif_axi_halt_ctrl0, reg_vbif_axi_halt_ctrl1;

	reg_vbif_src_err = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_SRC_ERR, false);
	reg_vbif_err_info = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_ERR_INFO, false);
	reg_vbif_xin_halt_ctrl0 = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_XIN_HALT_CTRL0, false);
	reg_vbif_xin_halt_ctrl1 = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_XIN_HALT_CTRL1, false);
	reg_vbif_axi_halt_ctrl0 = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_AXI_HALT_CTRL0, false);
	reg_vbif_axi_halt_ctrl1 = MDSS_VBIF_READ(mdata,
					MMSS_VBIF_AXI_HALT_CTRL1, false);
	pr_err("VBIF SRC_ERR=%x, ERR_INFO=%x\n",
				reg_vbif_src_err, reg_vbif_err_info);
	pr_err("VBIF XIN_HALT_CTRL0=%x, XIN_HALT_CTRL1=%x, AXI_HALT_CTRL0=%x, AXI_HALT_CTRL1=%x\n"
			, reg_vbif_xin_halt_ctrl0, reg_vbif_xin_halt_ctrl1,
			reg_vbif_axi_halt_ctrl0, reg_vbif_axi_halt_ctrl1);
}

void mdss_xlog(const char *name, int line, int flag, ...)
{
	unsigned long flags;
@@ -604,9 +646,18 @@ static void mdss_xlog_dump_array(struct mdss_debug_base *blk_arr[],
		mdss_dump_dsi_debug_bus(mdss_dbg_xlog.enable_dsi_dbgbus_dump,
			&mdss_dbg_xlog.dsi_dbgbus_dump);

	if (dead && mdss_dbg_xlog.panic_on_err)
	if (dead && mdss_dbg_xlog.panic_on_err) {
		mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON);
		__dump_vbif_state();
		__halt_vbif_xin();
		usleep_range(10000, 10010);
		__halt_vbif_axi();
		usleep_range(10000, 10010);
		__dump_vbif_state();
		mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
		panic(name);
	}
}

static void xlog_debug_work(struct work_struct *work)
{
+1 −0
Original line number Diff line number Diff line
@@ -2133,6 +2133,7 @@ static int mdss_fb_blank(int blank_mode, struct fb_info *info)
	}

	ret = mdss_fb_blank_sub(blank_mode, info, mfd->op_enable);
	MDSS_XLOG(blank_mode);

end:
	mutex_unlock(&mfd->mdss_sysfs_lock);
+4 −0
Original line number Diff line number Diff line
@@ -5770,6 +5770,10 @@ int mdss_mdp_display_commit(struct mdss_mdp_ctl *ctl, void *arg,
		mdss_mdp_bwcpanic_ctrl(mdata, true);

	ATRACE_BEGIN("flush_kickoff");

	MDSS_XLOG(ctl->intf_num, ctl_flush_bits, sctl_flush_bits,
		mdss_mdp_ctl_read(ctl, MDSS_MDP_REG_CTL_FLUSH), split_lm_valid);

	mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, ctl_flush_bits);
	if (sctl && sctl_flush_bits) {
		mdss_mdp_ctl_write(sctl, MDSS_MDP_REG_CTL_FLUSH,
+2 −0
Original line number Diff line number Diff line
@@ -820,6 +820,8 @@ enum mdss_mdp_pingpong_index {
#define MMSS_VBIF_WR_LIM_CONF			0x0C0
#define MMSS_VBIF_OUT_RD_LIM_CONF0		0x0D0

#define MMSS_VBIF_SRC_ERR		0x194
#define MMSS_VBIF_ERR_INFO		0x1A0
#define MMSS_VBIF_XIN_HALT_CTRL0	0x200
#define MMSS_VBIF_XIN_HALT_CTRL1	0x204
#define MMSS_VBIF_AXI_HALT_CTRL0	0x208
Loading