diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-20 08:09:12 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 07:52:16 -0500 |
commit | 934f992c763ae1e5eefcce8af769c16444085df7 (patch) | |
tree | 782f06fc0cf77813499d3d77e47a23c0f613625e /drivers | |
parent | 076e2c0eb83f1a0e2e7d0ae1e4d4c0f7b13f1f64 (diff) |
drm/i915: Recognise non-VGA display devices
Starting with SandyBridge (though possible with earlier hacked BIOSes),
the BIOS may initialise the IGFX as secondary to a discrete GPU. Prior,
it would simply disable the integrated GPU. So we adjust our PCI class
mask to match any DISPLAY_CLASS device.
In such a configuration, the IGFX is not a primary VGA controller and
so should not take part in VGA arbitration, and the error return from
vga_client_register() is expected.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/vga/vgaarb.c | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 665898124200..17bd766f2081 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1215,9 +1215,15 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
1215 | if (ret) | 1215 | if (ret) |
1216 | DRM_INFO("failed to find VBIOS tables\n"); | 1216 | DRM_INFO("failed to find VBIOS tables\n"); |
1217 | 1217 | ||
1218 | /* if we have > 1 VGA cards, then disable the radeon VGA resources */ | 1218 | /* If we have > 1 VGA cards, then we need to arbitrate access |
1219 | * to the common VGA resources. | ||
1220 | * | ||
1221 | * If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA), | ||
1222 | * then we do not take part in VGA arbitration and the | ||
1223 | * vga_client_register() fails with -ENODEV. | ||
1224 | */ | ||
1219 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); | 1225 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); |
1220 | if (ret) | 1226 | if (ret && ret != -ENODEV) |
1221 | goto cleanup_ringbuffer; | 1227 | goto cleanup_ringbuffer; |
1222 | 1228 | ||
1223 | intel_register_dsm_handler(); | 1229 | intel_register_dsm_handler(); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 72fea2bcfc4f..59eb19b13b3f 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -60,7 +60,7 @@ extern int intel_agp_enabled; | |||
60 | 60 | ||
61 | #define INTEL_VGA_DEVICE(id, info) { \ | 61 | #define INTEL_VGA_DEVICE(id, info) { \ |
62 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ | 62 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ |
63 | .class_mask = 0xffff00, \ | 63 | .class_mask = 0xff0000, \ |
64 | .vendor = 0x8086, \ | 64 | .vendor = 0x8086, \ |
65 | .device = id, \ | 65 | .device = id, \ |
66 | .subvendor = PCI_ANY_ID, \ | 66 | .subvendor = PCI_ANY_ID, \ |
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index c380c65da417..ace2b1623b21 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
@@ -636,7 +636,7 @@ int vga_client_register(struct pci_dev *pdev, void *cookie, | |||
636 | void (*irq_set_state)(void *cookie, bool state), | 636 | void (*irq_set_state)(void *cookie, bool state), |
637 | unsigned int (*set_vga_decode)(void *cookie, bool decode)) | 637 | unsigned int (*set_vga_decode)(void *cookie, bool decode)) |
638 | { | 638 | { |
639 | int ret = -1; | 639 | int ret = -ENODEV; |
640 | struct vga_device *vgadev; | 640 | struct vga_device *vgadev; |
641 | unsigned long flags; | 641 | unsigned long flags; |
642 | 642 | ||