diff options
author | Dave Airlie <airlied@redhat.com> | 2012-08-21 19:19:40 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-08-21 19:19:40 -0400 |
commit | 85119c16b34526b2b3c33b01ac6d770aa4431434 (patch) | |
tree | 6516fb3ac367a1296a21d6e0062b74985f8c0f45 | |
parent | e2be2cd8046748a006c4afa40959855fe4079274 (diff) | |
parent | 1ee9ae3244c4789f3184c5123f3b2d7e405b3f4c (diff) |
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Daniel writes:
" Nothing too major:
- A few fixes around the edid handling from Jani, also fixing a regression
in 3.5 due to us using gmbus by default.
- Fixup hsw uncached pte flags.
- Fix suspend/resume crash when using hw contexts, from Ben.
- Try to tune gpu turbo a bit better, seems to help with some oddball
power regressions."
* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
drm/i915: use hsw rps tuning values everywhere on gen6+
drm/i915: fall back to bit-banging if GMBUS fails in CRT EDID reads
drm/i915: extract connector update from intel_ddc_get_modes() for reuse
drm/i915: fix hsw uncached pte
drm/i915/contexts: fix list corruption
drm/i915: fix EDID memory leak in SDVO
-rw-r--r-- | drivers/char/agp/intel-agp.h | 1 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 105 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 36 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_modes.c | 31 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 1 |
10 files changed, 141 insertions, 64 deletions
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index 6f007b6c240d..6ec0fff79bc2 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
@@ -64,6 +64,7 @@ | |||
64 | #define I830_PTE_SYSTEM_CACHED 0x00000006 | 64 | #define I830_PTE_SYSTEM_CACHED 0x00000006 |
65 | /* GT PTE cache control fields */ | 65 | /* GT PTE cache control fields */ |
66 | #define GEN6_PTE_UNCACHED 0x00000002 | 66 | #define GEN6_PTE_UNCACHED 0x00000002 |
67 | #define HSW_PTE_UNCACHED 0x00000000 | ||
67 | #define GEN6_PTE_LLC 0x00000004 | 68 | #define GEN6_PTE_LLC 0x00000004 |
68 | #define GEN6_PTE_LLC_MLC 0x00000006 | 69 | #define GEN6_PTE_LLC_MLC 0x00000006 |
69 | #define GEN6_PTE_GFDT 0x00000008 | 70 | #define GEN6_PTE_GFDT 0x00000008 |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 08fc5cbb13cd..58e32f7c3229 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1156,6 +1156,30 @@ static bool gen6_check_flags(unsigned int flags) | |||
1156 | return true; | 1156 | return true; |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static void haswell_write_entry(dma_addr_t addr, unsigned int entry, | ||
1160 | unsigned int flags) | ||
1161 | { | ||
1162 | unsigned int type_mask = flags & ~AGP_USER_CACHED_MEMORY_GFDT; | ||
1163 | unsigned int gfdt = flags & AGP_USER_CACHED_MEMORY_GFDT; | ||
1164 | u32 pte_flags; | ||
1165 | |||
1166 | if (type_mask == AGP_USER_MEMORY) | ||
1167 | pte_flags = HSW_PTE_UNCACHED | I810_PTE_VALID; | ||
1168 | else if (type_mask == AGP_USER_CACHED_MEMORY_LLC_MLC) { | ||
1169 | pte_flags = GEN6_PTE_LLC_MLC | I810_PTE_VALID; | ||
1170 | if (gfdt) | ||
1171 | pte_flags |= GEN6_PTE_GFDT; | ||
1172 | } else { /* set 'normal'/'cached' to LLC by default */ | ||
1173 | pte_flags = GEN6_PTE_LLC | I810_PTE_VALID; | ||
1174 | if (gfdt) | ||
1175 | pte_flags |= GEN6_PTE_GFDT; | ||
1176 | } | ||
1177 | |||
1178 | /* gen6 has bit11-4 for physical addr bit39-32 */ | ||
1179 | addr |= (addr >> 28) & 0xff0; | ||
1180 | writel(addr | pte_flags, intel_private.gtt + entry); | ||
1181 | } | ||
1182 | |||
1159 | static void gen6_write_entry(dma_addr_t addr, unsigned int entry, | 1183 | static void gen6_write_entry(dma_addr_t addr, unsigned int entry, |
1160 | unsigned int flags) | 1184 | unsigned int flags) |
1161 | { | 1185 | { |
@@ -1382,6 +1406,15 @@ static const struct intel_gtt_driver sandybridge_gtt_driver = { | |||
1382 | .check_flags = gen6_check_flags, | 1406 | .check_flags = gen6_check_flags, |
1383 | .chipset_flush = i9xx_chipset_flush, | 1407 | .chipset_flush = i9xx_chipset_flush, |
1384 | }; | 1408 | }; |
1409 | static const struct intel_gtt_driver haswell_gtt_driver = { | ||
1410 | .gen = 6, | ||
1411 | .setup = i9xx_setup, | ||
1412 | .cleanup = gen6_cleanup, | ||
1413 | .write_entry = haswell_write_entry, | ||
1414 | .dma_mask_size = 40, | ||
1415 | .check_flags = gen6_check_flags, | ||
1416 | .chipset_flush = i9xx_chipset_flush, | ||
1417 | }; | ||
1385 | static const struct intel_gtt_driver valleyview_gtt_driver = { | 1418 | static const struct intel_gtt_driver valleyview_gtt_driver = { |
1386 | .gen = 7, | 1419 | .gen = 7, |
1387 | .setup = i9xx_setup, | 1420 | .setup = i9xx_setup, |
@@ -1499,77 +1532,77 @@ static const struct intel_gtt_driver_description { | |||
1499 | { PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG, | 1532 | { PCI_DEVICE_ID_INTEL_VALLEYVIEW_IG, |
1500 | "ValleyView", &valleyview_gtt_driver }, | 1533 | "ValleyView", &valleyview_gtt_driver }, |
1501 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT1_IG, | 1534 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT1_IG, |
1502 | "Haswell", &sandybridge_gtt_driver }, | 1535 | "Haswell", &haswell_gtt_driver }, |
1503 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_IG, | 1536 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_IG, |
1504 | "Haswell", &sandybridge_gtt_driver }, | 1537 | "Haswell", &haswell_gtt_driver }, |
1505 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_PLUS_IG, | 1538 | { PCI_DEVICE_ID_INTEL_HASWELL_D_GT2_PLUS_IG, |
1506 | "Haswell", &sandybridge_gtt_driver }, | 1539 | "Haswell", &haswell_gtt_driver }, |
1507 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT1_IG, | 1540 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT1_IG, |
1508 | "Haswell", &sandybridge_gtt_driver }, | 1541 | "Haswell", &haswell_gtt_driver }, |
1509 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_IG, | 1542 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_IG, |
1510 | "Haswell", &sandybridge_gtt_driver }, | 1543 | "Haswell", &haswell_gtt_driver }, |
1511 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_PLUS_IG, | 1544 | { PCI_DEVICE_ID_INTEL_HASWELL_M_GT2_PLUS_IG, |
1512 | "Haswell", &sandybridge_gtt_driver }, | 1545 | "Haswell", &haswell_gtt_driver }, |
1513 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT1_IG, | 1546 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT1_IG, |
1514 | "Haswell", &sandybridge_gtt_driver }, | 1547 | "Haswell", &haswell_gtt_driver }, |
1515 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_IG, | 1548 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_IG, |
1516 | "Haswell", &sandybridge_gtt_driver }, | 1549 | "Haswell", &haswell_gtt_driver }, |
1517 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_PLUS_IG, | 1550 | { PCI_DEVICE_ID_INTEL_HASWELL_S_GT2_PLUS_IG, |
1518 | "Haswell", &sandybridge_gtt_driver }, | 1551 | "Haswell", &haswell_gtt_driver }, |
1519 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT1_IG, | 1552 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT1_IG, |
1520 | "Haswell", &sandybridge_gtt_driver }, | 1553 | "Haswell", &haswell_gtt_driver }, |
1521 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT2_IG, | 1554 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT2_IG, |
1522 | "Haswell", &sandybridge_gtt_driver }, | 1555 | "Haswell", &haswell_gtt_driver }, |
1523 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT2_PLUS_IG, | 1556 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_D_GT2_PLUS_IG, |
1524 | "Haswell", &sandybridge_gtt_driver }, | 1557 | "Haswell", &haswell_gtt_driver }, |
1525 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT1_IG, | 1558 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT1_IG, |
1526 | "Haswell", &sandybridge_gtt_driver }, | 1559 | "Haswell", &haswell_gtt_driver }, |
1527 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT2_IG, | 1560 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT2_IG, |
1528 | "Haswell", &sandybridge_gtt_driver }, | 1561 | "Haswell", &haswell_gtt_driver }, |
1529 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT2_PLUS_IG, | 1562 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_M_GT2_PLUS_IG, |
1530 | "Haswell", &sandybridge_gtt_driver }, | 1563 | "Haswell", &haswell_gtt_driver }, |
1531 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT1_IG, | 1564 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT1_IG, |
1532 | "Haswell", &sandybridge_gtt_driver }, | 1565 | "Haswell", &haswell_gtt_driver }, |
1533 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT2_IG, | 1566 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT2_IG, |
1534 | "Haswell", &sandybridge_gtt_driver }, | 1567 | "Haswell", &haswell_gtt_driver }, |
1535 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT2_PLUS_IG, | 1568 | { PCI_DEVICE_ID_INTEL_HASWELL_SDV_S_GT2_PLUS_IG, |
1536 | "Haswell", &sandybridge_gtt_driver }, | 1569 | "Haswell", &haswell_gtt_driver }, |
1537 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT1_IG, | 1570 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT1_IG, |
1538 | "Haswell", &sandybridge_gtt_driver }, | 1571 | "Haswell", &haswell_gtt_driver }, |
1539 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT2_IG, | 1572 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT2_IG, |
1540 | "Haswell", &sandybridge_gtt_driver }, | 1573 | "Haswell", &haswell_gtt_driver }, |
1541 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT2_PLUS_IG, | 1574 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_D_GT2_PLUS_IG, |
1542 | "Haswell", &sandybridge_gtt_driver }, | 1575 | "Haswell", &haswell_gtt_driver }, |
1543 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT1_IG, | 1576 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT1_IG, |
1544 | "Haswell", &sandybridge_gtt_driver }, | 1577 | "Haswell", &haswell_gtt_driver }, |
1545 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT2_IG, | 1578 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT2_IG, |
1546 | "Haswell", &sandybridge_gtt_driver }, | 1579 | "Haswell", &haswell_gtt_driver }, |
1547 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT2_PLUS_IG, | 1580 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_M_GT2_PLUS_IG, |
1548 | "Haswell", &sandybridge_gtt_driver }, | 1581 | "Haswell", &haswell_gtt_driver }, |
1549 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT1_IG, | 1582 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT1_IG, |
1550 | "Haswell", &sandybridge_gtt_driver }, | 1583 | "Haswell", &haswell_gtt_driver }, |
1551 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT2_IG, | 1584 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT2_IG, |
1552 | "Haswell", &sandybridge_gtt_driver }, | 1585 | "Haswell", &haswell_gtt_driver }, |
1553 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT2_PLUS_IG, | 1586 | { PCI_DEVICE_ID_INTEL_HASWELL_ULT_S_GT2_PLUS_IG, |
1554 | "Haswell", &sandybridge_gtt_driver }, | 1587 | "Haswell", &haswell_gtt_driver }, |
1555 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT1_IG, | 1588 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT1_IG, |
1556 | "Haswell", &sandybridge_gtt_driver }, | 1589 | "Haswell", &haswell_gtt_driver }, |
1557 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT2_IG, | 1590 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT2_IG, |
1558 | "Haswell", &sandybridge_gtt_driver }, | 1591 | "Haswell", &haswell_gtt_driver }, |
1559 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT2_PLUS_IG, | 1592 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_D_GT2_PLUS_IG, |
1560 | "Haswell", &sandybridge_gtt_driver }, | 1593 | "Haswell", &haswell_gtt_driver }, |
1561 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT1_IG, | 1594 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT1_IG, |
1562 | "Haswell", &sandybridge_gtt_driver }, | 1595 | "Haswell", &haswell_gtt_driver }, |
1563 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT2_IG, | 1596 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT2_IG, |
1564 | "Haswell", &sandybridge_gtt_driver }, | 1597 | "Haswell", &haswell_gtt_driver }, |
1565 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT2_PLUS_IG, | 1598 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_M_GT2_PLUS_IG, |
1566 | "Haswell", &sandybridge_gtt_driver }, | 1599 | "Haswell", &haswell_gtt_driver }, |
1567 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT1_IG, | 1600 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT1_IG, |
1568 | "Haswell", &sandybridge_gtt_driver }, | 1601 | "Haswell", &haswell_gtt_driver }, |
1569 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT2_IG, | 1602 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT2_IG, |
1570 | "Haswell", &sandybridge_gtt_driver }, | 1603 | "Haswell", &haswell_gtt_driver }, |
1571 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT2_PLUS_IG, | 1604 | { PCI_DEVICE_ID_INTEL_HASWELL_CRW_S_GT2_PLUS_IG, |
1572 | "Haswell", &sandybridge_gtt_driver }, | 1605 | "Haswell", &haswell_gtt_driver }, |
1573 | { 0, NULL, NULL } | 1606 | { 0, NULL, NULL } |
1574 | }; | 1607 | }; |
1575 | 1608 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 5c4657a54f97..489e2b162b27 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2365,6 +2365,10 @@ int i915_gpu_idle(struct drm_device *dev) | |||
2365 | 2365 | ||
2366 | /* Flush everything onto the inactive list. */ | 2366 | /* Flush everything onto the inactive list. */ |
2367 | for_each_ring(ring, dev_priv, i) { | 2367 | for_each_ring(ring, dev_priv, i) { |
2368 | ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID); | ||
2369 | if (ret) | ||
2370 | return ret; | ||
2371 | |||
2368 | ret = i915_ring_idle(ring); | 2372 | ret = i915_ring_idle(ring); |
2369 | if (ret) | 2373 | if (ret) |
2370 | return ret; | 2374 | return ret; |
@@ -2372,10 +2376,6 @@ int i915_gpu_idle(struct drm_device *dev) | |||
2372 | /* Is the device fubar? */ | 2376 | /* Is the device fubar? */ |
2373 | if (WARN_ON(!list_empty(&ring->gpu_write_list))) | 2377 | if (WARN_ON(!list_empty(&ring->gpu_write_list))) |
2374 | return -EBUSY; | 2378 | return -EBUSY; |
2375 | |||
2376 | ret = i915_switch_context(ring, NULL, DEFAULT_CONTEXT_ID); | ||
2377 | if (ret) | ||
2378 | return ret; | ||
2379 | } | 2379 | } |
2380 | 2380 | ||
2381 | return 0; | 2381 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index ee9b68f6bc36..d9a5372ec56f 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -261,7 +261,10 @@ void i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt, | |||
261 | pte_flags |= GEN6_PTE_CACHE_LLC; | 261 | pte_flags |= GEN6_PTE_CACHE_LLC; |
262 | break; | 262 | break; |
263 | case I915_CACHE_NONE: | 263 | case I915_CACHE_NONE: |
264 | pte_flags |= GEN6_PTE_UNCACHED; | 264 | if (IS_HASWELL(dev)) |
265 | pte_flags |= HSW_PTE_UNCACHED; | ||
266 | else | ||
267 | pte_flags |= GEN6_PTE_UNCACHED; | ||
265 | break; | 268 | break; |
266 | default: | 269 | default: |
267 | BUG(); | 270 | BUG(); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index acc99b21e0b6..28725ce5b82c 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -115,6 +115,7 @@ | |||
115 | 115 | ||
116 | #define GEN6_PTE_VALID (1 << 0) | 116 | #define GEN6_PTE_VALID (1 << 0) |
117 | #define GEN6_PTE_UNCACHED (1 << 1) | 117 | #define GEN6_PTE_UNCACHED (1 << 1) |
118 | #define HSW_PTE_UNCACHED (0) | ||
118 | #define GEN6_PTE_CACHE_LLC (2 << 1) | 119 | #define GEN6_PTE_CACHE_LLC (2 << 1) |
119 | #define GEN6_PTE_CACHE_LLC_MLC (3 << 1) | 120 | #define GEN6_PTE_CACHE_LLC_MLC (3 << 1) |
120 | #define GEN6_PTE_CACHE_BITS (3 << 1) | 121 | #define GEN6_PTE_CACHE_BITS (3 << 1) |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 7ed4a41c3965..23bdc8cd1458 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -326,6 +326,36 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
326 | return ret; | 326 | return ret; |
327 | } | 327 | } |
328 | 328 | ||
329 | static struct edid *intel_crt_get_edid(struct drm_connector *connector, | ||
330 | struct i2c_adapter *i2c) | ||
331 | { | ||
332 | struct edid *edid; | ||
333 | |||
334 | edid = drm_get_edid(connector, i2c); | ||
335 | |||
336 | if (!edid && !intel_gmbus_is_forced_bit(i2c)) { | ||
337 | DRM_DEBUG_KMS("CRT GMBUS EDID read failed, retry using GPIO bit-banging\n"); | ||
338 | intel_gmbus_force_bit(i2c, true); | ||
339 | edid = drm_get_edid(connector, i2c); | ||
340 | intel_gmbus_force_bit(i2c, false); | ||
341 | } | ||
342 | |||
343 | return edid; | ||
344 | } | ||
345 | |||
346 | /* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */ | ||
347 | static int intel_crt_ddc_get_modes(struct drm_connector *connector, | ||
348 | struct i2c_adapter *adapter) | ||
349 | { | ||
350 | struct edid *edid; | ||
351 | |||
352 | edid = intel_crt_get_edid(connector, adapter); | ||
353 | if (!edid) | ||
354 | return 0; | ||
355 | |||
356 | return intel_connector_update_modes(connector, edid); | ||
357 | } | ||
358 | |||
329 | static bool intel_crt_detect_ddc(struct drm_connector *connector) | 359 | static bool intel_crt_detect_ddc(struct drm_connector *connector) |
330 | { | 360 | { |
331 | struct intel_crt *crt = intel_attached_crt(connector); | 361 | struct intel_crt *crt = intel_attached_crt(connector); |
@@ -336,7 +366,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) | |||
336 | BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); | 366 | BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); |
337 | 367 | ||
338 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); | 368 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); |
339 | edid = drm_get_edid(connector, i2c); | 369 | edid = intel_crt_get_edid(connector, i2c); |
340 | 370 | ||
341 | if (edid) { | 371 | if (edid) { |
342 | bool is_digital = edid->input & DRM_EDID_INPUT_DIGITAL; | 372 | bool is_digital = edid->input & DRM_EDID_INPUT_DIGITAL; |
@@ -544,13 +574,13 @@ static int intel_crt_get_modes(struct drm_connector *connector) | |||
544 | struct i2c_adapter *i2c; | 574 | struct i2c_adapter *i2c; |
545 | 575 | ||
546 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); | 576 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); |
547 | ret = intel_ddc_get_modes(connector, i2c); | 577 | ret = intel_crt_ddc_get_modes(connector, i2c); |
548 | if (ret || !IS_G4X(dev)) | 578 | if (ret || !IS_G4X(dev)) |
549 | return ret; | 579 | return ret; |
550 | 580 | ||
551 | /* Try to probe digital port for output in DVI-I -> VGA mode. */ | 581 | /* Try to probe digital port for output in DVI-I -> VGA mode. */ |
552 | i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB); | 582 | i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB); |
553 | return intel_ddc_get_modes(connector, i2c); | 583 | return intel_crt_ddc_get_modes(connector, i2c); |
554 | } | 584 | } |
555 | 585 | ||
556 | static int intel_crt_set_property(struct drm_connector *connector, | 586 | static int intel_crt_set_property(struct drm_connector *connector, |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 132ab511b90c..cd54cf88a28f 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -342,6 +342,8 @@ struct intel_fbc_work { | |||
342 | int interval; | 342 | int interval; |
343 | }; | 343 | }; |
344 | 344 | ||
345 | int intel_connector_update_modes(struct drm_connector *connector, | ||
346 | struct edid *edid); | ||
345 | int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); | 347 | int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); |
346 | 348 | ||
347 | extern void intel_attach_force_audio_property(struct drm_connector *connector); | 349 | extern void intel_attach_force_audio_property(struct drm_connector *connector); |
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c index 45848b9b670b..29b72593fbb2 100644 --- a/drivers/gpu/drm/i915/intel_modes.c +++ b/drivers/gpu/drm/i915/intel_modes.c | |||
@@ -33,6 +33,25 @@ | |||
33 | #include "i915_drv.h" | 33 | #include "i915_drv.h" |
34 | 34 | ||
35 | /** | 35 | /** |
36 | * intel_connector_update_modes - update connector from edid | ||
37 | * @connector: DRM connector device to use | ||
38 | * @edid: previously read EDID information | ||
39 | */ | ||
40 | int intel_connector_update_modes(struct drm_connector *connector, | ||
41 | struct edid *edid) | ||
42 | { | ||
43 | int ret; | ||
44 | |||
45 | drm_mode_connector_update_edid_property(connector, edid); | ||
46 | ret = drm_add_edid_modes(connector, edid); | ||
47 | drm_edid_to_eld(connector, edid); | ||
48 | connector->display_info.raw_edid = NULL; | ||
49 | kfree(edid); | ||
50 | |||
51 | return ret; | ||
52 | } | ||
53 | |||
54 | /** | ||
36 | * intel_ddc_get_modes - get modelist from monitor | 55 | * intel_ddc_get_modes - get modelist from monitor |
37 | * @connector: DRM connector device to use | 56 | * @connector: DRM connector device to use |
38 | * @adapter: i2c adapter | 57 | * @adapter: i2c adapter |
@@ -43,18 +62,12 @@ int intel_ddc_get_modes(struct drm_connector *connector, | |||
43 | struct i2c_adapter *adapter) | 62 | struct i2c_adapter *adapter) |
44 | { | 63 | { |
45 | struct edid *edid; | 64 | struct edid *edid; |
46 | int ret = 0; | ||
47 | 65 | ||
48 | edid = drm_get_edid(connector, adapter); | 66 | edid = drm_get_edid(connector, adapter); |
49 | if (edid) { | 67 | if (!edid) |
50 | drm_mode_connector_update_edid_property(connector, edid); | 68 | return 0; |
51 | ret = drm_add_edid_modes(connector, edid); | ||
52 | drm_edid_to_eld(connector, edid); | ||
53 | connector->display_info.raw_edid = NULL; | ||
54 | kfree(edid); | ||
55 | } | ||
56 | 69 | ||
57 | return ret; | 70 | return intel_connector_update_modes(connector, edid); |
58 | } | 71 | } |
59 | 72 | ||
60 | static const struct drm_prop_enum_list force_audio_names[] = { | 73 | static const struct drm_prop_enum_list force_audio_names[] = { |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 58c07cdafb7e..1881c8c83f0e 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -2441,17 +2441,10 @@ static void gen6_enable_rps(struct drm_device *dev) | |||
2441 | dev_priv->max_delay << 24 | | 2441 | dev_priv->max_delay << 24 | |
2442 | dev_priv->min_delay << 16); | 2442 | dev_priv->min_delay << 16); |
2443 | 2443 | ||
2444 | if (IS_HASWELL(dev)) { | 2444 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400); |
2445 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400); | 2445 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000); |
2446 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000); | 2446 | I915_WRITE(GEN6_RP_UP_EI, 66000); |
2447 | I915_WRITE(GEN6_RP_UP_EI, 66000); | 2447 | I915_WRITE(GEN6_RP_DOWN_EI, 350000); |
2448 | I915_WRITE(GEN6_RP_DOWN_EI, 350000); | ||
2449 | } else { | ||
2450 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 10000); | ||
2451 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 1000000); | ||
2452 | I915_WRITE(GEN6_RP_UP_EI, 100000); | ||
2453 | I915_WRITE(GEN6_RP_DOWN_EI, 5000000); | ||
2454 | } | ||
2455 | 2448 | ||
2456 | I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); | 2449 | I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); |
2457 | I915_WRITE(GEN6_RP_CONTROL, | 2450 | I915_WRITE(GEN6_RP_CONTROL, |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index d172e9873131..d81bb0bf2885 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1692,6 +1692,7 @@ static bool intel_sdvo_detect_hdmi_audio(struct drm_connector *connector) | |||
1692 | edid = intel_sdvo_get_edid(connector); | 1692 | edid = intel_sdvo_get_edid(connector); |
1693 | if (edid != NULL && edid->input & DRM_EDID_INPUT_DIGITAL) | 1693 | if (edid != NULL && edid->input & DRM_EDID_INPUT_DIGITAL) |
1694 | has_audio = drm_detect_monitor_audio(edid); | 1694 | has_audio = drm_detect_monitor_audio(edid); |
1695 | kfree(edid); | ||
1695 | 1696 | ||
1696 | return has_audio; | 1697 | return has_audio; |
1697 | } | 1698 | } |