diff options
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 43 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 18 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 30 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 89 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 173 | ||||
| -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_panel.c | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 36 |
13 files changed, 355 insertions, 96 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index d09a6e02dc95..004b048c5192 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
| @@ -62,6 +62,7 @@ static int i915_capabilities(struct seq_file *m, void *data) | |||
| 62 | const struct intel_device_info *info = INTEL_INFO(dev); | 62 | const struct intel_device_info *info = INTEL_INFO(dev); |
| 63 | 63 | ||
| 64 | seq_printf(m, "gen: %d\n", info->gen); | 64 | seq_printf(m, "gen: %d\n", info->gen); |
| 65 | seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev)); | ||
| 65 | #define B(x) seq_printf(m, #x ": %s\n", yesno(info->x)) | 66 | #define B(x) seq_printf(m, #x ": %s\n", yesno(info->x)) |
| 66 | B(is_mobile); | 67 | B(is_mobile); |
| 67 | B(is_i85x); | 68 | B(is_i85x); |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index a9533c54c93c..a9ae374861e7 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -1454,6 +1454,14 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) | |||
| 1454 | 1454 | ||
| 1455 | diff1 = now - dev_priv->last_time1; | 1455 | diff1 = now - dev_priv->last_time1; |
| 1456 | 1456 | ||
| 1457 | /* Prevent division-by-zero if we are asking too fast. | ||
| 1458 | * Also, we don't get interesting results if we are polling | ||
| 1459 | * faster than once in 10ms, so just return the saved value | ||
| 1460 | * in such cases. | ||
| 1461 | */ | ||
| 1462 | if (diff1 <= 10) | ||
| 1463 | return dev_priv->chipset_power; | ||
| 1464 | |||
| 1457 | count1 = I915_READ(DMIEC); | 1465 | count1 = I915_READ(DMIEC); |
| 1458 | count2 = I915_READ(DDREC); | 1466 | count2 = I915_READ(DDREC); |
| 1459 | count3 = I915_READ(CSIEC); | 1467 | count3 = I915_READ(CSIEC); |
| @@ -1484,6 +1492,8 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) | |||
| 1484 | dev_priv->last_count1 = total_count; | 1492 | dev_priv->last_count1 = total_count; |
| 1485 | dev_priv->last_time1 = now; | 1493 | dev_priv->last_time1 = now; |
| 1486 | 1494 | ||
| 1495 | dev_priv->chipset_power = ret; | ||
| 1496 | |||
| 1487 | return ret; | 1497 | return ret; |
| 1488 | } | 1498 | } |
| 1489 | 1499 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 15bfa9145d2b..a1103fc6597d 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -58,15 +58,15 @@ module_param_named(powersave, i915_powersave, int, 0600); | |||
| 58 | MODULE_PARM_DESC(powersave, | 58 | MODULE_PARM_DESC(powersave, |
| 59 | "Enable powersavings, fbc, downclocking, etc. (default: true)"); | 59 | "Enable powersavings, fbc, downclocking, etc. (default: true)"); |
| 60 | 60 | ||
| 61 | unsigned int i915_semaphores __read_mostly = 0; | 61 | int i915_semaphores __read_mostly = -1; |
| 62 | module_param_named(semaphores, i915_semaphores, int, 0600); | 62 | module_param_named(semaphores, i915_semaphores, int, 0600); |
| 63 | MODULE_PARM_DESC(semaphores, | 63 | MODULE_PARM_DESC(semaphores, |
| 64 | "Use semaphores for inter-ring sync (default: false)"); | 64 | "Use semaphores for inter-ring sync (default: -1 (use per-chip defaults))"); |
| 65 | 65 | ||
| 66 | unsigned int i915_enable_rc6 __read_mostly = 0; | 66 | int i915_enable_rc6 __read_mostly = -1; |
| 67 | module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); | 67 | module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); |
| 68 | MODULE_PARM_DESC(i915_enable_rc6, | 68 | MODULE_PARM_DESC(i915_enable_rc6, |
| 69 | "Enable power-saving render C-state 6 (default: true)"); | 69 | "Enable power-saving render C-state 6 (default: -1 (use per-chip default)"); |
| 70 | 70 | ||
| 71 | int i915_enable_fbc __read_mostly = -1; | 71 | int i915_enable_fbc __read_mostly = -1; |
| 72 | module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); | 72 | module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); |
| @@ -328,7 +328,7 @@ void intel_detect_pch(struct drm_device *dev) | |||
| 328 | } | 328 | } |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | static void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) | 331 | void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) |
| 332 | { | 332 | { |
| 333 | int count; | 333 | int count; |
| 334 | 334 | ||
| @@ -344,6 +344,22 @@ static void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) | |||
| 344 | udelay(10); | 344 | udelay(10); |
| 345 | } | 345 | } |
| 346 | 346 | ||
| 347 | void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv) | ||
| 348 | { | ||
| 349 | int count; | ||
| 350 | |||
| 351 | count = 0; | ||
| 352 | while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_MT_ACK) & 1)) | ||
| 353 | udelay(10); | ||
| 354 | |||
| 355 | I915_WRITE_NOTRACE(FORCEWAKE_MT, (1<<16) | 1); | ||
| 356 | POSTING_READ(FORCEWAKE_MT); | ||
| 357 | |||
| 358 | count = 0; | ||
| 359 | while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_MT_ACK) & 1) == 0) | ||
| 360 | udelay(10); | ||
| 361 | } | ||
| 362 | |||
| 347 | /* | 363 | /* |
| 348 | * Generally this is called implicitly by the register read function. However, | 364 | * Generally this is called implicitly by the register read function. However, |
| 349 | * if some sequence requires the GT to not power down then this function should | 365 | * if some sequence requires the GT to not power down then this function should |
| @@ -356,15 +372,21 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) | |||
| 356 | 372 | ||
| 357 | /* Forcewake is atomic in case we get in here without the lock */ | 373 | /* Forcewake is atomic in case we get in here without the lock */ |
| 358 | if (atomic_add_return(1, &dev_priv->forcewake_count) == 1) | 374 | if (atomic_add_return(1, &dev_priv->forcewake_count) == 1) |
| 359 | __gen6_gt_force_wake_get(dev_priv); | 375 | dev_priv->display.force_wake_get(dev_priv); |
| 360 | } | 376 | } |
| 361 | 377 | ||
| 362 | static void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) | 378 | void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) |
| 363 | { | 379 | { |
| 364 | I915_WRITE_NOTRACE(FORCEWAKE, 0); | 380 | I915_WRITE_NOTRACE(FORCEWAKE, 0); |
| 365 | POSTING_READ(FORCEWAKE); | 381 | POSTING_READ(FORCEWAKE); |
| 366 | } | 382 | } |
| 367 | 383 | ||
| 384 | void __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv) | ||
| 385 | { | ||
| 386 | I915_WRITE_NOTRACE(FORCEWAKE_MT, (1<<16) | 0); | ||
| 387 | POSTING_READ(FORCEWAKE_MT); | ||
| 388 | } | ||
| 389 | |||
| 368 | /* | 390 | /* |
| 369 | * see gen6_gt_force_wake_get() | 391 | * see gen6_gt_force_wake_get() |
| 370 | */ | 392 | */ |
| @@ -373,7 +395,7 @@ void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) | |||
| 373 | WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); | 395 | WARN_ON(!mutex_is_locked(&dev_priv->dev->struct_mutex)); |
| 374 | 396 | ||
| 375 | if (atomic_dec_and_test(&dev_priv->forcewake_count)) | 397 | if (atomic_dec_and_test(&dev_priv->forcewake_count)) |
| 376 | __gen6_gt_force_wake_put(dev_priv); | 398 | dev_priv->display.force_wake_put(dev_priv); |
| 377 | } | 399 | } |
| 378 | 400 | ||
| 379 | void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv) | 401 | void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv) |
| @@ -903,8 +925,9 @@ MODULE_LICENSE("GPL and additional rights"); | |||
| 903 | /* We give fast paths for the really cool registers */ | 925 | /* We give fast paths for the really cool registers */ |
| 904 | #define NEEDS_FORCE_WAKE(dev_priv, reg) \ | 926 | #define NEEDS_FORCE_WAKE(dev_priv, reg) \ |
| 905 | (((dev_priv)->info->gen >= 6) && \ | 927 | (((dev_priv)->info->gen >= 6) && \ |
| 906 | ((reg) < 0x40000) && \ | 928 | ((reg) < 0x40000) && \ |
| 907 | ((reg) != FORCEWAKE)) | 929 | ((reg) != FORCEWAKE) && \ |
| 930 | ((reg) != ECOBUS)) | ||
| 908 | 931 | ||
| 909 | #define __i915_read(x, y) \ | 932 | #define __i915_read(x, y) \ |
| 910 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ | 933 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4a9c1b979804..554bef7a3b9c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -107,6 +107,7 @@ struct opregion_header; | |||
| 107 | struct opregion_acpi; | 107 | struct opregion_acpi; |
| 108 | struct opregion_swsci; | 108 | struct opregion_swsci; |
| 109 | struct opregion_asle; | 109 | struct opregion_asle; |
| 110 | struct drm_i915_private; | ||
| 110 | 111 | ||
| 111 | struct intel_opregion { | 112 | struct intel_opregion { |
| 112 | struct opregion_header *header; | 113 | struct opregion_header *header; |
| @@ -221,6 +222,8 @@ struct drm_i915_display_funcs { | |||
| 221 | struct drm_i915_gem_object *obj); | 222 | struct drm_i915_gem_object *obj); |
| 222 | int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, | 223 | int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
| 223 | int x, int y); | 224 | int x, int y); |
| 225 | void (*force_wake_get)(struct drm_i915_private *dev_priv); | ||
| 226 | void (*force_wake_put)(struct drm_i915_private *dev_priv); | ||
| 224 | /* clock updates for mode set */ | 227 | /* clock updates for mode set */ |
| 225 | /* cursor updates */ | 228 | /* cursor updates */ |
| 226 | /* render clock increase/decrease */ | 229 | /* render clock increase/decrease */ |
| @@ -710,6 +713,7 @@ typedef struct drm_i915_private { | |||
| 710 | 713 | ||
| 711 | u64 last_count1; | 714 | u64 last_count1; |
| 712 | unsigned long last_time1; | 715 | unsigned long last_time1; |
| 716 | unsigned long chipset_power; | ||
| 713 | u64 last_count2; | 717 | u64 last_count2; |
| 714 | struct timespec last_time2; | 718 | struct timespec last_time2; |
| 715 | unsigned long gfx_power; | 719 | unsigned long gfx_power; |
| @@ -998,11 +1002,11 @@ extern int i915_max_ioctl; | |||
| 998 | extern unsigned int i915_fbpercrtc __always_unused; | 1002 | extern unsigned int i915_fbpercrtc __always_unused; |
| 999 | extern int i915_panel_ignore_lid __read_mostly; | 1003 | extern int i915_panel_ignore_lid __read_mostly; |
| 1000 | extern unsigned int i915_powersave __read_mostly; | 1004 | extern unsigned int i915_powersave __read_mostly; |
| 1001 | extern unsigned int i915_semaphores __read_mostly; | 1005 | extern int i915_semaphores __read_mostly; |
| 1002 | extern unsigned int i915_lvds_downclock __read_mostly; | 1006 | extern unsigned int i915_lvds_downclock __read_mostly; |
| 1003 | extern int i915_panel_use_ssc __read_mostly; | 1007 | extern int i915_panel_use_ssc __read_mostly; |
| 1004 | extern int i915_vbt_sdvo_panel_type __read_mostly; | 1008 | extern int i915_vbt_sdvo_panel_type __read_mostly; |
| 1005 | extern unsigned int i915_enable_rc6 __read_mostly; | 1009 | extern int i915_enable_rc6 __read_mostly; |
| 1006 | extern int i915_enable_fbc __read_mostly; | 1010 | extern int i915_enable_fbc __read_mostly; |
| 1007 | extern bool i915_enable_hangcheck __read_mostly; | 1011 | extern bool i915_enable_hangcheck __read_mostly; |
| 1008 | 1012 | ||
| @@ -1308,6 +1312,11 @@ extern void gen6_set_rps(struct drm_device *dev, u8 val); | |||
| 1308 | extern void intel_detect_pch(struct drm_device *dev); | 1312 | extern void intel_detect_pch(struct drm_device *dev); |
| 1309 | extern int intel_trans_dp_port_sel(struct drm_crtc *crtc); | 1313 | extern int intel_trans_dp_port_sel(struct drm_crtc *crtc); |
| 1310 | 1314 | ||
| 1315 | extern void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv); | ||
| 1316 | extern void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv); | ||
| 1317 | extern void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv); | ||
| 1318 | extern void __gen6_gt_force_wake_mt_put(struct drm_i915_private *dev_priv); | ||
| 1319 | |||
| 1311 | /* overlay */ | 1320 | /* overlay */ |
| 1312 | #ifdef CONFIG_DEBUG_FS | 1321 | #ifdef CONFIG_DEBUG_FS |
| 1313 | extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev); | 1322 | extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev); |
| @@ -1352,8 +1361,9 @@ void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv); | |||
| 1352 | /* We give fast paths for the really cool registers */ | 1361 | /* We give fast paths for the really cool registers */ |
| 1353 | #define NEEDS_FORCE_WAKE(dev_priv, reg) \ | 1362 | #define NEEDS_FORCE_WAKE(dev_priv, reg) \ |
| 1354 | (((dev_priv)->info->gen >= 6) && \ | 1363 | (((dev_priv)->info->gen >= 6) && \ |
| 1355 | ((reg) < 0x40000) && \ | 1364 | ((reg) < 0x40000) && \ |
| 1356 | ((reg) != FORCEWAKE)) | 1365 | ((reg) != FORCEWAKE) && \ |
| 1366 | ((reg) != ECOBUS)) | ||
| 1357 | 1367 | ||
| 1358 | #define __i915_read(x, y) \ | 1368 | #define __i915_read(x, y) \ |
| 1359 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg); | 1369 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 60ff1b63b568..8359dc777041 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -2026,13 +2026,8 @@ i915_wait_request(struct intel_ring_buffer *ring, | |||
| 2026 | * to handle this, the waiter on a request often wants an associated | 2026 | * to handle this, the waiter on a request often wants an associated |
| 2027 | * buffer to have made it to the inactive list, and we would need | 2027 | * buffer to have made it to the inactive list, and we would need |
| 2028 | * a separate wait queue to handle that. | 2028 | * a separate wait queue to handle that. |
| 2029 | * | ||
| 2030 | * To avoid a recursion with the ilk VT-d workaround (that calls | ||
| 2031 | * gpu_idle when unbinding objects with interruptible==false) don't | ||
| 2032 | * retire requests in that case (because it might call unbind if the | ||
| 2033 | * active list holds the last reference to the object). | ||
| 2034 | */ | 2029 | */ |
| 2035 | if (ret == 0 && dev_priv->mm.interruptible) | 2030 | if (ret == 0) |
| 2036 | i915_gem_retire_requests_ring(ring); | 2031 | i915_gem_retire_requests_ring(ring); |
| 2037 | 2032 | ||
| 2038 | return ret; | 2033 | return ret; |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 3693e83a97f3..c681dc149d2a 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "i915_drv.h" | 32 | #include "i915_drv.h" |
| 33 | #include "i915_trace.h" | 33 | #include "i915_trace.h" |
| 34 | #include "intel_drv.h" | 34 | #include "intel_drv.h" |
| 35 | #include <linux/dma_remapping.h> | ||
| 35 | 36 | ||
| 36 | struct change_domains { | 37 | struct change_domains { |
| 37 | uint32_t invalidate_domains; | 38 | uint32_t invalidate_domains; |
| @@ -746,6 +747,22 @@ i915_gem_execbuffer_flush(struct drm_device *dev, | |||
| 746 | return 0; | 747 | return 0; |
| 747 | } | 748 | } |
| 748 | 749 | ||
| 750 | static bool | ||
| 751 | intel_enable_semaphores(struct drm_device *dev) | ||
| 752 | { | ||
| 753 | if (INTEL_INFO(dev)->gen < 6) | ||
| 754 | return 0; | ||
| 755 | |||
| 756 | if (i915_semaphores >= 0) | ||
| 757 | return i915_semaphores; | ||
| 758 | |||
| 759 | /* Enable semaphores on SNB when IO remapping is off */ | ||
| 760 | if (INTEL_INFO(dev)->gen == 6) | ||
| 761 | return !intel_iommu_enabled; | ||
| 762 | |||
| 763 | return 1; | ||
| 764 | } | ||
| 765 | |||
| 749 | static int | 766 | static int |
| 750 | i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj, | 767 | i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj, |
| 751 | struct intel_ring_buffer *to) | 768 | struct intel_ring_buffer *to) |
| @@ -758,7 +775,7 @@ i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj, | |||
| 758 | return 0; | 775 | return 0; |
| 759 | 776 | ||
| 760 | /* XXX gpu semaphores are implicated in various hard hangs on SNB */ | 777 | /* XXX gpu semaphores are implicated in various hard hangs on SNB */ |
| 761 | if (INTEL_INFO(obj->base.dev)->gen < 6 || !i915_semaphores) | 778 | if (!intel_enable_semaphores(obj->base.dev)) |
| 762 | return i915_gem_object_wait_rendering(obj); | 779 | return i915_gem_object_wait_rendering(obj); |
| 763 | 780 | ||
| 764 | idx = intel_ring_sync_index(from, to); | 781 | idx = intel_ring_sync_index(from, to); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index b080cc824001..a26d5b0a3690 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -3303,10 +3303,10 @@ | |||
| 3303 | /* or SDVOB */ | 3303 | /* or SDVOB */ |
| 3304 | #define HDMIB 0xe1140 | 3304 | #define HDMIB 0xe1140 |
| 3305 | #define PORT_ENABLE (1 << 31) | 3305 | #define PORT_ENABLE (1 << 31) |
| 3306 | #define TRANSCODER_A (0) | 3306 | #define TRANSCODER(pipe) ((pipe) << 30) |
| 3307 | #define TRANSCODER_B (1 << 30) | 3307 | #define TRANSCODER_CPT(pipe) ((pipe) << 29) |
| 3308 | #define TRANSCODER(pipe) ((pipe) << 30) | 3308 | #define TRANSCODER_MASK (1 << 30) |
| 3309 | #define TRANSCODER_MASK (1 << 30) | 3309 | #define TRANSCODER_MASK_CPT (3 << 29) |
| 3310 | #define COLOR_FORMAT_8bpc (0) | 3310 | #define COLOR_FORMAT_8bpc (0) |
| 3311 | #define COLOR_FORMAT_12bpc (3 << 26) | 3311 | #define COLOR_FORMAT_12bpc (3 << 26) |
| 3312 | #define SDVOB_HOTPLUG_ENABLE (1 << 23) | 3312 | #define SDVOB_HOTPLUG_ENABLE (1 << 23) |
| @@ -3447,8 +3447,30 @@ | |||
| 3447 | #define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22) | 3447 | #define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22) |
| 3448 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) | 3448 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) |
| 3449 | 3449 | ||
| 3450 | /* IVB */ | ||
| 3451 | #define EDP_LINK_TRAIN_400MV_0DB_IVB (0x24 <<22) | ||
| 3452 | #define EDP_LINK_TRAIN_400MV_3_5DB_IVB (0x2a <<22) | ||
| 3453 | #define EDP_LINK_TRAIN_400MV_6DB_IVB (0x2f <<22) | ||
| 3454 | #define EDP_LINK_TRAIN_600MV_0DB_IVB (0x30 <<22) | ||
| 3455 | #define EDP_LINK_TRAIN_600MV_3_5DB_IVB (0x36 <<22) | ||
| 3456 | #define EDP_LINK_TRAIN_800MV_0DB_IVB (0x38 <<22) | ||
| 3457 | #define EDP_LINK_TRAIN_800MV_3_5DB_IVB (0x33 <<22) | ||
| 3458 | |||
| 3459 | /* legacy values */ | ||
| 3460 | #define EDP_LINK_TRAIN_500MV_0DB_IVB (0x00 <<22) | ||
| 3461 | #define EDP_LINK_TRAIN_1000MV_0DB_IVB (0x20 <<22) | ||
| 3462 | #define EDP_LINK_TRAIN_500MV_3_5DB_IVB (0x02 <<22) | ||
| 3463 | #define EDP_LINK_TRAIN_1000MV_3_5DB_IVB (0x22 <<22) | ||
| 3464 | #define EDP_LINK_TRAIN_1000MV_6DB_IVB (0x23 <<22) | ||
| 3465 | |||
| 3466 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_IVB (0x3f<<22) | ||
| 3467 | |||
| 3450 | #define FORCEWAKE 0xA18C | 3468 | #define FORCEWAKE 0xA18C |
| 3451 | #define FORCEWAKE_ACK 0x130090 | 3469 | #define FORCEWAKE_ACK 0x130090 |
| 3470 | #define FORCEWAKE_MT 0xa188 /* multi-threaded */ | ||
| 3471 | #define FORCEWAKE_MT_ACK 0x130040 | ||
| 3472 | #define ECOBUS 0xa180 | ||
| 3473 | #define FORCEWAKE_MT_ENABLE (1<<5) | ||
| 3452 | 3474 | ||
| 3453 | #define GT_FIFO_FREE_ENTRIES 0x120008 | 3475 | #define GT_FIFO_FREE_ENTRIES 0x120008 |
| 3454 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 | 3476 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e77a863a3833..d809b038ca88 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -38,8 +38,8 @@ | |||
| 38 | #include "i915_drv.h" | 38 | #include "i915_drv.h" |
| 39 | #include "i915_trace.h" | 39 | #include "i915_trace.h" |
| 40 | #include "drm_dp_helper.h" | 40 | #include "drm_dp_helper.h" |
| 41 | |||
| 42 | #include "drm_crtc_helper.h" | 41 | #include "drm_crtc_helper.h" |
| 42 | #include <linux/dma_remapping.h> | ||
| 43 | 43 | ||
| 44 | #define HAS_eDP (intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP)) | 44 | #define HAS_eDP (intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP)) |
| 45 | 45 | ||
| @@ -4670,6 +4670,7 @@ static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv) | |||
| 4670 | /** | 4670 | /** |
| 4671 | * intel_choose_pipe_bpp_dither - figure out what color depth the pipe should send | 4671 | * intel_choose_pipe_bpp_dither - figure out what color depth the pipe should send |
| 4672 | * @crtc: CRTC structure | 4672 | * @crtc: CRTC structure |
| 4673 | * @mode: requested mode | ||
| 4673 | * | 4674 | * |
| 4674 | * A pipe may be connected to one or more outputs. Based on the depth of the | 4675 | * A pipe may be connected to one or more outputs. Based on the depth of the |
| 4675 | * attached framebuffer, choose a good color depth to use on the pipe. | 4676 | * attached framebuffer, choose a good color depth to use on the pipe. |
| @@ -4681,13 +4682,15 @@ static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv) | |||
| 4681 | * HDMI supports only 8bpc or 12bpc, so clamp to 8bpc with dither for 10bpc | 4682 | * HDMI supports only 8bpc or 12bpc, so clamp to 8bpc with dither for 10bpc |
| 4682 | * Displays may support a restricted set as well, check EDID and clamp as | 4683 | * Displays may support a restricted set as well, check EDID and clamp as |
| 4683 | * appropriate. | 4684 | * appropriate. |
| 4685 | * DP may want to dither down to 6bpc to fit larger modes | ||
| 4684 | * | 4686 | * |
| 4685 | * RETURNS: | 4687 | * RETURNS: |
| 4686 | * Dithering requirement (i.e. false if display bpc and pipe bpc match, | 4688 | * Dithering requirement (i.e. false if display bpc and pipe bpc match, |
| 4687 | * true if they don't match). | 4689 | * true if they don't match). |
| 4688 | */ | 4690 | */ |
| 4689 | static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | 4691 | static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, |
| 4690 | unsigned int *pipe_bpp) | 4692 | unsigned int *pipe_bpp, |
| 4693 | struct drm_display_mode *mode) | ||
| 4691 | { | 4694 | { |
| 4692 | struct drm_device *dev = crtc->dev; | 4695 | struct drm_device *dev = crtc->dev; |
| 4693 | struct drm_i915_private *dev_priv = dev->dev_private; | 4696 | struct drm_i915_private *dev_priv = dev->dev_private; |
| @@ -4758,6 +4761,11 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
| 4758 | } | 4761 | } |
| 4759 | } | 4762 | } |
| 4760 | 4763 | ||
| 4764 | if (mode->private_flags & INTEL_MODE_DP_FORCE_6BPC) { | ||
| 4765 | DRM_DEBUG_KMS("Dithering DP to 6bpc\n"); | ||
| 4766 | display_bpc = 6; | ||
| 4767 | } | ||
| 4768 | |||
| 4761 | /* | 4769 | /* |
| 4762 | * We could just drive the pipe at the highest bpc all the time and | 4770 | * We could just drive the pipe at the highest bpc all the time and |
| 4763 | * enable dithering as needed, but that costs bandwidth. So choose | 4771 | * enable dithering as needed, but that costs bandwidth. So choose |
| @@ -5019,6 +5027,16 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, | |||
| 5019 | pipeconf &= ~PIPECONF_DOUBLE_WIDE; | 5027 | pipeconf &= ~PIPECONF_DOUBLE_WIDE; |
| 5020 | } | 5028 | } |
| 5021 | 5029 | ||
| 5030 | /* default to 8bpc */ | ||
| 5031 | pipeconf &= ~(PIPECONF_BPP_MASK | PIPECONF_DITHER_EN); | ||
| 5032 | if (is_dp) { | ||
| 5033 | if (mode->private_flags & INTEL_MODE_DP_FORCE_6BPC) { | ||
| 5034 | pipeconf |= PIPECONF_BPP_6 | | ||
| 5035 | PIPECONF_DITHER_EN | | ||
| 5036 | PIPECONF_DITHER_TYPE_SP; | ||
| 5037 | } | ||
| 5038 | } | ||
| 5039 | |||
| 5022 | dpll |= DPLL_VCO_ENABLE; | 5040 | dpll |= DPLL_VCO_ENABLE; |
| 5023 | 5041 | ||
| 5024 | DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B'); | 5042 | DRM_DEBUG_KMS("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B'); |
| @@ -5480,7 +5498,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
| 5480 | /* determine panel color depth */ | 5498 | /* determine panel color depth */ |
| 5481 | temp = I915_READ(PIPECONF(pipe)); | 5499 | temp = I915_READ(PIPECONF(pipe)); |
| 5482 | temp &= ~PIPE_BPC_MASK; | 5500 | temp &= ~PIPE_BPC_MASK; |
| 5483 | dither = intel_choose_pipe_bpp_dither(crtc, &pipe_bpp); | 5501 | dither = intel_choose_pipe_bpp_dither(crtc, &pipe_bpp, mode); |
| 5484 | switch (pipe_bpp) { | 5502 | switch (pipe_bpp) { |
| 5485 | case 18: | 5503 | case 18: |
| 5486 | temp |= PIPE_6BPC; | 5504 | temp |= PIPE_6BPC; |
| @@ -7189,11 +7207,16 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 7189 | work->old_fb_obj = intel_fb->obj; | 7207 | work->old_fb_obj = intel_fb->obj; |
| 7190 | INIT_WORK(&work->work, intel_unpin_work_fn); | 7208 | INIT_WORK(&work->work, intel_unpin_work_fn); |
| 7191 | 7209 | ||
| 7210 | ret = drm_vblank_get(dev, intel_crtc->pipe); | ||
| 7211 | if (ret) | ||
| 7212 | goto free_work; | ||
| 7213 | |||
| 7192 | /* We borrow the event spin lock for protecting unpin_work */ | 7214 | /* We borrow the event spin lock for protecting unpin_work */ |
| 7193 | spin_lock_irqsave(&dev->event_lock, flags); | 7215 | spin_lock_irqsave(&dev->event_lock, flags); |
| 7194 | if (intel_crtc->unpin_work) { | 7216 | if (intel_crtc->unpin_work) { |
| 7195 | spin_unlock_irqrestore(&dev->event_lock, flags); | 7217 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 7196 | kfree(work); | 7218 | kfree(work); |
| 7219 | drm_vblank_put(dev, intel_crtc->pipe); | ||
| 7197 | 7220 | ||
| 7198 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); | 7221 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); |
| 7199 | return -EBUSY; | 7222 | return -EBUSY; |
| @@ -7212,10 +7235,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 7212 | 7235 | ||
| 7213 | crtc->fb = fb; | 7236 | crtc->fb = fb; |
| 7214 | 7237 | ||
| 7215 | ret = drm_vblank_get(dev, intel_crtc->pipe); | ||
| 7216 | if (ret) | ||
| 7217 | goto cleanup_objs; | ||
| 7218 | |||
| 7219 | work->pending_flip_obj = obj; | 7238 | work->pending_flip_obj = obj; |
| 7220 | 7239 | ||
| 7221 | work->enable_stall_check = true; | 7240 | work->enable_stall_check = true; |
| @@ -7238,7 +7257,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 7238 | 7257 | ||
| 7239 | cleanup_pending: | 7258 | cleanup_pending: |
| 7240 | atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); | 7259 | atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip); |
| 7241 | cleanup_objs: | ||
| 7242 | drm_gem_object_unreference(&work->old_fb_obj->base); | 7260 | drm_gem_object_unreference(&work->old_fb_obj->base); |
| 7243 | drm_gem_object_unreference(&obj->base); | 7261 | drm_gem_object_unreference(&obj->base); |
| 7244 | mutex_unlock(&dev->struct_mutex); | 7262 | mutex_unlock(&dev->struct_mutex); |
| @@ -7247,6 +7265,8 @@ cleanup_objs: | |||
| 7247 | intel_crtc->unpin_work = NULL; | 7265 | intel_crtc->unpin_work = NULL; |
| 7248 | spin_unlock_irqrestore(&dev->event_lock, flags); | 7266 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 7249 | 7267 | ||
| 7268 | drm_vblank_put(dev, intel_crtc->pipe); | ||
| 7269 | free_work: | ||
| 7250 | kfree(work); | 7270 | kfree(work); |
| 7251 | 7271 | ||
| 7252 | return ret; | 7272 | return ret; |
| @@ -7887,6 +7907,33 @@ void intel_init_emon(struct drm_device *dev) | |||
| 7887 | dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); | 7907 | dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); |
| 7888 | } | 7908 | } |
| 7889 | 7909 | ||
| 7910 | static bool intel_enable_rc6(struct drm_device *dev) | ||
| 7911 | { | ||
| 7912 | /* | ||
| 7913 | * Respect the kernel parameter if it is set | ||
| 7914 | */ | ||
| 7915 | if (i915_enable_rc6 >= 0) | ||
| 7916 | return i915_enable_rc6; | ||
| 7917 | |||
| 7918 | /* | ||
| 7919 | * Disable RC6 on Ironlake | ||
| 7920 | */ | ||
| 7921 | if (INTEL_INFO(dev)->gen == 5) | ||
| 7922 | return 0; | ||
| 7923 | |||
| 7924 | /* | ||
| 7925 | * Enable rc6 on Sandybridge if DMA remapping is disabled | ||
| 7926 | */ | ||
| 7927 | if (INTEL_INFO(dev)->gen == 6) { | ||
| 7928 | DRM_DEBUG_DRIVER("Sandybridge: intel_iommu_enabled %s -- RC6 %sabled\n", | ||
| 7929 | intel_iommu_enabled ? "true" : "false", | ||
| 7930 | !intel_iommu_enabled ? "en" : "dis"); | ||
| 7931 | return !intel_iommu_enabled; | ||
| 7932 | } | ||
| 7933 | DRM_DEBUG_DRIVER("RC6 enabled\n"); | ||
| 7934 | return 1; | ||
| 7935 | } | ||
| 7936 | |||
| 7890 | void gen6_enable_rps(struct drm_i915_private *dev_priv) | 7937 | void gen6_enable_rps(struct drm_i915_private *dev_priv) |
| 7891 | { | 7938 | { |
| 7892 | u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP); | 7939 | u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP); |
| @@ -7923,7 +7970,7 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv) | |||
| 7923 | I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); | 7970 | I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); |
| 7924 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ | 7971 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ |
| 7925 | 7972 | ||
| 7926 | if (i915_enable_rc6) | 7973 | if (intel_enable_rc6(dev_priv->dev)) |
| 7927 | rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | | 7974 | rc6_mask = GEN6_RC_CTL_RC6p_ENABLE | |
| 7928 | GEN6_RC_CTL_RC6_ENABLE; | 7975 | GEN6_RC_CTL_RC6_ENABLE; |
| 7929 | 7976 | ||
| @@ -8372,7 +8419,7 @@ void ironlake_enable_rc6(struct drm_device *dev) | |||
| 8372 | /* rc6 disabled by default due to repeated reports of hanging during | 8419 | /* rc6 disabled by default due to repeated reports of hanging during |
| 8373 | * boot and resume. | 8420 | * boot and resume. |
| 8374 | */ | 8421 | */ |
| 8375 | if (!i915_enable_rc6) | 8422 | if (!intel_enable_rc6(dev)) |
| 8376 | return; | 8423 | return; |
| 8377 | 8424 | ||
| 8378 | mutex_lock(&dev->struct_mutex); | 8425 | mutex_lock(&dev->struct_mutex); |
| @@ -8491,6 +8538,28 @@ static void intel_init_display(struct drm_device *dev) | |||
| 8491 | 8538 | ||
| 8492 | /* For FIFO watermark updates */ | 8539 | /* For FIFO watermark updates */ |
| 8493 | if (HAS_PCH_SPLIT(dev)) { | 8540 | if (HAS_PCH_SPLIT(dev)) { |
| 8541 | dev_priv->display.force_wake_get = __gen6_gt_force_wake_get; | ||
| 8542 | dev_priv->display.force_wake_put = __gen6_gt_force_wake_put; | ||
| 8543 | |||
| 8544 | /* IVB configs may use multi-threaded forcewake */ | ||
| 8545 | if (IS_IVYBRIDGE(dev)) { | ||
| 8546 | u32 ecobus; | ||
| 8547 | |||
| 8548 | mutex_lock(&dev->struct_mutex); | ||
| 8549 | __gen6_gt_force_wake_mt_get(dev_priv); | ||
| 8550 | ecobus = I915_READ(ECOBUS); | ||
| 8551 | __gen6_gt_force_wake_mt_put(dev_priv); | ||
| 8552 | mutex_unlock(&dev->struct_mutex); | ||
| 8553 | |||
| 8554 | if (ecobus & FORCEWAKE_MT_ENABLE) { | ||
| 8555 | DRM_DEBUG_KMS("Using MT version of forcewake\n"); | ||
| 8556 | dev_priv->display.force_wake_get = | ||
| 8557 | __gen6_gt_force_wake_mt_get; | ||
| 8558 | dev_priv->display.force_wake_put = | ||
| 8559 | __gen6_gt_force_wake_mt_put; | ||
| 8560 | } | ||
| 8561 | } | ||
| 8562 | |||
| 8494 | if (HAS_PCH_IBX(dev)) | 8563 | if (HAS_PCH_IBX(dev)) |
| 8495 | dev_priv->display.init_pch_clock_gating = ibx_init_clock_gating; | 8564 | dev_priv->display.init_pch_clock_gating = ibx_init_clock_gating; |
| 8496 | else if (HAS_PCH_CPT(dev)) | 8565 | else if (HAS_PCH_CPT(dev)) |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 4d0358fad937..92b041b66e49 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -208,13 +208,15 @@ intel_dp_link_clock(uint8_t link_bw) | |||
| 208 | */ | 208 | */ |
| 209 | 209 | ||
| 210 | static int | 210 | static int |
| 211 | intel_dp_link_required(struct intel_dp *intel_dp, int pixel_clock) | 211 | intel_dp_link_required(struct intel_dp *intel_dp, int pixel_clock, int check_bpp) |
| 212 | { | 212 | { |
| 213 | struct drm_crtc *crtc = intel_dp->base.base.crtc; | 213 | struct drm_crtc *crtc = intel_dp->base.base.crtc; |
| 214 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 214 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
| 215 | int bpp = 24; | 215 | int bpp = 24; |
| 216 | 216 | ||
| 217 | if (intel_crtc) | 217 | if (check_bpp) |
| 218 | bpp = check_bpp; | ||
| 219 | else if (intel_crtc) | ||
| 218 | bpp = intel_crtc->bpp; | 220 | bpp = intel_crtc->bpp; |
| 219 | 221 | ||
| 220 | return (pixel_clock * bpp + 9) / 10; | 222 | return (pixel_clock * bpp + 9) / 10; |
| @@ -233,6 +235,7 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
| 233 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 235 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
| 234 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); | 236 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); |
| 235 | int max_lanes = intel_dp_max_lane_count(intel_dp); | 237 | int max_lanes = intel_dp_max_lane_count(intel_dp); |
| 238 | int max_rate, mode_rate; | ||
| 236 | 239 | ||
| 237 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { | 240 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { |
| 238 | if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) | 241 | if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) |
| @@ -242,9 +245,17 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
| 242 | return MODE_PANEL; | 245 | return MODE_PANEL; |
| 243 | } | 246 | } |
| 244 | 247 | ||
| 245 | if (intel_dp_link_required(intel_dp, mode->clock) | 248 | mode_rate = intel_dp_link_required(intel_dp, mode->clock, 0); |
| 246 | > intel_dp_max_data_rate(max_link_clock, max_lanes)) | 249 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); |
| 247 | return MODE_CLOCK_HIGH; | 250 | |
| 251 | if (mode_rate > max_rate) { | ||
| 252 | mode_rate = intel_dp_link_required(intel_dp, | ||
| 253 | mode->clock, 18); | ||
| 254 | if (mode_rate > max_rate) | ||
| 255 | return MODE_CLOCK_HIGH; | ||
| 256 | else | ||
| 257 | mode->private_flags |= INTEL_MODE_DP_FORCE_6BPC; | ||
| 258 | } | ||
| 248 | 259 | ||
| 249 | if (mode->clock < 10000) | 260 | if (mode->clock < 10000) |
| 250 | return MODE_CLOCK_LOW; | 261 | return MODE_CLOCK_LOW; |
| @@ -362,8 +373,8 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
| 362 | * clock divider. | 373 | * clock divider. |
| 363 | */ | 374 | */ |
| 364 | if (is_cpu_edp(intel_dp)) { | 375 | if (is_cpu_edp(intel_dp)) { |
| 365 | if (IS_GEN6(dev)) | 376 | if (IS_GEN6(dev) || IS_GEN7(dev)) |
| 366 | aux_clock_divider = 200; /* SNB eDP input clock at 400Mhz */ | 377 | aux_clock_divider = 200; /* SNB & IVB eDP input clock at 400Mhz */ |
| 367 | else | 378 | else |
| 368 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ | 379 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ |
| 369 | } else if (HAS_PCH_SPLIT(dev)) | 380 | } else if (HAS_PCH_SPLIT(dev)) |
| @@ -672,6 +683,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 672 | int lane_count, clock; | 683 | int lane_count, clock; |
| 673 | int max_lane_count = intel_dp_max_lane_count(intel_dp); | 684 | int max_lane_count = intel_dp_max_lane_count(intel_dp); |
| 674 | int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0; | 685 | int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0; |
| 686 | int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 0; | ||
| 675 | static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 }; | 687 | static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 }; |
| 676 | 688 | ||
| 677 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { | 689 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { |
| @@ -689,7 +701,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 689 | for (clock = 0; clock <= max_clock; clock++) { | 701 | for (clock = 0; clock <= max_clock; clock++) { |
| 690 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); | 702 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); |
| 691 | 703 | ||
| 692 | if (intel_dp_link_required(intel_dp, mode->clock) | 704 | if (intel_dp_link_required(intel_dp, mode->clock, bpp) |
| 693 | <= link_avail) { | 705 | <= link_avail) { |
| 694 | intel_dp->link_bw = bws[clock]; | 706 | intel_dp->link_bw = bws[clock]; |
| 695 | intel_dp->lane_count = lane_count; | 707 | intel_dp->lane_count = lane_count; |
| @@ -817,10 +829,11 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 817 | } | 829 | } |
| 818 | 830 | ||
| 819 | /* | 831 | /* |
| 820 | * There are three kinds of DP registers: | 832 | * There are four kinds of DP registers: |
| 821 | * | 833 | * |
| 822 | * IBX PCH | 834 | * IBX PCH |
| 823 | * CPU | 835 | * SNB CPU |
| 836 | * IVB CPU | ||
| 824 | * CPT PCH | 837 | * CPT PCH |
| 825 | * | 838 | * |
| 826 | * IBX PCH and CPU are the same for almost everything, | 839 | * IBX PCH and CPU are the same for almost everything, |
| @@ -873,7 +886,25 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 873 | 886 | ||
| 874 | /* Split out the IBX/CPU vs CPT settings */ | 887 | /* Split out the IBX/CPU vs CPT settings */ |
| 875 | 888 | ||
| 876 | if (!HAS_PCH_CPT(dev) || is_cpu_edp(intel_dp)) { | 889 | if (is_cpu_edp(intel_dp) && IS_GEN7(dev)) { |
| 890 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) | ||
| 891 | intel_dp->DP |= DP_SYNC_HS_HIGH; | ||
| 892 | if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) | ||
| 893 | intel_dp->DP |= DP_SYNC_VS_HIGH; | ||
| 894 | intel_dp->DP |= DP_LINK_TRAIN_OFF_CPT; | ||
| 895 | |||
| 896 | if (intel_dp->link_configuration[1] & DP_LANE_COUNT_ENHANCED_FRAME_EN) | ||
| 897 | intel_dp->DP |= DP_ENHANCED_FRAMING; | ||
| 898 | |||
| 899 | intel_dp->DP |= intel_crtc->pipe << 29; | ||
| 900 | |||
| 901 | /* don't miss out required setting for eDP */ | ||
| 902 | intel_dp->DP |= DP_PLL_ENABLE; | ||
| 903 | if (adjusted_mode->clock < 200000) | ||
| 904 | intel_dp->DP |= DP_PLL_FREQ_160MHZ; | ||
| 905 | else | ||
| 906 | intel_dp->DP |= DP_PLL_FREQ_270MHZ; | ||
| 907 | } else if (!HAS_PCH_CPT(dev) || is_cpu_edp(intel_dp)) { | ||
| 877 | intel_dp->DP |= intel_dp->color_range; | 908 | intel_dp->DP |= intel_dp->color_range; |
| 878 | 909 | ||
| 879 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) | 910 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) |
| @@ -1375,34 +1406,59 @@ static char *link_train_names[] = { | |||
| 1375 | * These are source-specific values; current Intel hardware supports | 1406 | * These are source-specific values; current Intel hardware supports |
| 1376 | * a maximum voltage of 800mV and a maximum pre-emphasis of 6dB | 1407 | * a maximum voltage of 800mV and a maximum pre-emphasis of 6dB |
| 1377 | */ | 1408 | */ |
| 1378 | #define I830_DP_VOLTAGE_MAX DP_TRAIN_VOLTAGE_SWING_800 | ||
| 1379 | #define I830_DP_VOLTAGE_MAX_CPT DP_TRAIN_VOLTAGE_SWING_1200 | ||
| 1380 | 1409 | ||
| 1381 | static uint8_t | 1410 | static uint8_t |
| 1382 | intel_dp_pre_emphasis_max(uint8_t voltage_swing) | 1411 | intel_dp_voltage_max(struct intel_dp *intel_dp) |
| 1383 | { | 1412 | { |
| 1384 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | 1413 | struct drm_device *dev = intel_dp->base.base.dev; |
| 1385 | case DP_TRAIN_VOLTAGE_SWING_400: | 1414 | |
| 1386 | return DP_TRAIN_PRE_EMPHASIS_6; | 1415 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) |
| 1387 | case DP_TRAIN_VOLTAGE_SWING_600: | 1416 | return DP_TRAIN_VOLTAGE_SWING_800; |
| 1388 | return DP_TRAIN_PRE_EMPHASIS_6; | 1417 | else if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) |
| 1389 | case DP_TRAIN_VOLTAGE_SWING_800: | 1418 | return DP_TRAIN_VOLTAGE_SWING_1200; |
| 1390 | return DP_TRAIN_PRE_EMPHASIS_3_5; | 1419 | else |
| 1391 | case DP_TRAIN_VOLTAGE_SWING_1200: | 1420 | return DP_TRAIN_VOLTAGE_SWING_800; |
| 1392 | default: | 1421 | } |
| 1393 | return DP_TRAIN_PRE_EMPHASIS_0; | 1422 | |
| 1423 | static uint8_t | ||
| 1424 | intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing) | ||
| 1425 | { | ||
| 1426 | struct drm_device *dev = intel_dp->base.base.dev; | ||
| 1427 | |||
| 1428 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { | ||
| 1429 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | ||
| 1430 | case DP_TRAIN_VOLTAGE_SWING_400: | ||
| 1431 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
| 1432 | case DP_TRAIN_VOLTAGE_SWING_600: | ||
| 1433 | case DP_TRAIN_VOLTAGE_SWING_800: | ||
| 1434 | return DP_TRAIN_PRE_EMPHASIS_3_5; | ||
| 1435 | default: | ||
| 1436 | return DP_TRAIN_PRE_EMPHASIS_0; | ||
| 1437 | } | ||
| 1438 | } else { | ||
| 1439 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | ||
| 1440 | case DP_TRAIN_VOLTAGE_SWING_400: | ||
| 1441 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
| 1442 | case DP_TRAIN_VOLTAGE_SWING_600: | ||
| 1443 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
| 1444 | case DP_TRAIN_VOLTAGE_SWING_800: | ||
| 1445 | return DP_TRAIN_PRE_EMPHASIS_3_5; | ||
| 1446 | case DP_TRAIN_VOLTAGE_SWING_1200: | ||
| 1447 | default: | ||
| 1448 | return DP_TRAIN_PRE_EMPHASIS_0; | ||
| 1449 | } | ||
| 1394 | } | 1450 | } |
| 1395 | } | 1451 | } |
| 1396 | 1452 | ||
| 1397 | static void | 1453 | static void |
| 1398 | intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]) | 1454 | intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]) |
| 1399 | { | 1455 | { |
| 1400 | struct drm_device *dev = intel_dp->base.base.dev; | ||
| 1401 | uint8_t v = 0; | 1456 | uint8_t v = 0; |
| 1402 | uint8_t p = 0; | 1457 | uint8_t p = 0; |
| 1403 | int lane; | 1458 | int lane; |
| 1404 | uint8_t *adjust_request = link_status + (DP_ADJUST_REQUEST_LANE0_1 - DP_LANE0_1_STATUS); | 1459 | uint8_t *adjust_request = link_status + (DP_ADJUST_REQUEST_LANE0_1 - DP_LANE0_1_STATUS); |
| 1405 | int voltage_max; | 1460 | uint8_t voltage_max; |
| 1461 | uint8_t preemph_max; | ||
| 1406 | 1462 | ||
| 1407 | for (lane = 0; lane < intel_dp->lane_count; lane++) { | 1463 | for (lane = 0; lane < intel_dp->lane_count; lane++) { |
| 1408 | uint8_t this_v = intel_get_adjust_request_voltage(adjust_request, lane); | 1464 | uint8_t this_v = intel_get_adjust_request_voltage(adjust_request, lane); |
| @@ -1414,15 +1470,13 @@ intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_ST | |||
| 1414 | p = this_p; | 1470 | p = this_p; |
| 1415 | } | 1471 | } |
| 1416 | 1472 | ||
| 1417 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1473 | voltage_max = intel_dp_voltage_max(intel_dp); |
| 1418 | voltage_max = I830_DP_VOLTAGE_MAX_CPT; | ||
| 1419 | else | ||
| 1420 | voltage_max = I830_DP_VOLTAGE_MAX; | ||
| 1421 | if (v >= voltage_max) | 1474 | if (v >= voltage_max) |
| 1422 | v = voltage_max | DP_TRAIN_MAX_SWING_REACHED; | 1475 | v = voltage_max | DP_TRAIN_MAX_SWING_REACHED; |
| 1423 | 1476 | ||
| 1424 | if (p >= intel_dp_pre_emphasis_max(v)) | 1477 | preemph_max = intel_dp_pre_emphasis_max(intel_dp, v); |
| 1425 | p = intel_dp_pre_emphasis_max(v) | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; | 1478 | if (p >= preemph_max) |
| 1479 | p = preemph_max | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; | ||
| 1426 | 1480 | ||
| 1427 | for (lane = 0; lane < 4; lane++) | 1481 | for (lane = 0; lane < 4; lane++) |
| 1428 | intel_dp->train_set[lane] = v | p; | 1482 | intel_dp->train_set[lane] = v | p; |
| @@ -1494,6 +1548,37 @@ intel_gen6_edp_signal_levels(uint8_t train_set) | |||
| 1494 | } | 1548 | } |
| 1495 | } | 1549 | } |
| 1496 | 1550 | ||
| 1551 | /* Gen7's DP voltage swing and pre-emphasis control */ | ||
| 1552 | static uint32_t | ||
| 1553 | intel_gen7_edp_signal_levels(uint8_t train_set) | ||
| 1554 | { | ||
| 1555 | int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK | | ||
| 1556 | DP_TRAIN_PRE_EMPHASIS_MASK); | ||
| 1557 | switch (signal_levels) { | ||
| 1558 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0: | ||
| 1559 | return EDP_LINK_TRAIN_400MV_0DB_IVB; | ||
| 1560 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
| 1561 | return EDP_LINK_TRAIN_400MV_3_5DB_IVB; | ||
| 1562 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6: | ||
| 1563 | return EDP_LINK_TRAIN_400MV_6DB_IVB; | ||
| 1564 | |||
| 1565 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_0: | ||
| 1566 | return EDP_LINK_TRAIN_600MV_0DB_IVB; | ||
| 1567 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
| 1568 | return EDP_LINK_TRAIN_600MV_3_5DB_IVB; | ||
| 1569 | |||
| 1570 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0: | ||
| 1571 | return EDP_LINK_TRAIN_800MV_0DB_IVB; | ||
| 1572 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
| 1573 | return EDP_LINK_TRAIN_800MV_3_5DB_IVB; | ||
| 1574 | |||
| 1575 | default: | ||
| 1576 | DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level:" | ||
| 1577 | "0x%x\n", signal_levels); | ||
| 1578 | return EDP_LINK_TRAIN_500MV_0DB_IVB; | ||
| 1579 | } | ||
| 1580 | } | ||
| 1581 | |||
| 1497 | static uint8_t | 1582 | static uint8_t |
| 1498 | intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE], | 1583 | intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE], |
| 1499 | int lane) | 1584 | int lane) |
| @@ -1599,7 +1684,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1599 | DP_LINK_CONFIGURATION_SIZE); | 1684 | DP_LINK_CONFIGURATION_SIZE); |
| 1600 | 1685 | ||
| 1601 | DP |= DP_PORT_EN; | 1686 | DP |= DP_PORT_EN; |
| 1602 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1687 | |
| 1688 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) | ||
| 1603 | DP &= ~DP_LINK_TRAIN_MASK_CPT; | 1689 | DP &= ~DP_LINK_TRAIN_MASK_CPT; |
| 1604 | else | 1690 | else |
| 1605 | DP &= ~DP_LINK_TRAIN_MASK; | 1691 | DP &= ~DP_LINK_TRAIN_MASK; |
| @@ -1613,7 +1699,11 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1613 | uint8_t link_status[DP_LINK_STATUS_SIZE]; | 1699 | uint8_t link_status[DP_LINK_STATUS_SIZE]; |
| 1614 | uint32_t signal_levels; | 1700 | uint32_t signal_levels; |
| 1615 | 1701 | ||
| 1616 | if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | 1702 | |
| 1703 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { | ||
| 1704 | signal_levels = intel_gen7_edp_signal_levels(intel_dp->train_set[0]); | ||
| 1705 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_IVB) | signal_levels; | ||
| 1706 | } else if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | ||
| 1617 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1707 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
| 1618 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1708 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
| 1619 | } else { | 1709 | } else { |
| @@ -1622,7 +1712,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1622 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1712 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
| 1623 | } | 1713 | } |
| 1624 | 1714 | ||
| 1625 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1715 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
| 1626 | reg = DP | DP_LINK_TRAIN_PAT_1_CPT; | 1716 | reg = DP | DP_LINK_TRAIN_PAT_1_CPT; |
| 1627 | else | 1717 | else |
| 1628 | reg = DP | DP_LINK_TRAIN_PAT_1; | 1718 | reg = DP | DP_LINK_TRAIN_PAT_1; |
| @@ -1703,7 +1793,10 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
| 1703 | break; | 1793 | break; |
| 1704 | } | 1794 | } |
| 1705 | 1795 | ||
| 1706 | if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | 1796 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { |
| 1797 | signal_levels = intel_gen7_edp_signal_levels(intel_dp->train_set[0]); | ||
| 1798 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_IVB) | signal_levels; | ||
| 1799 | } else if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | ||
| 1707 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1800 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
| 1708 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1801 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
| 1709 | } else { | 1802 | } else { |
| @@ -1711,7 +1804,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
| 1711 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1804 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
| 1712 | } | 1805 | } |
| 1713 | 1806 | ||
| 1714 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1807 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
| 1715 | reg = DP | DP_LINK_TRAIN_PAT_2_CPT; | 1808 | reg = DP | DP_LINK_TRAIN_PAT_2_CPT; |
| 1716 | else | 1809 | else |
| 1717 | reg = DP | DP_LINK_TRAIN_PAT_2; | 1810 | reg = DP | DP_LINK_TRAIN_PAT_2; |
| @@ -1752,7 +1845,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
| 1752 | ++tries; | 1845 | ++tries; |
| 1753 | } | 1846 | } |
| 1754 | 1847 | ||
| 1755 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1848 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
| 1756 | reg = DP | DP_LINK_TRAIN_OFF_CPT; | 1849 | reg = DP | DP_LINK_TRAIN_OFF_CPT; |
| 1757 | else | 1850 | else |
| 1758 | reg = DP | DP_LINK_TRAIN_OFF; | 1851 | reg = DP | DP_LINK_TRAIN_OFF; |
| @@ -1782,7 +1875,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1782 | udelay(100); | 1875 | udelay(100); |
| 1783 | } | 1876 | } |
| 1784 | 1877 | ||
| 1785 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) { | 1878 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) { |
| 1786 | DP &= ~DP_LINK_TRAIN_MASK_CPT; | 1879 | DP &= ~DP_LINK_TRAIN_MASK_CPT; |
| 1787 | I915_WRITE(intel_dp->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE_CPT); | 1880 | I915_WRITE(intel_dp->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE_CPT); |
| 1788 | } else { | 1881 | } else { |
| @@ -1794,7 +1887,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1794 | msleep(17); | 1887 | msleep(17); |
| 1795 | 1888 | ||
| 1796 | if (is_edp(intel_dp)) { | 1889 | if (is_edp(intel_dp)) { |
| 1797 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1890 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
| 1798 | DP |= DP_LINK_TRAIN_OFF_CPT; | 1891 | DP |= DP_LINK_TRAIN_OFF_CPT; |
| 1799 | else | 1892 | else |
| 1800 | DP |= DP_LINK_TRAIN_OFF; | 1893 | DP |= DP_LINK_TRAIN_OFF; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index bd9a604b73da..a1b4343814e8 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -110,6 +110,7 @@ | |||
| 110 | /* drm_display_mode->private_flags */ | 110 | /* drm_display_mode->private_flags */ |
| 111 | #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) | 111 | #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) |
| 112 | #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) | 112 | #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) |
| 113 | #define INTEL_MODE_DP_FORCE_6BPC (0x10) | ||
| 113 | 114 | ||
| 114 | static inline void | 115 | static inline void |
| 115 | intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, | 116 | intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 42f165a520de..e44191132ac4 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -715,6 +715,14 @@ static const struct dmi_system_id intel_no_lvds[] = { | |||
| 715 | DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"), | 715 | DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"), |
| 716 | }, | 716 | }, |
| 717 | }, | 717 | }, |
| 718 | { | ||
| 719 | .callback = intel_no_lvds_dmi_callback, | ||
| 720 | .ident = "Asus AT5NM10T-I", | ||
| 721 | .matches = { | ||
| 722 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
| 723 | DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"), | ||
| 724 | }, | ||
| 725 | }, | ||
| 718 | 726 | ||
| 719 | { } /* terminating entry */ | 727 | { } /* terminating entry */ |
| 720 | }; | 728 | }; |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 21f60b7d69a3..04d79fd1dc9d 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
| @@ -178,13 +178,10 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev) | |||
| 178 | if (HAS_PCH_SPLIT(dev)) { | 178 | if (HAS_PCH_SPLIT(dev)) { |
| 179 | max >>= 16; | 179 | max >>= 16; |
| 180 | } else { | 180 | } else { |
| 181 | if (IS_PINEVIEW(dev)) { | 181 | if (INTEL_INFO(dev)->gen < 4) |
| 182 | max >>= 17; | 182 | max >>= 17; |
| 183 | } else { | 183 | else |
| 184 | max >>= 16; | 184 | max >>= 16; |
| 185 | if (INTEL_INFO(dev)->gen < 4) | ||
| 186 | max &= ~1; | ||
| 187 | } | ||
| 188 | 185 | ||
| 189 | if (is_backlight_combination_mode(dev)) | 186 | if (is_backlight_combination_mode(dev)) |
| 190 | max *= 0xff; | 187 | max *= 0xff; |
| @@ -203,13 +200,12 @@ u32 intel_panel_get_backlight(struct drm_device *dev) | |||
| 203 | val = I915_READ(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | 200 | val = I915_READ(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; |
| 204 | } else { | 201 | } else { |
| 205 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | 202 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; |
| 206 | if (IS_PINEVIEW(dev)) | 203 | if (INTEL_INFO(dev)->gen < 4) |
| 207 | val >>= 1; | 204 | val >>= 1; |
| 208 | 205 | ||
| 209 | if (is_backlight_combination_mode(dev)) { | 206 | if (is_backlight_combination_mode(dev)) { |
| 210 | u8 lbpc; | 207 | u8 lbpc; |
| 211 | 208 | ||
| 212 | val &= ~1; | ||
| 213 | pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); | 209 | pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); |
| 214 | val *= lbpc; | 210 | val *= lbpc; |
| 215 | } | 211 | } |
| @@ -246,11 +242,9 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level | |||
| 246 | } | 242 | } |
| 247 | 243 | ||
| 248 | tmp = I915_READ(BLC_PWM_CTL); | 244 | tmp = I915_READ(BLC_PWM_CTL); |
| 249 | if (IS_PINEVIEW(dev)) { | 245 | if (INTEL_INFO(dev)->gen < 4) |
| 250 | tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); | ||
| 251 | level <<= 1; | 246 | level <<= 1; |
| 252 | } else | 247 | tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; |
| 253 | tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; | ||
| 254 | I915_WRITE(BLC_PWM_CTL, tmp | level); | 248 | I915_WRITE(BLC_PWM_CTL, tmp | level); |
| 255 | } | 249 | } |
| 256 | 250 | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 3003fb25aefd..f7b9268df266 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #define IS_TMDS(c) (c->output_flag & SDVO_TMDS_MASK) | 50 | #define IS_TMDS(c) (c->output_flag & SDVO_TMDS_MASK) |
| 51 | #define IS_LVDS(c) (c->output_flag & SDVO_LVDS_MASK) | 51 | #define IS_LVDS(c) (c->output_flag & SDVO_LVDS_MASK) |
| 52 | #define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK)) | 52 | #define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK)) |
| 53 | #define IS_DIGITAL(c) (c->output_flag & (SDVO_TMDS_MASK | SDVO_LVDS_MASK)) | ||
| 53 | 54 | ||
| 54 | 55 | ||
| 55 | static const char *tv_format_names[] = { | 56 | static const char *tv_format_names[] = { |
| @@ -1086,8 +1087,12 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1086 | } | 1087 | } |
| 1087 | sdvox |= (9 << 19) | SDVO_BORDER_ENABLE; | 1088 | sdvox |= (9 << 19) | SDVO_BORDER_ENABLE; |
| 1088 | } | 1089 | } |
| 1089 | if (intel_crtc->pipe == 1) | 1090 | |
| 1090 | sdvox |= SDVO_PIPE_B_SELECT; | 1091 | if (INTEL_PCH_TYPE(dev) >= PCH_CPT) |
| 1092 | sdvox |= TRANSCODER_CPT(intel_crtc->pipe); | ||
| 1093 | else | ||
| 1094 | sdvox |= TRANSCODER(intel_crtc->pipe); | ||
| 1095 | |||
| 1091 | if (intel_sdvo->has_hdmi_audio) | 1096 | if (intel_sdvo->has_hdmi_audio) |
| 1092 | sdvox |= SDVO_AUDIO_ENABLE; | 1097 | sdvox |= SDVO_AUDIO_ENABLE; |
| 1093 | 1098 | ||
| @@ -1314,6 +1319,18 @@ intel_sdvo_tmds_sink_detect(struct drm_connector *connector) | |||
| 1314 | return status; | 1319 | return status; |
| 1315 | } | 1320 | } |
| 1316 | 1321 | ||
| 1322 | static bool | ||
| 1323 | intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo, | ||
| 1324 | struct edid *edid) | ||
| 1325 | { | ||
| 1326 | bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL); | ||
| 1327 | bool connector_is_digital = !!IS_DIGITAL(sdvo); | ||
| 1328 | |||
| 1329 | DRM_DEBUG_KMS("connector_is_digital? %d, monitor_is_digital? %d\n", | ||
| 1330 | connector_is_digital, monitor_is_digital); | ||
| 1331 | return connector_is_digital == monitor_is_digital; | ||
| 1332 | } | ||
| 1333 | |||
| 1317 | static enum drm_connector_status | 1334 | static enum drm_connector_status |
| 1318 | intel_sdvo_detect(struct drm_connector *connector, bool force) | 1335 | intel_sdvo_detect(struct drm_connector *connector, bool force) |
| 1319 | { | 1336 | { |
| @@ -1358,10 +1375,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) | |||
| 1358 | if (edid == NULL) | 1375 | if (edid == NULL) |
| 1359 | edid = intel_sdvo_get_analog_edid(connector); | 1376 | edid = intel_sdvo_get_analog_edid(connector); |
| 1360 | if (edid != NULL) { | 1377 | if (edid != NULL) { |
| 1361 | if (edid->input & DRM_EDID_INPUT_DIGITAL) | 1378 | if (intel_sdvo_connector_matches_edid(intel_sdvo_connector, |
| 1362 | ret = connector_status_disconnected; | 1379 | edid)) |
| 1363 | else | ||
| 1364 | ret = connector_status_connected; | 1380 | ret = connector_status_connected; |
| 1381 | else | ||
| 1382 | ret = connector_status_disconnected; | ||
| 1383 | |||
| 1365 | connector->display_info.raw_edid = NULL; | 1384 | connector->display_info.raw_edid = NULL; |
| 1366 | kfree(edid); | 1385 | kfree(edid); |
| 1367 | } else | 1386 | } else |
| @@ -1402,11 +1421,8 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) | |||
| 1402 | edid = intel_sdvo_get_analog_edid(connector); | 1421 | edid = intel_sdvo_get_analog_edid(connector); |
| 1403 | 1422 | ||
| 1404 | if (edid != NULL) { | 1423 | if (edid != NULL) { |
| 1405 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); | 1424 | if (intel_sdvo_connector_matches_edid(to_intel_sdvo_connector(connector), |
| 1406 | bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL); | 1425 | edid)) { |
| 1407 | bool connector_is_digital = !!IS_TMDS(intel_sdvo_connector); | ||
| 1408 | |||
| 1409 | if (connector_is_digital == monitor_is_digital) { | ||
| 1410 | drm_mode_connector_update_edid_property(connector, edid); | 1426 | drm_mode_connector_update_edid_property(connector, edid); |
| 1411 | drm_add_edid_modes(connector, edid); | 1427 | drm_add_edid_modes(connector, edid); |
| 1412 | } | 1428 | } |
