Skip to content

Commit 6b6352d

Browse files
jleiamdalexdeucher
authored andcommitted
drm/amd/display: Disable idle optimizations before programming DCN
[Why] Programming DCN is explicitly forbidden during idle optimzations allowed state. Existing implemenation relies on OS/DM, which is not robust. Instead DC should sequence this. Note that DC will not re-enter idle optimized state on its own, it is only responsible for catching out of sequence calls. It is still DM responsibility to sequence appropriate for optimized power, but this change removes the requirement for DM to cover the .1% case. [How] - elevate updates during idle optimized state to full updates - disable idle power optimizations prior to programming Signed-off-by: Jun Lei <[email protected]> Reviewed-by: Jun Lei <[email protected]> Acked-by: Eryk Brol <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c5892a1 commit 6b6352d

File tree

1 file changed

+16
-2
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+16
-2
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
12501250
int i, k, l;
12511251
struct dc_stream_state *dc_streams[MAX_STREAMS] = {0};
12521252

1253+
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
1254+
dc_allow_idle_optimizations(dc, false);
1255+
#endif
12531256

12541257
for (i = 0; i < context->stream_count; i++)
12551258
dc_streams[i] = context->streams[i];
@@ -1838,6 +1841,11 @@ static enum surface_update_type check_update_surfaces_for_stream(
18381841
int i;
18391842
enum surface_update_type overall_type = UPDATE_TYPE_FAST;
18401843

1844+
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
1845+
if (dc->idle_optimizations_allowed)
1846+
overall_type = UPDATE_TYPE_FULL;
1847+
1848+
#endif
18411849
if (stream_status == NULL || stream_status->plane_count != surface_count)
18421850
overall_type = UPDATE_TYPE_FULL;
18431851

@@ -2306,8 +2314,14 @@ static void commit_planes_for_stream(struct dc *dc,
23062314
}
23072315
}
23082316

2309-
if (update_type == UPDATE_TYPE_FULL && dc->optimize_seamless_boot_streams == 0) {
2310-
dc->hwss.prepare_bandwidth(dc, context);
2317+
if (update_type == UPDATE_TYPE_FULL) {
2318+
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
2319+
dc_allow_idle_optimizations(dc, false);
2320+
2321+
#endif
2322+
if (dc->optimize_seamless_boot_streams == 0)
2323+
dc->hwss.prepare_bandwidth(dc, context);
2324+
23112325
context_clock_trace(dc, context);
23122326
}
23132327

0 commit comments

Comments
 (0)