drm/amd/display: Collapse resource arrays when pipe is disabled
authorNoah Abradjian <noah.abradjian@amd.com>
Fri, 22 Nov 2019 21:07:24 +0000 (16:07 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Dec 2019 21:09:08 +0000 (16:09 -0500)
commitb9f1246df179522bc28fda50b720553c845863db
tree1945d5590926cde83bba5ddb7fac2dd49839656c
parentcf27a6d15d950ed1beb3926469c9eaa6907bbf88
drm/amd/display: Collapse resource arrays when pipe is disabled

[Why]
Currently, pipe resources are assigned to an index that matches the pipe position.
However, if pipe 1 or 2 is disabled, there will be a gap in the arrays which causes a crash when iterating based on pipe_count.

[How]
Fix resource construct to assign resources to minimum available array index.

Signed-off-by: Noah Abradjian <noah.abradjian@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c