Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2229ECF3963 for ; Thu, 19 Sep 2024 18:14:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A06210E11D; Thu, 19 Sep 2024 18:14:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.b="ntgI7Vom"; dkim-atps=neutral Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2050.outbound.protection.outlook.com [40.107.101.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC34B10E11D for ; Thu, 19 Sep 2024 18:14:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vLqfrZjUQkbCuOsd7CbA/K14ax1C7wwxTen8kWeRH4NxFtGcwUa+JTZEpex0EpXphdfAqapzt0qKzgqrEa7TUYFTPmHUR5k3SP55s2MOIygocPtp2hC8ECVLip9EVv1fvUIPfesk1aplHBB9IeAXvvDJwhOnVGN0OGZYKz7MX1KHd/t9F5PAucEIyBJw4+YKD8SG12vfdDGgwuy779ZMQ4dbQcn2A0963iUlJZtc0FJ+iWSISNYZqV/wZ3p4XrNe5Q5ndrPSR7OOH4qgX0pJSsA+PWj1bfNOiPWRgp8jqqApuxmd2xHU92Th5yjeiTT5TMms2xtIVKh6s/eFXSdPVQ== 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=wCKJqQV6ePdmFx2/jya4P8e6eny8Hy2z0JXfS7SXOe0=; b=MZtTQnLg54/abJUyvLe56WB6lzc34BAXwa4mM8EP3EJHo3Rmm3+kIev7Xl+f/vg7AovLmMT1YdKJF1dOJXoouPeme3AJjKxkVFgMpOh5Z4RZ2JKf+PrCe5VQ2iek+LYBBNEPpVCua1Zz7GEk4tjWFanOxuB0Xp+h7j45Ocnbm646adkfoYAthL5d91tQR1xYQIOJMidLS//4QR2OskEI/MbUOTtgVbwtbhO0grzWD+X9jGk1k6KaaG9/G3lPmsAQH3aTszlx8kNyEX+MF7wvhCLFax+UA16KE7tS4x13ZDqOMnkVEQL1mUJW1pTab8nF4H8mMnslmUolGXmrHyLaUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wCKJqQV6ePdmFx2/jya4P8e6eny8Hy2z0JXfS7SXOe0=; b=ntgI7VomsWEOFf+DfBsJee/M2Ob2Yb8uAaPoSEHo78f1NKFnJmFO3VZD7n1zRO3dRAsrLeAD+UlTD5ILKIHPVb5lJHRRq64NZ5zeBIq0Il//ejB9TFO3oxyM9v/QRkjnzthTDcFin37mKROxkFT5Ceuc05QoXSaKB9373aavJIcRB/W/+mewp2lnlpYLTUwZkknFhL4vXJhFPSES64jV+QaILdJlgGYT/uNxyLhSzPI7/X/lqIMf8NysaMM23pc2OysJgtTIto0UVAzZysRUCV+ahdV9uJdiltnLcDuS1s4nUy9m+XAj43+2EcuQ4kbtqo25ZaQuPJrS4O07ptKXxw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SJ0PR12MB7458.namprd12.prod.outlook.com (2603:10b6:a03:48d::13) by CY5PR12MB6227.namprd12.prod.outlook.com (2603:10b6:930:21::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Thu, 19 Sep 2024 18:14:04 +0000 Received: from SJ0PR12MB7458.namprd12.prod.outlook.com ([fe80::3518:64f8:f908:eb7d]) by SJ0PR12MB7458.namprd12.prod.outlook.com ([fe80::3518:64f8:f908:eb7d%4]) with mapi id 15.20.7982.018; Thu, 19 Sep 2024 18:14:04 +0000 Date: Thu, 19 Sep 2024 13:14:03 -0500 (CDT) From: Vidith Madhu To: dri-devel@lists.freedesktop.org Subject: Changes to `vrr_enabled` property Message-ID: X-NVConfidentiality: public Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: SJ0PR05CA0087.namprd05.prod.outlook.com (2603:10b6:a03:332::32) To SJ0PR12MB7458.namprd12.prod.outlook.com (2603:10b6:a03:48d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR12MB7458:EE_|CY5PR12MB6227:EE_ X-MS-Office365-Filtering-Correlation-Id: 09d64cd2-ad8a-49e1-2891-08dcd8d6d835 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jviIahvGmBMDlXbZNCcrsI5mc4eNl3/bJMCMoBfnmQkZmkwLQZJBIH3u1v1N?= =?us-ascii?Q?pBC0RpJdmcVFU4UzJ5Ht31yJhP34aHyGRVvUvtvAAHM8bk+6aO1dQgXBEqjq?= =?us-ascii?Q?gZzxbxW3elwAFNZEP0ekCURajmNVumIon6FRSTG0Ih0C3RBWBQ9vFRP6KWGG?= =?us-ascii?Q?nDtOTGyFXDPSG3EeZ3ZGjqhRgcZ+zxq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= =?us-ascii?Q?czs0AM8j5OdFWyioOqM5LBQbZ3VHTmcAKMsN8jctVw5Ym+8PZeJMEWDMATTR?= =?us-ascii?Q?hKvn8dCqvyufnz3GIdUCTWgJX9XCqsqxX2XBtFp0ubfAwOHQJ9H9tf9RfXNE?= =?us-ascii?Q?2hmsyc/m6ybCk+RqUx1TqdRlfcWug/wUUgqzIcQg3V8Y0Za2svwxAFLa8ZtP?= =?us-ascii?Q?bdgr3sKgovVOjSpifhUADk7LM5mdYAZWWJlUaCJF910EqmZsKkfCojj6xEhD?= =?us-ascii?Q?Qk0owZ3r3OAhtkV4WYZlMGs1kc3Md0b56o7vOD+V3RLmyA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR12MB7458.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LqQ/h4YWKc9NfFEzErGj7tem62WwKaGdkAUL7+uBRpV6fkXOvrIq33AdJdzP?= =?us-ascii?Q?YiAmxk500mUtYORg5dwmxhsATPRZlp7QlpXq/zsqkGSc7PBqD6n0A0AQGCVv?= =?us-ascii?Q?nCrGvNDUnEGJ4ZKtBYjznzQy1IXdzqNJTZtUdcDOI8QJK/zEBFMl+RuUFHWi?= =?us-ascii?Q?6tdPcCWB3nTz2v/Xce9aSo5gJCWWHaX/3km2YZrq9f9DJvT6bGg/7BnN03Hj?= =?us-ascii?Q?GC4+V9k5n181I/9yjXb1p8ZeIhNlnWQJI1GB6cLPKumCLR8UY/Rpfh4DjwUc?= =?us-ascii?Q?QQQ8BEMdzC5vWlTIW9ayYVOygqnm26IYdUutXWO2Hgyi5jbU63XfyLHfKgDp?= =?us-ascii?Q?xXAxaQofPntqJdWkzYA071S8OLxS1oyyAXx6G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4G5F1k4wJCy4/ugpS7TchvfkN9c4eyH9BzMcJ31diBxvs3JibNR?= =?us-ascii?Q?ScT6/MqQQjPRDckapNwuB9kFrQwZqMUfq1hzRcGUYmRCQ1WglqUhT9pI0SuR?= =?us-ascii?Q?DOBNHh19c9yrkzpGKPKnOGZ+qCvaGi34cKxBqzYu3V7U4hAS2vEEydF9jrGf?= =?us-ascii?Q?LRfPa/7mhzO8W6wp/LNGtfca9HVxgXk2QVy39F8zVugVw9x2/m9FWLOmQLd7?= =?us-ascii?Q?wuZVvfll4arVxmlfDVMxnPcVreku+gwHSjiGiYjSMjCTM0bNfgJ/4LowZfS6?= =?us-ascii?Q?G8VNNHpE+W6nYAPoH88lDQIUookA5eCHY6UYobw+?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09d64cd2-ad8a-49e1-2891-08dcd8d6d835 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR12MB7458.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 18:14:04.2407 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rRymYTLxD77l6b7IOSpW551m1GqrnHW6FuYnZiCO28y+fnwn5YyQ6l7Qa/aBYmeTAKchW8pHUB/KRhFtgIFluw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6227 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi all, I'd like to discuss a potential opportunity to enhance the `vrr_enabled` property of `drm_crtc_state`. Currently, this property is a Boolean flag, but this exposes some ambiguity and potential disconnect between client and driver/display behavior. Namely, it's unclear to the client whether it must allow a modeset for changes to `vrr_enabled`. I understand that the DP spec mandates seamless VRR transitions, but there is no such requirement for HDMI. Therefore, it is possible for clients to toggle `vrr_enabled` without setting `allow_modeset`, when in fact the display requires a modeset and/or display blanking. There are multiple ways this might be handled, each of which has flaws: 1. The driver proceeds with a modeset/blanking transition anyways, if the display requires it. As I understand, this is how amdgpu and i915 work [1, 2]. This is a problem because any Wayland compositor that has the "Automatic" option for VRR may transition in and out at unexpected moments, causing disruptive blanking effects. 2. The driver initially forces all VRR-capable displays into VRR mode, and controls whether the refresh rate is fixed or variable on-the-fly. This is a problem because many displays have features like ULMB, motion interpolation, black frame insertion, etc. that are unavailable when the display is in VRR mode. This is how the NVIDIA driver currently handles the situation; there have been user complaints about this [3]. 3. The driver rejects the request. This is a uAPI violation, as currently `allow_modeset` is not required for changes to `vrr_enabled`. I would suggest the following approach: Make `vrr_enabled` an enum of {TRUE, INACTIVE, FALSE}. FALSE would shut off VRR on the display (potentially with a modeset), and TRUE/INACTIVE would turn it on (again, potentially with modeset). INACTIVE would have the driver lock a fixed refresh rate while keeping VRR enabled on display. Transitioning between (TRUE/INACTIVE) and (FALSE) on any CRTC would require `allow_modeset` in `drm_atomic_state` to be set, else the request will fail. In addition, it would be the driver's responsibility to implement the distinction between TRUE and INACTIVE. With this change, clients are forced to declare their intentions clearly, and driver-side ambiguity is eliminated. I would appreciate any feedback or discussion about this. References: 1. https://gitlab.freedesktop.org/drm/amd/-/issues/2200#note_2160244 2. https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/7542#note_1643183 3. https://forums.developer.nvidia.com/t/cant-enable-ulmb-2-on-wayland/277478 Thanks, Vidith