Commit 4b675aad authored by Joshua Aberback's avatar Joshua Aberback Committed by Alex Deucher

drm/amd/display: Update idle optimization handling

[How]
 - use dc interface instead of hwss interface in cursor functions, to keep
dc->idle_optimizations_allowed updated
 - add dc interface to check if idle optimizations might apply to a plane
Signed-off-by: default avatarJoshua Aberback <joshua.aberback@amd.com>
Acked-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0825d965
...@@ -3039,4 +3039,10 @@ void dc_lock_memory_clock_frequency(struct dc *dc) ...@@ -3039,4 +3039,10 @@ void dc_lock_memory_clock_frequency(struct dc *dc)
if (dc->current_state->res_ctx.pipe_ctx[i].plane_state) if (dc->current_state->res_ctx.pipe_ctx[i].plane_state)
core_link_enable_stream(dc->current_state, &dc->current_state->res_ctx.pipe_ctx[i]); core_link_enable_stream(dc->current_state, &dc->current_state->res_ctx.pipe_ctx[i]);
} }
bool dc_is_plane_eligible_for_idle_optimizaitons(struct dc *dc,
struct dc_plane_state *plane)
{
return false;
}
#endif #endif
...@@ -298,7 +298,7 @@ bool dc_stream_set_cursor_attributes( ...@@ -298,7 +298,7 @@ bool dc_stream_set_cursor_attributes(
#if defined(CONFIG_DRM_AMD_DC_DCN3_0) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
/* disable idle optimizations while updating cursor */ /* disable idle optimizations while updating cursor */
if (dc->idle_optimizations_allowed) { if (dc->idle_optimizations_allowed) {
dc->hwss.apply_idle_power_optimizations(dc, false); dc_allow_idle_optimizations(dc, false);
reset_idle_optimizations = true; reset_idle_optimizations = true;
} }
...@@ -326,7 +326,7 @@ bool dc_stream_set_cursor_attributes( ...@@ -326,7 +326,7 @@ bool dc_stream_set_cursor_attributes(
#if defined(CONFIG_DRM_AMD_DC_DCN3_0) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
/* re-enable idle optimizations if necessary */ /* re-enable idle optimizations if necessary */
if (reset_idle_optimizations) if (reset_idle_optimizations)
dc->hwss.apply_idle_power_optimizations(dc, true); dc_allow_idle_optimizations(dc, true);
#endif #endif
return true; return true;
...@@ -359,9 +359,8 @@ bool dc_stream_set_cursor_position( ...@@ -359,9 +359,8 @@ bool dc_stream_set_cursor_position(
#if defined(CONFIG_DRM_AMD_DC_DCN3_0) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
/* disable idle optimizations if enabling cursor */ /* disable idle optimizations if enabling cursor */
if (dc->idle_optimizations_allowed && if (dc->idle_optimizations_allowed && !stream->cursor_position.enable && position->enable) {
!stream->cursor_position.enable && position->enable) { dc_allow_idle_optimizations(dc, false);
dc->hwss.apply_idle_power_optimizations(dc, false);
reset_idle_optimizations = true; reset_idle_optimizations = true;
} }
...@@ -392,7 +391,7 @@ bool dc_stream_set_cursor_position( ...@@ -392,7 +391,7 @@ bool dc_stream_set_cursor_position(
#if defined(CONFIG_DRM_AMD_DC_DCN3_0) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
/* re-enable idle optimizations if necessary */ /* re-enable idle optimizations if necessary */
if (reset_idle_optimizations) if (reset_idle_optimizations)
dc->hwss.apply_idle_power_optimizations(dc, true); dc_allow_idle_optimizations(dc, true);
#endif #endif
return true; return true;
......
...@@ -1250,6 +1250,9 @@ enum dc_status dc_set_clock(struct dc *dc, enum dc_clock_type clock_type, uint32 ...@@ -1250,6 +1250,9 @@ enum dc_status dc_set_clock(struct dc *dc, enum dc_clock_type clock_type, uint32
void dc_get_clock(struct dc *dc, enum dc_clock_type clock_type, struct dc_clock_config *clock_cfg); void dc_get_clock(struct dc *dc, enum dc_clock_type clock_type, struct dc_clock_config *clock_cfg);
#if defined(CONFIG_DRM_AMD_DC_DCN3_0) #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc,
struct dc_plane_state *plane);
void dc_allow_idle_optimizations(struct dc *dc, bool allow); void dc_allow_idle_optimizations(struct dc *dc, bool allow);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment