disp: msm: fix dsi debugbus in-mem logging

Update the dump_mem pointer offset while storing the debugbus
data for the second DSI to avoid overwriting to same memory.
As part of the change, register the DSI ctrl with sde_dbg from
ctrl_init directly, instead of debugfs_init to avoid code replication.

Change-Id: I4089f3038ffa89136eaea956d27270f638a99043
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Signed-off-by: Andhavarapu Karthik <kartkart@codeaurora.org>
This commit is contained in:
Veera Sundaram Sankaran 2021-04-27 15:56:02 -07:00 • committed by Andhavarapu Karthik
commit 2a15e531a3
2 changed files with 8 additions and 14 deletions

View file

@ -266,7 +266,6 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
{
int rc = 0;
struct dentry *dir, *state_file, *reg_dump, *cmd_dma_logs;
char dbg_name[DSI_DEBUG_NAME_LEN];
if (!dsi_ctrl || !parent) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
@ -329,10 +328,6 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
dsi_ctrl->debugfs_root = dir;
snprintf(dbg_name, DSI_DEBUG_NAME_LEN, "dsi%d_ctrl",
dsi_ctrl->cell_index);
sde_dbg_reg_register_base(dbg_name, dsi_ctrl->hw.base,
msm_iomap_size(dsi_ctrl->pdev, "dsi_ctrl"));
error_remove_dir:
debugfs_remove(dir);
error:
@ -345,16 +340,8 @@ static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
return 0;
}
#else
static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
struct dentry *parent)
static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
{
char dbg_name[DSI_DEBUG_NAME_LEN];
snprintf(dbg_name, DSI_DEBUG_NAME_LEN, "dsi%d_ctrl",
dsi_ctrl->cell_index);
sde_dbg_reg_register_base(dbg_name,
dsi_ctrl->hw.base,
msm_iomap_size(dsi_ctrl->pdev, "dsi_ctrl"));
return 0;
}
static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
@ -2350,6 +2337,7 @@ void dsi_ctrl_put(struct dsi_ctrl *dsi_ctrl)
*/
int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
{
char dbg_name[DSI_DEBUG_NAME_LEN];
int rc = 0;
if (!dsi_ctrl) {
@ -2371,6 +2359,10 @@ int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
goto error;
}
snprintf(dbg_name, DSI_DEBUG_NAME_LEN, "dsi%d_ctrl", dsi_ctrl->cell_index);
sde_dbg_reg_register_base(dbg_name, dsi_ctrl->hw.base,
msm_iomap_size(dsi_ctrl->pdev, "dsi_ctrl"));
error:
mutex_unlock(&dsi_ctrl->ctrl_lock);
return rc;

View file

@ -1041,6 +1041,8 @@ static void _sde_dbg_dump_dsi_dbg_bus(struct sde_dbg_sde_debug_bus *bus)
SDE_DBG_LOG_DUMP_ADDR(ctl_entry->name, dump_addr, list_size / dsi_count, 0);
_sde_dbg_dump_bus_entry(bus, entries, bus_size, ctl_entry->base, dump_addr);
if (dump_addr)
dump_addr += list_size / (sizeof(u32) * dsi_count);
}
mutex_unlock(&sde_dbg_dsi_mutex);