Skip to content

Commit 8d0f4cd

Browse files
Samson Tamalexdeucher
authored andcommitted
drm/amd/display: add null check for invalid opps
[Why] In cases where number of pipes available is less than num_opp, there will opp instances that are null [How] Add null check to skip over these opp instances Fixes: 40de840 ("drm/amd/display: Update OPP counter from new interface") Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Acked-by: Roman Li <roman.li@amd.com> Signed-off-by: Samson Tam <samson.tam@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f583db8 commit 8d0f4cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/gpu/drm/amd/display/dc/core

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3575,7 +3575,8 @@ static void wait_for_outstanding_hw_updates(struct dc *dc, const struct dc_state
35753575
mpcc_inst = hubp->inst;
35763576
// MPCC inst is equal to pipe index in practice
35773577
for (opp_inst = 0; opp_inst < opp_count; opp_inst++) {
3578-
if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) {
3578+
if ((dc->res_pool->opps[opp_inst] != NULL) &&
3579+
(dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst])) {
35793580
dc->res_pool->mpc->funcs->wait_for_idle(dc->res_pool->mpc, mpcc_inst);
35803581
dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false;
35813582
break;

0 commit comments

Comments
 (0)