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 C1B58606A332 for ; Tue, 1 Dec 2026 19:03:35 +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=sz7DLI3R Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59BCC10FC1D; Tue, 1 Dec 2026 19:03:30 +0000 (UTC) Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010022.outbound.protection.outlook.com [52.101.201.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id D939010FC01 for ; Tue, 1 Dec 2026 19:03:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U1L/4tN5UGYd2sZbk0DONevYoYNQoJZW0PBY8ukIXWW61a4IbcQDn9b23DHAGhipliCpcavppR5G4u1mpKQpCzTYua0yaplr4tEH4O4szvWH5bnXLSsc/B2fYJd8kXiZx9ryM6bUbXMpunMvD91fHdO9qrJVqgaIjt6hDXibadh1iqZ3qTxN+g88myWHMKdUQeQA5418tILvx+hm2MtT3y6CrAnht694awOZYGDl2EkzQw/BD4pTN2NtLXMjEISMhAPu503A587zraM4TlaomP5+MiiHpKJhW/3yvTctiq5FcPSyvtVd+jz47RaXs9Si2GvbvBUYY8/dI5IpAQW6bQ== 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=StHxSHKOEa/BCqYmF6o1BICVwp2OBWpJBiDJQcALMd0=; b=WB5Fz6N+UxvmEmXRxM2S8O76qEocACcXk46XQ5wwptzUB+Ic/KlmxmztKXETKRgmfT3hiNqnCzNMasSQuyZybuvLzhsg2LC19JX7Dt+9g/Wk+MSqook9qqL8P1Uj+jpysDMjADC7Zz3VlShELtSw6Iqqu8NvXjQGVw7H9BBibW81nL/dK0RLHcy0qkPRW/9fsxdZXpvnRD1QhyTWuBuhVvqsOvvUBF+GEr30omwk/GXe18OWnqe16AbqNiwqB9kpG7LaWn40ciTAFLzeavDAEnYKFa9grTAg8p5t3dgeo1pCuSHj+FMfzqaIp3gS8Ps7Fwod+lJbuaXVgO9g/bNz7Q== 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=StHxSHKOEa/BCqYmF6o1BICVwp2OBWpJBiDJQcALMd0=; b=sz7DLI3R5HWIWhJhrQtUA4q9uesyyFAdZHvNqbNUpc/wCKXMjVcXDYihc1MnkmMZxoRyZ4/VI8s/AcmsHwXU8/iLaeynNu+fvt9pVi2X6NSyvm+CzKxq0OoznDqHBe/MfnVpAIV7ZAjxAYEkINKVK184R0JwHYYbgT6BYHptVkE= Received: from DS7P220CA0080.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:259::13) by MN2PR12MB4288.namprd12.prod.outlook.com (2603:10b6:208:1d2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 19:03:17 +0000 Received: from DM3PEPF000265B2.namprd02.prod.outlook.com (2603:10b6:8:259:cafe::a4) by DS7P220CA0080.outlook.office365.com (2603:10b6:8:259::13) 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:17 +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 DM3PEPF000265B2.mail.protection.outlook.com (10.167.23.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.3 via Frontend Transport; Tue, 1 Dec 2026 19:03:17 +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:14 -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 , Ilya Bakoulin , Wenjing Liu , George Zhang Subject: [PATCH 07/30] drm/amd/display: Account for downspread and DFS in clock validation Date: Tue, 1 Dec 2026 13:57:43 -0500 Message-ID: <20261201190245.360906-8-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: DM3PEPF000265B2:EE_|MN2PR12MB4288:EE_ X-MS-Office365-Filtering-Correlation-Id: 98d9af10-5cc2-4f13-15b8-08df4fddc23f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700016|1800799024|23010399003|11063799006|5023799004|261009223027099003|18002099003|22082099003|3023799007|10067099003|56012099006|261028144727099003|261026121527099003|261026140227099003|261022105027099003|261021121427099003|261102123227099003|261022075727099003|261021123027099003; X-Microsoft-Antispam-Message-Info: RwGV47N16JATX7KeM3yLjuvNU66D5DDQeMJSDC4QJRIzoSdmg+IWqVfN7hg1Lhyx3JrnhAEKS75AOk5Wp7UsofJMaZGwpIkUGFMNBApyHdpEoW4UY/5UjGZ2+u69cqwD1XQp1GEQKcn2ahBAze1sshRlqGsbHwR13OM7/daURe0okx6vy7q+L/xyngFLX0WdI6rig0GetA4UjUDOWqacaPVW4KQIKDdux/8immKE76wwi590/MIUjuPB4mQdESApPPawsJembtG5DfU4DGZf59Tm0WwfQZlnU0kMpxgzEnpPYVxlfjlqxDG4PZZVJ0BYemWOgnC0ykHKE5AF00eKAJO4i7EcmnwvrY53NaxmIOmSXt/glaOczelGTD5xD5HPpWynVyfURmh4ONNAAwGig2GUhJbSD35RDgf3uOuxiVHRYACJP2xTy/37gygdhDsT74x/U+denwxAUdUA+qXMHqCP6gQq1kisX90nUWKzuHBXlJkiM9XA3aQeXJuT+hrEyB5X2HQNik/8vUHDnkgb5OBscRIp2RejKfv6htY9PEGr1CFeL4M+7A8CMRQj8sZKt4PhKrSz0EIwrygJksaFgRaoapLVx4jozGvy+Q0qGHfYYlDUOlHGmWU/Y1tSRFuV5+CgChFeocwaJ9NkTW1iFQizt+LHh79HQ8MD5kmXYry/I4ICwQYTqAar7K3eU4fEalQqeEz0bOiHVS7Z8xjkJw== 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)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(11063799006)(5023799004)(261009223027099003)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026140227099003)(261022105027099003)(261021121427099003)(261102123227099003)(261022075727099003)(261021123027099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AEQ2a/vQlK0D/V1DTdsQwZRVnAKBbdKvKcPVPfonmV8tDzw3bXTPABCkMCnsShFf8B1erBvqg+lE4Oa6qZIR86z2pDhOVK8WI8353HsXiHzd9fPe2E2/rHEWimbo9bEDCXhtcS8k7u8deJFCEjgDrvVU9HkZKhM2cL0VJ15jeV6O6zFgDBMIf+OeIHl1uTBa0Svfo0lGbrp+CzjTbu/OL2myt+Mrp10okRoIZWk9J8XCbzv8Yb89Z/s4dRpGPtbJcf8dJ/6EbDLCitAzDWZrGpWukdUYjWm6glSPGpmlZv1apz+cz56C+PDvFsplH2T5dwxec0jO4xs2kwzcbs0flCDEylQMeRuFf15mabP1sC16Ux2Pfhrnixz07tNNqZCCUEjaDSWplMe3/kiH+8Fp6fSfaVsw0+2NCaTCG0Cdy2v5D9DXiIb8mh1qImTDL0jy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 19:03:17.4421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98d9af10-5cc2-4f13-15b8-08df4fddc23f 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: DM3PEPF000265B2.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4288 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: Ilya Bakoulin [Why] ODM selection can choose a combine factor that fails the final DISPCLK check when downspread raises the clock requirement above the limit. Clamping ramp margin to a cap between DFS steps can also round the request up past the cap even when the mandatory clock fits. [How] Use the highest supported DFS step for the DCN6 ramp-margin clamp and account for downspread when passing that ceiling to ODM selection. Preserve the final check for mandatory clock requirements. Derive the DISPCLK ceiling from the highest DFS step at or below the clock table's maximum DISPCLK, floored to whole kHz. Account for downspread in the DCN5 DISPCLK, DPPCLK, and DSCCLK limits. Cc: Wenjing Liu Signed-off-by: Ilya Bakoulin Signed-off-by: George Zhang --- .../dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c | 43 +++++++++++++++---- .../dml2_core_dcn5_funcs_mode_support.c | 11 +++-- .../dml2_core_dcn6_funcs_mode_support.c | 5 +-- .../src/inc/dml2_internal_shared_types.h | 1 + 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c index 43ee8a0b21b3..2817340a0586 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_cga/dml2_cga_dcn6.c @@ -14,6 +14,29 @@ static double cga_dcn6_add_overhead_percent(double clk, double overhead_percent) return clk * (1 + overhead_percent / 100.0); } +static double cga_dcn6_scaled_vco_mhz(const struct dml2_clock_granularity_adjuster *adjuster) +{ + return math_floor2(adjuster->dispclk_dppclk_vco_speed_mhz, CLOCK_UNIT_GRANULARITY) * + DFS_DIVIDER_RANGE_SCALE_FACTOR; +} + +static unsigned int cga_dcn6_max_dfs_dispclk_khz(const struct dml2_clock_granularity_adjuster *adjuster, + unsigned int max_dispclk_khz) +{ + unsigned int scaled_vco_khz; + unsigned int divider; + + if (adjuster->dispclk_dppclk_vco_speed_mhz == 0.0) + return max_dispclk_khz; + + scaled_vco_khz = (unsigned int)(cga_dcn6_scaled_vco_mhz(adjuster) * 1000.0 + 0.5); + /* The reported DFS clock is floored to kHz. Find the smallest divider + * for which the exact clock is strictly below max_dispclk_khz + 1. + */ + divider = scaled_vco_khz / (max_dispclk_khz + 1) + 1; + return scaled_vco_khz / divider; +} + static double cga_dcn6_calculate_refclk_mhz(const struct dml2_clock_granularity_adjuster *adjuster, const double *clks_mhz, unsigned int count) { @@ -40,11 +63,11 @@ static double cga_dcn6_calculate_actual_dispclk_mhz(const struct dml2_clock_gran dispclk_with_downspread_mhz = cga_dcn6_add_overhead_percent(dispclk_mhz, adjuster->dcn_downspread_percent); dispclk_with_ramp_margin_mhz = cga_dcn6_add_overhead_percent( dispclk_with_downspread_mhz, adjuster->dispclk_ramp_margin_percent); - if (dispclk_with_downspread_mhz <= adjuster->max_dispclk_mhz && - dispclk_with_ramp_margin_mhz > adjuster->max_dispclk_mhz) - /* when dispclk with ramp margin is slightly over max, clamp the ramp margin to the max dispclk */ - return math_floor2(adjuster->max_dispclk_mhz, CLOCK_UNIT_GRANULARITY); - else if (dispclk_with_downspread_mhz > adjuster->max_dispclk_mhz) + if (dispclk_with_downspread_mhz <= adjuster->max_adjusted_dispclk_mhz && + dispclk_with_ramp_margin_mhz > adjuster->max_adjusted_dispclk_mhz) + /* Clamp optional ramp margin to the highest reachable DFS clock. */ + return adjuster->max_adjusted_dispclk_mhz; + else if (dispclk_with_downspread_mhz > adjuster->max_adjusted_dispclk_mhz) return math_floor2(dispclk_with_downspread_mhz, CLOCK_UNIT_GRANULARITY); else return math_floor2(dispclk_with_ramp_margin_mhz, CLOCK_UNIT_GRANULARITY); @@ -63,8 +86,7 @@ static double cga_dcn6_adjust_to_dfs_clock_value_mhz(const struct dml2_clock_gra /* There are cases when a clock is not needed */ return 0; - vco_speed_scaled_mhz = math_floor2(adjuster->dispclk_dppclk_vco_speed_mhz, 0.001); - vco_speed_scaled_mhz *= DFS_DIVIDER_RANGE_SCALE_FACTOR; + vco_speed_scaled_mhz = cga_dcn6_scaled_vco_mhz(adjuster); vco_divider = vco_speed_scaled_mhz / clk_mhz; vco_divider = math_floor(vco_divider); adjusted_clock_mhz = vco_speed_scaled_mhz / vco_divider; @@ -137,11 +159,16 @@ static double cga_dcn6_adjust_dcfclk_deepsleep_mhz(const struct dml2_clock_granu static void cga_dcn6_initialize(const struct dml2_cga_initialize_in_out *in_out) { + const struct dml2_clk_table *dispclk = &in_out->soc_bb->clk_table.dispclk; + in_out->adjuster->dcn_downspread_percent = in_out->soc_bb->dcn_downspread_percent; in_out->adjuster->dispclk_dppclk_vco_speed_mhz = in_out->soc_bb->dispclk_dppclk_vco_speed_mhz; in_out->adjuster->dispclk_ramp_margin_percent = in_out->ip->dispclk_ramp_margin_percent; + in_out->adjuster->max_adjusted_dispclk_mhz = + cga_dcn6_max_dfs_dispclk_khz(in_out->adjuster, + dispclk->clk_values_khz[dispclk->num_clk_values - 1]) / 1000.0; in_out->adjuster->max_dispclk_mhz = - in_out->soc_bb->clk_table.dispclk.clk_values_khz[in_out->soc_bb->clk_table.dispclk.num_clk_values - 1] / 1000.0; + in_out->adjuster->max_adjusted_dispclk_mhz / (1.0 + in_out->soc_bb->dcn_downspread_percent / 100.0); } void cga_dcn6_create(struct dml2_clock_granularity_adjuster *adjuster) diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.c index b9aef66d722d..8cfa0f712ad4 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_funcs_mode_support.c @@ -2485,6 +2485,11 @@ static void dcn5_ms_get_stream_support_info(const struct dml2_display_cfg *displ DML_LOG_VERBOSE("DML::%s: vblank_reserved_time_us = %u\n", __func__, out->vblank_reserved_time_us); } +static double dcn5_ms_subtract_dcn_overhead_percent(double clk, const struct dml2_utm_soc_bb *utm_soc_bb) +{ + return clk / (1.0 + utm_soc_bb->dcn_downspread_percent / 100.0); +} + static void dcn5_ms_setup_mode_lib_constants(struct dml2_core_calcs_mode_support_ex *in_out_params) { struct dml2_core_internal_display_mode_lib *mode_lib = in_out_params->mode_lib; @@ -2503,9 +2508,9 @@ static void dcn5_ms_setup_mode_lib_constants(struct dml2_core_calcs_mode_support sizeof(struct dml2_core_internal_mode_support)); mode_lib->ms.use_legacy_dsc_delay_formula = mode_lib->ip.use_legacy_dsc_delay_formula; mode_lib->ms.num_active_planes = display_cfg->num_planes; - mode_lib->ms.max_dispclk_freq_mhz = (double) utm_soc_bb->max_dispclk_khz / 1000; - mode_lib->ms.max_dscclk_freq_mhz = (double) utm_soc_bb->max_dscclk_khz / 1000; - mode_lib->ms.max_dppclk_freq_mhz = (double) utm_soc_bb->max_dppclk_khz / 1000; + mode_lib->ms.max_dispclk_freq_mhz = dcn5_ms_subtract_dcn_overhead_percent((double) utm_soc_bb->max_dispclk_khz / 1000, utm_soc_bb); + mode_lib->ms.max_dscclk_freq_mhz = dcn5_ms_subtract_dcn_overhead_percent((double) utm_soc_bb->max_dscclk_khz / 1000, utm_soc_bb); + mode_lib->ms.max_dppclk_freq_mhz = dcn5_ms_subtract_dcn_overhead_percent((double) utm_soc_bb->max_dppclk_khz / 1000, utm_soc_bb); DML_LOG_VERBOSE("DML::%s: --- START --- \n", __func__); DML_LOG_VERBOSE("DML::%s: num_active_planes = %u\n", __func__, 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 bd81e02e462f..290557d87b0d 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 @@ -860,7 +860,6 @@ void dcn6_ms_calculate_odm_mode( { 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; struct dml2_core_internal_mode_support *inputs = states; struct dml2_core_internal_mode_support *outputs = states; const struct dml2_stream_parameters *stream; @@ -880,7 +879,7 @@ void dcn6_ms_calculate_odm_mode( stream->output.output_format, stream->output.output_encoder, stream->overrides.odm_mode, - ((double) soc_bb->max_dispclk_khz / 1000), + ctx->clock_adjuster->max_dispclk_mhz, inputs->RequiresDSC[k], // DSCEnable totalNumberOfActiveDPP, ip->max_num_dpp, @@ -1176,7 +1175,7 @@ bool dcn6_ms_check_dispclk_and_dppclk_support( struct dml2_core_internal_mode_support *outputs = states; DML_LOG_FUNC_ENTER(); - outputs->support.DISPCLK_DPPCLK_Support = (inputs->RequiredDISPCLK <= ((double) soc_bb->max_dispclk_khz / 1000)) + outputs->support.DISPCLK_DPPCLK_Support = (inputs->RequiredDISPCLK <= ctx->clock_adjuster->max_adjusted_dispclk_mhz) && (inputs->GlobalDPPCLK <= ((double) soc_bb->max_dppclk_khz / 1000)); DML_LOG_DEBUG_BOOL(outputs->support.DISPCLK_DPPCLK_Support); diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h index 3f51c26dc238..d64705b9f976 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/inc/dml2_internal_shared_types.h @@ -163,6 +163,7 @@ struct dml2_clock_granularity_adjuster { double dispclk_dppclk_vco_speed_mhz; double dispclk_ramp_margin_percent; double max_dispclk_mhz; + double max_adjusted_dispclk_mhz; void (*initialize)(const struct dml2_cga_initialize_in_out *in_out); double (*adjust_dispclk_mhz)(const struct dml2_clock_granularity_adjuster *adjuster, double dispclk_mhz); void (*adjust_dppclks_mhz)(const struct dml2_clock_granularity_adjuster *adjuster, unsigned int count, -- 2.56.1