blob: 08d7d3f0cb6982a10f8af7c2568e95c43a7272d1 [file] [log] [blame]
Lloyd Pique66ce40d2018-01-23 16:42:19 -08001cc_defaults {
2 name: "surfaceflinger_defaults",
3 cflags: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -08004 "-Wall",
5 "-Werror",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -07006 "-Wformat",
Lloyd Pique755e3192018-01-31 16:46:15 -08007 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -08008 "-Wunused",
9 "-Wunreachable-code",
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080010 "-Wconversion",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080011 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080012}
13
14cc_defaults {
15 name: "libsurfaceflinger_defaults",
16 defaults: ["surfaceflinger_defaults"],
17 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070018 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080019 "-DGL_GLEXT_PROTOTYPES",
20 "-DEGL_EGLEXT_PROTOTYPES",
21 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080022 shared_libs: [
mamik94e91f62019-08-19 09:11:33 -070023 "android.frameworks.vr.composer@2.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080024 "android.hardware.configstore-utils",
25 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080026 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080027 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080028 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070029 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080030 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070031 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070032 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070033 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080034 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010035 "android.hardware.power@1.3",
Dan Stoza030fbc12020-02-19 15:32:01 -080036 "android.hardware.power-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080037 "libbase",
38 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080039 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080040 "libcutils",
41 "libdl",
42 "libEGL",
43 "libfmq",
44 "libGLESv1_CM",
45 "libGLESv2",
46 "libgui",
47 "libhardware",
48 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080049 "liblayers_proto",
50 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090051 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080052 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070053 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080054 "libprotobuf-cpp-lite",
55 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080056 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070058 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080059 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090060 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080061 ],
mamik94e91f62019-08-19 09:11:33 -070062 // VrComposer is not used when building surfaceflinger for vendors
63 target: {
64 vendor: {
65 exclude_shared_libs: [
66 "android.frameworks.vr.composer@2.0",
67 ],
68 },
69 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080070 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070071 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070072 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070073 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080074 "libserviceutils",
75 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080076 "libvr_manager",
77 "libvrflinger",
78 ],
79 header_libs: [
80 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070081 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070082 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080083 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080084 ],
85 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070086 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070087 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080088 "libserviceutils",
89 ],
90 export_shared_lib_headers: [
91 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080092 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070093 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080094 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070095 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070096 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070097 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010098 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080099 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -0800100 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800101 ],
Marissa Wall48586522019-11-19 14:01:36 -0800102 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
103 // the library compiled in a way that is accessible to system partition when running
104 // IMapper's VTS.
105 required: ["libgralloctypes"]
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800106}
107
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700108cc_defaults {
109 name: "libsurfaceflinger_production_defaults",
110 defaults: ["libsurfaceflinger_defaults"],
111 cflags: [
112 "-fvisibility=hidden",
113 "-fwhole-program-vtables", // requires ThinLTO
114 ],
115 lto: {
116 thin: true,
117 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700118 // TODO(b/131771163): Fix broken fuzzer support with LTO.
119 sanitize: {
120 fuzzer: false,
121 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700122}
123
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800124cc_library_headers {
125 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800126 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800127 static_libs: ["libserviceutils"],
128 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800129}
Kalle Raitaa099a242017-01-11 11:17:29 -0800130
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131filegroup {
132 name: "libsurfaceflinger_sources",
133 srcs: [
134 "BufferLayer.cpp",
135 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700136 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700137 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700138 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800140 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800141 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "DisplayDevice.cpp",
143 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700144 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800145 "DisplayHardware/FramebufferSurface.cpp",
146 "DisplayHardware/HWC2.cpp",
147 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100148 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800149 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800150 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800151 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700152 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800153 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800154 "Layer.cpp",
155 "LayerProtoHelper.cpp",
156 "LayerRejecter.cpp",
157 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800158 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700159 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700160 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800161 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700162 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700163 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700164 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700165 "Scheduler/EventControlThread.cpp",
166 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700167 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100168 "Scheduler/LayerHistory.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800169 "Scheduler/LayerHistoryV2.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700170 "Scheduler/LayerInfo.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800171 "Scheduler/LayerInfoV2.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700172 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700173 "Scheduler/PhaseOffsets.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800174 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700175 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100176 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800177 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700178 "Scheduler/VSyncDispatchTimerQueue.cpp",
179 "Scheduler/VSyncPredictor.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700180 "Scheduler/VSyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800181 "Scheduler/VSyncReactor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800182 "StartPropertySetThread.cpp",
183 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700184 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800185 "SurfaceInterceptor.cpp",
186 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700187 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800188 ],
189}
190
191cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700192 // Please use libsurfaceflinger_defaults to configure how the sources are
193 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800194 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700195 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800196 srcs: [
197 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700198
199 // Note: SurfaceFlingerFactory is not in the default sources so that it
200 // can be easily replaced.
201 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800202 ],
mamik94e91f62019-08-19 09:11:33 -0700203 cflags: [
204 "-DUSE_VR_COMPOSER=1",
205 ],
206 // VrComposer is not used when building surfaceflinger for vendors
207 target: {
208 vendor: {
209 cflags: [
210 "-DUSE_VR_COMPOSER=0",
211 ],
212 },
213 },
Lloyd Piquef58625d2017-12-19 13:22:33 -0800214 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215}
216
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700217cc_defaults {
218 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800219 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700220 cflags: [
221 "-DLOG_TAG=\"SurfaceFlinger\"",
222 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800223 shared_libs: [
224 "android.frameworks.displayservice@1.0",
225 "android.hardware.configstore-utils",
226 "android.hardware.configstore@1.0",
227 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800228 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800229 "libbinder",
230 "libcutils",
231 "libdisplayservicehidl",
232 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700233 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800234 "liblayers_proto",
235 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700236 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800237 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800238 "libutils",
239 ],
240 static_libs: [
241 "libserviceutils",
242 "libtrace_proto",
243 ],
244 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700245}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800246
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700247filegroup {
248 name: "surfaceflinger_binary_sources",
249 srcs: ["main_surfaceflinger.cpp"],
250}
251
252cc_binary {
253 name: "surfaceflinger",
254 defaults: ["libsurfaceflinger_binary"],
255 init_rc: ["surfaceflinger.rc"],
256 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900257 shared_libs: [
258 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900259 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900260 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800261}
262
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800263subdirs = [
264 "layerproto",
265 "tests",
266]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900267
268cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900269 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270 srcs: [
271 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900272 ],
273 shared_libs: [
274 "android.hardware.configstore-utils",
275 "android.hardware.configstore@1.0",
276 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900277 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900278 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900279 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900280 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900281 "liblog",
282 ],
283 static_libs: [
284 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900285 ],
286 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900287 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900288 "libhidlbase",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900289 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900290 export_static_lib_headers: [
291 "SurfaceFlingerProperties",
292 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900293}