@@ -362,6 +362,7 @@ static void dpu_kms_global_destroy_state(struct drm_private_obj *obj,
static const struct drm_private_state_funcs dpu_kms_global_state_funcs = {
.atomic_duplicate_state = dpu_kms_global_duplicate_state,
.atomic_destroy_state = dpu_kms_global_destroy_state,
+ .atomic_print_state = dpu_rm_print_state,
};
static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms)
@@ -375,6 +376,9 @@ static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms)
drm_atomic_private_obj_init(dpu_kms->dev, &dpu_kms->global_state,
&state->base,
&dpu_kms_global_state_funcs);
+
+ state->rm = &dpu_kms->rm;
+
return 0;
}
@@ -130,6 +130,8 @@ struct vsync_info {
struct dpu_global_state {
struct drm_private_state base;
+ struct dpu_rm *rm;
+
uint32_t pingpong_to_enc_id[PINGPONG_MAX - PINGPONG_0];
uint32_t mixer_to_enc_id[LM_MAX - LM_0];
uint32_t ctl_to_enc_id[CTL_MAX - CTL_0];
@@ -652,3 +652,51 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
return num_blks;
}
+
+void dpu_rm_print_state(struct drm_printer *p,
+ const struct drm_private_state *state)
+{
+ const struct dpu_global_state *global_state = to_dpu_global_state(state);
+ const struct dpu_rm *rm = global_state->rm;
+ int i;
+
+ drm_puts(p, "pingpong:");
+ for (i = 0; i < ARRAY_SIZE(global_state->pingpong_to_enc_id); i++)
+ if (rm->pingpong_blks[i])
+ drm_printf(p, " %d,", global_state->pingpong_to_enc_id[i]);
+ else
+ drm_puts(p, " -,");
+ drm_puts(p, "\n");
+
+ drm_puts(p, "mixer:");
+ for (i = 0; i < ARRAY_SIZE(global_state->mixer_to_enc_id); i++)
+ if (rm->mixer_blks[i])
+ drm_printf(p, " %d,", global_state->mixer_to_enc_id[i]);
+ else
+ drm_puts(p, " -,");
+ drm_puts(p, "\n");
+
+ drm_puts(p, "ctl:");
+ for (i = 0; i < ARRAY_SIZE(global_state->ctl_to_enc_id); i++)
+ if (rm->ctl_blks[i])
+ drm_printf(p, " %d,", global_state->ctl_to_enc_id[i]);
+ else
+ drm_puts(p, " -,");
+ drm_puts(p, "\n");
+
+ drm_puts(p, "dspp:");
+ for (i = 0; i < ARRAY_SIZE(global_state->dspp_to_enc_id); i++)
+ if (rm->dspp_blks[i])
+ drm_printf(p, " %d,", global_state->dspp_to_enc_id[i]);
+ else
+ drm_puts(p, " -,");
+ drm_puts(p, "\n");
+
+ drm_puts(p, "dsc:");
+ for (i = 0; i < ARRAY_SIZE(global_state->dsc_to_enc_id); i++)
+ if (rm->dsc_blks[i])
+ drm_printf(p, " %d,", global_state->dsc_to_enc_id[i]);
+ else
+ drm_puts(p, " -,");
+ drm_puts(p, "\n");
+}
@@ -92,6 +92,14 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
struct dpu_global_state *global_state, uint32_t enc_id,
enum dpu_hw_blk_type type, struct dpu_hw_blk **blks, int blks_size);
+/**
+ * dpu_rm_print_state - output the RM private state
+ * @p: DRM printer
+ * @state: private object state
+ */
+void dpu_rm_print_state(struct drm_printer *p,
+ const struct drm_private_state *state);
+
/**
* dpu_rm_get_intf - Return a struct dpu_hw_intf instance given it's index.
* @rm: DPU Resource Manager handle
Provide atomic_print_state callback to the DPU's private object. This way the debugfs/dri/0/state will also include RM's internal state. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 +++ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 2 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 48 +++++++++++++++++++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 8 +++++ 4 files changed, 62 insertions(+)