summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-02-23 07:44:14 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-02-23 14:49:32 +0000
commit754c9fd5764909bc7c3ba9779355d55cb357be8a (patch)
tree6368dabb127d1ad6eb5d7b6d8403dc3f9d7750cd /drivers/gpu/drm/i915/selftests
parentfe49789fab974dd04c0fef26a4ce7f7f411b40dd (diff)
downloadop-kernel-dev-754c9fd5764909bc7c3ba9779355d55cb357be8a.zip
op-kernel-dev-754c9fd5764909bc7c3ba9779355d55cb357be8a.tar.gz
drm/i915: Protect the request->global_seqno with the engine->timeline lock
A request is assigned a global seqno only when it is on the hardware execution queue. The global seqno can be used to maintain a list of requests on the same engine in retirement order, for example for constructing a priority queue for waiting. Prior to its execution, or if it is subsequently removed in the event of preemption, its global seqno is zero. As both insertion and removal from the execution queue may operate in IRQ context, it is not guarded by the usual struct_mutex BKL. Instead those relying on the global seqno must be prepared for its value to change between reads. Only when the request is complete can the global seqno be stable (due to the memory barriers on submitting the commands to the hardware to write the breadcrumb, if the HWS shows that it has passed the global seqno and the global seqno is unchanged after the read, it is indeed complete). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170223074422.4125-9-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r--drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
index 6426acc..621be1c 100644
--- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
@@ -131,7 +131,7 @@ static int igt_random_insert_remove(void *arg)
goto out_bitmap;
for (n = 0; n < count; n++)
- intel_wait_init(&waiters[n], seqno_bias + n);
+ intel_wait_init_for_seqno(&waiters[n], seqno_bias + n);
err = check_rbtree(engine, bitmap, waiters, count);
if (err)
@@ -197,7 +197,7 @@ static int igt_insert_complete(void *arg)
goto out_waiters;
for (n = 0; n < count; n++) {
- intel_wait_init(&waiters[n], n + seqno_bias);
+ intel_wait_init_for_seqno(&waiters[n], n + seqno_bias);
intel_engine_add_wait(engine, &waiters[n]);
__set_bit(n, bitmap);
}
@@ -318,7 +318,7 @@ static int igt_wakeup_thread(void *arg)
while (wait_for_ready(w)) {
GEM_BUG_ON(kthread_should_stop());
- intel_wait_init(&wait, w->seqno);
+ intel_wait_init_for_seqno(&wait, w->seqno);
intel_engine_add_wait(w->engine, &wait);
for (;;) {
set_current_state(TASK_UNINTERRUPTIBLE);
OpenPOWER on IntegriCloud