• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #include "sync_device.h"
18 
defaultCreateTimeline()19 static uint64_t defaultCreateTimeline() { return 0; }
20 
defaultCreateFence(uint64_t timeline,uint32_t pt)21 static int defaultCreateFence(uint64_t timeline, uint32_t pt) {
22     (void)timeline;
23     (void)pt;
24     return -1;
25 }
26 
defaultTimelineInc(uint64_t timeline,uint32_t howmuch)27 static void defaultTimelineInc(uint64_t timeline, uint32_t howmuch) {
28     (void)timeline;
29     (void)howmuch;
30     return;
31 }
32 
defaultDestroyTimeline(uint64_t timeline)33 static void defaultDestroyTimeline(uint64_t timeline) {
34     (void)timeline;
35     return;
36 }
37 
defaultRegisterTriggerWait(emugl_sync_trigger_wait_t f)38 static void defaultRegisterTriggerWait(emugl_sync_trigger_wait_t f) {
39     (void)f;
40     return;
41 }
42 
defaultDeviceExists()43 static bool defaultDeviceExists() {
44     return false;
45 }
46 
47 namespace emugl {
48 
49 emugl_sync_create_timeline_t emugl_sync_create_timeline = defaultCreateTimeline;
50 emugl_sync_create_fence_t emugl_sync_create_fence = defaultCreateFence;
51 emugl_sync_timeline_inc_t emugl_sync_timeline_inc = defaultTimelineInc;
52 emugl_sync_destroy_timeline_t emugl_sync_destroy_timeline = defaultDestroyTimeline;
53 emugl_sync_register_trigger_wait_t emugl_sync_register_trigger_wait = defaultRegisterTriggerWait;
54 emugl_sync_device_exists_t emugl_sync_device_exists = defaultDeviceExists;
55 
set_emugl_sync_create_timeline(emugl_sync_create_timeline_t f)56 void set_emugl_sync_create_timeline(emugl_sync_create_timeline_t f) {
57     emugl_sync_create_timeline = f;
58 }
59 
set_emugl_sync_create_fence(emugl_sync_create_fence_t f)60 void set_emugl_sync_create_fence(emugl_sync_create_fence_t f) {
61     emugl_sync_create_fence = f;
62 }
63 
set_emugl_sync_timeline_inc(emugl_sync_timeline_inc_t f)64 void set_emugl_sync_timeline_inc(emugl_sync_timeline_inc_t f) {
65     emugl_sync_timeline_inc = f;
66 }
67 
set_emugl_sync_destroy_timeline(emugl_sync_destroy_timeline_t f)68 void set_emugl_sync_destroy_timeline(emugl_sync_destroy_timeline_t f) {
69     emugl_sync_destroy_timeline = f;
70 }
71 
set_emugl_sync_register_trigger_wait(emugl_sync_register_trigger_wait_t f)72 void set_emugl_sync_register_trigger_wait(emugl_sync_register_trigger_wait_t f) {
73     emugl_sync_register_trigger_wait = f;
74 }
75 
set_emugl_sync_device_exists(emugl_sync_device_exists_t f)76 void set_emugl_sync_device_exists(emugl_sync_device_exists_t f) {
77     emugl_sync_device_exists = f;
78 }
79 
80 }  // namespace emugl
81