[PATCH v3 11/11] gpu: nova-core: vbios: use the first PCI-AT and FWSEC images

Eliot Courtney
2026-04-21T08:21:30Z

Currently, PCI-AT takes the final image if multiple exist. For FWSEC, it
takes the first one and the last one. Align both of these to nouveau
behavior by taking the first ones.

Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
drivers/gpu/nova-core/vbios.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
index 5cc251c73800..8cfc75b1184f 100644
--- a/drivers/gpu/nova-core/vbios.rs
+++ b/drivers/gpu/nova-core/vbios.rs
@@ -251,12 +251,16 @@ pub(crate) fn new(dev: &device::Device, bar0: &Bar0) -> Result<Vbios> {
// Convert to a specific image type
match BiosImageType::try_from(image.pcir.code_type) {
Ok(BiosImageType::PciAt) => {
- pci_at_image = Some(PciAtBiosImage::try_from(image)?);
+ // Silently ignore any extra PCI-AT images.
+ if pci_at_image.is_none() {
+ pci_at_image = Some(PciAtBiosImage::try_from(image)?);
+ }
}
Ok(BiosImageType::FwSec) => {
+ // Silently ignore any extra FwSec images beyond the first two.
if first_fwsec_image.is_none() {
first_fwsec_image = Some(image);
- } else {
+ } else if second_fwsec_image.is_none() {
second_fwsec_image = Some(image);
}
}

--
2.53.0