Commit a698b5cd authored by Abhinav Kumar's avatar Abhinav Kumar Committed by Rob Clark

drm/msm/disp/dpu1: add API to take DPU register snapshot

Add an API to take a snapshot of DPU controller registers. This API
will be used by the msm_disp_snapshot module to capture the DPU
snapshot.
Signed-off-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/1618606645-19695-6-git-send-email-abhinavk@codeaurora.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 0f6090f3
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "msm_drv.h" #include "msm_drv.h"
#include "msm_mmu.h" #include "msm_mmu.h"
#include "msm_gem.h" #include "msm_gem.h"
#include "disp/msm_disp_snapshot.h"
#include "dpu_kms.h" #include "dpu_kms.h"
#include "dpu_core_irq.h" #include "dpu_core_irq.h"
...@@ -798,6 +799,54 @@ static void dpu_irq_uninstall(struct msm_kms *kms) ...@@ -798,6 +799,54 @@ static void dpu_irq_uninstall(struct msm_kms *kms)
dpu_core_irq_uninstall(dpu_kms); dpu_core_irq_uninstall(dpu_kms);
} }
static void dpu_kms_mdp_snapshot(struct msm_kms *kms)
{
int i;
struct dpu_kms *dpu_kms;
struct dpu_mdss_cfg *cat;
struct dpu_hw_mdp *top;
struct msm_disp_state *disp_state;
disp_state = kms->disp_state;
dpu_kms = to_dpu_kms(kms);
cat = dpu_kms->catalog;
top = dpu_kms->hw_mdp;
pm_runtime_get_sync(&dpu_kms->pdev->dev);
/* dump CTL sub-blocks HW regs info */
for (i = 0; i < cat->ctl_count; i++)
msm_disp_snapshot_add_block(disp_state, cat->ctl[i].len,
dpu_kms->mmio + cat->ctl[i].base, "ctl_%d", i);
/* dump DSPP sub-blocks HW regs info */
for (i = 0; i < cat->dspp_count; i++)
msm_disp_snapshot_add_block(disp_state, cat->dspp[i].len,
dpu_kms->mmio + cat->dspp[i].base, "dspp_%d", i);
/* dump INTF sub-blocks HW regs info */
for (i = 0; i < cat->intf_count; i++)
msm_disp_snapshot_add_block(disp_state, cat->intf[i].len,
dpu_kms->mmio + cat->intf[i].base, "intf_%d", i);
/* dump PP sub-blocks HW regs info */
for (i = 0; i < cat->pingpong_count; i++)
msm_disp_snapshot_add_block(disp_state, cat->pingpong[i].len,
dpu_kms->mmio + cat->pingpong[i].base, "pingpong_%d", i);
/* dump SSPP sub-blocks HW regs info */
for (i = 0; i < cat->sspp_count; i++)
msm_disp_snapshot_add_block(disp_state, cat->sspp[i].len,
dpu_kms->mmio + cat->sspp[i].base, "sspp_%d", i);
msm_disp_snapshot_add_block(disp_state, top->hw.length,
dpu_kms->mmio + top->hw.blk_off, "top");
pm_runtime_put_sync(&dpu_kms->pdev->dev);
}
static const struct msm_kms_funcs kms_funcs = { static const struct msm_kms_funcs kms_funcs = {
.hw_init = dpu_kms_hw_init, .hw_init = dpu_kms_hw_init,
.irq_preinstall = dpu_irq_preinstall, .irq_preinstall = dpu_irq_preinstall,
...@@ -818,6 +867,7 @@ static const struct msm_kms_funcs kms_funcs = { ...@@ -818,6 +867,7 @@ static const struct msm_kms_funcs kms_funcs = {
.round_pixclk = dpu_kms_round_pixclk, .round_pixclk = dpu_kms_round_pixclk,
.destroy = dpu_kms_destroy, .destroy = dpu_kms_destroy,
.set_encoder_mode = _dpu_kms_set_encoder_mode, .set_encoder_mode = _dpu_kms_set_encoder_mode,
.snapshot = dpu_kms_mdp_snapshot,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
.debugfs_init = dpu_kms_debugfs_init, .debugfs_init = dpu_kms_debugfs_init,
#endif #endif
......
...@@ -122,6 +122,10 @@ struct msm_kms_funcs { ...@@ -122,6 +122,10 @@ struct msm_kms_funcs {
bool cmd_mode); bool cmd_mode);
/* cleanup: */ /* cleanup: */
void (*destroy)(struct msm_kms *kms); void (*destroy)(struct msm_kms *kms);
/* snapshot: */
void (*snapshot)(struct msm_kms *kms);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
/* debugfs: */ /* debugfs: */
int (*debugfs_init)(struct msm_kms *kms, struct drm_minor *minor); int (*debugfs_init)(struct msm_kms *kms, struct drm_minor *minor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment