[PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants

John Hubbard posted 2 patches 3 days, 18 hours ago
[PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by John Hubbard 3 days, 18 hours ago
Replace manual usize-to-u64 conversions of SZ_* constants with the
SizeConstants trait's associated constants on u64. With the
SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
and similar.

This removes several now-unused imports: usize_as_u64, FromSafeCast,
and individual SZ_* type-level constants.

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 drivers/gpu/nova-core/fb.rs     | 21 +++++++++------------
 drivers/gpu/nova-core/gsp/fw.rs | 15 +++++++--------
 drivers/gpu/nova-core/regs.rs   |  7 +++----
 3 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
index bdd5eed760e1..5c304fc03467 100644
--- a/drivers/gpu/nova-core/fb.rs
+++ b/drivers/gpu/nova-core/fb.rs
@@ -24,11 +24,8 @@
     firmware::gsp::GspFirmware,
     gpu::Chipset,
     gsp,
-    num::{
-        usize_as_u64,
-        FromSafeCast, //
-    },
-    regs,
+    num::FromSafeCast,
+    regs, //
 };
 
 mod hal;
@@ -127,8 +124,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if f.alternate() {
             let size = self.len();
 
-            if size < usize_as_u64(SZ_1M) {
-                let size_kib = size / usize_as_u64(SZ_1K);
+            if size < u64::SZ_1M {
+                let size_kib = size / u64::SZ_1K;
                 f.write_fmt(fmt!(
                     "{:#x}..{:#x} ({} KiB)",
                     self.0.start,
@@ -136,7 +133,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                     size_kib
                 ))
             } else {
-                let size_mib = size / usize_as_u64(SZ_1M);
+                let size_mib = size / u64::SZ_1M;
                 f.write_fmt(fmt!(
                     "{:#x}..{:#x} ({} MiB)",
                     self.0.start,
@@ -186,7 +183,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
 
         let vga_workspace = {
             let vga_base = {
-                const NV_PRAMIN_SIZE: u64 = usize_as_u64(SZ_1M);
+                const NV_PRAMIN_SIZE: u64 = u64::SZ_1M;
                 let base = fb.end - NV_PRAMIN_SIZE;
 
                 if hal.supports_display(bar) {
@@ -196,7 +193,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
                     {
                         Some(addr) => {
                             if addr < base {
-                                const VBIOS_WORKSPACE_SIZE: u64 = usize_as_u64(SZ_128K);
+                                const VBIOS_WORKSPACE_SIZE: u64 = u64::SZ_128K;
 
                                 // Point workspace address to end of framebuffer.
                                 fb.end - VBIOS_WORKSPACE_SIZE
@@ -216,7 +213,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
 
         let frts = {
             const FRTS_DOWN_ALIGN: Alignment = Alignment::new::<SZ_128K>();
-            const FRTS_SIZE: u64 = usize_as_u64(SZ_1M);
+            const FRTS_SIZE: u64 = u64::SZ_1M;
             let frts_base = vga_workspace.start.align_down(FRTS_DOWN_ALIGN) - FRTS_SIZE;
 
             FbRange(frts_base..frts_base + FRTS_SIZE)
@@ -256,7 +253,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
         };
 
         let heap = {
-            const HEAP_SIZE: u64 = usize_as_u64(SZ_1M);
+            const HEAP_SIZE: u64 = u64::SZ_1M;
 
             FbRange(wpr2.start - HEAP_SIZE..wpr2.start)
         };
diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs
index 0c8a74f0e8ac..9dac3288f3a3 100644
--- a/drivers/gpu/nova-core/gsp/fw.rs
+++ b/drivers/gpu/nova-core/gsp/fw.rs
@@ -17,8 +17,8 @@
         KnownSize, //
     },
     sizes::{
-        SZ_128K,
-        SZ_1M, //
+        SizeConstants,
+        SZ_128K, //
     },
     transmute::{
         AsBytes,
@@ -123,7 +123,7 @@ fn client_alloc_size() -> u64 {
     /// Returns the amount of memory to reserve for management purposes for a framebuffer of size
     /// `fb_size`.
     fn management_overhead(fb_size: u64) -> u64 {
-        let fb_size_gb = fb_size.div_ceil(u64::from_safe_cast(kernel::sizes::SZ_1G));
+        let fb_size_gb = fb_size.div_ceil(u64::SZ_1G);
 
         u64::from(bindings::GSP_FW_HEAP_PARAM_SIZE_PER_GB_FB)
             .saturating_mul(fb_size_gb)
@@ -145,9 +145,8 @@ impl LibosParams {
     const LIBOS2: LibosParams = LibosParams {
         carveout_size: num::u32_as_u64(bindings::GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS2),
         allowed_heap_size: num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MIN_MB)
-            * num::usize_as_u64(SZ_1M)
-            ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MAX_MB)
-                * num::usize_as_u64(SZ_1M),
+            * u64::SZ_1M
+            ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MAX_MB) * u64::SZ_1M,
     };
 
     /// Version 3 of the GSP LIBOS (GA102+)
@@ -155,9 +154,9 @@ impl LibosParams {
         carveout_size: num::u32_as_u64(bindings::GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS3_BAREMETAL),
         allowed_heap_size: num::u32_as_u64(
             bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS3_BAREMETAL_MIN_MB,
-        ) * num::usize_as_u64(SZ_1M)
+        ) * u64::SZ_1M
             ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS3_BAREMETAL_MAX_MB)
-                * num::usize_as_u64(SZ_1M),
+                * u64::SZ_1M,
     };
 
     /// Returns the libos parameters corresponding to `chipset`.
diff --git a/drivers/gpu/nova-core/regs.rs b/drivers/gpu/nova-core/regs.rs
index 2f171a4ff9ba..6faeed73901d 100644
--- a/drivers/gpu/nova-core/regs.rs
+++ b/drivers/gpu/nova-core/regs.rs
@@ -7,6 +7,7 @@
         Io, //
     },
     prelude::*,
+    sizes::SizeConstants,
     time, //
 };
 
@@ -30,7 +31,6 @@
         Architecture,
         Chipset, //
     },
-    num::FromSafeCast,
 };
 
 // PMC
@@ -150,8 +150,7 @@ fn fmt(&self, f: &mut kernel::fmt::Formatter<'_>) -> kernel::fmt::Result {
 impl NV_PFB_PRI_MMU_LOCAL_MEMORY_RANGE {
     /// Returns the usable framebuffer size, in bytes.
     pub(crate) fn usable_fb_size(self) -> u64 {
-        let size = (u64::from(self.lower_mag()) << u64::from(self.lower_scale()))
-            * u64::from_safe_cast(kernel::sizes::SZ_1M);
+        let size = (u64::from(self.lower_mag()) << u64::from(self.lower_scale())) * u64::SZ_1M;
 
         if self.ecc_mode_enabled() {
             // Remove the amount of memory reserved for ECC (one per 16 units).
@@ -241,7 +240,7 @@ pub(crate) fn completed(self) -> bool {
 impl NV_USABLE_FB_SIZE_IN_MB {
     /// Returns the usable framebuffer size, in bytes.
     pub(crate) fn usable_fb_size(self) -> u64 {
-        u64::from(self.value()) * u64::from_safe_cast(kernel::sizes::SZ_1M)
+        u64::from(self.value()) * u64::SZ_1M
     }
 }
 
-- 
2.53.0
Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by Joel Fernandes 3 days, 1 hour ago

On 4/1/2026 6:27 PM, John Hubbard wrote:
> Replace manual usize-to-u64 conversions of SZ_* constants with the
> SizeConstants trait's associated constants on u64. With the
> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
> and similar.
> 
> This removes several now-unused imports: usize_as_u64, FromSafeCast,
> and individual SZ_* type-level constants.
> 
> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>

I am very happy to see this series since I have these issues with mm
patches quite a bit, which this series will resolve. Should I update the
nova mm series to use these, or wait for it to be merged? The issue with
updating the nova mm series is, then I'll have to either:

 a) carry the series as a dependency.
 b) wait for it to merge into drm-rust-next and rebase

I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
did for some drm buddy bindings patches. Thoughts?

thanks,

--
Joel Fernandes

> ---
>  drivers/gpu/nova-core/fb.rs     | 21 +++++++++------------
>  drivers/gpu/nova-core/gsp/fw.rs | 15 +++++++--------
>  drivers/gpu/nova-core/regs.rs   |  7 +++----
>  3 files changed, 19 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/nova-core/fb.rs b/drivers/gpu/nova-core/fb.rs
> index bdd5eed760e1..5c304fc03467 100644
> --- a/drivers/gpu/nova-core/fb.rs
> +++ b/drivers/gpu/nova-core/fb.rs
> @@ -24,11 +24,8 @@
>      firmware::gsp::GspFirmware,
>      gpu::Chipset,
>      gsp,
> -    num::{
> -        usize_as_u64,
> -        FromSafeCast, //
> -    },
> -    regs,
> +    num::FromSafeCast,
> +    regs, //
>  };
>  
>  mod hal;
> @@ -127,8 +124,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
>          if f.alternate() {
>              let size = self.len();
>  
> -            if size < usize_as_u64(SZ_1M) {
> -                let size_kib = size / usize_as_u64(SZ_1K);
> +            if size < u64::SZ_1M {
> +                let size_kib = size / u64::SZ_1K;
>                  f.write_fmt(fmt!(
>                      "{:#x}..{:#x} ({} KiB)",
>                      self.0.start,
> @@ -136,7 +133,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
>                      size_kib
>                  ))
>              } else {
> -                let size_mib = size / usize_as_u64(SZ_1M);
> +                let size_mib = size / u64::SZ_1M;
>                  f.write_fmt(fmt!(
>                      "{:#x}..{:#x} ({} MiB)",
>                      self.0.start,
> @@ -186,7 +183,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>  
>          let vga_workspace = {
>              let vga_base = {
> -                const NV_PRAMIN_SIZE: u64 = usize_as_u64(SZ_1M);
> +                const NV_PRAMIN_SIZE: u64 = u64::SZ_1M;
>                  let base = fb.end - NV_PRAMIN_SIZE;
>  
>                  if hal.supports_display(bar) {
> @@ -196,7 +193,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>                      {
>                          Some(addr) => {
>                              if addr < base {
> -                                const VBIOS_WORKSPACE_SIZE: u64 = usize_as_u64(SZ_128K);
> +                                const VBIOS_WORKSPACE_SIZE: u64 = u64::SZ_128K;
>  
>                                  // Point workspace address to end of framebuffer.
>                                  fb.end - VBIOS_WORKSPACE_SIZE
> @@ -216,7 +213,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>  
>          let frts = {
>              const FRTS_DOWN_ALIGN: Alignment = Alignment::new::<SZ_128K>();
> -            const FRTS_SIZE: u64 = usize_as_u64(SZ_1M);
> +            const FRTS_SIZE: u64 = u64::SZ_1M;
>              let frts_base = vga_workspace.start.align_down(FRTS_DOWN_ALIGN) - FRTS_SIZE;
>  
>              FbRange(frts_base..frts_base + FRTS_SIZE)
> @@ -256,7 +253,7 @@ pub(crate) fn new(chipset: Chipset, bar: &Bar0, gsp_fw: &GspFirmware) -> Result<
>          };
>  
>          let heap = {
> -            const HEAP_SIZE: u64 = usize_as_u64(SZ_1M);
> +            const HEAP_SIZE: u64 = u64::SZ_1M;
>  
>              FbRange(wpr2.start - HEAP_SIZE..wpr2.start)
>          };
> diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs
> index 0c8a74f0e8ac..9dac3288f3a3 100644
> --- a/drivers/gpu/nova-core/gsp/fw.rs
> +++ b/drivers/gpu/nova-core/gsp/fw.rs
> @@ -17,8 +17,8 @@
>          KnownSize, //
>      },
>      sizes::{
> -        SZ_128K,
> -        SZ_1M, //
> +        SizeConstants,
> +        SZ_128K, //
>      },
>      transmute::{
>          AsBytes,
> @@ -123,7 +123,7 @@ fn client_alloc_size() -> u64 {
>      /// Returns the amount of memory to reserve for management purposes for a framebuffer of size
>      /// `fb_size`.
>      fn management_overhead(fb_size: u64) -> u64 {
> -        let fb_size_gb = fb_size.div_ceil(u64::from_safe_cast(kernel::sizes::SZ_1G));
> +        let fb_size_gb = fb_size.div_ceil(u64::SZ_1G);
>  
>          u64::from(bindings::GSP_FW_HEAP_PARAM_SIZE_PER_GB_FB)
>              .saturating_mul(fb_size_gb)
> @@ -145,9 +145,8 @@ impl LibosParams {
>      const LIBOS2: LibosParams = LibosParams {
>          carveout_size: num::u32_as_u64(bindings::GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS2),
>          allowed_heap_size: num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MIN_MB)
> -            * num::usize_as_u64(SZ_1M)
> -            ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MAX_MB)
> -                * num::usize_as_u64(SZ_1M),
> +            * u64::SZ_1M
> +            ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS2_MAX_MB) * u64::SZ_1M,
>      };
>  
>      /// Version 3 of the GSP LIBOS (GA102+)
> @@ -155,9 +154,9 @@ impl LibosParams {
>          carveout_size: num::u32_as_u64(bindings::GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS3_BAREMETAL),
>          allowed_heap_size: num::u32_as_u64(
>              bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS3_BAREMETAL_MIN_MB,
> -        ) * num::usize_as_u64(SZ_1M)
> +        ) * u64::SZ_1M
>              ..num::u32_as_u64(bindings::GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS3_BAREMETAL_MAX_MB)
> -                * num::usize_as_u64(SZ_1M),
> +                * u64::SZ_1M,
>      };
>  
>      /// Returns the libos parameters corresponding to `chipset`.
> diff --git a/drivers/gpu/nova-core/regs.rs b/drivers/gpu/nova-core/regs.rs
> index 2f171a4ff9ba..6faeed73901d 100644
> --- a/drivers/gpu/nova-core/regs.rs
> +++ b/drivers/gpu/nova-core/regs.rs
> @@ -7,6 +7,7 @@
>          Io, //
>      },
>      prelude::*,
> +    sizes::SizeConstants,
>      time, //
>  };
>  
> @@ -30,7 +31,6 @@
>          Architecture,
>          Chipset, //
>      },
> -    num::FromSafeCast,
>  };
>  
>  // PMC
> @@ -150,8 +150,7 @@ fn fmt(&self, f: &mut kernel::fmt::Formatter<'_>) -> kernel::fmt::Result {
>  impl NV_PFB_PRI_MMU_LOCAL_MEMORY_RANGE {
>      /// Returns the usable framebuffer size, in bytes.
>      pub(crate) fn usable_fb_size(self) -> u64 {
> -        let size = (u64::from(self.lower_mag()) << u64::from(self.lower_scale()))
> -            * u64::from_safe_cast(kernel::sizes::SZ_1M);
> +        let size = (u64::from(self.lower_mag()) << u64::from(self.lower_scale())) * u64::SZ_1M;
>  
>          if self.ecc_mode_enabled() {
>              // Remove the amount of memory reserved for ECC (one per 16 units).
> @@ -241,7 +240,7 @@ pub(crate) fn completed(self) -> bool {
>  impl NV_USABLE_FB_SIZE_IN_MB {
>      /// Returns the usable framebuffer size, in bytes.
>      pub(crate) fn usable_fb_size(self) -> u64 {
> -        u64::from(self.value()) * u64::from_safe_cast(kernel::sizes::SZ_1M)
> +        u64::from(self.value()) * u64::SZ_1M
>      }
>  }
>
Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by Alexandre Courbot 3 days, 1 hour ago
On Thu Apr 2, 2026 at 11:33 PM JST, Joel Fernandes wrote:
>
>
> On 4/1/2026 6:27 PM, John Hubbard wrote:
>> Replace manual usize-to-u64 conversions of SZ_* constants with the
>> SizeConstants trait's associated constants on u64. With the
>> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
>> and similar.
>> 
>> This removes several now-unused imports: usize_as_u64, FromSafeCast,
>> and individual SZ_* type-level constants.
>> 
>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>
> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
>
> I am very happy to see this series since I have these issues with mm
> patches quite a bit, which this series will resolve. Should I update the
> nova mm series to use these, or wait for it to be merged? The issue with
> updating the nova mm series is, then I'll have to either:
>
>  a) carry the series as a dependency.
>  b) wait for it to merge into drm-rust-next and rebase
>
> I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
> did for some drm buddy bindings patches. Thoughts?

There is no need to carry the series into yours, just add a link to the
cover letter to your dependencies and folks can pick them up.

b4 also provides a dependency management mechanism, and will even fetch
them automatically if the people applying your series also use it.

I don't know which tree is going to pick this series, so whether we can
use it this cycle or not will depend on that. But if it lands in
`drm-rust-next`, then it's just a few weeks until you can drop the
dependency link from your cover letter anyway.
Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by Joel Fernandes 3 days, 1 hour ago

On 4/2/2026 10:55 AM, Alexandre Courbot wrote:
> On Thu Apr 2, 2026 at 11:33 PM JST, Joel Fernandes wrote:
>>
>>
>> On 4/1/2026 6:27 PM, John Hubbard wrote:
>>> Replace manual usize-to-u64 conversions of SZ_* constants with the
>>> SizeConstants trait's associated constants on u64. With the
>>> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
>>> and similar.
>>>
>>> This removes several now-unused imports: usize_as_u64, FromSafeCast,
>>> and individual SZ_* type-level constants.
>>>
>>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>>
>> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
>>
>> I am very happy to see this series since I have these issues with mm
>> patches quite a bit, which this series will resolve. Should I update the
>> nova mm series to use these, or wait for it to be merged? The issue with
>> updating the nova mm series is, then I'll have to either:
>>
>>  a) carry the series as a dependency.
>>  b) wait for it to merge into drm-rust-next and rebase
>>
>> I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
>> did for some drm buddy bindings patches. Thoughts?
> 
> There is no need to carry the series into yours, just add a link to the
> cover letter to your dependencies and folks can pick them up.
> 
> b4 also provides a dependency management mechanism, and will even fetch
> them automatically if the people applying your series also use it.

Oooh, b4 can actually track dependencies not in any tree as well? I have to
check that out.

> 
> I don't know which tree is going to pick this series, so whether we can
> use it this cycle or not will depend on that. But if it lands in
> `drm-rust-next`, then it's just a few weeks until you can drop the
> dependency link from your cover letter anyway.

Sounds good, thanks,

--
Joel Fernandes
Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by Joel Fernandes 3 days, 1 hour ago

On 4/2/2026 10:59 AM, Joel Fernandes wrote:
> 
> 
> On 4/2/2026 10:55 AM, Alexandre Courbot wrote:
>> On Thu Apr 2, 2026 at 11:33 PM JST, Joel Fernandes wrote:
>>>
>>>
>>> On 4/1/2026 6:27 PM, John Hubbard wrote:
>>>> Replace manual usize-to-u64 conversions of SZ_* constants with the
>>>> SizeConstants trait's associated constants on u64. With the
>>>> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
>>>> and similar.
>>>>
>>>> This removes several now-unused imports: usize_as_u64, FromSafeCast,
>>>> and individual SZ_* type-level constants.
>>>>
>>>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>>>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>>>
>>> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
>>>
>>> I am very happy to see this series since I have these issues with mm
>>> patches quite a bit, which this series will resolve. Should I update the
>>> nova mm series to use these, or wait for it to be merged? The issue with
>>> updating the nova mm series is, then I'll have to either:
>>>
>>>  a) carry the series as a dependency.
>>>  b) wait for it to merge into drm-rust-next and rebase
>>>
>>> I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
>>> did for some drm buddy bindings patches. Thoughts?
>>
>> There is no need to carry the series into yours, just add a link to the
>> cover letter to your dependencies and folks can pick them up.
>>
>> b4 also provides a dependency management mechanism, and will even fetch
>> them automatically if the people applying your series also use it.
> 
> Oooh, b4 can actually track dependencies not in any tree as well? I have to
> check that out.
> 

There is also the issue of if we sure we are going forward with this as the
final api (I am inclined to believe it is). Trying to avoid reworking too
much, I'd rather wait in that case for it to be confirmed as being slated
for merge.
Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants
Posted by Alexandre Courbot 3 days, 1 hour ago
On Fri Apr 3, 2026 at 12:05 AM JST, Joel Fernandes wrote:
>
>
> On 4/2/2026 10:59 AM, Joel Fernandes wrote:
>> 
>> 
>> On 4/2/2026 10:55 AM, Alexandre Courbot wrote:
>>> On Thu Apr 2, 2026 at 11:33 PM JST, Joel Fernandes wrote:
>>>>
>>>>
>>>> On 4/1/2026 6:27 PM, John Hubbard wrote:
>>>>> Replace manual usize-to-u64 conversions of SZ_* constants with the
>>>>> SizeConstants trait's associated constants on u64. With the
>>>>> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
>>>>> and similar.
>>>>>
>>>>> This removes several now-unused imports: usize_as_u64, FromSafeCast,
>>>>> and individual SZ_* type-level constants.
>>>>>
>>>>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>>>>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>>>>
>>>> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
>>>>
>>>> I am very happy to see this series since I have these issues with mm
>>>> patches quite a bit, which this series will resolve. Should I update the
>>>> nova mm series to use these, or wait for it to be merged? The issue with
>>>> updating the nova mm series is, then I'll have to either:
>>>>
>>>>  a) carry the series as a dependency.
>>>>  b) wait for it to merge into drm-rust-next and rebase
>>>>
>>>> I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
>>>> did for some drm buddy bindings patches. Thoughts?
>>>
>>> There is no need to carry the series into yours, just add a link to the
>>> cover letter to your dependencies and folks can pick them up.
>>>
>>> b4 also provides a dependency management mechanism, and will even fetch
>>> them automatically if the people applying your series also use it.
>> 
>> Oooh, b4 can actually track dependencies not in any tree as well? I have to
>> check that out.
>> 
>
> There is also the issue of if we sure we are going forward with this as the
> final api (I am inclined to believe it is). Trying to avoid reworking too
> much, I'd rather wait in that case for it to be confirmed as being slated
> for merge.

Yup that's probably simpler for now given that not having this series is
a mere inconvenience, as opposed to a hard blocker.