linux-stable/drivers/gpu/drm/i915/selftests/mock_timeline.c
Chris Wilson de220cc219 drm/i915: Consolidate the timeline->barrier
The timeline is strictly ordered, so by inserting the timeline->barrier
request into the timeline->last_request it naturally provides the same
barrier. Consolidate the pair of barriers into one as they serve the
same purpose.

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/20190408091728.20207-4-chris@chris-wilson.co.uk
2019-04-08 17:04:12 +01:00

30 lines
602 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);
mutex_init(&timeline->mutex);
INIT_ACTIVE_REQUEST(&timeline->last_request);
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);
}