Commit c51d8720 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist

[why]
In some cases such as 8k desktop surface with 144Hz timing, we decide to
enable ODM power optimization but this surface doesn't have a minimum
transition state. Therefore we cannot switch off ODM power optimization seamlessly
This creates path depedency on ODM power optimization decision. i.e
whether or not we should switch off ODM power optimization is dependent
on if the transition to switch off ODM power optimization from current state
is seamless. We don't desire a path dependent power optimization policy
as it is too dynamic and difficult to maintain.

[how]
Attempt ODM power optimization only after we can validate new state without
using pipe combine.
Reviewed-by: default avatarDillon Varone <dillon.varone@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c3040662
......@@ -1885,67 +1885,6 @@ bool dcn32_validate_bandwidth(struct dc *dc,
return out;
}
static bool should_allow_odm_power_optimization(struct dc *dc,
struct dc_state *context)
{
struct dc_stream_state *stream = context->streams[0];
/*
* this debug flag allows us to disable ODM power optimization feature
* unconditionally. we force the feature off if this is set to false.
*/
if (!dc->debug.enable_single_display_2to1_odm_policy)
return false;
/* current design and test coverage is only limited to allow ODM power
* optimization for single stream. Supporting it for multiple streams
* use case would require additional algorithm to decide how to
* optimize power consumption when there are not enough free pipes to
* allocate for all the streams. This level of optimization would
* require multiple attempts of revalidation to make an optimized
* decision. Unfortunately We do not support revalidation flow in
* current version of DML.
*/
if (context->stream_count != 1)
return false;
/*
* Our hardware doesn't support ODM for HDMI TMDS
*/
if (dc_is_hdmi_signal(stream->signal))
return false;
/*
* ODM Combine 2:1 requires horizontal timing divisible by 2 so each
* ODM segment has the same size.
*/
if (!is_h_timing_divisible_by_2(stream))
return false;
/*
* No power benefits if the timing's pixel clock is not high enough to
* raise display clock from minimum power state.
*/
if (stream->timing.pix_clk_100hz * 100 <= DCN3_2_VMIN_DISPCLK_HZ)
return false;
/* the new ODM power optimization feature reduces software design
* limitation and allows ODM power optimization to be supported even
* with presence of overlay planes. The new feature is enabled based on
* enable_windowed_mpo_odm flag. If the flag is not set, we limit our
* feature scope due to previous software design limitation */
if (!dc->config.enable_windowed_mpo_odm) {
if (context->stream_status[0].plane_count != 1)
return false;
if (stream->src.width >= 5120 &&
stream->src.width > stream->dst.width)
return false;
}
return true;
}
int dcn32_populate_dml_pipes_from_context(
struct dc *dc, struct dc_state *context,
display_e2e_pipe_params_st *pipes,
......@@ -1959,20 +1898,6 @@ int dcn32_populate_dml_pipes_from_context(
dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
/*
* Apply pipe split policy first so we can predict the pipe split correctly
* (dcn32_predict_pipe_split).
*/
for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
if (!res_ctx->pipe_ctx[i].stream)
continue;
if (should_allow_odm_power_optimization(dc, context))
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
else
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
pipe_cnt++;
}
for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
if (!res_ctx->pipe_ctx[i].stream)
......@@ -1985,6 +1910,7 @@ int dcn32_populate_dml_pipes_from_context(
dcn32_zero_pipe_dcc_fraction(pipes, pipe_cnt);
DC_FP_END();
pipes[pipe_cnt].pipe.dest.vfront_porch = timing->v_front_porch;
pipes[pipe_cnt].pipe.dest.odm_combine_policy = dm_odm_combine_policy_dal;
pipes[pipe_cnt].pipe.src.gpuvm_min_page_size_kbytes = 256; // according to spreadsheet
pipes[pipe_cnt].pipe.src.unbounded_req_mode = false;
pipes[pipe_cnt].pipe.scale_ratio_depth.lb_depth = dm_lb_19;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment