Skip to content

Commit 3bae201

Browse files
Nicholas Kazlauskasalexdeucher
authored andcommitted
drm/amd/display: Calculate scaling ratios on every medium/full update
[Why] If a plane isn't being actively enabled or disabled then DC won't always recalculate scaling rects and ratios for the primary plane. This results in only a partial or corrupted rect being displayed on the screen instead of scaling to fit the screen. [How] Add back the logic to recalculate the scaling rects into dc_commit_updates_for_stream since this is the expected place to do it in DC. This was previously removed a few years ago to fix an underscan issue but underscan is still functional now with this change - and it should be, since this is only updating to the latest plane state getting passed in. Signed-off-by: Nicholas Kazlauskas <[email protected]> Reviewed-by: Aric Cyr <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3efcaf7 commit 3bae201

File tree

1 file changed

+12
-1
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ void dc_commit_updates_for_stream(struct dc *dc,
24642464
enum surface_update_type update_type;
24652465
struct dc_state *context;
24662466
struct dc_context *dc_ctx = dc->ctx;
2467-
int i;
2467+
int i, j;
24682468

24692469
stream_status = dc_stream_get_status(stream);
24702470
context = dc->current_state;
@@ -2502,6 +2502,17 @@ void dc_commit_updates_for_stream(struct dc *dc,
25022502

25032503
copy_surface_update_to_plane(surface, &srf_updates[i]);
25042504

2505+
if (update_type >= UPDATE_TYPE_MED) {
2506+
for (j = 0; j < dc->res_pool->pipe_count; j++) {
2507+
struct pipe_ctx *pipe_ctx =
2508+
&context->res_ctx.pipe_ctx[j];
2509+
2510+
if (pipe_ctx->plane_state != surface)
2511+
continue;
2512+
2513+
resource_build_scaling_params(pipe_ctx);
2514+
}
2515+
}
25052516
}
25062517

25072518
copy_stream_update_to_stream(dc, context, stream, stream_update);

0 commit comments

Comments
 (0)