[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFLJrHdfrTmoyhin@phenom.ffwll.local>
Date: Wed, 18 Jun 2025 16:14:04 +0200
From: Simona Vetter <simona.vetter@...ll.ch>
To: Mario Limonciello <superm1@...nel.org>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Lukas Wunner <lukas@...ner.de>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Alex Williamson <alex.williamson@...hat.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
"open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:INTEL IOMMU (VT-d)" <iommu@...ts.linux.dev>,
"open list:PCI SUBSYSTEM" <linux-pci@...r.kernel.org>,
"open list:VFIO DRIVER" <kvm@...r.kernel.org>,
"open list:SOUND" <linux-sound@...r.kernel.org>,
Daniel Dadap <ddadap@...dia.com>,
Mario Limonciello <mario.limonciello@....com>,
Bjorn Helgaas <helgaas@...nel.org>
Subject: Re: [PATCH v2 5/6] ALSA: hda: Use pci_is_display()
On Tue, Jun 17, 2025 at 12:59:09PM -0500, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@....com>
>
> The inline pci_is_display() helper does the same thing. Use it.
>
> Suggested-by: Bjorn Helgaas <helgaas@...nel.org>
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
I think the helper here is still neat, so for patches 1-5:
Reviewed-by: Simona Vetter <simona.vetter@...ll.ch>
And a-b for the vgaswitcheroo patch for merging through the pci tree or a
dedicated pr to Linus, since I guess that's the simplest way to get that
done.
Cheers, Sima
> ---
> sound/hda/hdac_i915.c | 2 +-
> sound/pci/hda/hda_intel.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
> index e9425213320ea..44438c799f957 100644
> --- a/sound/hda/hdac_i915.c
> +++ b/sound/hda/hdac_i915.c
> @@ -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))
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index e5210ed48ddf1..a165c44b43940 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1465,7 +1465,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci)
> * the dGPU is the one who is involved in
> * vgaswitcheroo.
> */
> - if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
> + if (pci_is_display(p) &&
> (atpx_present() || apple_gmux_detect(NULL, NULL)))
> return p;
> pci_dev_put(p);
> @@ -1477,7 +1477,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci)
> p = pci_get_domain_bus_and_slot(pci_domain_nr(pci->bus),
> pci->bus->number, 0);
> if (p) {
> - if ((p->class >> 16) == PCI_BASE_CLASS_DISPLAY)
> + if (pci_is_display(p))
> return p;
> pci_dev_put(p);
> }
> --
> 2.43.0
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Powered by blists - more mailing lists