Skip to content

Commit 9941b81

Browse files
Yongqiang Sunalexdeucher
authored andcommitted
drm/amd/display: Not doing optimize bandwidth if flip pending.
[Why] In some scenario like 1366x768 VSR enabled connected with a 4K monitor and playing 4K video in clone mode, underflow will be observed due to decrease dppclk when previouse surface scan isn't finished [How] In this use case, surface flip is switching between 4K and 1366x768, 1366x768 needs smaller dppclk, and when decrease the clk and previous surface scan is for 4K and scan isn't done, underflow will happen. Not doing optimize bandwidth in case of flip pending. Signed-off-by: Yongqiang Sun <[email protected]> Reviewed-by: Tony Cheng <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8f43965 commit 9941b81

File tree

1 file changed

+23
-0
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,26 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
13601360
return (result == DC_OK);
13611361
}
13621362

1363+
static bool is_flip_pending_in_pipes(struct dc *dc, struct dc_state *context)
1364+
{
1365+
int i;
1366+
struct pipe_ctx *pipe;
1367+
1368+
for (i = 0; i < MAX_PIPES; i++) {
1369+
pipe = &context->res_ctx.pipe_ctx[i];
1370+
1371+
if (!pipe->plane_state)
1372+
continue;
1373+
1374+
/* Must set to false to start with, due to OR in update function */
1375+
pipe->plane_state->status.is_flip_pending = false;
1376+
dc->hwss.update_pending_status(pipe);
1377+
if (pipe->plane_state->status.is_flip_pending)
1378+
return true;
1379+
}
1380+
return false;
1381+
}
1382+
13631383
bool dc_post_update_surfaces_to_stream(struct dc *dc)
13641384
{
13651385
int i;
@@ -1370,6 +1390,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
13701390

13711391
post_surface_trace(dc);
13721392

1393+
if (is_flip_pending_in_pipes(dc, context))
1394+
return true;
1395+
13731396
for (i = 0; i < dc->res_pool->pipe_count; i++)
13741397
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
13751398
context->res_ctx.pipe_ctx[i].plane_state == NULL) {

0 commit comments

Comments
 (0)