drm/amd/display: Use pre-allocated temp struct for bounding box update
authorLeo Li <sunpeng.li@amd.com>
Wed, 8 Jun 2022 16:17:44 +0000 (12:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jun 2022 01:38:40 +0000 (21:38 -0400)
commit1f474c8742fd53a048cc8cc4b20e20b2614397eb
tree1b27c71435cce99bf6a458fadec9c92d93ab026e
parentea937ad6e925994b94d17555e4c2f2f9a99234e1
drm/amd/display: Use pre-allocated temp struct for bounding box update

[Why]

There is a theoretical problem in prior patches for reducing the stack
size of *update_bw_bounding_box() functions.

By modifying the soc.clock_limits[n] struct directly, this can cause
unintended behavior as the for loop attempts to swap rows in
clock_limits[n]. A temporary struct is still required to make sure we
stay functinoally equivalent.

[How]

Add a temporary clock_limits table to the SOC struct, and use it when
swapping rows.

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h