summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamson Tam <samson.tam@amd.com>2023-10-06 17:36:16 -0400
committerAlex Deucher <alexander.deucher@amd.com>2023-10-26 19:00:31 -0400
commit8d0f4cd2ae44ebe50ff85a49fb248e64f28b6d66 (patch)
treebe5c48cb48d4415852c6a2571011c1c1069f8a3e
parentf583db812bc9a97384303761932768e44d1d92a3 (diff)
downloadlinux-stable-8d0f4cd2ae44ebe50ff85a49fb248e64f28b6d66.tar.gz
linux-stable-8d0f4cd2ae44ebe50ff85a49fb248e64f28b6d66.tar.bz2
linux-stable-8d0f4cd2ae44ebe50ff85a49fb248e64f28b6d66.zip
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: 40de8403b998 ("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>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index d13904548505..74c21d98b4de 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3575,7 +3575,8 @@ static void wait_for_outstanding_hw_updates(struct dc *dc, const struct dc_state
mpcc_inst = hubp->inst;
// MPCC inst is equal to pipe index in practice
for (opp_inst = 0; opp_inst < opp_count; opp_inst++) {
- if (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst]) {
+ if ((dc->res_pool->opps[opp_inst] != NULL) &&
+ (dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst])) {
dc->res_pool->mpc->funcs->wait_for_idle(dc->res_pool->mpc, mpcc_inst);
dc->res_pool->opps[opp_inst]->mpcc_disconnect_pending[mpcc_inst] = false;
break;