summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 09:03:59 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 09:03:59 +0000
commit1e014b5a0ea25ee7a5a4b894c487f9b80116edad (patch)
tree1606e768506c34923c1cd3b9658a6b7d3a6bf1d7
parent97b49c8c8c4b5d9df8b85c83588056f6f6eed2e9 (diff)
drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration
From Hersen Wu 8406158a546441b73f0b216aedacbf9a1e5748fb in linux-6.6.y/6.6.50 a54f7e866cc73a4cb71b8b24bb568ba35c8969df in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dml/display_mode_vba.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dml/display_mode_vba.c b/sys/dev/pci/drm/amd/display/dc/dml/display_mode_vba.c
index 9a3ded31119..85453bbb4f9 100644
--- a/sys/dev/pci/drm/amd/display/dc/dml/display_mode_vba.c
+++ b/sys/dev/pci/drm/amd/display/dc/dml/display_mode_vba.c
@@ -1099,8 +1099,13 @@ void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib)
// Total Available Pipes Support Check
for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; ++k) {
- total_pipes += mode_lib->vba.DPPPerPlane[k];
pipe_idx = get_pipe_idx(mode_lib, k);
+ if (pipe_idx == -1) {
+ ASSERT(0);
+ continue; // skip inactive planes
+ }
+ total_pipes += mode_lib->vba.DPPPerPlane[k];
+
if (mode_lib->vba.cache_pipes[pipe_idx].clks_cfg.dppclk_mhz > 0.0)
mode_lib->vba.DPPCLK[k] = mode_lib->vba.cache_pipes[pipe_idx].clks_cfg.dppclk_mhz;
else