drm/amd/display: Disable AC/DC codepath when unnecessary
authorJoshua Aberback <joshua.aberback@amd.com>
Thu, 28 Mar 2024 17:43:36 +0000 (13:43 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 19:45:55 +0000 (15:45 -0400)
commit7662bc61c030edae9346dc56daa6109ce353f5b4
tree21cdae99f52796101499cabce4c4e97620fa8c53
parent78d18b6655fea3d9d8b30fd2b78b11749b4b981f
drm/amd/display: Disable AC/DC codepath when unnecessary

[WHY]
If there are no DC clock limits present, or if the DC limits are the same
as the AC limits, we can disable the AC/DC codepath as there won't be any
validation differences between the two modes.

[HOW]
When all DC power mode clock limits are the same as the max clock
values, there won't be any difference between AC mode and DC mode. Zero
out DC limits that equal max and provide a new cap to indicate the
presence of any non-zero DC mode limit. In summary:
 - zero out DC limits that are the same as max clock value
 - new dc cap to indicate the presence of DC mode limits
 - set limits present if any clock has distinct AC and DC values from SMU

Acked-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@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/clk_mgr/dcn401/dcn401_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c