From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E2351494DB; Thu, 5 Sep 2024 10:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725530516; cv=none; b=sbytjU7u644Db9tSxM+PMy1/MMxap+3VrsCWuVKD2Cw1pqERAxsTmk9pyuVywGvgjAslhgCrK0Q0pSBHY8sLHx0beUXMQes4njtYJL58yGdjswVpGCvn1JR/FZ9KsTsB/eq7i5hSGL/f+VQwP1/Z6y+0K2HD2jSk1WGlOXW9Apo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725530516; c=relaxed/simple; bh=B2fY8SuiFtTe73brBiMsSAg0e7jxkzeIb9QnSGR+gT4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ihsJ7JyBg04Cm6gEFkHq+1psNMXI8Jvy4vtS0DppfmHX8zG7pSJyGLdzQLmaZVVm281tYmcgJnywD20FH6YMx7mKLodMSL44Xry6WzFV5EYE/D7waYL/z4j775SSfX+NhpqevMIPh/80VXyqqaygL8/YRWLWpMl+3cfeFXOMoX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zkIEez8s; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zkIEez8s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD8E2C4CEC3; Thu, 5 Sep 2024 10:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725530516; bh=B2fY8SuiFtTe73brBiMsSAg0e7jxkzeIb9QnSGR+gT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zkIEez8sZ2mYJ72leOUVVuttnyHiDFthZ3M+xbPNweQ00/wLI6Ei60UFfwKIn6t9k Beave439Fj8H7IQidphDxo4XY/KyhMw4MBPJ/HmOg3gCGuhzj+L06jkJv2dxA0aWsu /wLbW7G4OpmeiAExrRLxoN8hqOqLM++lHQAuwuo0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Hung , Tom Chung , Hersen Wu , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 6.1 048/101] drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration Date: Thu, 5 Sep 2024 11:41:20 +0200 Message-ID: <20240905093718.017708683@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240905093716.075835938@linuxfoundation.org> References: <20240905093716.075835938@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hersen Wu [ Upstream commit a54f7e866cc73a4cb71b8b24bb568ba35c8969df ] [Why] Coverity reports Memory - illegal accesses. [How] Skip inactive planes. Reviewed-by: Alex Hung Acked-by: Tom Chung Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c index 1070cf870196..b2ad56c459ba 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +++ b/drivers/gpu/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 -- 2.43.0