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 6DF0D34DCC8 for ; Thu, 11 Jun 2026 13:01:50 +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=1781182911; cv=none; b=WdXnWuPZBYugQrA2l0zr0ccXk4WaTorqodpIMRTXvVx3KvT5FUxcerqQqXTMyLLYaHgPpeTtdpHHIGgWvdlXLXuNzh9jmpVWjNb/5Dbn0AYR6E7WV1wNFCPz39pULP6x2+uZCuwHuWBT6+L1KxDLwMUjCIp2KCR34ETjBBp2osU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781182911; c=relaxed/simple; bh=jfyTREl2qj0pJW9meEgy90wwXWzksQKJIR6IYvs8Gs4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=VYT5YiT7XAF55ATgQxqu0NOREWCCFnhNJk07IX3pZOxGV8rsF2P/io0/ecUvfFJpkDy7qZrHYOkCB3xZX/89mL2q9uY/9zeT5PHh8ngGacTB5WtopmSnrnjCUwUmjFmZsF/GaXuWcMIAa+SGpCRUAZGeh2XXQAL6+7I1cq7Q3x4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eiwdcB1V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eiwdcB1V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E2B51F00899; Thu, 11 Jun 2026 13:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781182910; bh=meJ1afBorEUNqejpXl9IdpFcRhnoq1YC3B4Naj940b8=; h=From:To:Cc:Subject:Date; b=eiwdcB1VPLBtfoLVjijtaF0gae0TMfChxNlrnRhr38Y2C6g/PvmFdCgvxXwvEjYPs Rtsj1luq96zgwOM89VA/3U/9/Lz2qN3aHxxdTyaik/FJZD+G03VDfWrYyw6hOQDynO alQT7ABXCBa/4Bw85OHIww8OdysIofwHCpiVd5iPGKvs7YAUrtEg9xB3+ixybfjm71 D95E62l3LJVv19sc/74YWm2B6TOnsyEl1Q7Ys4V1P5VJh+u26lYQRVV6iUT7W6eNrg BndAOCVj8TK+3xeFyQv9IZz0YAXIjoppCWR0YArLto1vJArFUyKAFFgrwmlXU8Mp+l 7aQjvCvFGbfIg== From: Arnd Bergmann To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , James Lin , Alvin Lee , Bhuvanachandra Pinninti Cc: Arnd Bergmann , Rodrigo Siqueira , Dillon Varone , Nicholas Kazlauskas , Alex Hung , Ivan Lipski , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amd/display: avoid large stack allocation in commit_planes_do_stream_update_sequence Date: Thu, 11 Jun 2026 15:01:19 +0200 Message-Id: <20260611130141.3387920-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann The function has two arrays on the stack to hold temporary dsc_optc_config and dsc_config objects. The combination blows through common stack frame warning limits in combination with the other local variables: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:4070:22: error: stack frame size (1352) exceeds limit (1280) in 'commit_planes_do_stream_update_sequence' [-Werror,-Wframe-larger-than] Since neither array is initialized or used outside of the add_link_update_dsc_config_sequence() function, there is no actual need to keep each element around. Replace the arrays with a single instance each to reduce the stack usage to less than half. Fixes: 9f49d3cd7e71 ("drm/amd/display: Implement block sequencing infrastructure for modular hardware operations.") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/core/dc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index bcdbf3471039..72762c4fa392 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -4077,8 +4077,6 @@ static void commit_planes_do_stream_update_sequence(struct dc *dc, { int j; struct block_sequence_state seq_state = { .steps = block_sequence, .num_steps = num_steps }; - struct dsc_config dsc_cfgs[MAX_PIPES]; - struct dsc_optc_config dsc_optc_cfgs[MAX_PIPES]; unsigned int dsc_cfg_index = 0; *num_steps = 0; // Initialize to 0 @@ -4150,11 +4148,13 @@ static void commit_planes_do_stream_update_sequence(struct dc *dc, if (stream_update->dsc_config) if (dsc_cfg_index < MAX_PIPES) { + struct dsc_config dsc_cfg; + struct dsc_optc_config dsc_optc_cfg; + add_link_update_dsc_config_sequence(&seq_state, pipe_ctx, - &dsc_cfgs[dsc_cfg_index], - &dsc_optc_cfgs[dsc_cfg_index]); - dsc_cfg_index++; + &dsc_cfg, + &dsc_optc_cfg); } if (stream_update->mst_bw_update) { -- 2.39.5