Page MenuHomeFreeBSD

linuxkpi: add pci_is_vga()
Needs ReviewPublic

Authored by denis.borovikov_gmail.com on Thu, Oct 1, 4:19 PM.
Tags
None
Referenced Files
F175316576: D60200.diff
Fri, Oct 9, 10:00 PM
F175256841: D60200.id188323.diff
Fri, Oct 9, 11:57 AM
F175256713: D60200.id188692.diff
Fri, Oct 9, 11:55 AM
F175243824: D60200.diff
Fri, Oct 9, 9:27 AM
F175230062: D60200.id188692.diff
Fri, Oct 9, 6:57 AM
F175222176: D60200.id188323.diff
Fri, Oct 9, 5:34 AM
F175210594: D60200.id188692.diff
Fri, Oct 9, 3:21 AM
F175210365: D60200.id188323.diff
Fri, Oct 9, 3:18 AM

Details

Reviewers
wulf
manu
Summary

Returns true for a VGA-compatible display controller and for the pre-PCI 2.0 VGA class (base 0x00, subclass 0x01), as Linux's pci_is_vga() does. LinuxKPI keeps only the base class in pdev->class, so the subclass comes from pci_get_subclass(), using the native class constants as linuxkpi_pci_map_rom() does. Used by drm/virtio to decide whether to remove the firmware framebuffer on virtio-vga.

Test Plan

Built on main with this applied: linuxkpi, linuxkpi_wlan, mlx5, iwlwifi and ath10k for aarch64 and amd64, and drm-kmod's virtio-gpu (freebsd/drm-kmod#517) without its interim copy. drm-kmod's identical interim copy runs at virtio-gpu attach on 16.0-CURRENT aarch64 under UTM.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/compat/linuxkpi/common/include/linux/pci.h
420

Than we should fix lkpifill_pci_dev() and/or use native FreeBSD code. See e.g. linuxkpi_pci_map_rom() for example

denis.borovikov_gmail.com edited the summary of this revision. (Show Details)
denis.borovikov_gmail.com edited the test plan for this revision. (Show Details)

native code, as wulf asked; pci_ids.h is no longer touched.

sys/compat/linuxkpi/common/include/linux/pci.h
420

Switched to native code, like linuxkpi_pci_map_rom(): pdev->class plus pci_get_subclass() against PCIC_DISPLAY/PCIS_DISPLAY_VGA and PCIC_OLD/PCIS_OLD_VGA. That also drops the pci_ids.h change.