summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-09-19 12:54:41 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-09-19 12:54:41 +0000
commit5922f6856965df6887d3c61743b7d56a73053eb6 (patch)
tree1ca326ebf7b2f7ee285f04a9d00ac4945373d12c /sys
parenta8338cc430a9f118454faeebf16f9cc26380ab32 (diff)
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
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_mpc.c5
1 files changed, 3 insertions, 2 deletions
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;
}