From: Danilo Krummrich <dakr@kernel.org>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: Zhi Wang <zhiw@nvidia.com>,
airlied@gmail.com, simona@ffwll.ch, corbet@lwn.net,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, ajanulgu@redhat.com, lyude@redhat.com,
pstanner@redhat.com, cjia@nvidia.com, jhubbard@nvidia.com,
bskeggs@nvidia.com, acurrid@nvidia.com, ojeda@kernel.org,
alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, benno.lossin@proton.me,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org,
rust-for-linux@vger.kernel.org,
Nouveau <nouveau-bounces@lists.freedesktop.org>
Subject: Re: [PATCH v2 2/2] gpu: nova-core: add initial documentation
Date: Sun, 9 Feb 2025 16:25:33 +0100 [thread overview]
Message-ID: <Z6jI7cKZQe2gyM_v@pollux> (raw)
In-Reply-To: <D7M2HTWHNGEZ.10FM642ZMX1PX@nvidia.com>
On Fri, Feb 07, 2025 at 05:23:37PM +0900, Alexandre Courbot wrote:
> On Wed Feb 5, 2025 at 10:56 PM JST, Zhi Wang wrote:
> > On Tue, 4 Feb 2025 20:03:12 +0100
> > Danilo Krummrich <dakr@kernel.org> wrote:
> >> + regressions with all 2nd level drivers.
> >> diff --git a/Documentation/gpu/nova/core/todo.rst b/Documentation/gpu/nova/core/todo.rst
> >> new file mode 100644
> >> index 000000000000..5e66ec35c5e3
> >> --- /dev/null
> >> +++ b/Documentation/gpu/nova/core/todo.rst
> >> @@ -0,0 +1,445 @@
> >> +.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >> +
> >> +=========
> >> +Task List
> >> +=========
> >> +
> >
> > ...
> >
> >> +
> >> +Generic register abstraction
> >> +----------------------------
> >> +
> >> +Work out how register constants and structures can be automatically generated
> >> +through generalized macros.
> >> +
> >> +Example:
> >> +
> >> +.. code-block:: rust
> >> +
> >> + register!(BOOT0, 0x0, u32, pci::Bar<SIZE>, Fields [
> >> + MINOR_REVISION(3:0, RO),
> >> + MAJOR_REVISION(7:4, RO),
> >> + REVISION(7:0, RO), // Virtual register combining major and minor rev.
> >> + ])
> >> +
> >
> > I think it is better not to tie this to pci::Bar and its operations. It
> > would be better to have a intermediate container as the macro param. The
> > container holds the register region vaddr pointer, size, read/write traits.
> > The macro expands it from there, thus, we can also use this on firmware
> > memory structures, e.g. GSP WPR2 info.
>
> Another reason for not tying this to a particular bus is that Tegra
> doesn't use PCI to reach the registers of its integrated GPU. Maybe we
> can remove that parameter from the register!() macro and have read()
> take a generic argument for its `bar` parameter instead, so that method
> gets automatically specialized for every type of bus we need to use?
This is just an example, I do not mean to tie this to the PCI bus. But rather
make it generic, such that it can be tied to any I/O resource.
Being able to tie the generated code (but not the macro itself) to a specific
resource though would be nice to have.
next prev parent reply other threads:[~2025-02-09 15:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 19:03 [PATCH v2 1/2] gpu: nova-core: add initial driver stub Danilo Krummrich
2025-02-04 19:03 ` [PATCH v2 2/2] gpu: nova-core: add initial documentation Danilo Krummrich
2025-02-05 13:56 ` Zhi Wang
2025-02-05 14:13 ` Miguel Ojeda
2025-02-05 14:56 ` Zhi Wang
2025-02-05 16:20 ` Danilo Krummrich
2025-02-05 16:10 ` Danilo Krummrich
2025-02-05 19:44 ` Zhi Wang
2025-02-09 15:36 ` Danilo Krummrich
2025-02-07 8:23 ` Alexandre Courbot
2025-02-09 15:25 ` Danilo Krummrich [this message]
2025-02-06 14:05 ` [PATCH v2 1/2] gpu: nova-core: add initial driver stub Alexandre Courbot
2025-02-06 14:49 ` Danilo Krummrich
2025-02-07 1:41 ` Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6jI7cKZQe2gyM_v@pollux \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=acurrid@nvidia.com \
--cc=airlied@gmail.com \
--cc=ajanulgu@redhat.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=bskeggs@nvidia.com \
--cc=cjia@nvidia.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=jhubbard@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau-bounces@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=pstanner@redhat.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=tzimmermann@suse.de \
--cc=zhiw@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).