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

Commit 6bdce868 authored by Sandeep Panda's avatar Sandeep Panda Committed by Tharun Raj Soma
Browse files

drm/msm/dsi-staging: improve xlog debug support for dsi



This change adds more debug points in xlog for dsi
driver and also adds support to dump only dsi specific
registers along with dsi debug bus registers instead of
relying on full register dump every time.

Change-Id: I27c122e7aea146af8a0241142486a7cf5a408e80
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent 92a2b707
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -124,7 +124,8 @@ void dsi_phy_hw_v4_0_reset_clk_en_sel(struct dsi_phy_hw *phy);

/* DSI controller common ops */
u32 dsi_ctrl_hw_cmn_get_interrupt_status(struct dsi_ctrl_hw *ctrl);
void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl);
void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl, u32 *entries,
			       u32 size);
void dsi_ctrl_hw_cmn_clear_interrupt_status(struct dsi_ctrl_hw *ctrl, u32 ints);
void dsi_ctrl_hw_cmn_enable_status_interrupts(struct dsi_ctrl_hw *ctrl,
					     u32 ints);
+9 −2
Original line number Diff line number Diff line
@@ -248,6 +248,8 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
						dsi_ctrl->cell_index);
	sde_dbg_reg_register_base(dbg_name, dsi_ctrl->hw.base,
				msm_iomap_size(dsi_ctrl->pdev, "dsi_ctrl"));
	sde_dbg_reg_register_dump_range(dbg_name, dbg_name, 0,
				msm_iomap_size(dsi_ctrl->pdev, "dsi_ctrl"), 0);
error_remove_dir:
	debugfs_remove(dir);
error:
@@ -277,6 +279,8 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl,
	int rc = 0;
	struct dsi_ctrl_state_info *state = &dsi_ctrl->current_state;

	SDE_EVT32(dsi_ctrl->cell_index, op);

	switch (op) {
	case DSI_CTRL_OP_POWER_STATE_CHANGE:
		if (state->power_state == op_state) {
@@ -1832,11 +1836,14 @@ static struct platform_driver dsi_ctrl_driver = {

#if defined(CONFIG_DEBUG_FS)

void dsi_ctrl_debug_dump(void)
void dsi_ctrl_debug_dump(u32 *entries, u32 size)
{
	struct list_head *pos, *tmp;
	struct dsi_ctrl *ctrl = NULL;

	if (!entries || !size)
		return;

	mutex_lock(&dsi_ctrl_list_lock);
	list_for_each_safe(pos, tmp, &dsi_ctrl_list) {
		struct dsi_ctrl_list_item *n;
@@ -1844,7 +1851,7 @@ void dsi_ctrl_debug_dump(void)
		n = list_entry(pos, struct dsi_ctrl_list_item, list);
		ctrl = n->ctrl;
		pr_err("dsi ctrl:%d\n", ctrl->cell_index);
		ctrl->hw.ops.debug_bus(&ctrl->hw);
		ctrl->hw.ops.debug_bus(&ctrl->hw, entries, size);
	}
	mutex_unlock(&dsi_ctrl_list_lock);
}
+3 −1
Original line number Diff line number Diff line
@@ -463,8 +463,10 @@ struct dsi_ctrl_hw_ops {
	/**
	 * debug_bus() - get dsi debug bus status.
	 * @ctrl:        Pointer to the controller host hardware.
	 * @entries:     Array of dsi debug bus control values.
	 * @size:        Size of dsi debug bus control array.
	 */
	void (*debug_bus)(struct dsi_ctrl_hw *ctrl);
	void (*debug_bus)(struct dsi_ctrl_hw *ctrl, u32 *entries, u32 size);

	/**
	 * soft_reset() - perform a soft reset on DSI controller
+11 −9
Original line number Diff line number Diff line
@@ -485,18 +485,20 @@ void dsi_ctrl_hw_cmn_video_engine_setup(struct dsi_ctrl_hw *ctrl,
	pr_debug("[DSI_%d] Video engine setup done\n", ctrl->index);
}

void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl)
void dsi_ctrl_hw_cmn_debug_bus(struct dsi_ctrl_hw *ctrl, u32 *entries, u32 size)
{
	u32 reg = 0;

	DSI_W32(ctrl, DSI_DEBUG_BUS_CTL, 0x181);
	u32 reg = 0, i = 0;

	for (i = 0; i < size; i++) {
		DSI_W32(ctrl, DSI_DEBUG_BUS_CTL, entries[i]);
		/* make sure that debug test point is enabled */
		wmb();
		reg = DSI_R32(ctrl, DSI_DEBUG_BUS_STATUS);

	pr_err("[DSI_%d] debug bus status:0x%x\n", ctrl->index, reg);
		pr_err("[DSI_%d] debug bus ctrl: 0x%x status:0x%x\n",
				ctrl->index, entries[i], reg);
	}
}

/**
 * cmd_engine_setup() - setup dsi host controller for command mode
 * @ctrl:          Pointer to the controller host hardware.
+12 −0
Original line number Diff line number Diff line
@@ -761,6 +761,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display,
		rc = -EINVAL;
		goto release_panel_lock;
	}
	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);

	if (te_check_override && gpio_is_valid(dsi_display->disp_te_gpio))
		status_mode = ESD_MODE_PANEL_TE;
@@ -799,6 +800,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display,

release_panel_lock:
	dsi_panel_release_panel_lock(panel);
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);

	return rc;
}
@@ -3619,6 +3621,7 @@ static int dsi_display_dfps_update(struct dsi_display *display,
	/* For split DSI, update the clock master first */

	pr_debug("configuring seamless dynamic fps\n\n");
	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);

	m_ctrl = &display->ctrl[display->clk_master_idx];
	rc = dsi_ctrl_async_timing_update(m_ctrl->ctrl, timing);
@@ -3653,6 +3656,7 @@ static int dsi_display_dfps_update(struct dsi_display *display,
	panel_mode->dsi_mode_flags = 0;

error:
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
	return rc;
}

@@ -5996,6 +6000,7 @@ int dsi_display_prepare(struct dsi_display *display)
		return -EINVAL;
	}

	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
	mutex_lock(&display->display_lock);

	mode = display->panel->cur_mode;
@@ -6132,6 +6137,7 @@ int dsi_display_prepare(struct dsi_display *display)
	(void)dsi_panel_post_unprepare(display->panel);
error:
	mutex_unlock(&display->display_lock);
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
	return rc;
}

@@ -6399,6 +6405,7 @@ int dsi_display_enable(struct dsi_display *display)
		pr_err("no valid mode set for the display");
		return -EINVAL;
	}
	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);

	/* Engine states and panel states are populated during splash
	 * resource init and hence we return early
@@ -6484,6 +6491,7 @@ int dsi_display_enable(struct dsi_display *display)
	(void)dsi_panel_disable(display->panel);
error:
	mutex_unlock(&display->display_lock);
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
	return rc;
}

@@ -6546,6 +6554,7 @@ int dsi_display_disable(struct dsi_display *display)
		return -EINVAL;
	}

	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
	mutex_lock(&display->display_lock);

	rc = dsi_display_wake_up(display);
@@ -6574,6 +6583,7 @@ int dsi_display_disable(struct dsi_display *display)
		       display->name, rc);

	mutex_unlock(&display->display_lock);
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
	return rc;
}

@@ -6603,6 +6613,7 @@ int dsi_display_unprepare(struct dsi_display *display)
		return -EINVAL;
	}

	SDE_EVT32(SDE_EVTLOG_FUNC_ENTRY);
	mutex_lock(&display->display_lock);

	rc = dsi_display_wake_up(display);
@@ -6656,6 +6667,7 @@ int dsi_display_unprepare(struct dsi_display *display)
		       display->name, rc);

	mutex_unlock(&display->display_lock);
	SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
	return rc;
}

Loading