diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-14 10:42:14 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-17 03:21:35 -0400 |
commit | a843af186c3157cee58f1cf689385ab906e1f109 (patch) | |
tree | 846f37d4ea194e61938c8e307fbb16c5c2f82775 /drivers | |
parent | b6c7488df68ae3660d81b149b61b55b97929da83 (diff) |
drm/i915: fix hsw uncached pte
They've changed it ... for no apparent reason. Meh.
V2: remove unused 'is_hsw' field.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-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_gtt.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 |
4 files changed, 75 insertions, 37 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_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) |