Skip to content

Commit 94cfada

Browse files
Sui Jingfengbjorn-helgaas
authored andcommitted
drm/qxl: Use pci_is_vga() to identify VGA devices
Use pci_is_vga() to identify VGA devices instead of a private is_vga() function. This means qxl will use the VGA arbiter for old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it recognized previously. This probably doesn't make a difference because qxl_pci_driver doesn't claim PCI_CLASS_NOT_DEFINED_VGA devices by default, so it's mainly a code simplification. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sui Jingfeng <[email protected]> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]>
1 parent 76432cf commit 94cfada

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/gpu/drm/qxl/qxl_drv.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ module_param_named(num_heads, qxl_num_crtc, int, 0400);
6868
static struct drm_driver qxl_driver;
6969
static struct pci_driver qxl_pci_driver;
7070

71-
static bool is_vga(struct pci_dev *pdev)
72-
{
73-
return pdev->class == PCI_CLASS_DISPLAY_VGA << 8;
74-
}
75-
7671
static int
7772
qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
7873
{
@@ -100,7 +95,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10095
if (ret)
10196
goto disable_pci;
10297

103-
if (is_vga(pdev) && pdev->revision < 5) {
98+
if (pci_is_vga(pdev) && pdev->revision < 5) {
10499
ret = vga_get_interruptible(pdev, VGA_RSRC_LEGACY_IO);
105100
if (ret) {
106101
DRM_ERROR("can't get legacy vga ioports\n");
@@ -131,7 +126,7 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
131126
unload:
132127
qxl_device_fini(qdev);
133128
put_vga:
134-
if (is_vga(pdev) && pdev->revision < 5)
129+
if (pci_is_vga(pdev) && pdev->revision < 5)
135130
vga_put(pdev, VGA_RSRC_LEGACY_IO);
136131
disable_pci:
137132
pci_disable_device(pdev);
@@ -159,7 +154,7 @@ qxl_pci_remove(struct pci_dev *pdev)
159154

160155
drm_dev_unregister(dev);
161156
drm_atomic_helper_shutdown(dev);
162-
if (is_vga(pdev) && pdev->revision < 5)
157+
if (pci_is_vga(pdev) && pdev->revision < 5)
163158
vga_put(pdev, VGA_RSRC_LEGACY_IO);
164159
}
165160

0 commit comments

Comments
 (0)