blob: b017ad7e78e6ad5884bd889e2612da52cf474ddc [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",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080041 "libEGL",
42 "libfmq",
43 "libGLESv1_CM",
44 "libGLESv2",
45 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080046 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080047 "liblayers_proto",
48 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090049 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080050 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070051 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080052 "libprotobuf-cpp-lite",
Alec Mouri989ddbe2020-02-06 09:26:19 -080053 "libstatslog",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080054 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080055 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070057 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080058 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090059 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080060 ],
mamik94e91f62019-08-19 09:11:33 -070061 // VrComposer is not used when building surfaceflinger for vendors
62 target: {
63 vendor: {
64 exclude_shared_libs: [
65 "android.frameworks.vr.composer@2.0",
66 ],
67 },
68 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080069 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070070 "libcompositionengine",
Adithya Srinivasanf279e042020-08-17 14:56:27 -070071 "libframetimeline",
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 "libvrflinger",
77 ],
78 header_libs: [
79 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070080 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070081 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080082 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080083 ],
84 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070085 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070086 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080087 "libserviceutils",
88 ],
89 export_shared_lib_headers: [
90 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080091 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070092 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080093 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070094 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070095 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070096 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010097 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080098 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -080099 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800100 ],
Marissa Wall48586522019-11-19 14:01:36 -0800101 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
102 // the library compiled in a way that is accessible to system partition when running
103 // IMapper's VTS.
104 required: ["libgralloctypes"]
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800105}
106
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700107cc_defaults {
108 name: "libsurfaceflinger_production_defaults",
109 defaults: ["libsurfaceflinger_defaults"],
110 cflags: [
111 "-fvisibility=hidden",
112 "-fwhole-program-vtables", // requires ThinLTO
113 ],
114 lto: {
115 thin: true,
116 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700117 // TODO(b/131771163): Fix broken fuzzer support with LTO.
118 sanitize: {
119 fuzzer: false,
120 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700121}
122
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800123cc_library_headers {
124 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800125 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800126 static_libs: ["libserviceutils"],
127 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800128}
Kalle Raitaa099a242017-01-11 11:17:29 -0800129
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800130filegroup {
131 name: "libsurfaceflinger_sources",
132 srcs: [
133 "BufferLayer.cpp",
134 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700135 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700136 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700137 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800138 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800139 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800140 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800141 "DisplayDevice.cpp",
142 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700143 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800144 "DisplayHardware/FramebufferSurface.cpp",
145 "DisplayHardware/HWC2.cpp",
146 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100147 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800148 "DisplayHardware/VirtualDisplaySurface.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200149 "DisplayRenderArea.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",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200157 "LayerRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800158 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800159 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700160 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700161 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800162 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700163 "RenderArea.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700164 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700165 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700166 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100167 "Scheduler/LayerHistory.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800168 "Scheduler/LayerHistoryV2.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700169 "Scheduler/LayerInfo.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800170 "Scheduler/LayerInfoV2.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700171 "Scheduler/MessageQueue.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800172 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700173 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100174 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800175 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700176 "Scheduler/VSyncDispatchTimerQueue.cpp",
177 "Scheduler/VSyncPredictor.cpp",
Dominik Laskowskia93a5312020-07-23 15:10:03 -0700178 "Scheduler/VsyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800179 "Scheduler/VSyncReactor.cpp",
Ady Abrahamc581d3c2020-08-06 17:34:27 -0700180 "Scheduler/VsyncConfiguration.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800181 "StartPropertySetThread.cpp",
182 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700183 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800184 "SurfaceInterceptor.cpp",
185 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700186 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800187 ],
188}
189
John Reck8b1ae3f2020-09-10 17:01:09 +0000190cc_defaults {
191 name: "libsurfaceflinger_binary",
192 defaults: [
193 "surfaceflinger_defaults",
194 "libsurfaceflinger_production_defaults",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800195 ],
mamik94e91f62019-08-19 09:11:33 -0700196 cflags: [
John Reck8b1ae3f2020-09-10 17:01:09 +0000197 "-DLOG_TAG=\"SurfaceFlinger\"",
mamik94e91f62019-08-19 09:11:33 -0700198 "-DUSE_VR_COMPOSER=1",
199 ],
200 // VrComposer is not used when building surfaceflinger for vendors
John Reck8b1ae3f2020-09-10 17:01:09 +0000201 // TODO: Is this ever built for vendors?
mamik94e91f62019-08-19 09:11:33 -0700202 target: {
203 vendor: {
204 cflags: [
205 "-DUSE_VR_COMPOSER=0",
206 ],
207 },
208 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800209 shared_libs: [
210 "android.frameworks.displayservice@1.0",
211 "android.hardware.configstore-utils",
212 "android.hardware.configstore@1.0",
213 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800214 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215 "libbinder",
216 "libcutils",
217 "libdisplayservicehidl",
218 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700219 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800220 "liblayers_proto",
221 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700222 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800223 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800224 "libutils",
225 ],
226 static_libs: [
227 "libserviceutils",
228 "libtrace_proto",
229 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700230}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800231
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700232filegroup {
233 name: "surfaceflinger_binary_sources",
John Reck8b1ae3f2020-09-10 17:01:09 +0000234 srcs: [
235 ":libsurfaceflinger_sources",
236 // Note: SurfaceFlingerFactory is not in the default sources so that it
237 // can be easily replaced.
238 "SurfaceFlingerFactory.cpp",
239 "main_surfaceflinger.cpp"
240 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700241}
242
243cc_binary {
244 name: "surfaceflinger",
245 defaults: ["libsurfaceflinger_binary"],
246 init_rc: ["surfaceflinger.rc"],
247 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900248 shared_libs: [
Inseob Kimd6e835b2019-02-14 12:33:30 +0900249 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900250 ],
Alec Mouri0a9bc472020-09-10 18:03:43 -0700251
252 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800253}
254
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800255subdirs = [
256 "layerproto",
257 "tests",
258]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900259
260cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900261 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900262 srcs: [
263 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900264 ],
265 shared_libs: [
266 "android.hardware.configstore-utils",
267 "android.hardware.configstore@1.0",
268 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900269 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900271 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900272 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900273 "liblog",
274 ],
275 static_libs: [
276 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900277 ],
278 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900279 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900280 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900281 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900282 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900283 export_static_lib_headers: [
284 "SurfaceFlingerProperties",
285 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900286}