Skip to content

Commit 73d4509

Browse files
Wenjing Liualexdeucher
authored andcommitted
drm/amd/display: fix incorrect stream_res allocation for older ASIC
[why] There is a recent work for developing a new pipe resource allocation policy used for new ASIC. The new code change needs to modify asic independent pipe resource allocation flow and hook up the new allocation policy in asic dependent layer. Unfortunately this change revealed a hidden bug in the old pipe resource allocation sequence used for older asics. In the older version of acquiring pipe for layer, we are always assigning otg master's opp and tg to the newly allocated secondary dpp pipe. This logic is incorrect when the secodnary dpp pipe is connected to a secondary opp head pipe in ODM combine configuration. Before the recent change, we will overwrite this wrong assignement in asic independent layer again. This covers up the issue. With the recent change, we will no longer cover up this in upper layer and therefore causes wrong tg and opp assignement to the secondary dpp pipe connected to a secondary opp head. [how] Always assign tg and opp from its own opp head instead of otg master. Reviewed-by: Martin Leung <martin.leung@amd.com> Acked-by: Stylon Wang <stylon.wang@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent d288c87 commit 73d4509

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,28 +2151,27 @@ struct pipe_ctx *dcn20_acquire_free_pipe_for_layer(
21512151
const struct dc_state *cur_ctx,
21522152
struct dc_state *new_ctx,
21532153
const struct resource_pool *pool,
2154-
const struct pipe_ctx *opp_head_pipe)
2154+
const struct pipe_ctx *opp_head)
21552155
{
21562156
struct resource_context *res_ctx = &new_ctx->res_ctx;
2157-
struct pipe_ctx *head_pipe = resource_get_head_pipe_for_stream(res_ctx, opp_head_pipe->stream);
2158-
struct pipe_ctx *idle_pipe = find_free_secondary_pipe_legacy(res_ctx, pool, head_pipe);
2157+
struct pipe_ctx *otg_master = resource_get_head_pipe_for_stream(res_ctx, opp_head->stream);
2158+
struct pipe_ctx *sec_dpp_pipe = find_free_secondary_pipe_legacy(res_ctx, pool, otg_master);
21592159

2160-
if (!head_pipe)
2161-
ASSERT(0);
2160+
ASSERT(otg_master);
21622161

2163-
if (!idle_pipe)
2162+
if (!sec_dpp_pipe)
21642163
return NULL;
21652164

2166-
idle_pipe->stream = head_pipe->stream;
2167-
idle_pipe->stream_res.tg = head_pipe->stream_res.tg;
2168-
idle_pipe->stream_res.opp = head_pipe->stream_res.opp;
2165+
sec_dpp_pipe->stream = opp_head->stream;
2166+
sec_dpp_pipe->stream_res.tg = opp_head->stream_res.tg;
2167+
sec_dpp_pipe->stream_res.opp = opp_head->stream_res.opp;
21692168

2170-
idle_pipe->plane_res.hubp = pool->hubps[idle_pipe->pipe_idx];
2171-
idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx];
2172-
idle_pipe->plane_res.dpp = pool->dpps[idle_pipe->pipe_idx];
2173-
idle_pipe->plane_res.mpcc_inst = pool->dpps[idle_pipe->pipe_idx]->inst;
2169+
sec_dpp_pipe->plane_res.hubp = pool->hubps[sec_dpp_pipe->pipe_idx];
2170+
sec_dpp_pipe->plane_res.ipp = pool->ipps[sec_dpp_pipe->pipe_idx];
2171+
sec_dpp_pipe->plane_res.dpp = pool->dpps[sec_dpp_pipe->pipe_idx];
2172+
sec_dpp_pipe->plane_res.mpcc_inst = pool->dpps[sec_dpp_pipe->pipe_idx]->inst;
21742173

2175-
return idle_pipe;
2174+
return sec_dpp_pipe;
21762175
}
21772176

21782177
bool dcn20_get_dcc_compression_cap(const struct dc *dc,

0 commit comments

Comments
 (0)