amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: <Roman.Li@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>,
	Zaeem Mohamed <zaeem.mohamed@amd.com>,
	"Daniel Wheeler" <daniel.wheeler@amd.com>,
	Kevin Gao <kevin.gao3@amd.com>,
	"Agustin Gutierrez" <agustin.gutierrez2@amd.com>
Subject: [PATCH 11/16] drm/amd/display: Add DCN301 specific hubbub init function
Date: Wed, 2 Apr 2025 12:13:15 -0400	[thread overview]
Message-ID: <20250402161320.983072-12-Roman.Li@amd.com> (raw)
In-Reply-To: <20250402161320.983072-1-Roman.Li@amd.com>

From: Kevin Gao <kevin.gao3@amd.com>

[Why] DCN301 needs specific functionality
[How] Add it

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Agustin Gutierrez <agustin.gutierrez2@amd.com>
Signed-off-by: Kevin Gao <kevin.gao3@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
---
 .../display/dc/hubbub/dcn301/dcn301_hubbub.c  | 34 ++++++++++++++++++-
 .../display/dc/hubbub/dcn301/dcn301_hubbub.h  |  3 ++
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c
index c1959672df50..95cf0ff43a83 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.c
@@ -47,10 +47,42 @@
 #define FN(reg_name, field_name) \
 	hubbub1->shifts->field_name, hubbub1->masks->field_name
 
+int hubbub301_init_dchub(struct hubbub *hubbub,
+		struct dcn_hubbub_phys_addr_config *pa_config)
+{
+	struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub);
+	struct dcn_vmid_page_table_config phys_config;
+
+	REG_SET(DCN_VM_FB_LOCATION_BASE, 0,
+			FB_BASE, pa_config->system_aperture.fb_base >> 24);
+	REG_SET(DCN_VM_FB_LOCATION_TOP, 0,
+			FB_TOP, pa_config->system_aperture.fb_top >> 24);
+	REG_SET(DCN_VM_FB_OFFSET, 0,
+			FB_OFFSET, pa_config->system_aperture.fb_offset >> 24);
+	REG_SET(DCN_VM_AGP_BOT, 0,
+			AGP_BOT, pa_config->system_aperture.agp_bot >> 24);
+	REG_SET(DCN_VM_AGP_TOP, 0,
+			AGP_TOP, pa_config->system_aperture.agp_top >> 24);
+	REG_SET(DCN_VM_AGP_BASE, 0,
+			AGP_BASE, pa_config->system_aperture.agp_base >> 24);
+
+	if (pa_config->gart_config.page_table_start_addr != pa_config->gart_config.page_table_end_addr) {
+		phys_config.page_table_start_addr = pa_config->gart_config.page_table_start_addr >> 12;
+		phys_config.page_table_end_addr = pa_config->gart_config.page_table_end_addr >> 12;
+		phys_config.page_table_base_addr = pa_config->gart_config.page_table_base_addr | 1; //Note: hack
+		phys_config.depth = 0;
+		phys_config.block_size = 0;
+		// Init VMID 0 based on PA config
+		dcn20_vmid_setup(&hubbub1->vmid[0], &phys_config);
+	}
+
+	dcn21_dchvm_init(hubbub);
+	return hubbub1->num_vmid;
+}
 
 static const struct hubbub_funcs hubbub301_funcs = {
 	.update_dchub = hubbub2_update_dchub,
-	.init_dchub_sys_ctx = hubbub21_init_dchub,
+	.init_dchub_sys_ctx = hubbub301_init_dchub,
 	.init_vm_ctx = hubbub2_init_vm_ctx,
 	.dcc_support_swizzle = hubbub3_dcc_support_swizzle,
 	.dcc_support_pixel_format = hubbub2_dcc_support_pixel_format,
diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h
index b599f4475479..e30573e1ecfd 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn301/dcn301_hubbub.h
@@ -50,6 +50,9 @@
 	HUBBUB_SF(DCHVM_RIOMMU_STAT0, RIOMMU_ACTIVE, mask_sh), \
 	HUBBUB_SF(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, mask_sh)
 
+int hubbub301_init_dchub(struct hubbub *hubbub,
+		struct dcn_hubbub_phys_addr_config *pa_config);
+
 void hubbub301_construct(struct dcn20_hubbub *hubbub3,
 	struct dc_context *ctx,
 	const struct dcn_hubbub_registers *hubbub_regs,
-- 
2.34.1


  parent reply	other threads:[~2025-04-02 16:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 16:13 [PATCH 00/16] DC Patches April 02, 2025 Roman.Li
2025-04-02 16:13 ` [PATCH 01/16] drm/amd/display: Optimize custom brightness curve Roman.Li
2025-04-02 16:13 ` [PATCH 02/16] drm/amd/display: Correct SSC enable detection for DCN351 Roman.Li
2025-04-02 16:13 ` [PATCH 03/16] drm/amd/display: HDCP Locality check using DMUB Fused IO Roman.Li
2025-04-02 16:13 ` [PATCH 04/16] drm/amd/display: Adjust all dev_*() messages to drm_*() Roman.Li
2025-04-02 16:13 ` [PATCH 05/16] drm/amd/display: Move PSR support message into amdgpu_dm Roman.Li
2025-04-02 16:13 ` [PATCH 06/16] drm/amd/display: Remove double checks for `debug.enable_mem_low_power.bits.cm` Roman.Li
2025-04-02 16:13 ` [PATCH 07/16] drm/amd/display: Add HP Probook 445 and 465 to the quirk list for eDP on DP1 Roman.Li
2025-04-02 16:13 ` [PATCH 08/16] drm/amd/display: Add HP Elitebook 645 " Roman.Li
2025-04-02 16:13 ` [PATCH 09/16] drm/amd/display: wait for updates to latch before locking Roman.Li
2025-04-02 16:13 ` [PATCH 10/16] drm/amd/display: dont disable dtb as dto src during dpms off Roman.Li
2025-04-02 16:13 ` Roman.Li [this message]
2025-04-02 16:13 ` [PATCH 12/16] drm/amd/display: turn off eDP lcdvdd and backlight if not required Roman.Li
2025-04-02 16:13 ` [PATCH 13/16] Revert "drm/amd/display: Fix VUpdate offset calculations for dcn401" Roman.Li
2025-04-02 16:13 ` [PATCH 14/16] drm/amd/display: [FW Promotion] Release 0.1.5.0 Roman.Li
2025-04-02 16:13 ` [PATCH 15/16] drm/amd/display: rename IPS2 entry/exit message Roman.Li
2025-04-02 16:13 ` [PATCH 16/16] drm/amd/display: Promote DC to 3.2.328 Roman.Li
2025-04-03 20:58 ` [PATCH 00/16] DC Patches April 02, 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=20250402161320.983072-12-Roman.Li@amd.com \
    --to=roman.li@amd.com \
    --cc=agustin.gutierrez2@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=kevin.gao3@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=zaeem.mohamed@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).