From bd3e9f6c14c3f35a8e6c9c775e126963ef1c3f8f Mon Sep 17 00:00:00 2001 From: Jayaprakash Date: Mon, 9 Nov 2020 17:17:01 +0530 Subject: [PATCH] disp: msm: sde: add optional sde register writes in event logs Add changes to configure register writes in the event log dump. The register writes can be enabled in the dump through the debug_fs command. Change-Id: I08154e193f670999746fbb30291a866db85c8c8d Signed-off-by: Jayaprakash --- msm/sde/sde_hw_util.c | 1 + msm/sde_dbg.h | 8 ++++++++ msm/sde_io_util.c | 1 + 3 files changed, 10 insertions(+) diff --git a/msm/sde/sde_hw_util.c b/msm/sde/sde_hw_util.c index cc759aa25194..4890e8c9541c 100644 --- a/msm/sde/sde_hw_util.c +++ b/msm/sde/sde_hw_util.c @@ -76,6 +76,7 @@ void sde_reg_write(struct sde_hw_blk_reg_map *c, if (c->log_mask & sde_hw_util_log_mask) SDE_DEBUG_DRIVER("[%s:0x%X] <= 0x%X\n", name, c->blk_off + reg_off, val); + SDE_EVT32_REGWRITE(c->blk_off, reg_off, val); writel_relaxed(val, c->base_off + c->blk_off + reg_off); SDE_REG_LOG(c->log_mask ? ilog2(c->log_mask)+1 : 0, val, c->blk_off + reg_off); diff --git a/msm/sde_dbg.h b/msm/sde_dbg.h index 365ec928d88a..44ba3c145dc0 100644 --- a/msm/sde_dbg.h +++ b/msm/sde_dbg.h @@ -35,6 +35,7 @@ enum sde_dbg_evtlog_flag { SDE_EVTLOG_IRQ = BIT(1), SDE_EVTLOG_VERBOSE = BIT(2), SDE_EVTLOG_EXTERNAL = BIT(3), + SDE_EVTLOG_REGWRITE = BIT(4), SDE_EVTLOG_ALWAYS = -1 }; @@ -200,6 +201,13 @@ extern struct sde_dbg_reglog *sde_dbg_base_reglog; #define SDE_EVT32_EXTERNAL(...) sde_evtlog_log(sde_dbg_base_evtlog, __func__, \ __LINE__, SDE_EVTLOG_EXTERNAL, ##__VA_ARGS__, \ SDE_EVTLOG_DATA_LIMITER) +/** + * SDE_EVT32_REGWRITE - Write a list of 32bit values for register writes logging + * ... - variable arguments + */ +#define SDE_EVT32_REGWRITE(...) sde_evtlog_log(sde_dbg_base_evtlog, __func__, \ + __LINE__, SDE_EVTLOG_REGWRITE, ##__VA_ARGS__, \ + SDE_EVTLOG_DATA_LIMITER) /** * SDE_DBG_DUMP - trigger dumping of all sde_dbg facilities diff --git a/msm/sde_io_util.c b/msm/sde_io_util.c index 1403fa067f01..1961dae2d0a6 100644 --- a/msm/sde_io_util.c +++ b/msm/sde_io_util.c @@ -36,6 +36,7 @@ void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug) DEV_DBG("[%08x] => %08x [%08x]\n", (u32)(unsigned long)(io->base + offset), value, in_val); + SDE_EVT32_REGWRITE(io->base, offset, value, in_val); } SDE_REG_LOG(SDE_REG_LOG_RSCC, value, offset); } /* dss_reg_w */