From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0BDAC35AC03; Fri, 4 Sep 2026 06:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501963; cv=none; b=Z+6L/VPjzQDKx4W/lOX+HKRKJDSkb4TudT1pp+3yYydXUerVokCnbGxFauuMt2J31qMJcM+WMniLspaRsnyvJPFzxWJMFCB4Aqja6t5Qs4ckq0X67uH0+50bvQwWyTM/FHCvn+MD9XPa13lCZ0QsCVWrFPKyvoQ3r8w8cF7fddU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788501963; c=relaxed/simple; bh=eUgk5UgbXGSKKG1YGYvxl2X0Me7PirGo/lZYGLVnYRU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RTEynuxrHvoxzEDt3T/UAxHBrAG5wFKYzXhY8/E/88j5Da5mRmzZUAXF8/RR1GkDCfcBuOkZqV55DXs1oOAhKLt+KtyaFatC+P89E4oKXEEM3FiHELJLHI1E/ZLn4S9XmcioEV6ecszPBNXqoDrQr6rxDET9j/N31MvM5b9B/m0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BzMP82Rk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BzMP82Rk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63E1C1F00A3D; Fri, 4 Sep 2026 06:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788501961; bh=quTly7/3w4xSpauamyPCm4qbrrVDaEovz0dUMyf8hz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BzMP82RkIEg0En6IPkmdKo/guFM083NkVjLzY1xOeTB9uPfSXtQK9MzxSw6r0wUqr tvGD32pJb/qcamYTB8MiLJGm/O8VtH4Eosa/SZk5cQQoTda3AUr5xh4QEwfthp1Vtz aLHnN+hVdBsqWCOaPfWTUHoUTct44m931ge5YQRM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Hung , Mario Limonciello , Zaeem Mohamed , Mark Broadworth , Alex Deucher , Sasha Levin Subject: [PATCH 6.12 005/403] drm/amd/display: Avoid divide by zero by initializing dummy pitch to 1 Date: Fri, 4 Sep 2026 06:56:48 +0200 Message-ID: <20260904045734.933202925@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045734.806166532@linuxfoundation.org> References: <20260904045734.806166532@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Limonciello [ Upstream commit 7e40f64896e8e3dca471e287672db5ace12ea0be ] [Why] If the dummy values in `populate_dummy_dml_surface_cfg()` aren't updated then they can lead to a divide by zero in downstream callers like CalculateVMAndRowBytes() [How] Initialize dummy value to a value to avoid divide by zero. Reviewed-by: Alex Hung Signed-off-by: Mario Limonciello Signed-off-by: Zaeem Mohamed Tested-by: Mark Broadworth Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c index 405aefd14d9b4..c768306ca69e8 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c @@ -852,7 +852,7 @@ static void populate_dummy_dml_surface_cfg(struct dml_surface_cfg_st *out, unsig out->SurfaceWidthC[location] = in->timing.h_addressable; out->SurfaceHeightC[location] = in->timing.v_addressable; out->PitchY[location] = ((out->SurfaceWidthY[location] + 127) / 128) * 128; - out->PitchC[location] = 0; + out->PitchC[location] = 1; out->DCCEnable[location] = false; out->DCCMetaPitchY[location] = 0; out->DCCMetaPitchC[location] = 0; -- 2.53.0