From: jsg Date: Tue, 19 Sep 2023 12:54:40 +0000 (+0000) Subject: drm/amd/display: Fix a bug when searching for insert_above_mpcc X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f052e0f682b7d4eb02abdb624d8a53afc3453374;p=openbsd drm/amd/display: Fix a bug when searching for insert_above_mpcc From Wesley Chalmers 77b49370a261c9c79587d4a83960d5db39ee6cfa in linux-6.1.y/6.1.54 3d028d5d60d516c536de1ddd3ebf3d55f3f8983b in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c index 8e9384094f6..f2f55565e98 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c @@ -212,8 +212,9 @@ struct mpcc *mpc1_insert_plane( /* check insert_above_mpcc exist in tree->opp_list */ struct mpcc *temp_mpcc = tree->opp_list; - while (temp_mpcc && temp_mpcc->mpcc_bot != insert_above_mpcc) - temp_mpcc = temp_mpcc->mpcc_bot; + if (temp_mpcc != insert_above_mpcc) + while (temp_mpcc && temp_mpcc->mpcc_bot != insert_above_mpcc) + temp_mpcc = temp_mpcc->mpcc_bot; if (temp_mpcc == NULL) return NULL; }