Commit e6035a08 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

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
parents 010c3105 6642adf0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ find_active_client(struct list_head *head)
 */
bool vga_switcheroo_client_probe_defer(struct pci_dev *pdev)
{
	if ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
	if (pci_is_display(pdev)) {
		/*
		 * apple-gmux is needed on pre-retina MacBook Pro
		 * to probe the panel if pdev is the inactive GPU.
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
#define ROOT_SIZE		VTD_PAGE_SIZE
#define CONTEXT_SIZE		VTD_PAGE_SIZE

#define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
#define IS_GFX_DEVICE(pdev) pci_is_display(pdev)
#define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB)
#define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
#define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e)
+1 −2
Original line number Diff line number Diff line
@@ -437,8 +437,7 @@ static int vfio_pci_igd_cfg_init(struct vfio_pci_core_device *vdev)

bool vfio_pci_is_intel_display(struct pci_dev *pdev)
{
	return (pdev->vendor == PCI_VENDOR_ID_INTEL) &&
	       ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY);
	return (pdev->vendor == PCI_VENDOR_ID_INTEL) && pci_is_display(pdev);
}

int vfio_pci_igd_init(struct vfio_pci_core_device *vdev)
+15 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ static int i915_gfx_present(struct pci_dev *hdac_pci)

	for_each_pci_dev(display_dev) {
		if (display_dev->vendor != PCI_VENDOR_ID_INTEL ||
		    (display_dev->class >> 16) != PCI_BASE_CLASS_DISPLAY)
		    !pci_is_display(display_dev))
			continue;

		if (pci_match_id(denylist, display_dev))
Loading