drm/i915: Serialise i915_active_fence_set() with itself
[linux-2.6-block.git] / drivers / gpu / drm / i915 / gt / selftests / mock_timeline.c
CommitLineData
47979480 1/*
a89d1f92 2 * SPDX-License-Identifier: MIT
47979480 3 *
a89d1f92 4 * Copyright © 2017-2018 Intel Corporation
47979480
CW
5 */
6
f0c02c1b 7#include "../intel_timeline.h"
a89d1f92 8
47979480
CW
9#include "mock_timeline.h"
10
f0c02c1b 11void mock_timeline_init(struct intel_timeline *timeline, u64 context)
47979480 12{
4c6d51ea 13 timeline->gt = NULL;
a89d1f92
CW
14 timeline->fence_context = context;
15
3ef71149 16 mutex_init(&timeline->mutex);
47979480 17
df9f85d8 18 INIT_ACTIVE_FENCE(&timeline->last_request);
a89d1f92 19 INIT_LIST_HEAD(&timeline->requests);
47979480 20
a89d1f92 21 i915_syncmap_init(&timeline->sync);
47979480 22
a89d1f92 23 INIT_LIST_HEAD(&timeline->link);
47979480
CW
24}
25
f0c02c1b 26void mock_timeline_fini(struct intel_timeline *timeline)
47979480 27{
1e345568 28 i915_syncmap_free(&timeline->sync);
47979480 29}