Commit e91241c0 authored by Alex Hung's avatar Alex Hung Committed by Alex Deucher

drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN for z10

[Why & How]
CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC
code should be OS-agnostic.

This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN
for enabling z10.
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: default avatarStylon Wang <stylon.wang@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 47f7d807
...@@ -1674,7 +1674,6 @@ static uint8_t get_stream_mask(struct dc *dc, struct dc_state *context) ...@@ -1674,7 +1674,6 @@ static uint8_t get_stream_mask(struct dc *dc, struct dc_state *context)
return stream_mask; return stream_mask;
} }
#if defined(CONFIG_DRM_AMD_DC_DCN)
void dc_z10_restore(const struct dc *dc) void dc_z10_restore(const struct dc *dc)
{ {
if (dc->hwss.z10_restore) if (dc->hwss.z10_restore)
...@@ -1686,7 +1685,7 @@ void dc_z10_save_init(struct dc *dc) ...@@ -1686,7 +1685,7 @@ void dc_z10_save_init(struct dc *dc)
if (dc->hwss.z10_save_init) if (dc->hwss.z10_save_init)
dc->hwss.z10_save_init(dc); dc->hwss.z10_save_init(dc);
} }
#endif
/* /*
* Applies given context to HW and copy it into current context. * Applies given context to HW and copy it into current context.
* It's up to the user to release the src context afterwards. * It's up to the user to release the src context afterwards.
...@@ -1700,10 +1699,8 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c ...@@ -1700,10 +1699,8 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
struct dc_stream_state *dc_streams[MAX_STREAMS] = {0}; struct dc_stream_state *dc_streams[MAX_STREAMS] = {0};
struct dc_state *old_state; struct dc_state *old_state;
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
dc_allow_idle_optimizations(dc, false); dc_allow_idle_optimizations(dc, false);
#endif
for (i = 0; i < context->stream_count; i++) for (i = 0; i < context->stream_count; i++)
dc_streams[i] = context->streams[i]; dc_streams[i] = context->streams[i];
...@@ -2839,9 +2836,7 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -2839,9 +2836,7 @@ static void commit_planes_for_stream(struct dc *dc,
struct pipe_ctx *top_pipe_to_program = NULL; struct pipe_ctx *top_pipe_to_program = NULL;
bool should_lock_all_pipes = (update_type != UPDATE_TYPE_FAST); bool should_lock_all_pipes = (update_type != UPDATE_TYPE_FAST);
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
#endif
if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) { if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
/* Optimize seamless boot flag keeps clocks and watermarks high until /* Optimize seamless boot flag keeps clocks and watermarks high until
...@@ -3298,9 +3293,8 @@ void dc_set_power_state( ...@@ -3298,9 +3293,8 @@ void dc_set_power_state(
case DC_ACPI_CM_POWER_STATE_D0: case DC_ACPI_CM_POWER_STATE_D0:
dc_resource_state_construct(dc, dc->current_state); dc_resource_state_construct(dc, dc->current_state);
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
#endif
if (dc->ctx->dmub_srv) if (dc->ctx->dmub_srv)
dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv); dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv);
......
...@@ -879,9 +879,7 @@ static bool should_prepare_phy_clocks_for_link_verification(const struct dc *dc, ...@@ -879,9 +879,7 @@ static bool should_prepare_phy_clocks_for_link_verification(const struct dc *dc,
static void prepare_phy_clocks_for_destructive_link_verification(const struct dc *dc) static void prepare_phy_clocks_for_destructive_link_verification(const struct dc *dc)
{ {
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
#endif
clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr); clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr);
} }
...@@ -3098,10 +3096,8 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active ...@@ -3098,10 +3096,8 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active
if (allow_active && link->psr_settings.psr_allow_active != *allow_active) { if (allow_active && link->psr_settings.psr_allow_active != *allow_active) {
link->psr_settings.psr_allow_active = *allow_active; link->psr_settings.psr_allow_active = *allow_active;
#if defined(CONFIG_DRM_AMD_DC_DCN)
if (!link->psr_settings.psr_allow_active) if (!link->psr_settings.psr_allow_active)
dc_z10_restore(dc); dc_z10_restore(dc);
#endif
if (psr != NULL && link->psr_settings.psr_feature_enabled) { if (psr != NULL && link->psr_settings.psr_feature_enabled) {
psr->funcs->psr_enable(psr, link->psr_settings.psr_allow_active, wait, panel_inst); psr->funcs->psr_enable(psr, link->psr_settings.psr_allow_active, wait, panel_inst);
......
...@@ -333,7 +333,6 @@ bool dc_stream_set_cursor_attributes( ...@@ -333,7 +333,6 @@ bool dc_stream_set_cursor_attributes(
dc = stream->ctx->dc; dc = stream->ctx->dc;
stream->cursor_attributes = *attributes; stream->cursor_attributes = *attributes;
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
/* disable idle optimizations while updating cursor */ /* disable idle optimizations while updating cursor */
if (dc->idle_optimizations_allowed) { if (dc->idle_optimizations_allowed) {
...@@ -341,7 +340,6 @@ bool dc_stream_set_cursor_attributes( ...@@ -341,7 +340,6 @@ bool dc_stream_set_cursor_attributes(
reset_idle_optimizations = true; reset_idle_optimizations = true;
} }
#endif
program_cursor_attributes(dc, stream, attributes); program_cursor_attributes(dc, stream, attributes);
/* re-enable idle optimizations if necessary */ /* re-enable idle optimizations if necessary */
...@@ -405,7 +403,6 @@ bool dc_stream_set_cursor_position( ...@@ -405,7 +403,6 @@ bool dc_stream_set_cursor_position(
} }
dc = stream->ctx->dc; dc = stream->ctx->dc;
#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_z10_restore(dc); dc_z10_restore(dc);
/* disable idle optimizations if enabling cursor */ /* disable idle optimizations if enabling cursor */
...@@ -414,7 +411,6 @@ bool dc_stream_set_cursor_position( ...@@ -414,7 +411,6 @@ bool dc_stream_set_cursor_position(
reset_idle_optimizations = true; reset_idle_optimizations = true;
} }
#endif
stream->cursor_position = *position; stream->cursor_position = *position;
program_cursor_position(dc, stream, position); program_cursor_position(dc, stream, position);
......
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