drm/amd/display: Increase block_sequence array size
authorJoshua Aberback <joshua.aberback@amd.com>
Wed, 8 Jan 2025 17:03:23 +0000 (12:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 13 Feb 2025 02:02:57 +0000 (21:02 -0500)
[Why]
It's possible to generate more than 50 steps in hwss_build_fast_sequence,
for example with a 6-pipe asic where all pipes are in one MPC chain. This
overflows the block_sequence buffer and corrupts block_sequence_steps,
causing a crash.

[How]
Expand block_sequence to 100 items. A naive upper bound on the possible
number of steps for a 6-pipe asic, ignoring the potential for steps to be
mutually exclusive, is 91 with current code, therefore 100 is sufficient.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/inc/core_types.h

index d558efc6e12f9d4bbc36c702894742a8d4672dfb..652d52040f4e615210d2ace0aa482703fbd2ffc4 100644 (file)
@@ -627,7 +627,7 @@ struct dc_state {
         */
        struct bw_context bw_ctx;
 
-       struct block_sequence block_sequence[50];
+       struct block_sequence block_sequence[100];
        unsigned int block_sequence_steps;
        struct dc_dmub_cmd dc_dmub_cmd[10];
        unsigned int dmub_cmd_count;