Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDDF3606A329 for ; Tue, 1 Dec 2026 19:03:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=ghPYv801 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F61710FC23; Tue, 1 Dec 2026 19:03:49 +0000 (UTC) Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010016.outbound.protection.outlook.com [52.101.56.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id B95CB10FC29 for ; Tue, 1 Dec 2026 19:03:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MJ2lXAEjnBMPNBUaOpkDhK/PRBfpbURdGOPUtznBDGo20Zf1ky7z2dsG6l4gQr46J1P0aRWF+Gh5XSlVSt4q01X34dyWL8CdJYWE3Tm2yf/VhrSOXgujrLHEC6+hNE4MW9QMhuf+FiTH6h9jbaQ/GRoPe6zm7FWMPX/VfTFTRY3aJoTbNO5ZXIpKlhCkW7aKOluv2fNWDFHxVx60Io8Nmjb9/cMQ5O6jdnVS/6YsNgz/Wsrs1yn9tulIhtbqjFiUoCOm2W2O7L9xvFiurhSM0ldRo5dLxZwRw2RtQcsjwbzDkGNJ7nMlX2ru+cIx8NPR84EyUYRl4jyO0zoR6OKKSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j8N2d/PBcNJ5w1WWS1wCUfZP4ucaIq0ughfr6V6UtyY=; b=yVz8LL7l7pxzEwZZlguKvn4BXqFlL9vvHF7g+dKuR9xHsSEB/rqJuFd+2p2oWUiJiA/k5utH2EZ2ZFfcOKdAd1Tg3uhTq/bkzgrehWVMxB9scCFm9U7aeGNtHf6KwHIryW+WsNrX709z5fgJd/noMhrCYWcI5z1qlN3yUD3VXdv+7i2xEvMosW9l/R2eQO0bN/QineGqbKpFYeatwl5qkesPQsxlz4KL8cO0jQtIipCG9FXu5FpUf+reJKhVJ83F4c0V4STU2eWuH0XFcaYAqMAo9CLV322l/8YF5VVDDc5QyvK5eSTKLr0p2Fqr96Ey5LGjArxr8M0A7iTxZXkRJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8N2d/PBcNJ5w1WWS1wCUfZP4ucaIq0ughfr6V6UtyY=; b=ghPYv801yIb9gxTAdRp3khz64F3qV3F2ihTJ9klK6AIaSy+usbuiJsyaa6C0aAn4q9Gjji0myB7l7Tr4IUdJ+sScbVVVeckQJ32mhsiC1/0re0SkpBDjYZXY/c2kaEh2kdi8H/pUguL/Z54HUlXJKEgJBodK6xlG4W5bx1fcq+s= Received: from DS0PR17CA0009.namprd17.prod.outlook.com (2603:10b6:8:191::9) by DS0PR12MB9347.namprd12.prod.outlook.com (2603:10b6:8:193::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Tue, 1 Dec 2026 19:03:36 +0000 Received: from DM3PEPF000265B1.namprd02.prod.outlook.com (2603:10b6:8:191:cafe::83) by DS0PR17CA0009.outlook.office365.com (2603:10b6:8:191::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 19:03:36 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by DM3PEPF000265B1.mail.protection.outlook.com (10.167.23.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 19:03:36 +0000 Received: from georzhanmkm.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 13:03:23 -0600 From: George Zhang To: CC: Harry Wentland , Leo Li , Aurabindo Pillai , Roman Li , Wayne Lin , Tom Chung , "Fangzhi Zuo" , Dan Wheeler , Ray Wu , Ivan Lipski , Alex Hung , James Lin , Chenyu Chen , Dillon Varone , Austin Zheng , George Zhang Subject: [PATCH 20/30] drm/amd/display: Refactor Max VStartup calculations for DCN6 Date: Tue, 1 Dec 2026 13:57:56 -0500 Message-ID: <20261201190245.360906-21-george.zhang@amd.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201190245.360906-1-george.zhang@amd.com> References: <20261201190245.360906-1-george.zhang@amd.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM3PEPF000265B1:EE_|DS0PR12MB9347:EE_ X-MS-Office365-Filtering-Correlation-Id: 07750131-81e2-46c2-0dda-08df4fddcd79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|23010399003|1800799024|36860700016|376014|6133799003|22082099003|18002099003|3023799007|261022115727099003|10067099003|5023799004|11063799006|261026140227099003|56012099006|261026121527099003|261028144727099003|261026130827099003|261022075727099003|261026135527099003|261021135927099003|261021133027099003|261102123227099003|261021123027099003|261022105027099003|261021121427099003|261009223027099003|261021130227099003|261022113327099003; X-Microsoft-Antispam-Message-Info: ZO0LfoTP2qZvC+4BXCKQscvlBkY5IyzHVJ/IO888RwRKmc+GZFmWRHG02qd9lidtPqMdzXhY7Rivp2GhJyt1I0sPDAMfLnJVxClhpFgmlhy0dUlrkUZ8Fv4Y70UE7dBODF5jFH1PrJYbJzFnWtSqbYNw2SgEonEKLC3syBDIvEArDnnLtSli9AqRjRlxMo2jVh/qBjNuGE+2qj63n7jixKLhSyv7+Rhq6r4fmvun7HqjyjNE1+q2iftr46LxnPWYBwrtxySukKoYIFX9GubMSoEOFmrqh2+aKz7xlghCwDWtpa+qnh2cQ1IKGLetlcYHQ+GUU1DMEEicIbgEdRD5gv80anvu0QKQKB20FCWelQHWu+gX5S0J8to6wwWrJEpDDHvck2aE6dF4MLjoKtfWvwSOChpXm53724i2EmBMzBIM6z0PJlkg4jlNuERjLDm0voV5eDyhlcdyGohT5nv58MUjNpk/2HGSfagw0W5wSebW+3M9ajsqC/KcXCcgHoyUNqVbr+Ri1z8YCRl/WZcVZObPvDA0MKuVwFuGrPnRqKQnERArQwKvoDbfaBJaopMDtwrOzuupF7BwyIFG9VMfjO7i5zAWWpkcMu9BJb6Xvp2CuRiC8SkmqbOwyIWjTvB1fpMOxNaxVZhP5QhWrO/XKEvhfbGcjVINY/Ho9S6pg+2EAf1hFnhzpK8PT3V8o/T9BAySP2lBhf0wvM3VvNry9Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(23010399003)(1800799024)(36860700016)(376014)(6133799003)(22082099003)(18002099003)(3023799007)(261022115727099003)(10067099003)(5023799004)(11063799006)(261026140227099003)(56012099006)(261026121527099003)(261028144727099003)(261026130827099003)(261022075727099003)(261026135527099003)(261021135927099003)(261021133027099003)(261102123227099003)(261021123027099003)(261022105027099003)(261021121427099003)(261009223027099003)(261021130227099003)(261022113327099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HdOyPhh8LY0WArF8F9LdtFNdXt/7xOrBWvw9yScOnvPYZrYD1dyPD3CsvJy1u0eF2pz4gtE/KA7exbn+U+Z3q/9DQ1d+rzNIZiDdYzfIge/CX94U1nZNuoCx3yzlK9BXBVZAVIMdUfzTTJn5Bp+mMGGYqCroE6L+ImQvFS/33Zm1CKlpOnwC0yFTxnbSpdfa5E3erqJUX+LicFiljle0S24k8Yk1Q0JlBU0YBURWVf8EIo7noUc56kqfvA6uBI8N9wkJmEaL6EHMWfHW+BknVCbPj6MvcQmLydVQM0ECwDU0LDfjKicjVKB2BGmFQAHgUnTu1yHg4RLZkqE/rgjQ2Bw20m9JnwdPJPHZmeBZ61wEwwvOKCXGTdZcH567NKddlxz6B4HcjX0qDbmlleWp+06qJVKuIlJp6Gqpe+ngmhgwt6rojq3rV1LSmhqB9deU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 19:03:36.3083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07750131-81e2-46c2-0dda-08df4fddcd79 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM3PEPF000265B1.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9347 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Dillon Varone [WHY&HOW] The limitation for alt-channel p-state was being applied incorrectly, such that VStartup could become "dynamic" based on the variable SVP0 and SVP1 sizes. This is not allowed, as VStartup should only depend on constants and the display timing. This refactor pins the VStartup to depend on 2x the UCLK P-State latency, and only if alt-channel P-state is supported for the IP. Cc: Austin Zheng Signed-off-by: Dillon Varone Signed-off-by: George Zhang --- .../dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h | 4 ++-- .../dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c | 11 +++++++---- .../dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h | 4 ++-- .../src/dml2_core/dml2_core_dcn6_funcs_initialize.c | 3 +++ .../src/dml2_core/dml2_core_dcn6_funcs_mode_support.c | 5 +++-- .../dml21/src/dml2_core/dml2_core_shared_types.h | 1 + 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h index 87252b658c16..f0d98bff5674 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs.h @@ -14,11 +14,11 @@ struct dml2_core_dcn6_calcs { unsigned int (*calculate_max_vstartup)( bool ptoi_supported, + bool alt_channel_supported, unsigned int vblank_nom_default_us, const struct dml2_timing_cfg *timing, - enum dml2_uclk_pstate_change_strategy pstate_strategy, double write_back_delay_us, - unsigned int svp_lines); + double uclk_pstate_latency_us); void (*calculate_alternate_params)(struct dml2_core_calcs_calculate_alternate_params *p); void (*calculate_alternate_svp_lines)(struct dml2_core_calcs_calculate_alternate_svp_lines *p); void (*calculate_flip_schedule)( diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c index 2ee50f8cf2f5..69439ec644e0 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c @@ -10,11 +10,11 @@ unsigned int dcn6_calculate_max_vstartup( bool ptoi_supported, + bool alt_channel_supported, unsigned int vblank_nom_default_us, const struct dml2_timing_cfg *timing, - enum dml2_uclk_pstate_change_strategy pstate_strategy, double write_back_delay_us, - unsigned int svp_lines) + double uclk_pstate_latency_us) { unsigned int vblank_size = 0; unsigned int max_vstartup_lines = 0; @@ -31,8 +31,11 @@ unsigned int dcn6_calculate_max_vstartup( else max_vstartup_lines = vblank_size - (unsigned int)math_max2(1.0, math_ceil2(write_back_delay_us / line_time_us, 1.0)); - if (pstate_strategy == dml2_uclk_pstate_change_strategy_force_alternate) - max_vstartup_lines = (unsigned int)math_min2(max_vstartup_lines, svp_lines); + // alt-channel p-state requires limiting max_vstartup_lines to p-state x2 + if (alt_channel_supported) { + max_vstartup_lines = (unsigned int)math_min2(max_vstartup_lines, + math_floor2(uclk_pstate_latency_us * 2.0 / line_time_us, 1.0)); + } max_vstartup_lines = (unsigned int)math_min2(max_vstartup_lines, __DML2_CALCS_MAX_VSTARTUP__); diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h index 41be61907e1a..fe4474c9eac7 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.h @@ -8,11 +8,11 @@ unsigned int dcn6_calculate_max_vstartup( bool ptoi_supported, + bool alt_channel_supported, unsigned int vblank_nom_default_us, const struct dml2_timing_cfg *timing, - enum dml2_uclk_pstate_change_strategy pstate_strategy, double write_back_delay_us, - unsigned int svp_lines); + double uclk_pstate_latency_us); void dcn6_calculate_alternate_params(struct dml2_core_calcs_calculate_alternate_params *p); void dcn6_calculate_alternate_svp_lines(struct dml2_core_calcs_calculate_alternate_svp_lines *p); void dcn6_calculate_alternate_lead_lines(struct dml2_core_calcs_calculate_alternate_lead_lines *p); diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.c index f20cee3c46fa..ddef5266785b 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_initialize.c @@ -156,6 +156,9 @@ bool dml2_core_dcn6_funcs_initialize(struct dml2_core_initialize_in_out *in_out) patch_ip_params_with_ip_caps(&core->clean_me_up.mode_lib.ip, in_out->ip_caps); core->clean_me_up.mode_lib.ip.imall_supported = false; + + if (in_out->project_id == dml2_project_dcn6x_soc_var_a) + core->clean_me_up.mode_lib.ip.alt_channel_supported = true; } memcpy(&core->clean_me_up.mode_lib.ip_caps, in_out->ip_caps, sizeof(struct dml2_ip_capabilities)); diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c index 290557d87b0d..d9b710baf66a 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c @@ -2397,6 +2397,7 @@ void dcn6_ms_calculate_max_vstartup( struct dml2_core_internal_mode_support *outputs = states; const struct dml2_display_cfg *display_cfg = ctx->display_cfg; const struct dml2_core_ip_params *ip = ctx->ip; + const struct dml2_utm_soc_bb *soc_bb = ctx->soc_bb; unsigned int k, stream_index; const struct dml2_stream_parameters *stream; @@ -2407,11 +2408,11 @@ void dcn6_ms_calculate_max_vstartup( stream = &display_cfg->stream_descriptors[stream_index]; outputs->MaximumVStartup[k] = get_calcs(ctx)->calculate_max_vstartup( ip->ptoi_supported, + ip->alt_channel_supported, ip->vblank_nom_default_us, &stream->timing, - display_cfg->plane_descriptors[k].overrides.uclk_pstate_change_strategy, inputs->WritebackDelayTime[k], - inputs->svp0_dst_lines[stream_index] + inputs->svp1_dst_lines[stream_index]); + soc_bb->power_management_parameters.dram_clk_change_blackout_us); outputs->MaxVStartupLines[k] = outputs->MaximumVStartup[k]; } DML_LOG_VERBOSE("DML::%s: k=%u, MaximumVStartup = %u\n", __func__, k, outputs->MaximumVStartup[k]); diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_shared_types.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_shared_types.h index dbc59c308762..567849453e3a 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_shared_types.h +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_shared_types.h @@ -73,6 +73,7 @@ struct dml2_core_ip_params { unsigned int max_num_dp2p0_streams; bool dcc_supported; bool ptoi_supported; + bool alt_channel_supported; double writeback_max_hscl_ratio; double writeback_max_vscl_ratio; double writeback_min_hscl_ratio; -- 2.56.1