diff options
author | Robin Chen <po-tchen@amd.com> | 2022-04-22 12:25:38 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-06-07 23:09:57 +0300 |
commit | 2ff6a14b20298db0763772b62cd4fb030e6d7f75 (patch) | |
tree | 95688c726830a01a5e8ff77c49d2f76bf58db08a /drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |
parent | f9f4daf15398c3aa0aa2dcd05ed4ea2544bcc62c (diff) | |
download | linux-2ff6a14b20298db0763772b62cd4fb030e6d7f75.tar.xz |
drm/amd/display: refactor dirty rect dmub command decision
[Why]
To wrap the decision logic of sending dirty rect dmub command
for both frame update and cursor update path.
Signed-off-by: Robin Chen <po-tchen@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index 351a923fbf73..573d5be9e302 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -3330,6 +3330,23 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) return false; } +static bool dcn10_dmub_should_update_cursor_data( + struct pipe_ctx *pipe_ctx, + struct dc_debug_options *debug) +{ + if (pipe_ctx->plane_state->address.type == PLN_ADDR_TYPE_VIDEO_PROGRESSIVE) + return false; + + if (pipe_ctx->stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1) + return true; + + if (pipe_ctx->stream->link->psr_settings.psr_version == DC_PSR_VERSION_1 && + debug->enable_sw_cntl_psr) + return true; + + return false; +} + static void dcn10_dmub_update_cursor_data( struct pipe_ctx *pipe_ctx, struct hubp *hubp, @@ -3351,13 +3368,8 @@ static void dcn10_dmub_update_cursor_data( struct dc_debug_options *debug = &hubp->ctx->dc->debug; - if (!debug->enable_sw_cntl_psr && pipe_ctx->stream->link->psr_settings.psr_version != DC_PSR_VERSION_SU_1) + if (!dcn10_dmub_should_update_cursor_data(pipe_ctx, debug)) return; - - if (pipe_ctx->stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED || - pipe_ctx->plane_state->address.type == PLN_ADDR_TYPE_VIDEO_PROGRESSIVE) - return; - /** * if cur_pos == NULL means the caller is from cursor_set_attribute * then driver use previous cursor position data |