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 52A90606A32E for ; Tue, 1 Dec 2026 19:03:56 +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=tu6FUw0S Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE2B910FC28; Tue, 1 Dec 2026 19:03:50 +0000 (UTC) Received: from BN1PR04CU002.outbound.protection.outlook.com (mail-eastus2azon11010041.outbound.protection.outlook.com [52.101.56.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EFE210FC2E for ; Tue, 1 Dec 2026 19:03:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dyesriu6u0+lGoE96ifHijFiLPdVYs5n0ilRCET3sSmJgRWwPizpl37mboR2qgc370N2c0VI/+L/SWt2MvXg66751fA/gT49HsrDSYjEf9nc0FiTL2dYTCXbfFJkp+qmP1k7OXARYJyMzr2ZHk1b6JEIdw8majecBylOuvYKb+KjMvtFM05GGeqhKuXQGYS1xSoARSODVI58hmz/DxFMRJSpq7gYkdVsIfcxe1TJrjOkWyhCwgopluR8MUHZH0U+D9bkAIQ5fNWhhN9yVIq32s8aGg+Yl6efQJeUYn6ly8L2rMYqXpK8jElUW/mZVcZ9MzIH5Adjum4NQvg0fZzGHg== 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=//TBiURLt2TPYkuDfyNewPT4g7Gox1960PfbVm7zwNs=; b=xItydJ6iWbmdXrhjEiL+FKbsEZDy/ZYXMSjBljmfasJ7dTmz1NC0thFLCu9LC9coEE0D/OBx/ENA8we2r/m0MdzzOtaV8pK9fGXPUAFgr/kjlSxkPtxuVlDrUBZkmq68lxEXsZsR73hQvZQWWakkqU5182dmREz5Qkygtu2MgAgnznfkhK+wfGcfXbb3ObBn99Bej+vYvmZzjEWeC+ykfk5EotNwDjmSe4me3w6EpAnQv0g0aBKvMsMxNlSTX6Ee2tfj5Zvf47lAHkHKcaW3uaI0NFVzFAQYGMfgs+bM4Mq6nL6qGGnAzndHwDRXFC3Z7RlYn/GjML9XG6dygeWdxw== 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=//TBiURLt2TPYkuDfyNewPT4g7Gox1960PfbVm7zwNs=; b=tu6FUw0SPF8nCz22iwIrrCjeLI1ogzTSOlLqDP6Ed/4xE4n+gZvpmRaBMMuEM+0uHa9kxbJldqTgXjmx5kgmvcw+B+8hkiXLMYTnohG11ui+GEej+GkA3sB8ZFzw3c6xYa99Z/ITtr1HbFI9Lrheah7CWTULUHKnt6H37asodN0= Received: from DS0PR17CA0007.namprd17.prod.outlook.com (2603:10b6:8:191::14) by SAWPR12MB999270.namprd12.prod.outlook.com (2603:10b6:806:562::7) 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:37 +0000 Received: from DM3PEPF000265B1.namprd02.prod.outlook.com (2603:10b6:8:191:cafe::28) by DS0PR17CA0007.outlook.office365.com (2603:10b6:8:191::14) 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:37 +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:37 +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:24 -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 21/30] drm/amd/display: Improve P-state admissability logic Date: Tue, 1 Dec 2026 13:57:57 -0500 Message-ID: <20261201190245.360906-22-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_|SAWPR12MB999270:EE_ X-MS-Office365-Filtering-Correlation-Id: e24d1651-7121-4e63-c89a-08df4fddce1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700016|82310400026|23010399003|56012099006|11063799006|10067099003|261026140227099003|261009223027099003|261021121427099003|261028144727099003|261026121527099003|261022105027099003|261102123227099003|261021123027099003|261022075727099003|22082099003|18002099003|3023799007; X-Microsoft-Antispam-Message-Info: 01OTRa4DIP472DyBYkNKDcIilp7QNiUYt83j18VPeoFDgsjaj3PzklSsM95mp8M1wOjLaEAi03ScTb7ty13BznQaKHIRtlelXx0N/tttopvXXIY1ACzZLDe5M9xs+oDASffUxbkFcyklvDytM5NBo00ga7Oqhy/WvJCvv33eLunFAR9P9UVMYRQyqnOFPxvU52tbYB4I1tDuAipHwoCa0lsIvTckew9FUDxJOE8kV/6kSuJVNd8nDwIo1eHTWzxmWK61EU4td1zt4ifSUObsR5x7+aJxL+gkJneUuFdbCZ2lJWhSq2b1KxCBNfDlfRLFPIiyjxa3ZvhpcUSlTxgmYRI5/KvDORJODe8XqGGyCDW9Y2ppbEQkwuZdEAUovQu3Hay4HeMzSj2S9BO1H/OsOrgkmzTJl9OH/bmmrgMfEpCwD+2XTbCLtsvrQj1Tr9GE3MbORFEONxVY9MamAVxNH/yfqkghg0Pws0Q+wlJtpXe+MouBqPNVmhmVt2nJGMjPkX8/PEf3naiw+SzUwl8c4RrXeD5Xqdpr8YlkjV1+R3VU4HG+YBQLRYRjGtyqu/aGthpnRRu3pXy8mfoNnywa88UU2ZLq9IN0TuK0YQJDdmgOjjBpCrEkDwhf/JaMmJ0k3uaq8CSeyhhIp4hmaVMsG2/oCkZ3gElcxUkFT+jHVw0wU7jhJuFwuPmsSGqQzk+a4/ole0riK0kdglTNbBQbjw== 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)(1800799024)(376014)(36860700016)(82310400026)(23010399003)(56012099006)(11063799006)(10067099003)(261026140227099003)(261009223027099003)(261021121427099003)(261028144727099003)(261026121527099003)(261022105027099003)(261102123227099003)(261021123027099003)(261022075727099003)(22082099003)(18002099003)(3023799007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AtV0hI9d4TY7zTvm8AXaXZF8O0NiG2WnH0ipMqMUip/M+Hkk+smvZ5/58u+pCBYphvaEroXx7fgqZYr+VNFUGmRPBvWaGR2snT3SjcQSMZkCiGegNmQufJRRLZnoofdVQfDZkEySN4dSqbyGKv66l4z599pWEGhbxNzTSAMOWiccCvpJAO1I9JCzKAhaQFIP4tcS/rjvbKkknLclZG5km/LX6ppNTo1ESKmmEB0gOa1lmaR28/MMbkQEODGeAzok7T/S82FQg8ouXREuV6OPmBYmssFupBoHo/QvbnTS+OPAioK0A8djXDDj5k+wPaVL6ywY21ZODmLHVrE5fNp3sl646/ogmhhBBpypQiSEqRf1MT48Vjj+Cxnrq34cP7/ntpM/kgGofsPuwjm7eIVdVS/oYwQoa5ZHGdFMeA+OPPGNYNCmZOXd3le7TVYyciyc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 19:03:37.3648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e24d1651-7121-4e63-c89a-08df4fddce1e 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: SAWPR12MB999270 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] P-State admissability logic failed to account for time leftover by a VStartup constrained to be smaller than VBlank. In this case, the difference between VBlank and VStartup should be considered as usable for latency hiding. Also clamp the ideal P-state disallow time per stream to the P-state allow delay divided by the number of streams when updating the worksheet for admissibility. Cc: Austin Zheng Signed-off-by: Dillon Varone Signed-off-by: George Zhang --- .../src/dml2_core/dml2_core_dcn6_calcs.h | 2 ++ .../dml2_core/dml2_core_dcn6_calcs_dchub.c | 8 +++++++- .../dml2_core/dml2_core_dcn6_calcs_dchub.h | 2 ++ .../dml2_core_dcn6_funcs_mode_support.c | 8 ++++++++ .../dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c | 20 ++++++++++++++++--- .../src/inc/dml2_internal_shared_types.h | 1 + 6 files changed, 37 insertions(+), 4 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 f0d98bff5674..f903b88de6dc 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 @@ -73,6 +73,8 @@ struct dml2_core_dcn6_calcs { int num_active_planes, const unsigned int v_blank_start[DML2_MAX_PLANES], const unsigned int v_blank_end[DML2_MAX_PLANES], + const unsigned int v_startup[DML2_MAX_PLANES], + const unsigned int v_total[DML2_MAX_PLANES], const double otg_vline_time_us[DML2_MAX_PLANES], const double det_fill_delay_us[DML2_MAX_PLANES], const double reserved_vblank_us[DML2_MAX_PLANES], 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 69439ec644e0..7b7fa428958e 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 @@ -1715,6 +1715,8 @@ void dcn6_calculate_pstate_schedule_windows( int num_active_planes, const unsigned int v_blank_start[DML2_MAX_PLANES], const unsigned int v_blank_end[DML2_MAX_PLANES], + const unsigned int v_startup[DML2_MAX_PLANES], + const unsigned int v_total[DML2_MAX_PLANES], const double otg_vline_time_us[DML2_MAX_PLANES], const double det_fill_delay_us[DML2_MAX_PLANES], const double reserved_vblank_us[DML2_MAX_PLANES], @@ -1728,6 +1730,7 @@ void dcn6_calculate_pstate_schedule_windows( int det_fill_delay_otg_vlines; int blackout_otg_vlines; int reserved_vblank_otg_vlines; + int unallocated_vblank_otg_vlines; /** * Calculate allow start and end for pstate in vactive: @@ -1742,10 +1745,13 @@ void dcn6_calculate_pstate_schedule_windows( blackout_otg_vlines = (int)(math_ceil(blackout_us / otg_vline_time_us[k])); det_fill_delay_otg_vlines = (int)(math_ceil(det_fill_delay_us[k] / otg_vline_time_us[k])); reserved_vblank_otg_vlines = (int)(math_ceil(reserved_vblank_us[k] / otg_vline_time_us[k])); + unallocated_vblank_otg_vlines = v_total[k] - v_blank_start[k] + v_blank_end[k] - v_startup[k]; /* for vactive only, make relative to vblank end */ allow_start_otg_vlines = det_fill_delay_otg_vlines; - allow_end_otg_vlines = v_blank_start[k] - v_blank_end[k] - (blackout_otg_vlines - reserved_vblank_otg_vlines); + allow_end_otg_vlines = v_blank_start[k] - v_blank_end[k] + + unallocated_vblank_otg_vlines - + (blackout_otg_vlines - reserved_vblank_otg_vlines); /* Convert them back to time since the start of a frame */ allow_start_us[k] = allow_start_otg_vlines * otg_vline_time_us[k]; 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 fe4474c9eac7..f23ee0e5ee9f 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 @@ -74,6 +74,8 @@ void dcn6_calculate_pstate_schedule_windows( int num_active_planes, const unsigned int v_blank_start[DML2_MAX_PLANES], const unsigned int v_blank_end[DML2_MAX_PLANES], + const unsigned int v_startup[DML2_MAX_PLANES], + const unsigned int v_total[DML2_MAX_PLANES], const double otg_vline_time_us[DML2_MAX_PLANES], const double det_fill_delay_us[DML2_MAX_PLANES], const double reserved_vblank_us[DML2_MAX_PLANES], 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 d9b710baf66a..c9adba53fbbf 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 @@ -3846,6 +3846,7 @@ void dcn6_ms_calculate_pstate_schedule_windows( struct dml2_core_calcs_mode_support_locals *dummies = ctx->dummies; unsigned int *v_blank_start = dummies->dummy_integer_array[0]; unsigned int *v_blank_end = dummies->dummy_integer_array[1]; + unsigned int *v_total = dummies->dummy_integer_array[2]; double *otg_vline_time_us = dummies->dummy_double_array[0]; double *reserved_vblank_us = dummies->dummy_double_array[1]; const struct dml2_plane_parameters *plane = NULL; @@ -3858,6 +3859,7 @@ void dcn6_ms_calculate_pstate_schedule_windows( stream = &display_cfg->stream_descriptors[plane->stream_index]; v_blank_start[k] = stream->timing.v_blank_end + stream->timing.v_active; v_blank_end[k] = stream->timing.v_blank_end; + v_total[k] = stream->timing.v_total; otg_vline_time_us[k] = (double)stream->timing.h_total / stream->timing.pixel_clock_khz * 1000.0; reserved_vblank_us[k] = plane->overrides.reserved_vblank_time_ns / 1000.0; } @@ -3868,6 +3870,8 @@ void dcn6_ms_calculate_pstate_schedule_windows( display_cfg->num_planes, v_blank_start, v_blank_end, + inputs->MaxVStartupLines, + v_total, otg_vline_time_us, inputs->pstate_vactive_det_fill_delay_us[dml2_pstate_type_fclk], reserved_vblank_us, @@ -3883,6 +3887,8 @@ void dcn6_ms_calculate_pstate_schedule_windows( display_cfg->num_planes, v_blank_start, v_blank_end, + inputs->MaxVStartupLines, + v_total, otg_vline_time_us, inputs->pstate_vactive_det_fill_delay_us[dml2_pstate_type_ppt], reserved_vblank_us, @@ -3900,6 +3906,8 @@ void dcn6_ms_calculate_pstate_schedule_windows( display_cfg->num_planes, v_blank_start, v_blank_end, + inputs->MaxVStartupLines, + v_total, otg_vline_time_us, inputs->pstate_vactive_det_fill_delay_us[dml2_pstate_type_temp_read], reserved_vblank_us, diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c index 71407eec2d83..44cc7de4d8dc 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_pmo/dml2_pmo_dcn6_stage_optimizers.c @@ -403,7 +403,7 @@ static bool dcn6_is_pstate_schedulable( } static bool dcn6_update_worksheet_for_pstate_admissibility(struct dml2_optimization_worksheet *worksheet, - struct dml2_pstate_meta *per_stream_pstate_meta, + struct dml2_stage_optimizer_fclk_ppt_temp_read_pstate_optimize_locals *l, enum dml2_pstate_type pstate_type) { const double vblank_ratio = 0.8; @@ -426,6 +426,8 @@ static bool dcn6_update_worksheet_for_pstate_admissibility(struct dml2_optimizat long reserved_vblank_time_ns; bool unvalidated_changes = false; + struct dml2_pstate_meta *per_stream_pstate_meta = l->per_stream_pstate_meta; + const struct dml2_display_cfg *display_config = worksheet->orig_dispcfg; /* Two possible locations to obtain the extra time required to pass admissibility * 1. Allocate some time from the reserved vblank @@ -456,6 +458,8 @@ static bool dcn6_update_worksheet_for_pstate_admissibility(struct dml2_optimizat (1.0 / (2.0 - math_pow(2.0, (float)(2 - display_config->num_streams)))); } + ideal_disallow_time_us = math_min2(ideal_disallow_time_us, l->pstate_allow_delay_us / (double)display_config->num_streams); + extra_time_required_us = 0.0; delta_max_det_fill_delay_us = 0.0; delta_reserved_vblank_time_us = 0.0; @@ -599,6 +603,13 @@ static int dcn6_get_required_vactive_det_fill_delay_us( return max_vactive_det_fill_delay_us; } +static int dcn6_get_vstartup_lines( + const struct dml2_validation_result *validation_res, + int stream_idx) +{ + return validation_res->mode_support.cfg_support_info.stream_support_info[stream_idx].max_vstartup_lines; +} + static bool dcn6_all_timings_support_vactive(struct dml2_pmo_stage_optimizer *stage, const struct dml2_display_cfg *display_config, unsigned int mask) @@ -769,6 +780,7 @@ static void dcn6_build_pstate_meta_per_stream(const struct dml2_display_cfg *dis /* scheduling params should be built based on the worst case for allow_time:disallow_time */ /* vactive */ + stream_pstate_meta->method_vactive.vstartup_lines = dcn6_get_vstartup_lines(&worksheet->validation_result, stream_index); stream_pstate_meta->method_vactive.vactive_latency_hiding_us = (double)dcn6_get_vactive_latency_hiding(&worksheet->validation_result, stream_plane_mask); if (stream_pstate_meta->method_vactive.vactive_latency_hiding_us < watermark_us) { @@ -836,11 +848,12 @@ static void dcn6_build_pstate_meta_per_stream(const struct dml2_display_cfg *dis if (stream_pstate_meta->method_vactive.max_vactive_det_fill_delay_us > 0.0) { stream_pstate_meta->method_vactive.common.allow_start_otg_vline = timing->v_blank_end + stream_pstate_meta->method_vactive.max_vactive_det_fill_delay_otg_vlines; + stream_pstate_meta->method_vactive.common.allow_end_otg_vline = stream_pstate_meta->vblank_start + stream_pstate_meta->nom_vtotal - stream_descriptor->timing.v_active - - stream_descriptor->timing.vblank_nom - + stream_pstate_meta->method_vactive.vstartup_lines - stream_pstate_meta->blackout_otg_vlines + stream_pstate_meta->method_vactive.reserved_blank_required_vlines; } else { @@ -1782,7 +1795,8 @@ static bool dml2_pmo_dcn6_stage_optimizer_fclk_ppt_temp_read_pstate_optimize_nex /* always update the worksheet with latest requirements */ if (dcn6_update_worksheet_for_pstate_admissibility(worksheet, - l->per_stream_pstate_meta, worksheet->fclk_ppt_temp_read_pstate.pstate_type_list[i])) { + l, + worksheet->fclk_ppt_temp_read_pstate.pstate_type_list[i])) { modified = true; DML_LOG_VERBOSE("fclk_ppt_temp_read pstate not admissible with current worksheet, adjusting the reserved vblank time\n"); } 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 d64705b9f976..0e250610c4c7 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 @@ -462,6 +462,7 @@ struct dml2_pstate_meta { double reserved_vblank_required_us; int max_vactive_det_fill_delay_otg_vlines; int reserved_blank_required_vlines; + int vstartup_lines; struct dml2_pstate_per_method_common_meta common; } method_vactive; struct { -- 2.56.1