diff options
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 36 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 60 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_overlay.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 8 |
12 files changed, 155 insertions, 32 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2dd2c93ebfa3..e6fc48ea55a9 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "i915_drm.h" | 34 | #include "i915_drm.h" |
35 | #include "i915_drv.h" | 35 | #include "i915_drv.h" |
36 | #include "i915_trace.h" | 36 | #include "i915_trace.h" |
37 | #include "../../../platform/x86/intel_ips.h" | ||
37 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
38 | #include <linux/vgaarb.h> | 39 | #include <linux/vgaarb.h> |
39 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
@@ -1418,9 +1419,15 @@ static int i915_load_modeset_init(struct drm_device *dev, | |||
1418 | if (ret) | 1419 | if (ret) |
1419 | DRM_INFO("failed to find VBIOS tables\n"); | 1420 | DRM_INFO("failed to find VBIOS tables\n"); |
1420 | 1421 | ||
1421 | /* if we have > 1 VGA cards, then disable the radeon VGA resources */ | 1422 | /* If we have > 1 VGA cards, then we need to arbitrate access |
1423 | * to the common VGA resources. | ||
1424 | * | ||
1425 | * If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA), | ||
1426 | * then we do not take part in VGA arbitration and the | ||
1427 | * vga_client_register() fails with -ENODEV. | ||
1428 | */ | ||
1422 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); | 1429 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); |
1423 | if (ret) | 1430 | if (ret && ret != -ENODEV) |
1424 | goto cleanup_ringbuffer; | 1431 | goto cleanup_ringbuffer; |
1425 | 1432 | ||
1426 | ret = vga_switcheroo_register_client(dev->pdev, | 1433 | ret = vga_switcheroo_register_client(dev->pdev, |
@@ -2047,6 +2054,26 @@ out_unlock: | |||
2047 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); | 2054 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); |
2048 | 2055 | ||
2049 | /** | 2056 | /** |
2057 | * Tells the intel_ips driver that the i915 driver is now loaded, if | ||
2058 | * IPS got loaded first. | ||
2059 | * | ||
2060 | * This awkward dance is so that neither module has to depend on the | ||
2061 | * other in order for IPS to do the appropriate communication of | ||
2062 | * GPU turbo limits to i915. | ||
2063 | */ | ||
2064 | static void | ||
2065 | ips_ping_for_i915_load(void) | ||
2066 | { | ||
2067 | void (*link)(void); | ||
2068 | |||
2069 | link = symbol_get(ips_link_to_i915_driver); | ||
2070 | if (link) { | ||
2071 | link(); | ||
2072 | symbol_put(ips_link_to_i915_driver); | ||
2073 | } | ||
2074 | } | ||
2075 | |||
2076 | /** | ||
2050 | * i915_driver_load - setup chip and create an initial config | 2077 | * i915_driver_load - setup chip and create an initial config |
2051 | * @dev: DRM device | 2078 | * @dev: DRM device |
2052 | * @flags: startup flags | 2079 | * @flags: startup flags |
@@ -2234,6 +2261,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2234 | /* XXX Prevent module unload due to memory corruption bugs. */ | 2261 | /* XXX Prevent module unload due to memory corruption bugs. */ |
2235 | __module_get(THIS_MODULE); | 2262 | __module_get(THIS_MODULE); |
2236 | 2263 | ||
2264 | ips_ping_for_i915_load(); | ||
2265 | |||
2237 | return 0; | 2266 | return 0; |
2238 | 2267 | ||
2239 | out_workqueue_free: | 2268 | out_workqueue_free: |
@@ -2306,6 +2335,9 @@ int i915_driver_unload(struct drm_device *dev) | |||
2306 | i915_gem_lastclose(dev); | 2335 | i915_gem_lastclose(dev); |
2307 | 2336 | ||
2308 | intel_cleanup_overlay(dev); | 2337 | intel_cleanup_overlay(dev); |
2338 | |||
2339 | if (!I915_NEED_GFX_HWS(dev)) | ||
2340 | i915_free_hws(dev); | ||
2309 | } | 2341 | } |
2310 | 2342 | ||
2311 | intel_teardown_mchbar(dev); | 2343 | intel_teardown_mchbar(dev); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 6dbe14cc4f74..7792c8f7c6dd 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -53,7 +53,7 @@ extern int intel_agp_enabled; | |||
53 | 53 | ||
54 | #define INTEL_VGA_DEVICE(id, info) { \ | 54 | #define INTEL_VGA_DEVICE(id, info) { \ |
55 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ | 55 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ |
56 | .class_mask = 0xffff00, \ | 56 | .class_mask = 0xff0000, \ |
57 | .vendor = 0x8086, \ | 57 | .vendor = 0x8086, \ |
58 | .device = id, \ | 58 | .device = id, \ |
59 | .subvendor = PCI_ANY_ID, \ | 59 | .subvendor = PCI_ANY_ID, \ |
@@ -414,6 +414,14 @@ int i965_reset(struct drm_device *dev, u8 flags) | |||
414 | static int __devinit | 414 | static int __devinit |
415 | i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 415 | i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
416 | { | 416 | { |
417 | /* Only bind to function 0 of the device. Early generations | ||
418 | * used function 1 as a placeholder for multi-head. This causes | ||
419 | * us confusion instead, especially on the systems where both | ||
420 | * functions have the same PCI-ID! | ||
421 | */ | ||
422 | if (PCI_FUNC(pdev->devfn)) | ||
423 | return -ENODEV; | ||
424 | |||
417 | return drm_get_pci_dev(pdev, ent, &driver); | 425 | return drm_get_pci_dev(pdev, ent, &driver); |
418 | } | 426 | } |
419 | 427 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 744225ebb4b2..477e4ac66639 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -310,6 +310,7 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
310 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 310 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
311 | int ret = IRQ_NONE; | 311 | int ret = IRQ_NONE; |
312 | u32 de_iir, gt_iir, de_ier, pch_iir; | 312 | u32 de_iir, gt_iir, de_ier, pch_iir; |
313 | u32 hotplug_mask; | ||
313 | struct drm_i915_master_private *master_priv; | 314 | struct drm_i915_master_private *master_priv; |
314 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | 315 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; |
315 | 316 | ||
@@ -325,6 +326,11 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
325 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) | 326 | if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) |
326 | goto done; | 327 | goto done; |
327 | 328 | ||
329 | if (HAS_PCH_CPT(dev)) | ||
330 | hotplug_mask = SDE_HOTPLUG_MASK_CPT; | ||
331 | else | ||
332 | hotplug_mask = SDE_HOTPLUG_MASK; | ||
333 | |||
328 | ret = IRQ_HANDLED; | 334 | ret = IRQ_HANDLED; |
329 | 335 | ||
330 | if (dev->primary->master) { | 336 | if (dev->primary->master) { |
@@ -366,10 +372,8 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
366 | drm_handle_vblank(dev, 1); | 372 | drm_handle_vblank(dev, 1); |
367 | 373 | ||
368 | /* check event from PCH */ | 374 | /* check event from PCH */ |
369 | if ((de_iir & DE_PCH_EVENT) && | 375 | if ((de_iir & DE_PCH_EVENT) && (pch_iir & hotplug_mask)) |
370 | (pch_iir & SDE_HOTPLUG_MASK)) { | ||
371 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); | 376 | queue_work(dev_priv->wq, &dev_priv->hotplug_work); |
372 | } | ||
373 | 377 | ||
374 | if (de_iir & DE_PCU_EVENT) { | 378 | if (de_iir & DE_PCU_EVENT) { |
375 | I915_WRITE16(MEMINTRSTS, I915_READ(MEMINTRSTS)); | 379 | I915_WRITE16(MEMINTRSTS, I915_READ(MEMINTRSTS)); |
@@ -1424,8 +1428,7 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
1424 | u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | | 1428 | u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | |
1425 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE; | 1429 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE; |
1426 | u32 render_mask = GT_PIPE_NOTIFY | GT_BSD_USER_INTERRUPT; | 1430 | u32 render_mask = GT_PIPE_NOTIFY | GT_BSD_USER_INTERRUPT; |
1427 | u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | | 1431 | u32 hotplug_mask; |
1428 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; | ||
1429 | 1432 | ||
1430 | dev_priv->irq_mask_reg = ~display_mask; | 1433 | dev_priv->irq_mask_reg = ~display_mask; |
1431 | dev_priv->de_irq_enable_reg = display_mask | DE_PIPEA_VBLANK | DE_PIPEB_VBLANK; | 1434 | dev_priv->de_irq_enable_reg = display_mask | DE_PIPEA_VBLANK | DE_PIPEB_VBLANK; |
@@ -1450,6 +1453,14 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
1450 | I915_WRITE(GTIER, dev_priv->gt_irq_enable_reg); | 1453 | I915_WRITE(GTIER, dev_priv->gt_irq_enable_reg); |
1451 | (void) I915_READ(GTIER); | 1454 | (void) I915_READ(GTIER); |
1452 | 1455 | ||
1456 | if (HAS_PCH_CPT(dev)) { | ||
1457 | hotplug_mask = SDE_CRT_HOTPLUG_CPT | SDE_PORTB_HOTPLUG_CPT | | ||
1458 | SDE_PORTC_HOTPLUG_CPT | SDE_PORTD_HOTPLUG_CPT ; | ||
1459 | } else { | ||
1460 | hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | | ||
1461 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; | ||
1462 | } | ||
1463 | |||
1453 | dev_priv->pch_irq_mask_reg = ~hotplug_mask; | 1464 | dev_priv->pch_irq_mask_reg = ~hotplug_mask; |
1454 | dev_priv->pch_irq_enable_reg = hotplug_mask; | 1465 | dev_priv->pch_irq_enable_reg = hotplug_mask; |
1455 | 1466 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 4f5e15577e89..7103d24c8213 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2551,6 +2551,10 @@ | |||
2551 | #define SDE_PORTD_HOTPLUG_CPT (1 << 23) | 2551 | #define SDE_PORTD_HOTPLUG_CPT (1 << 23) |
2552 | #define SDE_PORTC_HOTPLUG_CPT (1 << 22) | 2552 | #define SDE_PORTC_HOTPLUG_CPT (1 << 22) |
2553 | #define SDE_PORTB_HOTPLUG_CPT (1 << 21) | 2553 | #define SDE_PORTB_HOTPLUG_CPT (1 << 21) |
2554 | #define SDE_HOTPLUG_MASK_CPT (SDE_CRT_HOTPLUG_CPT | \ | ||
2555 | SDE_PORTD_HOTPLUG_CPT | \ | ||
2556 | SDE_PORTC_HOTPLUG_CPT | \ | ||
2557 | SDE_PORTB_HOTPLUG_CPT) | ||
2554 | 2558 | ||
2555 | #define SDEISR 0xc4000 | 2559 | #define SDEISR 0xc4000 |
2556 | #define SDEIMR 0xc4004 | 2560 | #define SDEIMR 0xc4004 |
@@ -2722,6 +2726,9 @@ | |||
2722 | #define FDI_RXB_CHICKEN 0xc2010 | 2726 | #define FDI_RXB_CHICKEN 0xc2010 |
2723 | #define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1) | 2727 | #define FDI_RX_PHASE_SYNC_POINTER_ENABLE (1) |
2724 | 2728 | ||
2729 | #define SOUTH_DSPCLK_GATE_D 0xc2020 | ||
2730 | #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) | ||
2731 | |||
2725 | /* CPU: FDI_TX */ | 2732 | /* CPU: FDI_TX */ |
2726 | #define FDI_TXA_CTL 0x60100 | 2733 | #define FDI_TXA_CTL 0x60100 |
2727 | #define FDI_TXB_CTL 0x61100 | 2734 | #define FDI_TXB_CTL 0x61100 |
@@ -2946,6 +2953,7 @@ | |||
2946 | #define TRANS_DP_10BPC (1<<9) | 2953 | #define TRANS_DP_10BPC (1<<9) |
2947 | #define TRANS_DP_6BPC (2<<9) | 2954 | #define TRANS_DP_6BPC (2<<9) |
2948 | #define TRANS_DP_12BPC (3<<9) | 2955 | #define TRANS_DP_12BPC (3<<9) |
2956 | #define TRANS_DP_BPC_MASK (3<<9) | ||
2949 | #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) | 2957 | #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) |
2950 | #define TRANS_DP_VSYNC_ACTIVE_LOW 0 | 2958 | #define TRANS_DP_VSYNC_ACTIVE_LOW 0 |
2951 | #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3) | 2959 | #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3) |
@@ -2959,10 +2967,11 @@ | |||
2959 | #define EDP_LINK_TRAIN_600MV_3_5DB_SNB_A (0x01<<22) | 2967 | #define EDP_LINK_TRAIN_600MV_3_5DB_SNB_A (0x01<<22) |
2960 | #define EDP_LINK_TRAIN_800MV_0DB_SNB_A (0x0<<22) | 2968 | #define EDP_LINK_TRAIN_800MV_0DB_SNB_A (0x0<<22) |
2961 | /* SNB B-stepping */ | 2969 | /* SNB B-stepping */ |
2962 | #define EDP_LINK_TRAIN_400MV_0DB_SNB_B (0x0<<22) | 2970 | #define EDP_LINK_TRAIN_400_600MV_0DB_SNB_B (0x0<<22) |
2963 | #define EDP_LINK_TRAIN_400MV_6DB_SNB_B (0x3a<<22) | 2971 | #define EDP_LINK_TRAIN_400MV_3_5DB_SNB_B (0x1<<22) |
2964 | #define EDP_LINK_TRAIN_600MV_3_5DB_SNB_B (0x39<<22) | 2972 | #define EDP_LINK_TRAIN_400_600MV_6DB_SNB_B (0x3a<<22) |
2965 | #define EDP_LINK_TRAIN_800MV_0DB_SNB_B (0x38<<22) | 2973 | #define EDP_LINK_TRAIN_600_800MV_3_5DB_SNB_B (0x39<<22) |
2974 | #define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22) | ||
2966 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) | 2975 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) |
2967 | 2976 | ||
2968 | #endif /* _I915_REG_H_ */ | 2977 | #endif /* _I915_REG_H_ */ |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 31f08581e93a..2df5b9aadd5b 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -862,8 +862,10 @@ int i915_restore_state(struct drm_device *dev) | |||
862 | /* Clock gating state */ | 862 | /* Clock gating state */ |
863 | intel_init_clock_gating(dev); | 863 | intel_init_clock_gating(dev); |
864 | 864 | ||
865 | if (HAS_PCH_SPLIT(dev)) | 865 | if (HAS_PCH_SPLIT(dev)) { |
866 | ironlake_enable_drps(dev); | 866 | ironlake_enable_drps(dev); |
867 | intel_init_emon(dev); | ||
868 | } | ||
867 | 869 | ||
868 | /* Cache mode state */ | 870 | /* Cache mode state */ |
869 | I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000); | 871 | I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000); |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 197d4f32585a..0f950e74db3c 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -191,7 +191,8 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) | |||
191 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); | 191 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); |
192 | 192 | ||
193 | if (turn_off_dac) { | 193 | if (turn_off_dac) { |
194 | I915_WRITE(PCH_ADPA, temp); | 194 | /* Make sure hotplug is enabled */ |
195 | I915_WRITE(PCH_ADPA, temp | ADPA_CRT_HOTPLUG_ENABLE); | ||
195 | (void)I915_READ(PCH_ADPA); | 196 | (void)I915_READ(PCH_ADPA); |
196 | } | 197 | } |
197 | 198 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 979228594599..932a061f28d0 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2044,9 +2044,11 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2044 | 2044 | ||
2045 | reg = I915_READ(trans_dp_ctl); | 2045 | reg = I915_READ(trans_dp_ctl); |
2046 | reg &= ~(TRANS_DP_PORT_SEL_MASK | | 2046 | reg &= ~(TRANS_DP_PORT_SEL_MASK | |
2047 | TRANS_DP_SYNC_MASK); | 2047 | TRANS_DP_SYNC_MASK | |
2048 | TRANS_DP_BPC_MASK); | ||
2048 | reg |= (TRANS_DP_OUTPUT_ENABLE | | 2049 | reg |= (TRANS_DP_OUTPUT_ENABLE | |
2049 | TRANS_DP_ENH_FRAMING); | 2050 | TRANS_DP_ENH_FRAMING); |
2051 | reg |= TRANS_DP_8BPC; | ||
2050 | 2052 | ||
2051 | if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) | 2053 | if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) |
2052 | reg |= TRANS_DP_HSYNC_ACTIVE_HIGH; | 2054 | reg |= TRANS_DP_HSYNC_ACTIVE_HIGH; |
@@ -5674,6 +5676,13 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
5674 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | 5676 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); |
5675 | 5677 | ||
5676 | /* | 5678 | /* |
5679 | * On Ibex Peak and Cougar Point, we need to disable clock | ||
5680 | * gating for the panel power sequencer or it will fail to | ||
5681 | * start up when no ports are active. | ||
5682 | */ | ||
5683 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | ||
5684 | |||
5685 | /* | ||
5677 | * According to the spec the following bits should be set in | 5686 | * According to the spec the following bits should be set in |
5678 | * order to enable memory self-refresh | 5687 | * order to enable memory self-refresh |
5679 | * The bit 22/21 of 0x42004 | 5688 | * The bit 22/21 of 0x42004 |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 9ab8708ac6ba..0aa77f318790 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -425,6 +425,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, | |||
425 | uint16_t address = algo_data->address; | 425 | uint16_t address = algo_data->address; |
426 | uint8_t msg[5]; | 426 | uint8_t msg[5]; |
427 | uint8_t reply[2]; | 427 | uint8_t reply[2]; |
428 | unsigned retry; | ||
428 | int msg_bytes; | 429 | int msg_bytes; |
429 | int reply_bytes; | 430 | int reply_bytes; |
430 | int ret; | 431 | int ret; |
@@ -459,14 +460,33 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, | |||
459 | break; | 460 | break; |
460 | } | 461 | } |
461 | 462 | ||
462 | for (;;) { | 463 | for (retry = 0; retry < 5; retry++) { |
463 | ret = intel_dp_aux_ch(intel_dp, | 464 | ret = intel_dp_aux_ch(intel_dp, |
464 | msg, msg_bytes, | 465 | msg, msg_bytes, |
465 | reply, reply_bytes); | 466 | reply, reply_bytes); |
466 | if (ret < 0) { | 467 | if (ret < 0) { |
467 | DRM_DEBUG_KMS("aux_ch failed %d\n", ret); | 468 | DRM_DEBUG_KMS("aux_ch failed %d\n", ret); |
468 | return ret; | 469 | return ret; |
469 | } | 470 | } |
471 | |||
472 | switch (reply[0] & AUX_NATIVE_REPLY_MASK) { | ||
473 | case AUX_NATIVE_REPLY_ACK: | ||
474 | /* I2C-over-AUX Reply field is only valid | ||
475 | * when paired with AUX ACK. | ||
476 | */ | ||
477 | break; | ||
478 | case AUX_NATIVE_REPLY_NACK: | ||
479 | DRM_DEBUG_KMS("aux_ch native nack\n"); | ||
480 | return -EREMOTEIO; | ||
481 | case AUX_NATIVE_REPLY_DEFER: | ||
482 | udelay(100); | ||
483 | continue; | ||
484 | default: | ||
485 | DRM_ERROR("aux_ch invalid native reply 0x%02x\n", | ||
486 | reply[0]); | ||
487 | return -EREMOTEIO; | ||
488 | } | ||
489 | |||
470 | switch (reply[0] & AUX_I2C_REPLY_MASK) { | 490 | switch (reply[0] & AUX_I2C_REPLY_MASK) { |
471 | case AUX_I2C_REPLY_ACK: | 491 | case AUX_I2C_REPLY_ACK: |
472 | if (mode == MODE_I2C_READ) { | 492 | if (mode == MODE_I2C_READ) { |
@@ -474,17 +494,20 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, | |||
474 | } | 494 | } |
475 | return reply_bytes - 1; | 495 | return reply_bytes - 1; |
476 | case AUX_I2C_REPLY_NACK: | 496 | case AUX_I2C_REPLY_NACK: |
477 | DRM_DEBUG_KMS("aux_ch nack\n"); | 497 | DRM_DEBUG_KMS("aux_i2c nack\n"); |
478 | return -EREMOTEIO; | 498 | return -EREMOTEIO; |
479 | case AUX_I2C_REPLY_DEFER: | 499 | case AUX_I2C_REPLY_DEFER: |
480 | DRM_DEBUG_KMS("aux_ch defer\n"); | 500 | DRM_DEBUG_KMS("aux_i2c defer\n"); |
481 | udelay(100); | 501 | udelay(100); |
482 | break; | 502 | break; |
483 | default: | 503 | default: |
484 | DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]); | 504 | DRM_ERROR("aux_i2c invalid reply 0x%02x\n", reply[0]); |
485 | return -EREMOTEIO; | 505 | return -EREMOTEIO; |
486 | } | 506 | } |
487 | } | 507 | } |
508 | |||
509 | DRM_ERROR("too many retries, giving up\n"); | ||
510 | return -EREMOTEIO; | ||
488 | } | 511 | } |
489 | 512 | ||
490 | static int | 513 | static int |
@@ -1070,18 +1093,27 @@ intel_dp_signal_levels(uint8_t train_set, int lane_count) | |||
1070 | static uint32_t | 1093 | static uint32_t |
1071 | intel_gen6_edp_signal_levels(uint8_t train_set) | 1094 | intel_gen6_edp_signal_levels(uint8_t train_set) |
1072 | { | 1095 | { |
1073 | switch (train_set & (DP_TRAIN_VOLTAGE_SWING_MASK|DP_TRAIN_PRE_EMPHASIS_MASK)) { | 1096 | int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK | |
1097 | DP_TRAIN_PRE_EMPHASIS_MASK); | ||
1098 | switch (signal_levels) { | ||
1074 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0: | 1099 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0: |
1075 | return EDP_LINK_TRAIN_400MV_0DB_SNB_B; | 1100 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_0: |
1101 | return EDP_LINK_TRAIN_400_600MV_0DB_SNB_B; | ||
1102 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
1103 | return EDP_LINK_TRAIN_400MV_3_5DB_SNB_B; | ||
1076 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6: | 1104 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6: |
1077 | return EDP_LINK_TRAIN_400MV_6DB_SNB_B; | 1105 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_6: |
1106 | return EDP_LINK_TRAIN_400_600MV_6DB_SNB_B; | ||
1078 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5: | 1107 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5: |
1079 | return EDP_LINK_TRAIN_600MV_3_5DB_SNB_B; | 1108 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_3_5: |
1109 | return EDP_LINK_TRAIN_600_800MV_3_5DB_SNB_B; | ||
1080 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0: | 1110 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0: |
1081 | return EDP_LINK_TRAIN_800MV_0DB_SNB_B; | 1111 | case DP_TRAIN_VOLTAGE_SWING_1200 | DP_TRAIN_PRE_EMPHASIS_0: |
1112 | return EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B; | ||
1082 | default: | 1113 | default: |
1083 | DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level\n"); | 1114 | DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level:" |
1084 | return EDP_LINK_TRAIN_400MV_0DB_SNB_B; | 1115 | "0x%x\n", signal_levels); |
1116 | return EDP_LINK_TRAIN_400_600MV_0DB_SNB_B; | ||
1085 | } | 1117 | } |
1086 | } | 1118 | } |
1087 | 1119 | ||
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 8828b3ac6414..2b161375a38d 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -250,6 +250,7 @@ extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, | |||
250 | extern void intel_init_clock_gating(struct drm_device *dev); | 250 | extern void intel_init_clock_gating(struct drm_device *dev); |
251 | extern void ironlake_enable_drps(struct drm_device *dev); | 251 | extern void ironlake_enable_drps(struct drm_device *dev); |
252 | extern void ironlake_disable_drps(struct drm_device *dev); | 252 | extern void ironlake_disable_drps(struct drm_device *dev); |
253 | extern void intel_init_emon(struct drm_device *dev); | ||
253 | 254 | ||
254 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, | 255 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, |
255 | struct drm_gem_object *obj); | 256 | struct drm_gem_object *obj); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 6ec39a86ed06..c3b2208508fb 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -701,6 +701,14 @@ static const struct dmi_system_id intel_no_lvds[] = { | |||
701 | }, | 701 | }, |
702 | { | 702 | { |
703 | .callback = intel_no_lvds_dmi_callback, | 703 | .callback = intel_no_lvds_dmi_callback, |
704 | .ident = "AOpen i915GMm-HFS", | ||
705 | .matches = { | ||
706 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
707 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
708 | }, | ||
709 | }, | ||
710 | { | ||
711 | .callback = intel_no_lvds_dmi_callback, | ||
704 | .ident = "Aopen i945GTt-VFA", | 712 | .ident = "Aopen i945GTt-VFA", |
705 | .matches = { | 713 | .matches = { |
706 | DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), | 714 | DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), |
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index 1d306a458be6..743664187fef 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -1367,6 +1367,12 @@ void intel_setup_overlay(struct drm_device *dev) | |||
1367 | goto out_free_bo; | 1367 | goto out_free_bo; |
1368 | } | 1368 | } |
1369 | overlay->flip_addr = overlay->reg_bo->gtt_offset; | 1369 | overlay->flip_addr = overlay->reg_bo->gtt_offset; |
1370 | |||
1371 | ret = i915_gem_object_set_to_gtt_domain(reg_bo, true); | ||
1372 | if (ret) { | ||
1373 | DRM_ERROR("failed to move overlay register bo into the GTT\n"); | ||
1374 | goto out_unpin_bo; | ||
1375 | } | ||
1370 | } else { | 1376 | } else { |
1371 | ret = i915_gem_attach_phys_object(dev, reg_bo, | 1377 | ret = i915_gem_attach_phys_object(dev, reg_bo, |
1372 | I915_GEM_PHYS_OVERLAY_REGS, | 1378 | I915_GEM_PHYS_OVERLAY_REGS, |
@@ -1399,6 +1405,8 @@ void intel_setup_overlay(struct drm_device *dev) | |||
1399 | DRM_INFO("initialized overlay support\n"); | 1405 | DRM_INFO("initialized overlay support\n"); |
1400 | return; | 1406 | return; |
1401 | 1407 | ||
1408 | out_unpin_bo: | ||
1409 | i915_gem_object_unpin(reg_bo); | ||
1402 | out_free_bo: | 1410 | out_free_bo: |
1403 | drm_gem_object_unreference(reg_bo); | 1411 | drm_gem_object_unreference(reg_bo); |
1404 | out_free: | 1412 | out_free: |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index ee73e428a84a..b60652bfd1a3 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1498,10 +1498,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) | |||
1498 | if (!intel_sdvo_write_cmd(intel_sdvo, | 1498 | if (!intel_sdvo_write_cmd(intel_sdvo, |
1499 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) | 1499 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) |
1500 | return connector_status_unknown; | 1500 | return connector_status_unknown; |
1501 | if (intel_sdvo->is_tv) { | 1501 | |
1502 | /* add 30ms delay when the output type is SDVO-TV */ | 1502 | /* add 30ms delay when the output type might be TV */ |
1503 | if (intel_sdvo->caps.output_flags & | ||
1504 | (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_CVBS0)) | ||
1503 | mdelay(30); | 1505 | mdelay(30); |
1504 | } | 1506 | |
1505 | if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) | 1507 | if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) |
1506 | return connector_status_unknown; | 1508 | return connector_status_unknown; |
1507 | 1509 | ||