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

drm/amd/display: always acquire MPO pipe for every blending tree

[why]
We only acquire MPO pipe for blending tree where the plane clip will
be rendered. If an MPO plane is outside current ODM slice rect, we will
skip pipe allocation. With new programming policy we want to allocate
pipes for every ODM slice blending tree even for those whose ODM slice
rect doesn't intersect with plane clip. This is aligned with DML validation
so the pipe topology is programmed independently from the plane's
position and dst plane size.

[how]
- Remove the logic to allocate pipe only when the MPO plane intersects
with ODM slice and replace with the new logic to always allocate pipes.
- Remove the logic to tear down ODM configuration in favor for supporting
secondary MPO planes.
- Remove the logic to use full update when MPO goes accross ODM slice
boundary.
Reviewed-by: default avatarJun Lei <jun.lei@amd.com>
Acked-by: default avatarTom Chung <chiahsuan.chung@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 e75b965e
...@@ -2701,96 +2701,6 @@ static enum surface_update_type check_update_surfaces_for_stream( ...@@ -2701,96 +2701,6 @@ static enum surface_update_type check_update_surfaces_for_stream(
return overall_type; return overall_type;
} }
static bool dc_check_is_fullscreen_video(struct rect src, struct rect clip_rect)
{
int view_height, view_width, clip_x, clip_y, clip_width, clip_height;
view_height = src.height;
view_width = src.width;
clip_x = clip_rect.x;
clip_y = clip_rect.y;
clip_width = clip_rect.width;
clip_height = clip_rect.height;
/* check for centered video accounting for off by 1 scaling truncation */
if ((view_height - clip_y - clip_height <= clip_y + 1) &&
(view_width - clip_x - clip_width <= clip_x + 1) &&
(view_height - clip_y - clip_height >= clip_y - 1) &&
(view_width - clip_x - clip_width >= clip_x - 1)) {
/* when OS scales up/down to letter box, it may end up
* with few blank pixels on the border due to truncating.
* Add offset margin to account for this
*/
if (clip_x <= 4 || clip_y <= 4)
return true;
}
return false;
}
static enum surface_update_type check_boundary_crossing_for_windowed_mpo_with_odm(struct dc *dc,
struct dc_surface_update *srf_updates, int surface_count,
enum surface_update_type update_type)
{
enum surface_update_type new_update_type = update_type;
int i, j;
struct pipe_ctx *pipe = NULL;
struct dc_stream_state *stream;
/* Check that we are in windowed MPO with ODM
* - look for MPO pipe by scanning pipes for first pipe matching
* surface that has moved ( position change )
* - MPO pipe will have top pipe
* - check that top pipe has ODM pointer
*/
if ((surface_count > 1) && dc->config.enable_windowed_mpo_odm) {
for (i = 0; i < surface_count; i++) {
if (srf_updates[i].surface && srf_updates[i].scaling_info
&& srf_updates[i].surface->update_flags.bits.position_change) {
for (j = 0; j < dc->res_pool->pipe_count; j++) {
if (srf_updates[i].surface == dc->current_state->res_ctx.pipe_ctx[j].plane_state) {
pipe = &dc->current_state->res_ctx.pipe_ctx[j];
stream = pipe->stream;
break;
}
}
if (pipe && pipe->top_pipe && (get_num_odm_splits(pipe->top_pipe) > 0) && stream
&& !dc_check_is_fullscreen_video(stream->src, srf_updates[i].scaling_info->clip_rect)) {
struct rect old_clip_rect, new_clip_rect;
bool old_clip_rect_left, old_clip_rect_right, old_clip_rect_middle;
bool new_clip_rect_left, new_clip_rect_right, new_clip_rect_middle;
old_clip_rect = srf_updates[i].surface->clip_rect;
new_clip_rect = srf_updates[i].scaling_info->clip_rect;
old_clip_rect_left = ((old_clip_rect.x + old_clip_rect.width) <= (stream->src.x + (stream->src.width/2)));
old_clip_rect_right = (old_clip_rect.x >= (stream->src.x + (stream->src.width/2)));
old_clip_rect_middle = !old_clip_rect_left && !old_clip_rect_right;
new_clip_rect_left = ((new_clip_rect.x + new_clip_rect.width) <= (stream->src.x + (stream->src.width/2)));
new_clip_rect_right = (new_clip_rect.x >= (stream->src.x + (stream->src.width/2)));
new_clip_rect_middle = !new_clip_rect_left && !new_clip_rect_right;
if (old_clip_rect_left && new_clip_rect_middle)
new_update_type = UPDATE_TYPE_FULL;
else if (old_clip_rect_middle && new_clip_rect_right)
new_update_type = UPDATE_TYPE_FULL;
else if (old_clip_rect_right && new_clip_rect_middle)
new_update_type = UPDATE_TYPE_FULL;
else if (old_clip_rect_middle && new_clip_rect_left)
new_update_type = UPDATE_TYPE_FULL;
}
}
}
}
return new_update_type;
}
/* /*
* dc_check_update_surfaces_for_stream() - Determine update type (fast, med, or full) * dc_check_update_surfaces_for_stream() - Determine update type (fast, med, or full)
* *
...@@ -2822,10 +2732,6 @@ enum surface_update_type dc_check_update_surfaces_for_stream( ...@@ -2822,10 +2732,6 @@ enum surface_update_type dc_check_update_surfaces_for_stream(
updates[i].surface->update_flags.raw = 0xFFFFFFFF; updates[i].surface->update_flags.raw = 0xFFFFFFFF;
} }
if (type == UPDATE_TYPE_MED)
type = check_boundary_crossing_for_windowed_mpo_with_odm(dc,
updates, surface_count, type);
if (type == UPDATE_TYPE_FAST) { if (type == UPDATE_TYPE_FAST) {
// If there's an available clock comparator, we use that. // If there's an available clock comparator, we use that.
if (dc->clk_mgr->funcs->are_clock_states_equal) { if (dc->clk_mgr->funcs->are_clock_states_equal) {
......
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