blob: 2734ee94df9c3e7395d3a55bfef32a0eb5ef773a [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: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -080023 "android.hardware.configstore-utils",
24 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080025 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080026 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080027 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070028 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080029 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070030 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070031 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070032 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080033 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010034 "android.hardware.power@1.3",
Dan Stoza030fbc12020-02-19 15:32:01 -080035 "android.hardware.power-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080036 "libbase",
37 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080038 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080039 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080040 "libEGL",
41 "libfmq",
42 "libGLESv1_CM",
43 "libGLESv2",
44 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080045 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080046 "liblayers_proto",
47 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090048 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080049 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070050 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080051 "libprotobuf-cpp-lite",
Alec Mouri989ddbe2020-02-06 09:26:19 -080052 "libstatslog",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080053 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080054 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080055 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070056 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090058 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080059 ],
60 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070061 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070062 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070063 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080064 "libserviceutils",
65 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080066 ],
67 header_libs: [
68 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070069 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070070 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080071 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 ],
73 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070074 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070075 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080076 "libserviceutils",
77 ],
78 export_shared_lib_headers: [
79 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080080 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070081 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080082 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070083 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070084 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070085 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010086 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080087 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -080088 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080089 ],
Marissa Wall48586522019-11-19 14:01:36 -080090 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
91 // the library compiled in a way that is accessible to system partition when running
92 // IMapper's VTS.
93 required: ["libgralloctypes"]
Lloyd Pique66ce40d2018-01-23 16:42:19 -080094}
95
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070096cc_defaults {
97 name: "libsurfaceflinger_production_defaults",
98 defaults: ["libsurfaceflinger_defaults"],
99 cflags: [
100 "-fvisibility=hidden",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700101 ],
102 lto: {
103 thin: true,
104 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800105 whole_program_vtables: true, // Requires ThinLTO
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700106 // TODO(b/131771163): Fix broken fuzzer support with LTO.
107 sanitize: {
108 fuzzer: false,
109 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700110}
111
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800112cc_library_headers {
113 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800114 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800115 static_libs: ["libserviceutils"],
116 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800117}
Kalle Raitaa099a242017-01-11 11:17:29 -0800118
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800119filegroup {
120 name: "libsurfaceflinger_sources",
121 srcs: [
122 "BufferLayer.cpp",
123 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700124 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700125 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700126 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800127 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800128 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800129 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800130 "DisplayDevice.cpp",
131 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700132 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800133 "DisplayHardware/FramebufferSurface.cpp",
134 "DisplayHardware/HWC2.cpp",
135 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100136 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800137 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800138 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700140 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800141 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "Layer.cpp",
143 "LayerProtoHelper.cpp",
144 "LayerRejecter.cpp",
145 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700147 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700148 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800149 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700150 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700151 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700152 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700153 "Scheduler/EventControlThread.cpp",
154 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700155 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100156 "Scheduler/LayerHistory.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800157 "Scheduler/LayerHistoryV2.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700158 "Scheduler/LayerInfo.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800159 "Scheduler/LayerInfoV2.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700160 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700161 "Scheduler/PhaseOffsets.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800162 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700163 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100164 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800165 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700166 "Scheduler/VSyncDispatchTimerQueue.cpp",
167 "Scheduler/VSyncPredictor.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700168 "Scheduler/VSyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800169 "Scheduler/VSyncReactor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800170 "StartPropertySetThread.cpp",
171 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700172 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800173 "SurfaceInterceptor.cpp",
174 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700175 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800176 ],
177}
178
179cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700180 // Please use libsurfaceflinger_defaults to configure how the sources are
181 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800182 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700183 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800184 srcs: [
185 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700186
187 // Note: SurfaceFlingerFactory is not in the default sources so that it
188 // can be easily replaced.
189 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800190 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800191 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800192}
193
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700194cc_defaults {
195 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800196 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700197 cflags: [
198 "-DLOG_TAG=\"SurfaceFlinger\"",
199 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800200 shared_libs: [
201 "android.frameworks.displayservice@1.0",
202 "android.hardware.configstore-utils",
203 "android.hardware.configstore@1.0",
204 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800205 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800206 "libbinder",
207 "libcutils",
208 "libdisplayservicehidl",
209 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700210 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800211 "liblayers_proto",
212 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700213 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800214 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215 "libutils",
216 ],
217 static_libs: [
218 "libserviceutils",
219 "libtrace_proto",
220 ],
221 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700222}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800223
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700224filegroup {
225 name: "surfaceflinger_binary_sources",
226 srcs: ["main_surfaceflinger.cpp"],
227}
228
229cc_binary {
230 name: "surfaceflinger",
231 defaults: ["libsurfaceflinger_binary"],
232 init_rc: ["surfaceflinger.rc"],
233 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900234 shared_libs: [
235 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900236 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900237 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800238}
239
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800240subdirs = [
241 "layerproto",
242 "tests",
243]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900244
245cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900246 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900247 srcs: [
248 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900249 ],
250 shared_libs: [
251 "android.hardware.configstore-utils",
252 "android.hardware.configstore@1.0",
253 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900254 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900256 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900257 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900258 "liblog",
259 ],
260 static_libs: [
261 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900262 ],
263 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900264 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900265 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900266 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900267 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900268 export_static_lib_headers: [
269 "SurfaceFlingerProperties",
270 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900271}