amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Stylon Wang <stylon.wang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	roman.li@amd.com, solomon.chiu@amd.com, Aurabindo.Pillai@amd.com,
	Alex Hung <alex.hung@amd.com>,
	wayne.lin@amd.com, Bhawanpreet.Lakha@amd.com,
	agustin.gutierrez@amd.com, pavle.kotarac@amd.com
Subject: [PATCH 11/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN for z10
Date: Fri, 6 May 2022 23:42:10 +0800	[thread overview]
Message-ID: <20220506154214.3438665-12-stylon.wang@amd.com> (raw)
In-Reply-To: <20220506154214.3438665-1-stylon.wang@amd.com>

From: Alex Hung <alex.hung@amd.com>

[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: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c        | 10 ++--------
 drivers/gpu/drm/amd/display/dc/core/dc_link.c   |  4 ----
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c |  4 ----
 3 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 1eeea7c184ae..e41a48f596a3 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1674,7 +1674,6 @@ static uint8_t get_stream_mask(struct dc *dc, struct dc_state *context)
 	return stream_mask;
 }
 
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 void dc_z10_restore(const struct dc *dc)
 {
 	if (dc->hwss.z10_restore)
@@ -1686,7 +1685,7 @@ void dc_z10_save_init(struct dc *dc)
 	if (dc->hwss.z10_save_init)
 		dc->hwss.z10_save_init(dc);
 }
-#endif
+
 /*
  * Applies given context to HW and copy it into current context.
  * 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
 	struct dc_stream_state *dc_streams[MAX_STREAMS] = {0};
 	struct dc_state *old_state;
 
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	dc_z10_restore(dc);
 	dc_allow_idle_optimizations(dc, false);
-#endif
 
 	for (i = 0; i < context->stream_count; i++)
 		dc_streams[i] =  context->streams[i];
@@ -2839,9 +2836,7 @@ static void commit_planes_for_stream(struct dc *dc,
 	struct pipe_ctx *top_pipe_to_program = NULL;
 	bool should_lock_all_pipes = (update_type != UPDATE_TYPE_FAST);
 
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	dc_z10_restore(dc);
-#endif
 
 	if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
 		/* Optimize seamless boot flag keeps clocks and watermarks high until
@@ -3298,9 +3293,8 @@ void dc_set_power_state(
 	case DC_ACPI_CM_POWER_STATE_D0:
 		dc_resource_state_construct(dc, dc->current_state);
 
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 		dc_z10_restore(dc);
-#endif
+
 		if (dc->ctx->dmub_srv)
 			dc_dmub_srv_wait_phy_init(dc->ctx->dmub_srv);
 
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 9529b924742e..67ef357e5798 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -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)
 {
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	dc_z10_restore(dc);
-#endif
 	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
 	if (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)
 			dc_z10_restore(dc);
-#endif
 
 		if (psr != NULL && link->psr_settings.psr_feature_enabled) {
 			psr->funcs->psr_enable(psr, link->psr_settings.psr_allow_active, wait, panel_inst);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index acca35d86c10..de8b214132a2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -333,7 +333,6 @@ bool dc_stream_set_cursor_attributes(
 	dc = stream->ctx->dc;
 	stream->cursor_attributes = *attributes;
 
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	dc_z10_restore(dc);
 	/* disable idle optimizations while updating cursor */
 	if (dc->idle_optimizations_allowed) {
@@ -341,7 +340,6 @@ bool dc_stream_set_cursor_attributes(
 		reset_idle_optimizations = true;
 	}
 
-#endif
 	program_cursor_attributes(dc, stream, attributes);
 
 	/* re-enable idle optimizations if necessary */
@@ -405,7 +403,6 @@ bool dc_stream_set_cursor_position(
 	}
 
 	dc = stream->ctx->dc;
-#if defined(CONFIG_DRM_AMD_DC_DCN)
 	dc_z10_restore(dc);
 
 	/* disable idle optimizations if enabling cursor */
@@ -414,7 +411,6 @@ bool dc_stream_set_cursor_position(
 		reset_idle_optimizations = true;
 	}
 
-#endif
 	stream->cursor_position = *position;
 
 	program_cursor_position(dc, stream, position);
-- 
2.35.1


  parent reply	other threads:[~2022-05-06 15:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 15:41 [PATCH 00/15] DC Patches May 9, 2022 Stylon Wang
2022-05-06 15:42 ` [PATCH 01/15] drm/amd/display: Refactor LTTPR cap retrieval Stylon Wang
2022-05-06 15:42 ` [PATCH 02/15] drm/amd/display: Reset cached PSR parameters after hibernate Stylon Wang
2022-05-06 15:42 ` [PATCH 03/15] drm/amd/display: move definition of dc_flip_addrs struct Stylon Wang
2022-05-06 15:42 ` [PATCH 04/15] drm/amd/display: do not disable an invalid irq source in hdp finish Stylon Wang
2022-05-06 15:42 ` [PATCH 05/15] drm/amd/display: do not calculate DP2.0 SST payload when link is off Stylon Wang
2022-05-06 15:42 ` [PATCH 06/15] drm/amd/display: do not wait for vblank during pipe programming Stylon Wang
2022-05-06 15:42 ` [PATCH 07/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in dc Stylon Wang
2022-05-06 15:56   ` Alex Deucher
2022-05-06 17:12     ` Rodrigo Siqueira Jordao
2022-05-06 18:00       ` Alex Deucher
2022-05-07  7:39       ` Cui, Flora
2022-05-09 11:57         ` VURDIGERENATARAJ, CHANDAN
2022-05-09 13:22           ` Rodrigo Siqueira Jordao
2022-05-06 15:42 ` [PATCH 08/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in dce Stylon Wang
2022-05-06 15:42 ` [PATCH 09/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in gpio Stylon Wang
2022-05-06 15:42 ` [PATCH 10/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in irq Stylon Wang
2022-05-06 15:42 ` Stylon Wang [this message]
2022-05-06 15:42 ` [PATCH 12/15] drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in amdgpu_dm Stylon Wang
2022-05-06 15:42 ` [PATCH 13/15] drm/amd/display: remove unnecessary else by CONFIG_DRM_AMD_DC_DCN Stylon Wang
2022-05-06 15:42 ` [PATCH 14/15] Revert "drm/amd/display: Fix DCN3 B0 DP Alt Mapping" Stylon Wang
2022-05-06 15:42 ` [PATCH 15/15] drm/amd/display: 3.2.185 Stylon Wang
2022-05-09 13:14 ` [PATCH 00/15] DC Patches May 9, 2022 Wheeler, Daniel
2022-05-09 13:56   ` Paul Menzel
2022-05-09 14:00   ` How are the DC patches tested? (was: [PATCH 00/15] DC Patches May 9, 2022) Paul Menzel
2022-05-09 14:15     ` Rodrigo Siqueira Jordao
2022-05-09 14:28       ` How are the DC patches tested? Paul Menzel
2022-05-09 15:21         ` Wheeler, Daniel
2022-05-10 10:53           ` Paul Menzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220506154214.3438665-12-stylon.wang@amd.com \
    --to=stylon.wang@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=wayne.lin@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).