From: Rodrigo Siqueira <rodrigo.siqueira@xxxxxxx> If some part of the driver tries to call resource_get_opp_heads_for_otg_master in a non-OTG master context, DC will trigger a dmesg warning since this situation indicates that some configuration associated with ODM slices might be wrong. This commit adds an extra log to describe why the warning was triggered to make the debugging more straightforward. Reviewed-by: Wenjing Liu <wenjing.liu@xxxxxxx> Acked-by: Hamza Mahfooz <hamza.mahfooz@xxxxxxx> Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@xxxxxxx> --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 87e84b0a3d48..1cba8f58f1e6 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -1917,9 +1917,15 @@ int resource_get_opp_heads_for_otg_master(const struct pipe_ctx *otg_master, struct pipe_ctx *opp_heads[MAX_PIPES]) { struct pipe_ctx *opp_head = &res_ctx->pipe_ctx[otg_master->pipe_idx]; + struct dc *dc = otg_master->stream->ctx->dc; int i = 0; + DC_LOGGER_INIT(dc->ctx->logger); + if (!resource_is_pipe_type(otg_master, OTG_MASTER)) { + DC_LOG_WARNING("%s called from a non OTG master, something " + "is wrong in the pipe configuration", + __func__); ASSERT(0); return 0; } -- 2.45.1