Skip to content

Commit 8fef253

Browse files
Yihan Zhualexdeucher
authored andcommitted
drm/amd/display: update pipe selection policy to check head pipe
[Why] No check on head pipe during the dml to dc hw mapping will allow illegal pipe usage. This will result in a wrong pipe topology to cause mpcc tree totally mess up then cause a display hang. [How] Avoid to use the pipe is head in all check and avoid ODM slice during preferred pipe check. Cc: [email protected] Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Yihan Zhu <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6104112 commit 8fef253

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,25 @@ static unsigned int find_preferred_pipe_candidates(const struct dc_state *existi
258258
* However this condition comes with a caveat. We need to ignore pipes that will
259259
* require a change in OPP but still have the same stream id. For example during
260260
* an MPC to ODM transiton.
261+
*
262+
* Adding check to avoid pipe select on the head pipe by utilizing dc resource
263+
* helper function resource_get_primary_dpp_pipe and comparing the pipe index.
261264
*/
262265
if (existing_state) {
263266
for (i = 0; i < pipe_count; i++) {
264267
if (existing_state->res_ctx.pipe_ctx[i].stream && existing_state->res_ctx.pipe_ctx[i].stream->stream_id == stream_id) {
268+
struct pipe_ctx *head_pipe =
269+
resource_is_pipe_type(&existing_state->res_ctx.pipe_ctx[i], DPP_PIPE) ?
270+
resource_get_primary_dpp_pipe(&existing_state->res_ctx.pipe_ctx[i]) :
271+
NULL;
272+
273+
// we should always respect the head pipe from selection
274+
if (head_pipe && head_pipe->pipe_idx == i)
275+
continue;
265276
if (existing_state->res_ctx.pipe_ctx[i].plane_res.hubp &&
266-
existing_state->res_ctx.pipe_ctx[i].plane_res.hubp->opp_id != i)
277+
existing_state->res_ctx.pipe_ctx[i].plane_res.hubp->opp_id != i &&
278+
(existing_state->res_ctx.pipe_ctx[i].prev_odm_pipe ||
279+
existing_state->res_ctx.pipe_ctx[i].next_odm_pipe))
267280
continue;
268281

269282
preferred_pipe_candidates[num_preferred_candidates++] = i;
@@ -292,6 +305,14 @@ static unsigned int find_last_resort_pipe_candidates(const struct dc_state *exis
292305
*/
293306
if (existing_state) {
294307
for (i = 0; i < pipe_count; i++) {
308+
struct pipe_ctx *head_pipe =
309+
resource_is_pipe_type(&existing_state->res_ctx.pipe_ctx[i], DPP_PIPE) ?
310+
resource_get_primary_dpp_pipe(&existing_state->res_ctx.pipe_ctx[i]) :
311+
NULL;
312+
313+
// we should always respect the head pipe from selection
314+
if (head_pipe && head_pipe->pipe_idx == i)
315+
continue;
295316
if ((existing_state->res_ctx.pipe_ctx[i].plane_res.hubp &&
296317
existing_state->res_ctx.pipe_ctx[i].plane_res.hubp->opp_id != i) ||
297318
existing_state->res_ctx.pipe_ctx[i].stream_res.tg)

0 commit comments

Comments
 (0)