diff options
| author | Bjorn Helgaas <bhelgaas@google.com> | 2025-08-01 00:11:40 +0300 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-08-01 00:11:40 +0300 |
| commit | e6035a0809e05ec093e456c04fa2bad4f8a66e13 (patch) | |
| tree | f21c8a59ba5d17e6c28b45ebbf5daa733b409085 /include | |
| parent | 010c31057776ac43cfe773f719eccccbbc3e0f45 (diff) | |
| parent | 6642adf0c1fbe2977597ab277dfd507053a874ac (diff) | |
| download | linux-e6035a0809e05ec093e456c04fa2bad4f8a66e13.tar.xz | |
Merge branch 'pci/boot-display'
- Add pci_is_display() to check for "Display" base class and use it in
ALSA hda, vfio, vga_switcheroo, vt-d (Mario Limonciello)
* pci/boot-display:
ALSA: hda: Use pci_is_display()
iommu/vt-d: Use pci_is_display()
vga_switcheroo: Use pci_is_display()
vfio/pci: Use pci_is_display()
PCI: Add pci_is_display() to check if device is a display controller
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/pci.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 05e68f35f392..4fff6405a830 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -744,6 +744,21 @@ static inline bool pci_is_vga(struct pci_dev *pdev) return false; } +/** + * pci_is_display - check if the PCI device is a display controller + * @pdev: PCI device + * + * Determine whether the given PCI device corresponds to a display + * controller. Display controllers are typically used for graphical output + * and are identified based on their class code. + * + * Return: true if the PCI device is a display controller, false otherwise. + */ +static inline bool pci_is_display(struct pci_dev *pdev) +{ + return (pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY; +} + #define for_each_pci_bridge(dev, bus) \ list_for_each_entry(dev, &bus->devices, bus_list) \ if (!pci_is_bridge(dev)) {} else |
