Skip to content

Commit 8ecfef9

Browse files
lumagrobclark
authored andcommitted
drm/msm/dpu: add dpu_plane_atomic_print_state
Implement plane's atomic_print_state() callback, printing DPU-specific plane state: blending stage, SSPP and multirect mode and index. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] [DB: marked pdpu and pstate as const] Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 53b5333 commit 8ecfef9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,46 @@ dpu_plane_duplicate_state(struct drm_plane *plane)
13061306
return &pstate->base;
13071307
}
13081308

1309+
static const char * const multirect_mode_name[] = {
1310+
[DPU_SSPP_MULTIRECT_NONE] = "none",
1311+
[DPU_SSPP_MULTIRECT_PARALLEL] = "parallel",
1312+
[DPU_SSPP_MULTIRECT_TIME_MX] = "time_mx",
1313+
};
1314+
1315+
static const char * const multirect_index_name[] = {
1316+
[DPU_SSPP_RECT_SOLO] = "solo",
1317+
[DPU_SSPP_RECT_0] = "rect_0",
1318+
[DPU_SSPP_RECT_1] = "rect_1",
1319+
};
1320+
1321+
static const char *dpu_get_multirect_mode(enum dpu_sspp_multirect_mode mode)
1322+
{
1323+
if (WARN_ON(mode >= ARRAY_SIZE(multirect_mode_name)))
1324+
return "unknown";
1325+
1326+
return multirect_mode_name[mode];
1327+
}
1328+
1329+
static const char *dpu_get_multirect_index(enum dpu_sspp_multirect_index index)
1330+
{
1331+
if (WARN_ON(index >= ARRAY_SIZE(multirect_index_name)))
1332+
return "unknown";
1333+
1334+
return multirect_index_name[index];
1335+
}
1336+
1337+
static void dpu_plane_atomic_print_state(struct drm_printer *p,
1338+
const struct drm_plane_state *state)
1339+
{
1340+
const struct dpu_plane_state *pstate = to_dpu_plane_state(state);
1341+
const struct dpu_plane *pdpu = to_dpu_plane(state->plane);
1342+
1343+
drm_printf(p, "\tstage=%d\n", pstate->stage);
1344+
drm_printf(p, "\tsspp=%s\n", pdpu->pipe_hw->cap->name);
1345+
drm_printf(p, "\tmultirect_mode=%s\n", dpu_get_multirect_mode(pstate->multirect_mode));
1346+
drm_printf(p, "\tmultirect_index=%s\n", dpu_get_multirect_index(pstate->multirect_index));
1347+
}
1348+
13091349
static void dpu_plane_reset(struct drm_plane *plane)
13101350
{
13111351
struct dpu_plane *pdpu;
@@ -1445,6 +1485,7 @@ static const struct drm_plane_funcs dpu_plane_funcs = {
14451485
.reset = dpu_plane_reset,
14461486
.atomic_duplicate_state = dpu_plane_duplicate_state,
14471487
.atomic_destroy_state = dpu_plane_destroy_state,
1488+
.atomic_print_state = dpu_plane_atomic_print_state,
14481489
.late_register = dpu_plane_late_register,
14491490
.format_mod_supported = dpu_plane_format_mod_supported,
14501491
};

0 commit comments

Comments
 (0)