Add the pci_is_vga() helper and use it
Status from this message: I applied these on pci/vga for v6.7, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | PCI: Add the pci_is_vga() helperinclude/ | +27 | 3 replies | |
| 2/5 | PCI/VGA: Deal with VGA devicesdrivers/ | +9 | 0 replies | |
| 3/5 | PCI/sysfs: Use pci_is_vga() helperdrivers/ | +3 | 0 replies | |
| 4/5 | drm/virgpu: Switch to pci_is_vga()drivers/ | +1 | 3 replies | |
| 5/5 | drm/qxl: Switch to pci_is_vga()drivers/ | +3 | 0 replies |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | Mario Limonciello |
|---|---|
| 1/5 | |
| 2/5 | R-b |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [-next 0/5] Add the pci_is_vga() helper and use it
From: Sui Jingfeng <[email protected]>
The PCI code and ID assignment specification defined four types of display controllers for the display base class(03h), and the devices with 0x00h sub-class code are VGA devices. VGA devices with programming interface 0x00 is VGA-compatible, VGA devices with programming interface 0x01 are 8514-compatible controllers. Besides, PCI_CLASS_NOT_DEFINED_VGA is defined to provide backward compatibility for devices that were built before the class code field was defined. Thus, PCI(e) device with the PCI_CLASS_NOT_DEFINED_VGA class code should also be handled as the normal VGA-compatible devices.
Compared with the "if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)" code, the newly implemented pci_is_vga() is shorter and straightforward. So it is more easy to use. It is designed as a inline function, the more common case "if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA))" is put before the less common case "if ((pdev->class >> 8) == PCI_CLASS_NOT_DEFINED_VGA)", so there should no performance penalty.
Sui Jingfeng (5):
PCI: Add the pci_is_vga() helper
PCI/VGA: Deal with VGA devices
PCI/sysfs: Use pci_is_vga() helper
drm/virgpu: Switch to pci_is_vga()
drm/qxl: Switch to pci_is_vga()
drivers/gpu/drm/qxl/qxl_drv.c | 11 +++-------- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/pci/pci-sysfs.c | 6 +++--- drivers/pci/vgaarb.c | 19 +++++++++---------- include/linux/pci.h | 27 +++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 22 deletions(-)
base-commit: 43cc31da9146f9ce60e4a03d96ef0807c2cdac94
Signature · 1 line
2.34.1