From: Tony Cheng <[email protected]> [Why] A BLS builder should read what dc_core changed from the update flags instead of comparing the current and new states itself.
[How] dc_state_compute_update_flags copies the update flags of each stream into streams[], and the update bits of the plane on each pipe into the plane field of its pipe flags. No builder reads them yet. Cc: Jun Lei <[email protected]> Signed-off-by: Tony Cheng <[email protected]> Signed-off-by: Chenyu Chen <[email protected]> --- drivers/gpu/drm/amd/display/dc/core/dc_state.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc_state_priv.h | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c index 961c3c1ea51f..7eadf802c3e9 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c @@ -1174,6 +1174,8 @@ static void pipe_flags(const struct pipe_ctx *pipe, pipe->plane_res.hubp && pipe->plane_res.dpp && pipe->stream_res.opp; flags->det_size = pipe->hubp_regs.det_size; + if (pipe->plane_state) + flags->plane = pipe->plane_state->update_bits; } enum dc_status dc_state_compute_update_flags(const struct dc_state *cur_state, @@ -1191,5 +1193,7 @@ enum dc_status dc_state_compute_update_flags(const struct dc_state *cur_state, pipe_flags(&target_state->res_ctx.pipe_ctx[i], &out_flags->new_pipes[i]); } + for (i = 0; i < target_state->stream_count && i < MAX_STREAMS; i++) + out_flags->streams[i] = target_state->streams[i]->update_flags; return DC_OK; } diff --git a/drivers/gpu/drm/amd/display/dc/dc_state_priv.h b/drivers/gpu/drm/amd/display/dc/dc_state_priv.h index 0415e45d438e..c73c08989bd9 100644 --- a/drivers/gpu/drm/amd/display/dc/dc_state_priv.h +++ b/drivers/gpu/drm/amd/display/dc/dc_state_priv.h @@ -136,12 +136,18 @@ struct dc_state_pipe_flags { bool has_plane; /* The DET size from hubp_regs. */ uint32_t det_size; + /* What dc_core changed on the plane of the pipe. */ + struct pipe_update_bits plane; }; -/* The facts of pipe i in the current and in the target state. */ +/* + * The facts of pipe i in the current and in the target state, and what + * dc_core changed on stream i of the target state. + */ struct dc_state_update_flags { struct dc_state_pipe_flags cur_pipes[MAX_PIPES]; struct dc_state_pipe_flags new_pipes[MAX_PIPES]; + union stream_update_flags streams[MAX_STREAMS]; }; /* Pure: reads both states and writes only out_flags. */ -- 2.43.0
