From mboxrd@z Thu Jan 1 00:00:00 1970 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 C48F2C54F54 for ; Tue, 28 Jul 2026 18:26:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16EF710E9B3; Tue, 28 Jul 2026 18:26:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=garyguo.net header.i=@garyguo.net header.b="lPV47DpP"; dkim-atps=neutral Received: from LO3P265CU004.outbound.protection.outlook.com (mail-uksouthazon11020078.outbound.protection.outlook.com [52.101.196.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3399D10E9B3 for ; Tue, 28 Jul 2026 18:26:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fy2fI387JgSAV6dRl7rURzybGUm2UQBAtcNjCGR4nXX+0Az+k2HBwN92QQsuT6x70/d5QpogGv+pe1Xdm9XkPdZ0Fu9P1RVxTiywr6a0q7dVrzRT4CcScz7z7+8w5YzYsvfm/bm7UdVo8EtME+Iq4jCi458Sub1bkddeUtoxBuhA/kSlvH9DSJTB/Ffu7AgbM8tdqmOuTiJwI6UmXLcX68JCG0atdl5HFNfomZsJXznPSXH6jdXaeMFfRaLykW21W/VJezgjnVAOI69DwVKaS9XvzOxYy7iI8wTf9/rnyze3d1ZSJzC1SWLOOKjOVxyXC/aeGaaMxDnXVknoMdpV1A== 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=hsVfmV0Q78LE3qHzuW166D7sGm5Zp3/Mv7Y3yepwBaM=; b=HNsnOYCptczOT1h0LQFvEhCwoOAhSH/1si//y91RFx7aj/puQjoXk4D83mnEwWrHUHxl9K3qYXbmRVxrs10msaawKWjqM9Ri+fS3GVOqNCyCv6nfBdiU/c/MEbSOEHWWYwYrSCMNK+HflSdhLC5Pr9LUlj9tUW7Wiz+cY5ihVgIaTPrqCOKCMsWsFCXaYUsCoEUOYBxA1eKAX8tqIgZKTFMhMBkRZirWIkv3Rw+9iNJY7UzvYumwUWc2e2sCVQpL4Oj+z86mkKNFbVf80F0K0KQU/DGDi8FSaFFzw51+P3Q+xrLdd7SJnYuZd5X8OS5hq3Scf7Y61Pxc9RPtCOgYZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=garyguo.net; dmarc=pass action=none header.from=garyguo.net; dkim=pass header.d=garyguo.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garyguo.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hsVfmV0Q78LE3qHzuW166D7sGm5Zp3/Mv7Y3yepwBaM=; b=lPV47DpPkI06n5jkLwj6i5X0NUd50DL0EsLbxRLtMNYxMTUs0NvB7Fnsz4seJxTablZRNIjw/1I/K3s15IPpjansESn9fZ2W3gr9PmPC2OFXZMSGUrQhF7Z/ofSzyMa7hPk6uJfZp5/ollTCWNtLS+RZ4PSmEadF4iUWGdN7v98= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=garyguo.net; Received: from LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:488::16) by CW1P265MB8942.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:27b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 28 Jul 2026 18:26:08 +0000 Received: from LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM ([fe80::1c3:ceba:21b4:9986]) by LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM ([fe80::1c3:ceba:21b4:9986%2]) with mapi id 15.21.0270.009; Tue, 28 Jul 2026 18:26:08 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 28 Jul 2026 19:26:06 +0100 Message-Id: Cc: "Gary Guo" , "Alice Ryhl" , "Daniel Almeida" , "Miguel Ojeda" , "Boqun Feng" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Tamir Duberstein" , =?utf-8?q?Onur_=C3=96zkan?= , "David Airlie" , "Simona Vetter" , "Bjorn Helgaas" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , , , , , , Subject: Re: [PATCH 08/10] gpu: nova-core: use projection for PFALCON and PFALCON2 registers From: "Gary Guo" To: "Danilo Krummrich" , "Alexandre Courbot" X-Mailer: aerc 0.21.0 References: <20260721-typed_register-v1-0-452d72b60262@garyguo.net> <20260721-typed_register-v1-8-452d72b60262@garyguo.net> In-Reply-To: X-ClientProxiedBy: LO4P265CA0314.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:390::6) To LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:488::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LOVP265MB8871:EE_|CW1P265MB8942:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b29ae20-5db1-45d3-4504-08deecd5b161 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|23010399003|366016|7416014|376014|6133799003|56012099006|4143699003|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 2aU25Y+r9KXnm5eToEir21ZSOiHck69ecCTpSVUENqwEIU/0Y97SV9sCNS9F62d4givDLjyepf0XhUtM+MbD/Np73L3Dc/aU2t8diIwVXyDtLW6E7otHjy7Kte7TPtwZGZ6TycWfG4FRezhP8HHzSMthJqwvMgfjut9PjE0JhE4qmW4/L4b/eONJgYtXCoxbmXe5ZXQ3UDQMA+/8RVJNRkbIoU0mIpUxiP0JiR70YJ6LPrqq5Px0MKqUXkWE79TWLYDl17Dgb2vhavaurwUP8npYZg7//3RG7PEosjSoKiE0X7bbhhifKhbGbXdTXymr5FiAa/AaPdc1P0pzP7T8CsYRfKCocyByc59i3MQyaVIfPCNjwwEs8dqzj07C+iz3RIdk/anjp3dUA6gB/sRrO18t9Z5UYyIrYZ/cWLIw7nCCbUCZPf3Lb5zC1eXBUo7IDJFlRfXUEfGZMBU2/87DrPcIFLpKwztcKbIMS3XJoCeQrk7yzPCHZ8/xLr1OYN5yZtvGyPEe80qhQc/BYy15552ctazYqPtLxtPs/9m1B6rP7Bgj/edDRm+OcKdlGPIY8iL/XVOd5SqWfTbiMdAQiqQuosfQ9Fqk44XMXoTObVzyXXIOeeHxTODuFZ5/6QRIyE8Dp5Djlknv/JCz8XHq1y5PqE1ZyM2EIgnQSBcWLNM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(23010399003)(366016)(7416014)(376014)(6133799003)(56012099006)(4143699003)(10067099003)(22082099003)(18002099003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WnVBSFVrdXBOV2pSYno0M2x3UXJPMDNXcVRJWklLUzhoaS9LakQyMEV3MHBj?= =?utf-8?B?YXgvMGhnWFhDRzBLVVVod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cHNHNkNZ?= =?utf-8?B?V05HM0VmQzd0cmtiRnpUZXJiTUcrR2M0NHR3NE9rR0VlN0ZVZ1VJcjFZZEdY?= =?utf-8?B?YkwxVXNUS2w0cjk0WmJZWkJ6Z3M2MnFnSExWTWJ2bTFURTJveU5hNVdNNHdW?= =?utf-8?B?c01IazlGRFZxd1JWQ2w1cjBxLzlSZm1BTk1mMmsvRWJzV21zdVByN0NwZjhU?= =?utf-8?B?Tll3VDUzcFdFd2tTaFNKcWRCRG1iNDIyRFlIQzNYVHJvY1dub2Vjc09QOGR0?= =?utf-8?B?UUhRNU5lSTlnaWZ6azR3WUFiZzZPbExXZ2lReVlZWWgraXRsZktsWFpkamZx?= =?utf-8?B?aU8wR2FrNGJrZ2t4bHp2V3RKLzFZU2hMV1AzUUw3bitkbzMxdTZUb0FmOGM5?= =?utf-8?B?ZGxZVm1QSDZQMjdBblQ4RDdqRUdqY1g4L3UrR0R2YmZRcXF0TStDS0psWVha?= =?utf-8?Q?33+rhvkqghmeKDhIcq?= X-OriginatorOrg: garyguo.net X-MS-Exchange-CrossTenant-Network-Message-Id: 6b29ae20-5db1-45d3-4504-08deecd5b161 X-MS-Exchange-CrossTenant-AuthSource: LOVP265MB8871.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 18:26:08.2204 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bbc898ad-b10f-4e10-8552-d9377b823d45 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8/M17ELU5rfcTK6tznzJghe08rYWIQQjQzVq70SlUtYzCkHagriwT9wp4qBp3enOcRU6BhUWxKdxBClEfeizng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CW1P265MB8942 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" On Tue Jul 28, 2026 at 6:01 PM BST, Danilo Krummrich wrote: > On Tue Jul 28, 2026 at 5:09 PM CEST, Alexandre Courbot wrote: >> Great, keeping this commit purely mechanical sounds good to me if you >> prefer it that way (although one can argue that the refactor itself is >> also mostly mechanical as the end result shouldn't be more complex). > > I don't really see much value in this intermediate change; it's not reall= y less > invasive than to do the refactor I think, so let's do that. > >>>> And I suspect that once this is generalized, `Falcon` won't even need = to >>>> store a reference to the `Bar0` (and potentially poke the I/O of other >>>> engines) anymore. >>>> >>>> Actually I would like to push that even further and replace the >>>> `pfalcon()` and `pfalcon2()` trait methods by associated constants use= d >>>> to construct the projected view in `Falcon::new`, since the projection= s >>>> are all constructed the same way, but doing so requires >>>> `generic_const_exprs`. :/ > > Yes, that'd be best. > >>>> We could make it work by moving the `OFFSET` generic argument of >>>> `subregion` into a regular argument and enforcing its invariants using >>>> `build_assert!`, but that would require `subregion` to be >>>> `#[inline(always)]`. I don't know if there is another trick we can use= , >>>> if not otherwise I guess the trait methods are ok, especially if they >>>> are only called once in the constructor. > > I think this is fine if, as Alex says as well, we expose it as another va= riant > of subregion(). (In general, I'd like to avoid introducing more build_ass= ert!() > if there's not much value though.) > > In the nova-core case it would be a specific workaround for generic_const= _exprs > not being stable, so a separate subregion() variant that is specifically > targeted at this seems fine. > >>> This was definitely one option that I have considered, however as `NEW_= SIZE` >>> still needs to be generic so we're not entirely turbofish-free. But if = making >>> `offset` become an effective const parameter helps nova impl, it might = make >>> sense to use `build_assert!` for this. > > As mentioned I'd like to avoid additional build_assert!() if not needed, = the > turbofish doesn't hurt too much here. > >> Maybe we can have another variant of `subregion` that operates that way, >> but your call. I don't see any obvious flaw with the current >> implementation, it's just that the `FalconEngine` methods should not be >> useful outside of the constructor eventually, so it seems a bit >> superfluous to have them visible to the whole crate. > > I may have a slight preference for a separate subregion() variant for the > purpose of working around generic_const_exprs, as it probably is a bit cl= oser to > the final solution, but trait methods are fine with me too. I am not sure that's the final solution that I want. I want arg-position const-generics which would syntactically look more similar to `build_assert= !`. Personally I think most issues with `build_assert!` can be fixed by having lints, which is on my radar. Best, Gary