Home | History | Annotate | Line # | Download | only in selftests
      1 /*	$NetBSD: mock_timeline.c,v 1.2 2021/12/18 23:45:31 riastradh Exp $	*/
      2 
      3 /*
      4  * SPDX-License-Identifier: MIT
      5  *
      6  * Copyright  2017-2018 Intel Corporation
      7  */
      8 
      9 #include <sys/cdefs.h>
     10 __KERNEL_RCSID(0, "$NetBSD: mock_timeline.c,v 1.2 2021/12/18 23:45:31 riastradh Exp $");
     11 
     12 #include "../intel_timeline.h"
     13 
     14 #include "mock_timeline.h"
     15 
     16 void mock_timeline_init(struct intel_timeline *timeline, u64 context)
     17 {
     18 	timeline->gt = NULL;
     19 	timeline->fence_context = context;
     20 
     21 	mutex_init(&timeline->mutex);
     22 
     23 	INIT_ACTIVE_FENCE(&timeline->last_request);
     24 	INIT_LIST_HEAD(&timeline->requests);
     25 
     26 	i915_syncmap_init(&timeline->sync);
     27 
     28 	INIT_LIST_HEAD(&timeline->link);
     29 }
     30 
     31 void mock_timeline_fini(struct intel_timeline *timeline)
     32 {
     33 	i915_syncmap_free(&timeline->sync);
     34 }
     35