mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 14:03:47 +07:00
1e345568e3
Currently, the list of timelines is serialised by the struct_mutex, but to alleviate difficulties with using that mutex in future, move the list management under its own dedicated mutex. 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/20190128102356.15037-5-chris@chris-wilson.co.uk
30 lines
577 B
C
30 lines
577 B
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2017-2018 Intel Corporation
|
|
*/
|
|
|
|
#include "../i915_timeline.h"
|
|
|
|
#include "mock_timeline.h"
|
|
|
|
void mock_timeline_init(struct i915_timeline *timeline, u64 context)
|
|
{
|
|
timeline->i915 = NULL;
|
|
timeline->fence_context = context;
|
|
|
|
spin_lock_init(&timeline->lock);
|
|
|
|
init_request_active(&timeline->last_request, NULL);
|
|
INIT_LIST_HEAD(&timeline->requests);
|
|
|
|
i915_syncmap_init(&timeline->sync);
|
|
|
|
INIT_LIST_HEAD(&timeline->link);
|
|
}
|
|
|
|
void mock_timeline_fini(struct i915_timeline *timeline)
|
|
{
|
|
i915_syncmap_free(&timeline->sync);
|
|
}
|