summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'configstore/1.1/default/SurfaceFlingerConfigs.cpp')
-rw-r--r--configstore/1.1/default/SurfaceFlingerConfigs.cpp151
1 files changed, 151 insertions, 0 deletions
diff --git a/configstore/1.1/default/SurfaceFlingerConfigs.cpp b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
new file mode 100644
index 00000000..5a040f2a
--- /dev/null
+++ b/configstore/1.1/default/SurfaceFlingerConfigs.cpp
@@ -0,0 +1,151 @@
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.1 (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.1
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 "SurfaceFlingerConfigs.h"
18
19namespace android {
20namespace hardware {
21namespace configstore {
22namespace V1_1 {
23namespace implementation {
24
25// Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs
26// follow.
27Return<void> SurfaceFlingerConfigs::vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
28#ifdef VSYNC_EVENT_PHASE_OFFSET_NS
29 _hidl_cb({true, VSYNC_EVENT_PHASE_OFFSET_NS});
30#else
31 _hidl_cb({false, 0});
32#endif
33 return Void();
34}
35
36Return<void> SurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) {
37#ifdef SF_VSYNC_EVENT_PHASE_OFFSET_NS
38 _hidl_cb({true, SF_VSYNC_EVENT_PHASE_OFFSET_NS});
39#else
40 _hidl_cb({false, 0});
41#endif
42 return Void();
43}
44
45Return<void> SurfaceFlingerConfigs::useContextPriority(useContextPriority_cb _hidl_cb) {
46#ifdef USE_CONTEXT_PRIORITY
47 _hidl_cb({true, USE_CONTEXT_PRIORITY});
48#else
49 _hidl_cb({false, false});
50#endif
51 return Void();
52}
53
54Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(
55 maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
56#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
57 _hidl_cb({true, NUM_FRAMEBUFFER_SURFACE_BUFFERS});
58#else
59 _hidl_cb({false, 0});
60#endif
61 return Void();
62}
63
64Return<void> SurfaceFlingerConfigs::hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) {
65 bool value = false;
66#ifdef HAS_WIDE_COLOR_DISPLAY
67 value = true;
68#endif
69 _hidl_cb({true, value});
70 return Void();
71}
72
73Return<void> SurfaceFlingerConfigs::hasSyncFramework(hasSyncFramework_cb _hidl_cb) {
74 bool value = true;
75#ifdef RUNNING_WITHOUT_SYNC_FRAMEWORK
76 value = false;
77#endif
78 _hidl_cb({true, value});
79 return Void();
80}
81
82Return<void> SurfaceFlingerConfigs::hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) {
83 bool value = false;
84#ifdef HAS_HDR_DISPLAY
85 value = true;
86#endif
87 _hidl_cb({true, value});
88 return Void();
89}
90
91Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(
92 presentTimeOffsetFromVSyncNs_cb _hidl_cb) {
93#ifdef PRESENT_TIME_OFFSET_FROM_VSYNC_NS
94 _hidl_cb({true, PRESENT_TIME_OFFSET_FROM_VSYNC_NS});
95#else
96 _hidl_cb({false, 0});
97#endif
98 return Void();
99}
100
101Return<void> SurfaceFlingerConfigs::useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) {
102 bool value = false;
103#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
104 value = true;
105#endif
106 _hidl_cb({true, value});
107 return Void();
108}
109
110Return<void> SurfaceFlingerConfigs::maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) {
111 uint64_t maxSize = 0;
112#ifdef MAX_VIRTUAL_DISPLAY_DIMENSION
113 maxSize = MAX_VIRTUAL_DISPLAY_DIMENSION;
114 _hidl_cb({true, maxSize});
115#else
116 _hidl_cb({false, maxSize});
117#endif
118 return Void();
119}
120
121Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
122 bool value = false;
123 bool specified = false;
124#ifdef USE_VR_FLINGER
125 value = true;
126 specified = true;
127#endif
128 _hidl_cb({specified, value});
129 return Void();
130}
131
132Return<void> SurfaceFlingerConfigs::startGraphicsAllocatorService(
133 startGraphicsAllocatorService_cb _hidl_cb) {
134 bool value = false;
135#ifdef START_GRAPHICS_ALLOCATOR_SERVICE
136 value = true;
137#endif
138 _hidl_cb({true, value});
139 return Void();
140}
141
142// Methods from ::android::hardware::configstore::V1_1::ISurfaceFlingerConfigs
143// follow.
144
145// Methods from ::android::hidl::base::V1_0::IBase follow.
146
147} // namespace implementation
148} // namespace V1_1
149} // namespace configstore
150} // namespace hardware
151} // namespace android