2017-05-03 17:39:21 +08:00
|
|
|
/*
|
2018-05-03 00:38:39 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-05-03 17:39:21 +08:00
|
|
|
*
|
2018-05-03 00:38:39 +08:00
|
|
|
* Copyright © 2017-2018 Intel Corporation
|
2017-05-03 17:39:21 +08:00
|
|
|
*/
|
|
|
|
|
2018-05-03 00:38:39 +08:00
|
|
|
#include "../i915_timeline.h"
|
|
|
|
|
2017-05-03 17:39:21 +08:00
|
|
|
#include "mock_timeline.h"
|
|
|
|
|
2018-05-03 00:38:39 +08:00
|
|
|
void mock_timeline_init(struct i915_timeline *timeline, u64 context)
|
2017-05-03 17:39:21 +08:00
|
|
|
{
|
2019-01-28 18:23:56 +08:00
|
|
|
timeline->i915 = NULL;
|
2018-05-03 00:38:39 +08:00
|
|
|
timeline->fence_context = context;
|
|
|
|
|
|
|
|
spin_lock_init(&timeline->lock);
|
2019-03-01 19:05:44 +08:00
|
|
|
mutex_init(&timeline->mutex);
|
2017-05-03 17:39:21 +08:00
|
|
|
|
drm/i915: Pull i915_gem_active into the i915_active family
Looking forward, we need to break the struct_mutex dependency on
i915_gem_active. In the meantime, external use of i915_gem_active is
quite beguiling, little do new users suspect that it implies a barrier
as each request it tracks must be ordered wrt the previous one. As one
of many, it can be used to track activity across multiple timelines, a
shared fence, which fits our unordered request submission much better. We
need to steer external users away from the singular, exclusive fence
imposed by i915_gem_active to i915_active instead. As part of that
process, we move i915_gem_active out of i915_request.c into
i915_active.c to start separating the two concepts, and rename it to
i915_active_request (both to tie it to the concept of tracking just one
request, and to give it a longer, less appealing name).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190205130005.2807-5-chris@chris-wilson.co.uk
2019-02-05 21:00:05 +08:00
|
|
|
INIT_ACTIVE_REQUEST(&timeline->last_request);
|
2018-05-03 00:38:39 +08:00
|
|
|
INIT_LIST_HEAD(&timeline->requests);
|
2017-05-03 17:39:21 +08:00
|
|
|
|
2018-05-03 00:38:39 +08:00
|
|
|
i915_syncmap_init(&timeline->sync);
|
2017-05-03 17:39:21 +08:00
|
|
|
|
2018-05-03 00:38:39 +08:00
|
|
|
INIT_LIST_HEAD(&timeline->link);
|
2017-05-03 17:39:21 +08:00
|
|
|
}
|
|
|
|
|
2018-05-03 00:38:39 +08:00
|
|
|
void mock_timeline_fini(struct i915_timeline *timeline)
|
2017-05-03 17:39:21 +08:00
|
|
|
{
|
2019-01-28 18:23:56 +08:00
|
|
|
i915_syncmap_free(&timeline->sync);
|
2017-05-03 17:39:21 +08:00
|
|
|
}
|