Repository navigation
Read FreeBSD graphics card IDs from either pciconf format - #3805
Conversation
FreeBSD's pciconf -lv now prints vendor=0xVVVV device=0xDDDD in each header line rather than the chip=0xDDDDVVVV that the parser looked for, so every card reported an unknown device ID. The vendor was also never reset between devices: a card with no vendor name line, such as QEMU's display whose IDs the PCI database does not know, reported the vendor name of the device listed before it. Parsing moves into parsePciconf, which collects each device's fields into its own holder, reads either ID format (DragonFly BSD still prints chip=), and keeps the existing output shape. Tested with real output from FreeBSD 16 and DragonFly 6.4, and verified live on both.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3805 +/- ##
==========================================
Coverage 80.76% 80.76%
- Complexity 83 663 +580
==========================================
Files 725 725
Lines 25979 26026 +47
Branches 4426 4423 -3
==========================================
+ Hits 20981 21019 +38
- Misses 2772 2782 +10
+ Partials 2226 2225 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
HardwareAbstractionLayer.getGraphicsCards()on FreeBSD parsespciconf -lv, and had two problems on current releases.Device ID always unknown. The parser read IDs only from
chip=0xDDDDVVVV. FreeBSD now prints them separately in the header line:DragonFly BSD, which uses the same class, still prints
chip=.Vendor leaked from the previous device. The vendor was never reset at a new header, and the indented
vendor = '...'line only appears when the PCI ID database knows the IDs. On cfarm430 the QEMU display has neither name line, so it reported the host bridge'sIntel Corporation.Change
Parsing moves into a package-private
parsePciconf(List<String>). Each header line starts a fresh holder for that device, the header is read for either ID format, and the card is built when the next device starts. The output shape is unchanged: vendorName (0xVVVV)(or just the ID when there is no name line), device ID0xDDDD, versionrev=0xRR. No JNA/FFM changes — both backends, and DragonFly, call this class.Verification
vendor=Intel Corporation, deviceId=unknownvendor=0x1234, deviceId=0x1111Red Hat, Inc. (0x1af4),0x1050FreeBsdGraphicsCardTestusespciconf -lvoutput captured on both hosts, including the leak case. The one named FreeBSD card in the fixture (Intel UHD 620) is written in the current format rather than captured — neither host has a GPU the PCI database names. Gate clean onoshi-commonincluding-Perror-prone.Summary by CodeRabbit