From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 276B723AB8B; Fri, 3 Oct 2025 17:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759512329; cv=none; b=g4z6KC9DaJ4eERrc87nYyUpmpQ4+cbvd/eKfieJaU28Mnp7GRfMsDSmWhoeJH4RurCMxfeMZ4NVHHrkELclfrX+QUNfOXIkUP1eFHzgWodyp27DEzhr3/7S02rL8eff9ieo6e2OUzk0anjYwMlHfusC4R4amHdgHNNntq21tFY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759512329; c=relaxed/simple; bh=luVpW4oXVdkB/u0eckceGH7vLqc4ooLhC+TbY9fR/ag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SGf/yJLV96hVfkusg4ew+JBdAbSVTiWGz+SaTVfZk+zf5IDNVfVobomVVT7qOaCZFXbDr0aomc5t90hi88GJoy35eTuX9XIE3XabDhca07qg+AATozs48QDgEUxwU2rCRl3blbGOUc3lWeQ/Ll3006LrnqmoWyKuROFML7QLTHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jannau.net; spf=pass smtp.mailfrom=jannau.net; dkim=pass (2048-bit key) header.d=jannau.net header.i=@jannau.net header.b=JwFBJbaa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=nE9vk/bI; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jannau.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jannau.net header.i=@jannau.net header.b="JwFBJbaa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nE9vk/bI" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 4AEA3EC0213; Fri, 3 Oct 2025 13:25:26 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 03 Oct 2025 13:25:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jannau.net; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1759512326; x=1759598726; bh=80zTLlNJzL 69CstAw641a6XukyfcEwp1lxsA+QkUUPA=; b=JwFBJbaaRt/nqg+vVt7bZic0JU 1GG0iknvBOLM6mMBiNUTG+6a/3VwxL13MFucddigVSTFQ+js7H5k6qPjDDmDQFhn IRdBwg6gl9vWgBuYAL/a2w6XUNueG0AvPZNmvZza7DLsNXjEAu76gvpSJBSoTAqd 7c7HZBx5DYxp+kY9ZYZTX6xenM1io/A3QZaI7k4gq4QN6UlzDmAw5Fl22TwXiLbP KxLxGIvDoShk0KeLFOvO2AdEhFpanCyKt0IHr37w+K/r7VMYJ9Zo3QPKIAxa4ofc Bl9TwdFP2OB05TfyraSog0OO7C+apf+TNVwYlZPMnW2/5qpOvkg4PAQc178A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1759512326; x=1759598726; bh=80zTLlNJzL69CstAw641a6XukyfcEwp1lxs A+QkUUPA=; b=nE9vk/bI9WxRJaqgCcF4FUfBATlqE/SIujNFseORpqgb9oGu0TU 7a/FRpUlAU4Y3iMQeH9vUPIn/HdMCK+1DY+QWpa9231HXKe8ZijAnippqPiSLoYe J9XN6Zlp3YgM6Mg1fhy5Tmxf/TTdxFo/2qeiCqiX3ncWjiMsJsNWq8ioWyRvGIWL Z8f1BzjMAzcdrwX+KC1AKfCcuSXSwQ7PXaBITzSsDzxQaJeck9TUuZhDLukbd3Ja hmln0h3uQ2uYpdABdtfXE6H5y5tdvjhfq/ToVeSivSq4xqhq8+K1otHA5Q5SUGcS jIN9Gl6zdsLjh9cgiBvK71Mng34MOJmitZg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdekleeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdertddttdejnecuhfhrohhmpeflrghnnhgvucfi rhhunhgruhcuoehjsehjrghnnhgruhdrnhgvtheqnecuggftrfgrthhtvghrnhepudefhf ehudetjeeutdfhvefhtdeltdfgheefkeefleegveevtedtveelfffhiedtnecuffhomhgr ihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehjsehjrghnnhgruhdrnhgvthdpnhgspghrtghpthhtohepvdeg pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlohhsshhinheskhgvrhhnvghlrd horhhgpdhrtghpthhtoheprggtohhurhgsohhtsehnvhhiughirgdrtghomhdprhgtphht thhopegrphhophhplhgvsehnvhhiughirgdrtghomhdprhgtphhtthhopehruhhsthdqfh horhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurhhi qdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoh epuggrkhhrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehojhgvuggrsehkvghrnhgv lhdrohhrghdprhgtphhtthhopegrlhgvgidrghgrhihnohhrsehgmhgrihhlrdgtohhmpd hrtghpthhtohepsghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i47b949f6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Oct 2025 13:25:24 -0400 (EDT) Date: Fri, 3 Oct 2025 19:25:17 +0200 From: Janne Grunau To: Benno Lossin Cc: Alexandre Courbot , Alistair Popple , rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, dakr@kernel.org, Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Andreas Hindborg , Alice Ryhl , Trevor Gross , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , John Hubbard , Joel Fernandes , Timur Tabi , linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH v3 08/13] gpu: nova-core: Add bindings and accessors for GspSystemInfo Message-ID: <20251003172517.GA1574227@robin.jannau.net> References: <20250930131648.411720-1-apopple@nvidia.com> <20250930131648.411720-9-apopple@nvidia.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Fri, Oct 03, 2025 at 06:34:12PM +0200, Benno Lossin wrote: > On Thu Oct 2, 2025 at 3:49 PM CEST, Alexandre Courbot wrote: > > Hi Alistair, (+Benno as this concerns the `init!` macros) > > > > On Tue Sep 30, 2025 at 10:16 PM JST, Alistair Popple wrote: > >> Adds bindings and an in-place initialiser for the GspSystemInfo struct. > >> > >> Signed-off-by: Alistair Popple > >> > >> --- > >> > >> It would be good to move to using the `init!` macros at some point, but > >> I couldn't figure out how to make that work to initialise an enum rather > >> than a struct as is required for the transparent representation. > > > > Indeed we have to jump through a few (minor) hoops. > > > > First the `init!` macros do not seem to support tuple structs. They > > match a `{` after the type name, which is not present in > > `GspSystemInfo`. By turning it into a regular struct with a single > > field, we can overcome this, and it doesn't affect the layout the > > `#[repr(transparent)]` can still be used. > > Yeah that's the correct workaround at the moment. I'm tracking support > for tuple structs in [1]. Essentially the problem is that it requires > lots of effort to parse tuple structs using declarative macros. We will > get `syn` this cycle, which will enable me to support several things, > including tuple structs. > > [1]: https://github.com/Rust-for-Linux/pin-init/issues/85 > > > Then, due to a limitation with declarative macros, `init!` interprets > > `::` as a separator for generic arguments, so `bindings::GspSystemInfo` > > also doesn't parse. Here the trick is to use a local type alias. > > This one will also be solved when we switch to syn. I was planning to submit https://github.com/AsahiLinux/linux/commit/2d95fd3b6c359634a0976f27f7a3c667826256da https://github.com/AsahiLinux/linux/commit/515638cb47cf0ebdac378686fcbbdc6a8364096a from the asahi downstream tree after 6.18-rc1. Does that still make sense timing wise? Types with type paths are used extensively in the asahi driver but I can initially work around that. Janne