mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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 <[email protected]>
Cc: Danilo Krummrich <[email protected]>
Cc: Timur Tabi <[email protected]>
Reviewed-by: Joel Fernandes <[email protected]>
Signed-off-by: John Hubbard <[email protected]>
Signed-off-by: Alexandre Courbot <[email protected]>
Message-ID: <[email protected]>
This commit is contained in:
1 parent
5949d419c1
commit
38b7cc448a
1 file changed
+13
-7
@@ -180,6 +180,18 @@ impl Spec {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Spec {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"Chipset: {}, Architecture: {:?}, Revision: {}",
|
||||
self.chipset,
|
||||
self.chipset.arch(),
|
||||
self.revision
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Structure holding the resources required to operate the GPU.
|
||||
#[pin_data]
|
||||
pub(crate) struct Gpu {
|
||||
@@ -206,13 +218,7 @@ impl Gpu {
|
||||
) -> impl PinInit<Self, Error> + 'a {
|
||||
try_pin_init!(Self {
|
||||
spec: Spec::new(bar).inspect(|spec| {
|
||||
dev_info!(
|
||||
pdev.as_ref(),
|
||||
"NVIDIA (Chipset: {}, Architecture: {:?}, Revision: {})\n",
|
||||
spec.chipset,
|
||||
spec.chipset.arch(),
|
||||
spec.revision
|
||||
);
|
||||
dev_info!(pdev.as_ref(),"NVIDIA ({})\n", spec);
|
||||
})?,
|
||||
|
||||
// We must wait for GFW_BOOT completion before doing any significant setup on the GPU.
|
||||
|
||||
Reference in new issue
Block a user