[PATCH 04/12] drm/amd/display: Decrease stack size in logging path

Aurabindo Pillai aurabindo.pillai at amd.com
Wed Aug 20 20:19:54 UTC 2025


From: Reza Amini <reza.amini at amd.com>

[why]
Reducing stack size can avoid stack over flow

[how]
Make local variables const and static so they are not
on the stack.

Reviewed-by: Dillon Varone <dillon.varone at amd.com>
Signed-off-by: Reza Amini <reza.amini at amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
index 79c9bea78c47..d633033c98f2 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
@@ -328,7 +328,7 @@ static void dcn10_log_hubp_states(struct dc *dc, void *log_ctx)
 	}
 
 	DTN_INFO("\n=======HUBP FL======\n");
-	char pLabels[18][50] = {
+	static const char * const pLabels[] = {
 		"inst", "Enabled ", "Done ", "adr_mode ", "width ", "mpc_width ",
 		"tmz", "xbar_sel_R", "xbar_sel_G", "xbar_sel_B", "adr_hi ",
 		"adr_low", "REFCYC", "Bias", "Scale", "Mode",
@@ -552,7 +552,7 @@ static void dcn10_log_color_state(struct dc *dc,
 		 dc->caps.color.mpc.ogam_ram,
 		 dc->caps.color.mpc.ocsc);
 	DTN_INFO("===== MPC RMCM 3DLUT =====\n");
-	char pLabels[19][50] = {
+	static const char * const pLabels[] = {
 		"MPCC", "SIZE", "MODE", "MODE_CUR", "RD_SEL",
 		"30BIT_EN", "WR_EN_MASK", "RAM_SEL", "OUT_NORM_FACTOR", "FL_SEL",
 		"OUT_OFFSET", "OUT_SCALE", "FL_DONE", "SOFT_UNDERFLOW", "HARD_UNDERFLOW",
-- 
2.50.1



More information about the amd-gfx mailing list