summarylogtreecommitdiffstats
path: root/0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch
diff options
context:
space:
mode:
authorJeka2025-03-20 23:34:20 +0300
committerJeka2025-03-20 23:34:20 +0300
commite2603a165805a865040d5ffbe1db5dfcc1b15087 (patch)
tree3d387db5b9f5aecdb938052b953a942b95928833 /0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch
parenta9fcf6eb146bb99793f85b26567c1d3b350e5542 (diff)
downloadaur-linux-jcore.tar.gz
kernel release 6.13.7
Diffstat (limited to '0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch')
-rw-r--r--0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch b/0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch
new file mode 100644
index 000000000000..fc0211cae0dd
--- /dev/null
+++ b/0002-drm-amd-display-Avoid-divide-by-zero-by-initializing.patch
@@ -0,0 +1,31 @@
+From f2bcf1ee4c0bedfdc7e7611887372b62edd8a172 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Tue, 21 Jan 2025 16:03:52 -0600
+Subject: [PATCH 02/28] drm/amd/display: Avoid divide by zero by initializing
+ dummy pitch to 1
+
+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()
+
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+---
+ 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 bde4250853b1..f07afe451006 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.48.1
+