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 #ifndef _EGL_SYNC_H
18 #define _EGL_SYNC_H
19 
20 #include <EGL/egl.h>
21 #include <EGL/eglext.h>
22 #include <inttypes.h>
23 
24 // EGLSync_t is our driver's internal representation
25 // of EGLSyncKHR objects.
26 // The components are:
27 // a. handle: reference host sync objects
28 // b. android_native_fence_fd: for ANDROID_native_fence_sync
29 // when we want to wrap native fence fd's in EGLSyncKHR's
30 // c. type/status: track status of fence so SyncAttrib works
31 struct EGLSync_t {
EGLSync_tEGLSync_t32     EGLSync_t(uint64_t handle_in) :
33         handle(handle_in), android_native_fence_fd(-1),
34         type(EGL_SYNC_FENCE_KHR),
35         status(EGL_UNSIGNALED_KHR) { }
36     uint64_t handle;
37     int android_native_fence_fd;
38     EGLint type;
39     EGLint status;
40 };
41 
42 #endif
43