All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Alex Hung <alex.hung@amd.com>, Oleh Kuzhylnyi <okuzhyln@amd.com>,
	Alvin Lee <alvin.lee2@amd.com>
Subject: [PATCH 12/24] drm/amd/display: Add DML path for FAMS methods
Date: Wed, 28 May 2025 10:49:07 +0800	[thread overview]
Message-ID: <20250528025204.79578-13-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20250528025204.79578-1-Wayne.Lin@amd.com>

From: Oleh Kuzhylnyi <okuzhyln@amd.com>

[Why]
DML needs a path for FAMS methods.

[How]
Apply instance of fams2_stream_sub_params_v2 structure with
a FAMS placeholder for DML.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Oleh Kuzhylnyi <okuzhyln@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c       |  2 +-
 .../drm/amd/display/dc/dml2/dml21/dml21_utils.c    | 14 +++++++++++---
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  5 ++++-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 8c52d3fea1d8..00ea81fa9573 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1758,7 +1758,7 @@ static void dc_dmub_srv_ib_based_fams2_update_config(struct dc *dc,
 
 			/* copy stream static sub-state */
 			memcpy(&config->stream_v1[i].sub_state,
-				&context->bw_ctx.bw.dcn.fams2_stream_sub_params[i],
+				&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2[i],
 				sizeof(config->stream_v1[i].sub_state));
 		}
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c
index 930e86cdb88a..ee721606b883 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c
@@ -384,6 +384,7 @@ void dml21_build_fams2_programming(const struct dc *dc,
 	/* reset fams2 data */
 	memset(&context->bw_ctx.bw.dcn.fams2_stream_base_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
 	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params, 0, sizeof(union dmub_cmd_fams2_config) * DML2_MAX_PLANES);
+	memset(&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2, 0, sizeof(union dmub_fams2_stream_static_sub_state_v2) * DML2_MAX_PLANES);
 	memset(&context->bw_ctx.bw.dcn.fams2_global_config, 0, sizeof(struct dmub_cmd_fams2_global_config));
 
 	if (dml_ctx->v21.mode_programming.programming->fams2_required) {
@@ -414,9 +415,16 @@ void dml21_build_fams2_programming(const struct dc *dc,
 			memcpy(static_base_state,
 					&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_base_params,
 					sizeof(union dmub_cmd_fams2_config));
-			memcpy(static_sub_state,
-					&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params,
-					sizeof(union dmub_cmd_fams2_config));
+
+			if (dc->debug.fams_version.major == 3) {
+				memcpy(&context->bw_ctx.bw.dcn.fams2_stream_sub_params_v2[num_fams2_streams],
+						&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params_v2,
+						sizeof(union dmub_fams2_stream_static_sub_state_v2));
+			} else {
+				memcpy(static_sub_state,
+						&dml_ctx->v21.mode_programming.programming->stream_programming[dml_stream_idx].fams2_sub_params,
+						sizeof(union dmub_cmd_fams2_config));
+			}
 
 			switch (dc->debug.fams_version.minor) {
 			case 1:
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 0cf349cafb3e..56b0b3f59efc 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -556,7 +556,10 @@ struct dcn_bw_output {
 	struct dml2_mcache_surface_allocation mcache_allocations[DML2_MAX_PLANES];
 	struct dmub_cmd_fams2_global_config fams2_global_config;
 	union dmub_cmd_fams2_config fams2_stream_base_params[DML2_MAX_PLANES];
-	union dmub_cmd_fams2_config fams2_stream_sub_params[DML2_MAX_PLANES];
+	union {
+		union dmub_cmd_fams2_config fams2_stream_sub_params[DML2_MAX_PLANES];
+		union dmub_fams2_stream_static_sub_state_v2 fams2_stream_sub_params_v2[DML2_MAX_PLANES];
+	};
 	struct dml2_display_arb_regs arb_regs;
 };
 
-- 
2.43.0


  parent reply	other threads:[~2025-05-28  2:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28  2:48 [PATCH 00/24] DC Patches June 2nd, 2025 Wayne Lin
2025-05-28  2:48 ` [PATCH 01/24] drm/amd/display: [FW Promotion] Release 0.1.11.0 Wayne Lin
2025-05-28  2:48 ` [PATCH 02/24] drm/amd/display: Re-order FAMS2 sub commands Wayne Lin
2025-05-28  2:48 ` [PATCH 03/24] drm/amd/display: DML21 Fixes Wayne Lin
2025-05-28  2:48 ` [PATCH 04/24] drm/amd/display: Support OLED SDR with AMD ABC Wayne Lin
2025-05-28  2:49 ` [PATCH 05/24] drm/amd/display: move RMCM programming Wayne Lin
2025-05-28  2:49 ` [PATCH 06/24] drm/amd/display: Indirect buffer transport for FAMS2 commands Wayne Lin
2025-05-28  2:49 ` [PATCH 07/24] drm/amd/display: Drop unnecessary `amdgpu` prefix Wayne Lin
2025-05-28  2:49 ` [PATCH 08/24] drm/amd/display: Call setup_stream_attribute after stream enc clk is ungated Wayne Lin
2025-05-28  2:49 ` [PATCH 09/24] drm/amd/display: Correct non-OLED pre_T11_delay Wayne Lin
2025-05-28  2:49 ` [PATCH 10/24] drm/amd/display: Avoid trying AUX transactions on disconnected ports Wayne Lin
2025-05-28  2:49 ` [PATCH 11/24] drm/amd/display: Add disconnect case on dongle check Wayne Lin
2025-05-28  2:49 ` Wayne Lin [this message]
2025-05-28  2:49 ` [PATCH 13/24] drm/amd/display: Do not bypass chroma scaling in 1:1 case Wayne Lin
2025-05-28  2:49 ` [PATCH 14/24] drm/amd/display: Add support for 2nd sharpening range Wayne Lin
2025-05-28  2:49 ` [PATCH 15/24] drm/amd/display: Move vmalloc include to header file Wayne Lin
2025-05-28  2:49 ` [PATCH 16/24] drm/amd/display: [FW Promotion] Release 0.1.12.0 Wayne Lin
2025-05-28  2:49 ` [PATCH 17/24] drm/amd/display: Promote DAL to 3.2.335 Wayne Lin
2025-05-28  2:49 ` [PATCH 18/24] drm/amd/display: Update DMCUB loading sequence for DCN3.5 Wayne Lin
2025-05-28  2:49 ` [PATCH 19/24] drm/amd/display: replace fast_validate with enum dc_validate_mode Wayne Lin
2025-05-28  2:49 ` [PATCH 20/24] drm/amd/display: Avoid calling blank_stream() twice Wayne Lin
2025-05-28  2:49 ` [PATCH 21/24] drm/amd/display: Use DC log instead of using DM error msg Wayne Lin
2025-05-28  2:49 ` [PATCH 22/24] drm/amd/display: Add debugging message for brightness caps Wayne Lin
2025-05-28  2:49 ` [PATCH 23/24] drm/amd/display: Fix default DC and AC levels Wayne Lin
2025-05-28  2:49 ` [PATCH 24/24] drm/amd/display: Promote DAL to 3.2.336 Wayne Lin
2025-06-02 13:24 ` [PATCH 00/24] DC Patches June 2nd, 2025 Wheeler, Daniel

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=20250528025204.79578-13-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=alex.hung@amd.com \
    --cc=alvin.lee2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=okuzhyln@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.