提交 2ff6a14b 编写于 作者: R Robin Chen 提交者: Alex Deucher

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: NRobin Chen <po-tchen@amd.com>
Acked-by: NLeo Li <sunpeng.li@amd.com>
Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 f9f4daf1
...@@ -2827,6 +2827,18 @@ static void commit_planes_do_stream_update(struct dc *dc, ...@@ -2827,6 +2827,18 @@ static void commit_planes_do_stream_update(struct dc *dc,
} }
} }
static bool dc_dmub_should_send_dirty_rect_cmd(struct dc *dc, struct dc_stream_state *stream)
{
if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
return true;
if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_1 &&
dc->debug.enable_sw_cntl_psr)
return true;
return false;
}
void dc_dmub_update_dirty_rect(struct dc *dc, void dc_dmub_update_dirty_rect(struct dc *dc,
int surface_count, int surface_count,
struct dc_stream_state *stream, struct dc_stream_state *stream,
...@@ -2839,7 +2851,7 @@ void dc_dmub_update_dirty_rect(struct dc *dc, ...@@ -2839,7 +2851,7 @@ void dc_dmub_update_dirty_rect(struct dc *dc,
unsigned int i, j; unsigned int i, j;
unsigned int panel_inst = 0; unsigned int panel_inst = 0;
if (stream->link->psr_settings.psr_version != DC_PSR_VERSION_SU_1) if (!dc_dmub_should_send_dirty_rect_cmd(dc, stream))
return; return;
if (!dc_get_edp_link_panel_inst(dc, stream->link, &panel_inst)) if (!dc_get_edp_link_panel_inst(dc, stream->link, &panel_inst))
......
...@@ -3330,6 +3330,23 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) ...@@ -3330,6 +3330,23 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx)
return false; 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( static void dcn10_dmub_update_cursor_data(
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
struct hubp *hubp, struct hubp *hubp,
...@@ -3351,13 +3368,8 @@ static void dcn10_dmub_update_cursor_data( ...@@ -3351,13 +3368,8 @@ static void dcn10_dmub_update_cursor_data(
struct dc_debug_options *debug = &hubp->ctx->dc->debug; 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; 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 * if cur_pos == NULL means the caller is from cursor_set_attribute
* then driver use previous cursor position data * then driver use previous cursor position data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册