drm/amd/display: include soc._clock_tmp[] into DC's scratch region
authorHamza Mahfooz <hamza.mahfooz@amd.com>
Mon, 8 Aug 2022 20:22:42 +0000 (16:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Aug 2022 22:17:31 +0000 (18:17 -0400)
commit0a8c91d7b694d122afe513e95908e8497cddc195
tree29b9f0f8007fd6694b9e10d77704a8e8bfd1c328
parenta4d3230353e493d98263c5d7f03ee6403ed82d71
drm/amd/display: include soc._clock_tmp[] into DC's scratch region

Currently, we are using soc._clock_tmp[] to temporarily store and modify
data from soc.clock_limits[] before copying it back into
soc.clock_limits[] (because modifying data directly in
soc.clock_limits[] causes unintended behavior). However, this approach
has a number of downsides, such as:

1. struct _vcs_dpi_soc_bounding_box_st's creation/destruction
   aren't well defined (which could mean more unintended
   behavior).
2. Throwing "temp" varibles in structs everywhere doesn't make
   for a particularly readable codebase.

For these reasons, we should get rid of soc._clock_tmp[] by defining a
struct scratch within struct dc that, contains within it all of the
temporary variables (including _clock_tmp[]) such that it is obvious how
they are intended to be used.

Co-authored-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
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