From: jsg Date: Mon, 9 Sep 2024 09:03:58 +0000 (+0000) Subject: drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3f2cc29fb53672a77aab68cfe8bbcf340a08b716;p=openbsd drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration From Hersen Wu 8406158a546441b73f0b216aedacbf9a1e5748fb in linux-6.6.y/6.6.50 a54f7e866cc73a4cb71b8b24bb568ba35c8969df in mainline linux --- 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