<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/i915/gt/intel_ringbuffer.c, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-10-24T11:14:21Z</updated>
<entry>
<title>drm/i915/gt: Split intel_ring_submission</title>
<updated>2019-10-24T11:14:21Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-10-24T10:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2871ea85c119e6fb1127b30f0061436b285d3a2c'/>
<id>urn:sha1:2871ea85c119e6fb1127b30f0061436b285d3a2c</id>
<content type='text'>
Split the legacy submission backend from the common CS ring buffer
handling.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191024100344.5041-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915/gt: Convert the leftover for_each_engine(gt)</title>
<updated>2019-10-18T13:53:48Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-10-18T11:53:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6e07ada8eaa3ff66868a8bd6b1b9cdfa6d9fe21'/>
<id>urn:sha1:c6e07ada8eaa3ff66868a8bd6b1b9cdfa6d9fe21</id>
<content type='text'>
Use the local gt for iterating over the available set of engines.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191018115331.8980-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915/stolen: make the object creation interface consistent</title>
<updated>2019-10-04T18:27:41Z</updated>
<author>
<name>CQ Tang</name>
<email>cq.tang@intel.com</email>
</author>
<published>2019-10-04T17:04:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e5493cab5ef90fb91f89a2dc84259c7a7d7fd50'/>
<id>urn:sha1:0e5493cab5ef90fb91f89a2dc84259c7a7d7fd50</id>
<content type='text'>
Our other backends return an actual error value upon failure. Do the
same for stolen objects, which currently just return NULL on failure.

Signed-off-by: CQ Tang &lt;cq.tang@intel.com&gt;
Signed-off-by: Matthew Auld &lt;matthew.auld@intel.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191004170452.15410-2-matthew.auld@intel.com
</content>
</entry>
<entry>
<title>drm/i915: Pull i915_vma_pin under the vm-&gt;mutex</title>
<updated>2019-10-04T14:39:02Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-10-04T13:39:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2850748ef8763ab46958e43a4d1c445f29eeb37d'/>
<id>urn:sha1:2850748ef8763ab46958e43a4d1c445f29eeb37d</id>
<content type='text'>
Replace the struct_mutex requirement for pinning the i915_vma with the
local vm-&gt;mutex instead. Note that the vm-&gt;mutex is tainted by the
shrinker (we require unbinding from inside fs-reclaim) and so we cannot
allocate while holding that mutex. Instead we have to preallocate
workers to do allocate and apply the PTE updates after we have we
reserved their slot in the drm_mm (using fences to order the PTE writes
with the GPU work and with later unbind).

In adding the asynchronous vma binding, one subtle requirement is to
avoid coupling the binding fence into the backing object-&gt;resv. That is
the asynchronous binding only applies to the vma timeline itself and not
to the pages as that is a more global timeline (the binding of one vma
does not need to be ordered with another vma, nor does the implicit GEM
fencing depend on a vma, only on writes to the backing store). Keeping
the vma binding distinct from the backing store timelines is verified by
a number of async gem_exec_fence and gem_exec_schedule tests. The way we
do this is quite simple, we keep the fence for the vma binding separate
and only wait on it as required, and never add it to the obj-&gt;resv
itself.

Another consequence in reducing the locking around the vma is the
destruction of the vma is no longer globally serialised by struct_mutex.
A natural solution would be to add a kref to i915_vma, but that requires
decoupling the reference cycles, possibly by introducing a new
i915_mm_pages object that is own by both obj-&gt;mm and vma-&gt;pages.
However, we have not taken that route due to the overshadowing lmem/ttm
discussions, and instead play a series of complicated games with
trylocks to (hopefully) ensure that only one destruction path is called!

v2: Add some commentary, and some helpers to reduce patch churn.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-4-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Mark i915_request.timeline as a volatile, rcu pointer</title>
<updated>2019-09-20T09:24:09Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-09-19T11:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d19d71fc2b15bf30ff3e56932eae23ff096c1396'/>
<id>urn:sha1:d19d71fc2b15bf30ff3e56932eae23ff096c1396</id>
<content type='text'>
The request-&gt;timeline is only valid until the request is retired (i.e.
before it is completed). Upon retiring the request, the context may be
unpinned and freed, and along with it the timeline may be freed. We
therefore need to be very careful when chasing rq-&gt;timeline that the
pointer does not disappear beneath us. The vast majority of users are in
a protected context, either during request construction or retirement,
where the timeline-&gt;mutex is held and the timeline cannot disappear. It
is those few off the beaten path (where we access a second timeline) that
need extra scrutiny -- to be added in the next patch after first adding
the warnings about dangerous access.

One complication, where we cannot use the timeline-&gt;mutex itself, is
during request submission onto hardware (under spinlocks). Here, we want
to check on the timeline to finalize the breadcrumb, and so we need to
impose a second rule to ensure that the request-&gt;timeline is indeed
valid. As we are submitting the request, it's context and timeline must
be pinned, as it will be used by the hardware. Since it is pinned, we
know the request-&gt;timeline must still be valid, and we cannot submit the
idle barrier until after we release the engine-&gt;active.lock, ergo while
submitting and holding that spinlock, a second thread cannot release the
timeline.

v2: Don't be lazy inside selftests; hold the timeline-&gt;mutex for as long
as we need it, and tidy up acquiring the timeline with a bit of
refactoring (i915_active_add_request)

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190919111912.21631-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Extend Haswell GT1 PSMI workaround to all</title>
<updated>2019-09-18T11:01:53Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-09-17T19:47:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56c05de6bd773b96deca379370965c49042b5fbf'/>
<id>urn:sha1:56c05de6bd773b96deca379370965c49042b5fbf</id>
<content type='text'>
A few times in CI, we have detected a GPU hang on our Haswell GT2
systems with the characteristic IPEHR of 0x780c0000. When the PSMI w/a
was first introducted, it was applied to all Haswell, but later on we
found an erratum that supposedly restricted the issue to GT1 and so
constrained it only be applied on GT1. That may have been a mistake...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111692
Fixes: 167bc759e823 ("drm/i915: Restrict PSMI context load w/a to Haswell GT1")
References: 2c550183476d ("drm/i915: Disable PSMI sleep messages on all rings around context switches")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Acked-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190917194746.26710-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915/ringbuffer: Flush writes before RING_TAIL update</title>
<updated>2019-09-10T10:48:13Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-09-09T11:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0efa99dd58754d23e884b9ba41cd601f01b58c3d'/>
<id>urn:sha1:0efa99dd58754d23e884b9ba41cd601f01b58c3d</id>
<content type='text'>
Be paranoid and make sure we flush any and all writes out of the WCB
before performing the UC mmio to update the RING_TAIL. (An UC write
should itself be enough to do the flush, hence the paranoia here.) Quite
infrequently, we see problems where the GPU seems to overshoot the
RING_TAIL and so executes garbage, hence the speculation.

References: https://bugs.freedesktop.org/show_bug.cgi?id=111598
References: https://bugs.freedesktop.org/show_bug.cgi?id=111417
References: https://bugs.freedesktop.org/show_bug.cgi?id=111034
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190909113018.13300-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915/gtt: Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt</title>
<updated>2019-08-30T19:49:55Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-08-30T17:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3dc007fe9b2b256d2779bb9e9a0d372eb1d90643'/>
<id>urn:sha1:3dc007fe9b2b256d2779bb9e9a0d372eb1d90643</id>
<content type='text'>
With the upcoming change in timing (dramatically reducing the latency
between manipulating the ppGTT and execution), no amount of tweaking
could save Baytrail, it would always fail to invalidate its TLB. Ville
was right, Baytrail is beyond hope.

v2: Rollback on all gen7; same timing instability on TLB invalidation.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Acked-by: Matthew Auld &lt;matthew.auld@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190830180000.24608-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Always wrap the ring offset before resetting</title>
<updated>2019-08-19T08:51:02Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-08-19T07:58:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a736ebf314a0b0813bae248ad3daa9154463798'/>
<id>urn:sha1:6a736ebf314a0b0813bae248ad3daa9154463798</id>
<content type='text'>
We were passing in an unwrapped offset into intel_ring_reset() on
unpinning. Sooner or later that had to land on ring-&gt;size.

&lt;3&gt; [314.872147] intel_ring_reset:1237 GEM_BUG_ON(!intel_ring_offset_valid(ring, tail))
&lt;4&gt; [314.872272] ------------[ cut here ]------------
&lt;2&gt; [314.872276] kernel BUG at drivers/gpu/drm/i915/gt/intel_ringbuffer.c:1237!
&lt;4&gt; [314.872320] invalid opcode: 0000 [#1] PREEMPT SMP PTI
&lt;4&gt; [314.872331] CPU: 1 PID: 3466 Comm: i915_selftest Tainted: G     U            5.3.0-rc4-CI-Patchwork_14061+ #1
&lt;4&gt; [314.872346] Hardware name: Hewlett-Packard HP Compaq 8000 Elite CMT PC/3647h, BIOS 786G7 v01.02 10/22/2009
&lt;4&gt; [314.872477] RIP: 0010:intel_ring_reset+0x51/0x70 [i915]
&lt;4&gt; [314.872487] Code: 9e db 51 e0 48 8b 35 b6 c7 22 00 49 c7 c0 f8 d9 d6 a0 b9 d5 04 00 00 48 c7 c2 70 5b d4 a0 48 c7 c7 6c fc c0 a0 e8 cf be 58 e0 &lt;0f&gt; 0b 89 77 20 89 77 1c 89 77 24 e9 4f ed ff ff 0f 1f 44 00 00 66
&lt;4&gt; [314.872512] RSP: 0018:ffffc9000034fa98 EFLAGS: 00010282
&lt;4&gt; [314.872523] RAX: 0000000000000010 RBX: ffff8881019412c8 RCX: 0000000000000000
&lt;4&gt; [314.872534] RDX: 0000000000000001 RSI: 0000000000000008 RDI: 0000000000000f20
&lt;4&gt; [314.872545] RBP: ffff888104e0f740 R08: 0000000000000000 R09: 0000000000000f20
&lt;4&gt; [314.872557] R10: 0000000000000000 R11: ffff888117094518 R12: ffffffffa0d3d2c0
&lt;4&gt; [314.872569] R13: ffffffffa0e2a250 R14: ffffffffa0e2a1e0 R15: ffffc9000034fe88
&lt;4&gt; [314.872581] FS:  00007fe6d49f6e40(0000) GS:ffff888117a80000(0000) knlGS:0000000000000000
&lt;4&gt; [314.872595] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&lt;4&gt; [314.872605] CR2: 000055e3283e9cc8 CR3: 0000000108842000 CR4: 00000000000406e0
&lt;4&gt; [314.872616] Call Trace:
&lt;4&gt; [314.872701]  intel_ring_unpin+0x1a/0x220 [i915]
&lt;4&gt; [314.872787]  ring_destroy+0x48/0xc0 [i915]
&lt;4&gt; [314.872870]  intel_engines_cleanup+0x24/0x40 [i915]
&lt;4&gt; [314.872964]  i915_gem_driver_release+0x1b/0xf0 [i915]
&lt;4&gt; [314.872984]  i915_driver_release+0x1c/0x80 [i915]

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190819075835.20065-2-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Protect request retirement with timeline-&gt;mutex</title>
<updated>2019-08-15T22:21:13Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2019-08-15T20:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5dadff4b09376e8ed92ecc0c12f1b9b3b1fbd19'/>
<id>urn:sha1:e5dadff4b09376e8ed92ecc0c12f1b9b3b1fbd19</id>
<content type='text'>
Forgo the struct_mutex requirement for request retirement as we have
been transitioning over to only using the timeline-&gt;mutex for
controlling the lifetime of a request on that timeline.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Matthew Auld &lt;matthew.auld@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190815205709.24285-4-chris@chris-wilson.co.uk
</content>
</entry>
</feed>
