@@ -1183,6 +1183,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
unsigned long prealloc_size, gtt_size, mappable_size;
int ret = 0;
+ dev_priv->is_vga = dev->pdev->class == PCI_CLASS_DISPLAY_VGA;
+
prealloc_size = dev_priv->mm.gtt->stolen_size;
gtt_size = dev_priv->mm.gtt->gtt_total_entries << PAGE_SHIFT;
mappable_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
@@ -1228,19 +1230,23 @@ static int i915_load_modeset_init(struct drm_device *dev)
if (ret)
DRM_INFO("failed to find VBIOS tables\n");
- /* if we have > 1 VGA cards, then disable the radeon VGA resources */
- ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
- if (ret)
- goto cleanup_ringbuffer;
+ if (dev_priv->is_vga) {
+ /* If we have > 1 VGA cards with a single output,
+ * then disable the radeon VGA resources.
+ */
+ ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
+ if (ret)
+ goto cleanup_ringbuffer;
- intel_register_dsm_handler();
+ intel_register_dsm_handler();
- ret = vga_switcheroo_register_client(dev->pdev,
- i915_switcheroo_set_state,
- NULL,
- i915_switcheroo_can_switch);
- if (ret)
- goto cleanup_vga_client;
+ ret = vga_switcheroo_register_client(dev->pdev,
+ i915_switcheroo_set_state,
+ NULL,
+ i915_switcheroo_can_switch);
+ if (ret)
+ goto cleanup_vga_client;
+ }
/* IIR "flip pending" bit means done if this bit is set */
if (IS_GEN3(dev) && (I915_READ(ECOSKPD) & ECO_FLIP_DONE))
@@ -2106,8 +2112,10 @@ int i915_driver_unload(struct drm_device *dev)
dev_priv->child_dev_num = 0;
}
- vga_switcheroo_unregister_client(dev->pdev);
- vga_client_register(dev->pdev, NULL, NULL, NULL);
+ if (dev_priv->is_vga) {
+ vga_switcheroo_unregister_client(dev->pdev);
+ vga_client_register(dev->pdev, NULL, NULL, NULL);
+ }
}
/* Free error state after interrupts are fully disabled. */
@@ -60,7 +60,7 @@ extern int intel_agp_enabled;
#define INTEL_VGA_DEVICE(id, info) { \
.class = PCI_CLASS_DISPLAY_VGA << 8, \
- .class_mask = 0xffff00, \
+ .class_mask = 0xff0000, \
.vendor = 0x8086, \
.device = id, \
.subvendor = PCI_ANY_ID, \
@@ -262,6 +262,7 @@ typedef struct drm_i915_private {
int has_gem;
int relative_constants_mode;
+ int is_vga;
void __iomem *regs;