diff options
author | Dave Airlie <airlied@redhat.com> | 2015-03-09 05:41:15 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-03-09 05:41:15 -0400 |
commit | 8dd0eb3566711d81bfbe2b4421b33f0dd723cec4 (patch) | |
tree | e5567779a5b874d895761d37774a43100c2e77a9 /drivers/gpu/drm/i915/intel_ringbuffer.c | |
parent | d136dfeec84bfe3e4238bacd23f21e161268deac (diff) | |
parent | f89fe1ffe698a6bb7671ebf99f5bb918fda4cf35 (diff) |
Merge tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-intel into drm-next
- Y tiling support for scanout from Tvrtko&Damien
- Remove more UMS support
- some small prep patches for OLR removal from John Harrison
- first few patches for dynamic pagetable allocation from Ben Widawsky, rebased
by tons of other people
- DRRS support patches (Sonika&Vandana)
- fbc patches from Paulo
- make sure our vblank callbacks aren't called when the pipes are off
- various patches all over
* tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-intel: (61 commits)
drm/i915: Update DRIVER_DATE to 20150227
drm/i915: Clarify obj->map_and_fenceable
drm/i915/skl: Allow Y (and Yf) frame buffer creation
drm/i915/skl: Update watermarks for Y tiling
drm/i915/skl: Updated watermark programming
drm/i915/skl: Adjust get_plane_config() to support Yb/Yf tiling
drm/i915/skl: Teach pin_and_fence_fb_obj() about Y tiling constraints
drm/i915/skl: Adjust intel_fb_align_height() for Yb/Yf tiling
drm/i915/skl: Allow scanning out Y and Yf fbs
drm/i915/skl: Add new displayable tiling formats
drm/i915: Remove DRIVER_MODESET checks from modeset code
drm/i915: Remove regfile code&data for UMS suspend/resume
drm/i915: Remove DRIVER_MODESET checks from gem code
drm/i915: Remove DRIVER_MODESET checks in the gpu reset code
drm/i915: Remove DRIVER_MODESET checks from suspend/resume code
drm/i915: Remove DRIVER_MODESET checks in load/unload/close code
drm/i915: fix a printk format
drm/i915: Add media rc6 residency file to sysfs
drm/i915: Add missing description to parameter in alloc_pt_range
drm/i915: Removed the read of RP_STATE_CAP from sysfs/debugfs functions
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 89 |
1 files changed, 73 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index d17e76d32e03..cd79c3843452 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -1002,11 +1002,62 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring) | |||
1002 | return 0; | 1002 | return 0; |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | static int skl_tune_iz_hashing(struct intel_engine_cs *ring) | ||
1006 | { | ||
1007 | struct drm_device *dev = ring->dev; | ||
1008 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1009 | u8 vals[3] = { 0, 0, 0 }; | ||
1010 | unsigned int i; | ||
1011 | |||
1012 | for (i = 0; i < 3; i++) { | ||
1013 | u8 ss; | ||
1014 | |||
1015 | /* | ||
1016 | * Only consider slices where one, and only one, subslice has 7 | ||
1017 | * EUs | ||
1018 | */ | ||
1019 | if (hweight8(dev_priv->info.subslice_7eu[i]) != 1) | ||
1020 | continue; | ||
1021 | |||
1022 | /* | ||
1023 | * subslice_7eu[i] != 0 (because of the check above) and | ||
1024 | * ss_max == 4 (maximum number of subslices possible per slice) | ||
1025 | * | ||
1026 | * -> 0 <= ss <= 3; | ||
1027 | */ | ||
1028 | ss = ffs(dev_priv->info.subslice_7eu[i]) - 1; | ||
1029 | vals[i] = 3 - ss; | ||
1030 | } | ||
1031 | |||
1032 | if (vals[0] == 0 && vals[1] == 0 && vals[2] == 0) | ||
1033 | return 0; | ||
1034 | |||
1035 | /* Tune IZ hashing. See intel_device_info_runtime_init() */ | ||
1036 | WA_SET_FIELD_MASKED(GEN7_GT_MODE, | ||
1037 | GEN9_IZ_HASHING_MASK(2) | | ||
1038 | GEN9_IZ_HASHING_MASK(1) | | ||
1039 | GEN9_IZ_HASHING_MASK(0), | ||
1040 | GEN9_IZ_HASHING(2, vals[2]) | | ||
1041 | GEN9_IZ_HASHING(1, vals[1]) | | ||
1042 | GEN9_IZ_HASHING(0, vals[0])); | ||
1043 | |||
1044 | return 0; | ||
1045 | } | ||
1046 | |||
1047 | |||
1005 | static int skl_init_workarounds(struct intel_engine_cs *ring) | 1048 | static int skl_init_workarounds(struct intel_engine_cs *ring) |
1006 | { | 1049 | { |
1050 | struct drm_device *dev = ring->dev; | ||
1051 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1052 | |||
1007 | gen9_init_workarounds(ring); | 1053 | gen9_init_workarounds(ring); |
1008 | 1054 | ||
1009 | return 0; | 1055 | /* WaDisablePowerCompilerClockGating:skl */ |
1056 | if (INTEL_REVID(dev) == SKL_REVID_B0) | ||
1057 | WA_SET_BIT_MASKED(HIZ_CHICKEN, | ||
1058 | BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE); | ||
1059 | |||
1060 | return skl_tune_iz_hashing(ring); | ||
1010 | } | 1061 | } |
1011 | 1062 | ||
1012 | int init_workarounds_ring(struct intel_engine_cs *ring) | 1063 | int init_workarounds_ring(struct intel_engine_cs *ring) |
@@ -1690,7 +1741,7 @@ gen8_ring_put_irq(struct intel_engine_cs *ring) | |||
1690 | static int | 1741 | static int |
1691 | i965_dispatch_execbuffer(struct intel_engine_cs *ring, | 1742 | i965_dispatch_execbuffer(struct intel_engine_cs *ring, |
1692 | u64 offset, u32 length, | 1743 | u64 offset, u32 length, |
1693 | unsigned flags) | 1744 | unsigned dispatch_flags) |
1694 | { | 1745 | { |
1695 | int ret; | 1746 | int ret; |
1696 | 1747 | ||
@@ -1701,7 +1752,8 @@ i965_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1701 | intel_ring_emit(ring, | 1752 | intel_ring_emit(ring, |
1702 | MI_BATCH_BUFFER_START | | 1753 | MI_BATCH_BUFFER_START | |
1703 | MI_BATCH_GTT | | 1754 | MI_BATCH_GTT | |
1704 | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE_I965)); | 1755 | (dispatch_flags & I915_DISPATCH_SECURE ? |
1756 | 0 : MI_BATCH_NON_SECURE_I965)); | ||
1705 | intel_ring_emit(ring, offset); | 1757 | intel_ring_emit(ring, offset); |
1706 | intel_ring_advance(ring); | 1758 | intel_ring_advance(ring); |
1707 | 1759 | ||
@@ -1714,8 +1766,8 @@ i965_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1714 | #define I830_WA_SIZE max(I830_TLB_ENTRIES*4096, I830_BATCH_LIMIT) | 1766 | #define I830_WA_SIZE max(I830_TLB_ENTRIES*4096, I830_BATCH_LIMIT) |
1715 | static int | 1767 | static int |
1716 | i830_dispatch_execbuffer(struct intel_engine_cs *ring, | 1768 | i830_dispatch_execbuffer(struct intel_engine_cs *ring, |
1717 | u64 offset, u32 len, | 1769 | u64 offset, u32 len, |
1718 | unsigned flags) | 1770 | unsigned dispatch_flags) |
1719 | { | 1771 | { |
1720 | u32 cs_offset = ring->scratch.gtt_offset; | 1772 | u32 cs_offset = ring->scratch.gtt_offset; |
1721 | int ret; | 1773 | int ret; |
@@ -1733,7 +1785,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1733 | intel_ring_emit(ring, MI_NOOP); | 1785 | intel_ring_emit(ring, MI_NOOP); |
1734 | intel_ring_advance(ring); | 1786 | intel_ring_advance(ring); |
1735 | 1787 | ||
1736 | if ((flags & I915_DISPATCH_PINNED) == 0) { | 1788 | if ((dispatch_flags & I915_DISPATCH_PINNED) == 0) { |
1737 | if (len > I830_BATCH_LIMIT) | 1789 | if (len > I830_BATCH_LIMIT) |
1738 | return -ENOSPC; | 1790 | return -ENOSPC; |
1739 | 1791 | ||
@@ -1765,7 +1817,8 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1765 | return ret; | 1817 | return ret; |
1766 | 1818 | ||
1767 | intel_ring_emit(ring, MI_BATCH_BUFFER); | 1819 | intel_ring_emit(ring, MI_BATCH_BUFFER); |
1768 | intel_ring_emit(ring, offset | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE)); | 1820 | intel_ring_emit(ring, offset | (dispatch_flags & I915_DISPATCH_SECURE ? |
1821 | 0 : MI_BATCH_NON_SECURE)); | ||
1769 | intel_ring_emit(ring, offset + len - 8); | 1822 | intel_ring_emit(ring, offset + len - 8); |
1770 | intel_ring_emit(ring, MI_NOOP); | 1823 | intel_ring_emit(ring, MI_NOOP); |
1771 | intel_ring_advance(ring); | 1824 | intel_ring_advance(ring); |
@@ -1776,7 +1829,7 @@ i830_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1776 | static int | 1829 | static int |
1777 | i915_dispatch_execbuffer(struct intel_engine_cs *ring, | 1830 | i915_dispatch_execbuffer(struct intel_engine_cs *ring, |
1778 | u64 offset, u32 len, | 1831 | u64 offset, u32 len, |
1779 | unsigned flags) | 1832 | unsigned dispatch_flags) |
1780 | { | 1833 | { |
1781 | int ret; | 1834 | int ret; |
1782 | 1835 | ||
@@ -1785,7 +1838,8 @@ i915_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
1785 | return ret; | 1838 | return ret; |
1786 | 1839 | ||
1787 | intel_ring_emit(ring, MI_BATCH_BUFFER_START | MI_BATCH_GTT); | 1840 | intel_ring_emit(ring, MI_BATCH_BUFFER_START | MI_BATCH_GTT); |
1788 | intel_ring_emit(ring, offset | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE)); | 1841 | intel_ring_emit(ring, offset | (dispatch_flags & I915_DISPATCH_SECURE ? |
1842 | 0 : MI_BATCH_NON_SECURE)); | ||
1789 | intel_ring_advance(ring); | 1843 | intel_ring_advance(ring); |
1790 | 1844 | ||
1791 | return 0; | 1845 | return 0; |
@@ -2176,6 +2230,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring) | |||
2176 | 2230 | ||
2177 | kref_init(&request->ref); | 2231 | kref_init(&request->ref); |
2178 | request->ring = ring; | 2232 | request->ring = ring; |
2233 | request->ringbuf = ring->buffer; | ||
2179 | request->uniq = dev_private->request_uniq++; | 2234 | request->uniq = dev_private->request_uniq++; |
2180 | 2235 | ||
2181 | ret = i915_gem_get_seqno(ring->dev, &request->seqno); | 2236 | ret = i915_gem_get_seqno(ring->dev, &request->seqno); |
@@ -2352,9 +2407,10 @@ static int gen6_bsd_ring_flush(struct intel_engine_cs *ring, | |||
2352 | static int | 2407 | static int |
2353 | gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | 2408 | gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring, |
2354 | u64 offset, u32 len, | 2409 | u64 offset, u32 len, |
2355 | unsigned flags) | 2410 | unsigned dispatch_flags) |
2356 | { | 2411 | { |
2357 | bool ppgtt = USES_PPGTT(ring->dev) && !(flags & I915_DISPATCH_SECURE); | 2412 | bool ppgtt = USES_PPGTT(ring->dev) && |
2413 | !(dispatch_flags & I915_DISPATCH_SECURE); | ||
2358 | int ret; | 2414 | int ret; |
2359 | 2415 | ||
2360 | ret = intel_ring_begin(ring, 4); | 2416 | ret = intel_ring_begin(ring, 4); |
@@ -2373,8 +2429,8 @@ gen8_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
2373 | 2429 | ||
2374 | static int | 2430 | static int |
2375 | hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | 2431 | hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, |
2376 | u64 offset, u32 len, | 2432 | u64 offset, u32 len, |
2377 | unsigned flags) | 2433 | unsigned dispatch_flags) |
2378 | { | 2434 | { |
2379 | int ret; | 2435 | int ret; |
2380 | 2436 | ||
@@ -2384,7 +2440,7 @@ hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
2384 | 2440 | ||
2385 | intel_ring_emit(ring, | 2441 | intel_ring_emit(ring, |
2386 | MI_BATCH_BUFFER_START | | 2442 | MI_BATCH_BUFFER_START | |
2387 | (flags & I915_DISPATCH_SECURE ? | 2443 | (dispatch_flags & I915_DISPATCH_SECURE ? |
2388 | 0 : MI_BATCH_PPGTT_HSW | MI_BATCH_NON_SECURE_HSW)); | 2444 | 0 : MI_BATCH_PPGTT_HSW | MI_BATCH_NON_SECURE_HSW)); |
2389 | /* bit0-7 is the length on GEN6+ */ | 2445 | /* bit0-7 is the length on GEN6+ */ |
2390 | intel_ring_emit(ring, offset); | 2446 | intel_ring_emit(ring, offset); |
@@ -2396,7 +2452,7 @@ hsw_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
2396 | static int | 2452 | static int |
2397 | gen6_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | 2453 | gen6_ring_dispatch_execbuffer(struct intel_engine_cs *ring, |
2398 | u64 offset, u32 len, | 2454 | u64 offset, u32 len, |
2399 | unsigned flags) | 2455 | unsigned dispatch_flags) |
2400 | { | 2456 | { |
2401 | int ret; | 2457 | int ret; |
2402 | 2458 | ||
@@ -2406,7 +2462,8 @@ gen6_ring_dispatch_execbuffer(struct intel_engine_cs *ring, | |||
2406 | 2462 | ||
2407 | intel_ring_emit(ring, | 2463 | intel_ring_emit(ring, |
2408 | MI_BATCH_BUFFER_START | | 2464 | MI_BATCH_BUFFER_START | |
2409 | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE_I965)); | 2465 | (dispatch_flags & I915_DISPATCH_SECURE ? |
2466 | 0 : MI_BATCH_NON_SECURE_I965)); | ||
2410 | /* bit0-7 is the length on GEN6+ */ | 2467 | /* bit0-7 is the length on GEN6+ */ |
2411 | intel_ring_emit(ring, offset); | 2468 | intel_ring_emit(ring, offset); |
2412 | intel_ring_advance(ring); | 2469 | intel_ring_advance(ring); |