diff mbox series

[v5,6/7] drm/msm: add support to take dsi, dp and dpu snapshot

Message ID 1618606645-19695-7-git-send-email-abhinavk@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series Add devcoredump support for DPU | expand

Commit Message

Abhinav Kumar April 16, 2021, 8:57 p.m. UTC
Add support to take the register snapshot of dsi, dp and dpu
modules.

Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
---
 drivers/gpu/drm/msm/disp/msm_disp_snapshot.h      |  1 +
 drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h
index 11dfa57..7e075e7 100644
--- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h
+++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h
@@ -27,6 +27,7 @@ 
 #include <linux/devcoredump.h>
 #include <stdarg.h>
 #include "msm_kms.h"
+#include "dsi.h"
 
 #define MSM_DISP_SNAPSHOT_MAX_BLKS		10
 
diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
index 024ca49..44dc682 100644
--- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
+++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
@@ -130,9 +130,25 @@  void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state)
 {
 	struct msm_drm_private *priv;
 	struct drm_device *drm_dev;
+	struct msm_kms *kms;
+	int i;
 
 	drm_dev = disp_state->drm_dev;
 	priv = drm_dev->dev_private;
+	kms = priv->kms;
+
+	if (priv->dp)
+		msm_dp_snapshot(priv->dp);
+
+	for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
+		if (!priv->dsi[i])
+			continue;
+
+		msm_dsi_snapshot(priv->dsi[i]);
+	}
+
+	if (kms->funcs->snapshot)
+		kms->funcs->snapshot(kms);
 
 	msm_disp_capture_atomic_state(disp_state);
 }