* [PATCH] gpu: nova-core: make formatting compatible with rust tree
@ 2025-11-17 11:30 Alice Ryhl
2025-11-17 11:34 ` Alexandre Courbot
2025-11-17 14:52 ` Alice Ryhl
0 siblings, 2 replies; 3+ messages in thread
From: Alice Ryhl @ 2025-11-17 11:30 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot, Joel Fernandes, John Hubbard,
David Airlie, Simona Vetter
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, nouveau, dri-devel,
linux-kernel, rust-for-linux, Alice Ryhl
Commit 38b7cc448a5b ("gpu: nova-core: implement Display for Spec") in
drm-rust-next introduced some usage of the Display trait, but the
Display trait is being modified in the rust tree this cycle. Thus, to
avoid conflicts with the Rust tree, tweak how the formatting machinery
is used in a way where it works both with and without the changes in the
Rust tree.
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
drivers/gpu/nova-core/gpu.rs | 5 ++---
drivers/gpu/nova-core/gsp/fw.rs | 6 ++----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 19755af6ad045f4d42835985c2048868dac23dbc..629c9d2dc994cf79f37d4aa71ce65957f45736f9 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -227,13 +227,12 @@ fn try_from(boot42: regs::NV_PMC_BOOT_42) -> Result<Self> {
impl fmt::Display for Spec {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- write!(
- f,
+ f.write_fmt(fmt!(
"Chipset: {}, Architecture: {:?}, Revision: {}",
self.chipset,
self.chipset.arch(),
self.revision
- )
+ ))
}
}
diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs
index 8deec5e0a1d4affe705860401acd646ca8add11f..abffd6beec654466202abe70c4c52c9bd4504d14 100644
--- a/drivers/gpu/nova-core/gsp/fw.rs
+++ b/drivers/gpu/nova-core/gsp/fw.rs
@@ -6,13 +6,11 @@
// Alias to avoid repeating the version number with every use.
use r570_144 as bindings;
-use core::{
- fmt,
- ops::Range, //
-};
+use core::ops::Range;
use kernel::{
dma::CoherentAllocation,
+ fmt,
prelude::*,
ptr::{
Alignable,
---
base-commit: ce89e3e019f1ec4b11356f35feb8bd8c0f2c6bf7
change-id: 20251117-nova-fmt-rust-63cd29020d63
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: nova-core: make formatting compatible with rust tree
2025-11-17 11:30 [PATCH] gpu: nova-core: make formatting compatible with rust tree Alice Ryhl
@ 2025-11-17 11:34 ` Alexandre Courbot
2025-11-17 14:52 ` Alice Ryhl
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2025-11-17 11:34 UTC (permalink / raw)
To: Alice Ryhl, Danilo Krummrich, Alexandre Courbot, Joel Fernandes,
John Hubbard, David Airlie, Simona Vetter
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, nouveau, dri-devel,
linux-kernel, rust-for-linux
On Mon Nov 17, 2025 at 8:30 PM JST, Alice Ryhl wrote:
> Commit 38b7cc448a5b ("gpu: nova-core: implement Display for Spec") in
> drm-rust-next introduced some usage of the Display trait, but the
> Display trait is being modified in the rust tree this cycle. Thus, to
> avoid conflicts with the Rust tree, tweak how the formatting machinery
> is used in a way where it works both with and without the changes in the
> Rust tree.
>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Thanks, this solves the issue elegantly.
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Alexandre Courbot <acourbot@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: nova-core: make formatting compatible with rust tree
2025-11-17 11:30 [PATCH] gpu: nova-core: make formatting compatible with rust tree Alice Ryhl
2025-11-17 11:34 ` Alexandre Courbot
@ 2025-11-17 14:52 ` Alice Ryhl
1 sibling, 0 replies; 3+ messages in thread
From: Alice Ryhl @ 2025-11-17 14:52 UTC (permalink / raw)
To: Danilo Krummrich, Alexandre Courbot, Joel Fernandes, John Hubbard,
David Airlie, Simona Vetter
Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, nouveau, dri-devel,
linux-kernel, rust-for-linux
On Mon, Nov 17, 2025 at 11:30:07AM +0000, Alice Ryhl wrote:
> Commit 38b7cc448a5b ("gpu: nova-core: implement Display for Spec") in
> drm-rust-next introduced some usage of the Display trait, but the
> Display trait is being modified in the rust tree this cycle. Thus, to
> avoid conflicts with the Rust tree, tweak how the formatting machinery
> is used in a way where it works both with and without the changes in the
> Rust tree.
>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Applied to drm-rust-next.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-17 14:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 11:30 [PATCH] gpu: nova-core: make formatting compatible with rust tree Alice Ryhl
2025-11-17 11:34 ` Alexandre Courbot
2025-11-17 14:52 ` Alice Ryhl
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).