Commit eb9d6c7e authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm: pass dump state as a function argument

Instead of always getting the disp_state from drm device, pass it as an
argument.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
Link: https://lore.kernel.org/r/20210427001828.2375555-2-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 2ec5b3dc
...@@ -799,15 +799,12 @@ static void dpu_irq_uninstall(struct msm_kms *kms) ...@@ -799,15 +799,12 @@ 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) static void dpu_kms_mdp_snapshot(struct msm_disp_state *disp_state, struct msm_kms *kms)
{ {
int i; int i;
struct dpu_kms *dpu_kms; struct dpu_kms *dpu_kms;
struct dpu_mdss_cfg *cat; struct dpu_mdss_cfg *cat;
struct dpu_hw_mdp *top; struct dpu_hw_mdp *top;
struct msm_disp_state *disp_state;
disp_state = kms->disp_state;
dpu_kms = to_dpu_kms(kms); dpu_kms = to_dpu_kms(kms);
......
...@@ -104,14 +104,6 @@ void msm_disp_snapshot_destroy(struct drm_device *drm_dev); ...@@ -104,14 +104,6 @@ void msm_disp_snapshot_destroy(struct drm_device *drm_dev);
*/ */
void msm_disp_snapshot_state(struct drm_device *drm_dev); void msm_disp_snapshot_state(struct drm_device *drm_dev);
/**
* msm_disp_state_get - get the handle to msm_disp_state struct from the drm device
* @drm: handle to drm device
* Returns: handle to the msm_disp_state struct
*/
struct msm_disp_state *msm_disp_state_get(struct drm_device *drm);
/** /**
* msm_disp_state_print - print out the current dpu state * msm_disp_state_print - print out the current dpu state
* @disp_state: handle to drm device * @disp_state: handle to drm device
......
...@@ -69,17 +69,6 @@ static void msm_disp_state_print_regs(u32 **reg, u32 len, void __iomem *base_add ...@@ -69,17 +69,6 @@ static void msm_disp_state_print_regs(u32 **reg, u32 len, void __iomem *base_add
} }
} }
struct msm_disp_state *msm_disp_state_get(struct drm_device *drm)
{
struct msm_drm_private *priv;
struct msm_kms *kms;
priv = drm->dev_private;
kms = priv->kms;
return kms->disp_state;
}
void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p) void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p)
{ {
struct msm_disp_state_block *block, *tmp; struct msm_disp_state_block *block, *tmp;
...@@ -138,17 +127,17 @@ void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state) ...@@ -138,17 +127,17 @@ void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state)
kms = priv->kms; kms = priv->kms;
if (priv->dp) if (priv->dp)
msm_dp_snapshot(priv->dp); msm_dp_snapshot(disp_state, priv->dp);
for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) {
if (!priv->dsi[i]) if (!priv->dsi[i])
continue; continue;
msm_dsi_snapshot(priv->dsi[i]); msm_dsi_snapshot(disp_state, priv->dsi[i]);
} }
if (kms->funcs->snapshot) if (kms->funcs->snapshot)
kms->funcs->snapshot(kms); kms->funcs->snapshot(disp_state, kms);
msm_disp_capture_atomic_state(disp_state); msm_disp_capture_atomic_state(disp_state);
} }
......
...@@ -1039,15 +1039,13 @@ int dp_display_get_test_bpp(struct msm_dp *dp) ...@@ -1039,15 +1039,13 @@ int dp_display_get_test_bpp(struct msm_dp *dp)
dp_display->link->test_video.test_bit_depth); dp_display->link->test_video.test_bit_depth);
} }
void msm_dp_snapshot(struct msm_dp *dp) void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp)
{ {
struct dp_display_private *dp_display; struct dp_display_private *dp_display;
struct drm_device *drm; struct drm_device *drm;
struct msm_disp_state *disp_state;
dp_display = container_of(dp, struct dp_display_private, dp_display); dp_display = container_of(dp, struct dp_display_private, dp_display);
drm = dp->drm_dev; drm = dp->drm_dev;
disp_state = msm_disp_state_get(drm);
/* /*
* if we are reading registers we need the link clocks to be on * if we are reading registers we need the link clocks to be on
......
...@@ -266,8 +266,8 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, ...@@ -266,8 +266,8 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
return ret; return ret;
} }
void msm_dsi_snapshot(struct msm_dsi *msm_dsi) void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi)
{ {
msm_dsi_host_snapshot(msm_dsi->host); msm_dsi_host_snapshot(disp_state, msm_dsi->host);
} }
...@@ -91,7 +91,7 @@ static inline bool msm_dsi_device_connected(struct msm_dsi *msm_dsi) ...@@ -91,7 +91,7 @@ static inline bool msm_dsi_device_connected(struct msm_dsi *msm_dsi)
return msm_dsi->panel || msm_dsi->external_bridge; return msm_dsi->panel || msm_dsi->external_bridge;
} }
void msm_dsi_snapshot(struct msm_dsi *msm_dsi); void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi);
struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi); struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi);
...@@ -149,7 +149,7 @@ int dsi_clk_init_v2(struct msm_dsi_host *msm_host); ...@@ -149,7 +149,7 @@ int dsi_clk_init_v2(struct msm_dsi_host *msm_host);
int dsi_clk_init_6g_v2(struct msm_dsi_host *msm_host); int dsi_clk_init_6g_v2(struct msm_dsi_host *msm_host);
int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_dual_dsi); int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_dual_dsi);
int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi); int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi);
void msm_dsi_host_snapshot(struct mipi_dsi_host *host); void msm_dsi_host_snapshot(struct msm_disp_state *disp_state, struct mipi_dsi_host *host);
/* dsi phy */ /* dsi phy */
struct msm_dsi_phy; struct msm_dsi_phy;
struct msm_dsi_phy_shared_timings { struct msm_dsi_phy_shared_timings {
......
...@@ -2488,13 +2488,9 @@ struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host) ...@@ -2488,13 +2488,9 @@ struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host)
return of_drm_find_bridge(msm_host->device_node); return of_drm_find_bridge(msm_host->device_node);
} }
void msm_dsi_host_snapshot(struct mipi_dsi_host *host) void msm_dsi_host_snapshot(struct msm_disp_state *disp_state, struct mipi_dsi_host *host)
{ {
struct msm_dsi_host *msm_host = to_msm_dsi_host(host); struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
struct drm_device *dev = msm_host->dev;
struct msm_disp_state *disp_state;
disp_state = msm_disp_state_get(dev);
pm_runtime_get_sync(&msm_host->pdev->dev); pm_runtime_get_sync(&msm_host->pdev->dev);
......
...@@ -367,7 +367,8 @@ void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, ...@@ -367,7 +367,8 @@ void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder,
struct drm_display_mode *mode, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode); struct drm_display_mode *adjusted_mode);
void msm_dp_irq_postinstall(struct msm_dp *dp_display); void msm_dp_irq_postinstall(struct msm_dp *dp_display);
void msm_dp_snapshot(struct msm_dp *dp_display); struct msm_disp_state;
void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp_display);
void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor); void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor);
......
...@@ -124,7 +124,7 @@ struct msm_kms_funcs { ...@@ -124,7 +124,7 @@ struct msm_kms_funcs {
void (*destroy)(struct msm_kms *kms); void (*destroy)(struct msm_kms *kms);
/* snapshot: */ /* snapshot: */
void (*snapshot)(struct msm_kms *kms); void (*snapshot)(struct msm_disp_state *disp_state, struct msm_kms *kms);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
/* debugfs: */ /* debugfs: */
......
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