NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Gary Guo" <gary@kernel.org>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, <nova-gpu@lists.linux.dev>,
	<dri-devel@lists.freedesktop.org>, "Gary Guo" <gary@garyguo.net>
Subject: Re: [PATCH] gpu: nova-core: migrate to `kernel::num::casts`
Date: Wed, 02 Dec 2026 15:56:03 +0900	[thread overview]
Message-ID: <DNA1TZ0WZKWN.1F08MI3NYYCZA@nvidia.com> (raw)
In-Reply-To: <20261130-dev-nova-num-v1-1-6f8e19907b9d@garyguo.net>

On Mon Nov 30, 2026 at 10:07 PM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Migrate users of the Nova's internal `num` module over to the
> `kernel::num::casts` instead. `FromSafeCast` and `IntoSafeCast` are
> migrated to the same-named traits or their `Arch` variant; `uX_as_uY`
> methods are migrated to `FromSafeCast`/`IntoSafeCast` outside const
> contexts and migrated to `cv!` macro inside const context.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
>  drivers/gpu/nova-core/falcon.rs                    |   2 +-
>  drivers/gpu/nova-core/falcon/fsp.rs                |   4 +-
>  drivers/gpu/nova-core/fb.rs                        |   2 +-
>  drivers/gpu/nova-core/firmware.rs                  |   2 +-
>  drivers/gpu/nova-core/firmware/booter.rs           |   2 +-
>  drivers/gpu/nova-core/firmware/fwsec.rs            |   2 +-
>  drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |   2 +-
>  drivers/gpu/nova-core/firmware/gen_bootloader.rs   |   2 +-
>  drivers/gpu/nova-core/firmware/gsp.rs              |   2 +-
>  drivers/gpu/nova-core/firmware/radix3.rs           |   6 +-
>  drivers/gpu/nova-core/firmware/tlv.rs              |   8 +-
>  drivers/gpu/nova-core/gsp.rs                       |   4 +-
>  drivers/gpu/nova-core/gsp/cmdq.rs                  |   3 +-
>  drivers/gpu/nova-core/gsp/fw.rs                    |  14 +-
>  drivers/gpu/nova-core/gsp/fw/commands.rs           |   2 +-
>  drivers/gpu/nova-core/gsp/nvkv/decode.rs           |  18 ++-
>  drivers/gpu/nova-core/gsp/sequencer.rs             |   2 +-
>  drivers/gpu/nova-core/irq/interrupt_tree.rs        |  20 +--
>  drivers/gpu/nova-core/mctp.rs                      |   7 +-
>  drivers/gpu/nova-core/mm/bar_user.rs               |  20 ++-
>  drivers/gpu/nova-core/mm/pagetable/map.rs          |  18 +--
>  drivers/gpu/nova-core/mm/pagetable/walk.rs         |  24 ++--
>  drivers/gpu/nova-core/mm/pramin.rs                 |   7 +-
>  drivers/gpu/nova-core/mm/vmm.rs                    |  17 +--
>  drivers/gpu/nova-core/num.rs                       | 158 ---------------------
>  drivers/gpu/nova-core/vbios.rs                     |   2 +-
>  26 files changed, 94 insertions(+), 256 deletions(-)

There have been a couple of efforts to do that already (most recent
being [1] IIRC), but landing it has been tricky and pending on the
availability of `cv!`.

And with all the code landing in Nova at the moment this is going to be
difficult to apply, actually this already results in lots of conflicts
on today's drm-rust-next.

If we want to get this in soon, I think a good point to land this would
be after the r000 switch and before we start landing the vGPU patches. I
can point you to the tree once I have a better idea of what it will look
like, or I can revive my own patch if you prefer.

[1] https://lore.kernel.org/all/20260828-nova_num-v1-0-e21f17ba4127@nvidia.com/

      reply	other threads:[~2026-12-02  6:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 13:07 [PATCH] gpu: nova-core: migrate to `kernel::num::casts` Gary Guo
2026-12-02  6:56 ` Alexandre Courbot [this message]

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=DNA1TZ0WZKWN.1F08MI3NYYCZA@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=gary@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=simona@ffwll.ch \
    /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