2 // Copyright (c) 2016 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef OS_ANDROID_PLATFORMDEFINES_H_
18 #define OS_ANDROID_PLATFORMDEFINES_H_
21 #define LOG_TAG "iahwcomposer"
25 #define ATRACE_TAG ATRACE_TAG_GRAPHICS
28 #include <utils/Trace.h>
29 #include <cutils/log.h>
30 #include <hardware/hardware.h>
31 #include <hardware/hwcomposer.h>
33 #include <ui/GraphicBuffer.h>
36 #include <sync/sync.h>
42 struct gralloc_handle {
43 buffer_handle_t handle_ = NULL;
44 android::sp<android::GraphicBuffer> buffer_ = NULL;
45 native_handle_t* imported_handle_ = NULL;
46 uint32_t gem_handle_ = 0;
47 bool hwc_buffer_ = false;
50 typedef struct gralloc_handle* HWCNativeHandle;
52 #define VTRACE(fmt, ...) ALOGV("%s: " fmt, __func__, ##__VA_ARGS__)
53 #define DTRACE(fmt, ...) ALOGD("%s: " fmt, __func__, ##__VA_ARGS__)
54 #define ITRACE(fmt, ...) ALOGI(fmt, ##__VA_ARGS__)
55 #define WTRACE(fmt, ...) ALOGW("%s: " fmt, __func__, ##__VA_ARGS__)
56 #define ETRACE(fmt, ...) ALOGE("%s: " fmt, __func__, ##__VA_ARGS__)
57 #define STRACE() ATRACE_CALL()
63 #endif // OS_ANDROID_PLATFORMDEFINES_H_