Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpu: nova-core: implement Display for Spec

Implement Display for Spec. This simplifies the dev_info!() code for
printing banners such as:

NVIDIA (Chipset: GA104, Architecture: Ampere, Revision: a.1)

Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251114024109.465136-2-jhubbard@nvidia.com>

authored by

John Hubbard and committed by
Alexandre Courbot
38b7cc44 5949d419

+13 -7
+13 -7
drivers/gpu/nova-core/gpu.rs
··· 180 180 } 181 181 } 182 182 183 + impl fmt::Display for Spec { 184 + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 185 + write!( 186 + f, 187 + "Chipset: {}, Architecture: {:?}, Revision: {}", 188 + self.chipset, 189 + self.chipset.arch(), 190 + self.revision 191 + ) 192 + } 193 + } 194 + 183 195 /// Structure holding the resources required to operate the GPU. 184 196 #[pin_data] 185 197 pub(crate) struct Gpu { ··· 218 206 ) -> impl PinInit<Self, Error> + 'a { 219 207 try_pin_init!(Self { 220 208 spec: Spec::new(bar).inspect(|spec| { 221 - dev_info!( 222 - pdev.as_ref(), 223 - "NVIDIA (Chipset: {}, Architecture: {:?}, Revision: {})\n", 224 - spec.chipset, 225 - spec.chipset.arch(), 226 - spec.revision 227 - ); 209 + dev_info!(pdev.as_ref(),"NVIDIA ({})\n", spec); 228 210 })?, 229 211 230 212 // We must wait for GFW_BOOT completion before doing any significant setup on the GPU.