drm/amd/display: fix incorrect mpc_combine array size
authorWenjing Liu <wenjing.liu@amd.com>
Thu, 18 Jan 2024 20:14:15 +0000 (15:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 29 Jan 2024 20:45:43 +0000 (15:45 -0500)
[why]
MAX_SURFACES is per stream, while MAX_PLANES is per asic. The
mpc_combine is an array that records all the planes per asic. Therefore
MAX_PLANES should be used as the array size. Using MAX_SURFACES causes
array overflow when there are more than 3 planes.

[how]
Use the MAX_PLANES for the mpc_combine array size.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@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/dml/dcn32/dcn32_fpu.c

index 9b80f65c04664fda6cf894efd4eace076866ab14..a7981a0c4158f1ee9d944ef6af4aa075df3b361d 100644 (file)
@@ -1113,7 +1113,7 @@ struct pipe_slice_table {
                struct pipe_ctx *pri_pipe;
                struct dc_plane_state *plane;
                int slice_count;
-       } mpc_combines[MAX_SURFACES];
+       } mpc_combines[MAX_PLANES];
        int mpc_combine_count;
 };