blob: 4c5e5da36aa78bf8c1b84df2ca1978440d154953 [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",
10 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080011}
12
13cc_defaults {
14 name: "libsurfaceflinger_defaults",
15 defaults: ["surfaceflinger_defaults"],
16 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070017 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080018 "-DGL_GLEXT_PROTOTYPES",
19 "-DEGL_EGLEXT_PROTOTYPES",
20 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080021 shared_libs: [
mamik94e91f62019-08-19 09:11:33 -070022 "android.frameworks.vr.composer@2.0",
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",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080035 "libbase",
36 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080037 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080038 "libcutils",
39 "libdl",
40 "libEGL",
41 "libfmq",
42 "libGLESv1_CM",
43 "libGLESv2",
44 "libgui",
45 "libhardware",
46 "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",
53 "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 ],
mamik94e91f62019-08-19 09:11:33 -070060 // VrComposer is not used when building surfaceflinger for vendors
61 target: {
62 vendor: {
63 exclude_shared_libs: [
64 "android.frameworks.vr.composer@2.0",
65 ],
66 },
67 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080068 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070069 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070070 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070071 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 "libserviceutils",
73 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080074 "libvr_manager",
75 "libvrflinger",
76 ],
77 header_libs: [
78 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070079 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070080 "android.hardware.graphics.composer@2.3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080081 ],
82 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070083 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070084 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080085 "libserviceutils",
86 ],
87 export_shared_lib_headers: [
88 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080089 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070090 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080091 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070092 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070093 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070094 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010095 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080096 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -080097 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080098 ],
Marissa Wall48586522019-11-19 14:01:36 -080099 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
100 // the library compiled in a way that is accessible to system partition when running
101 // IMapper's VTS.
102 required: ["libgralloctypes"]
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800103}
104
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700105cc_defaults {
106 name: "libsurfaceflinger_production_defaults",
107 defaults: ["libsurfaceflinger_defaults"],
108 cflags: [
109 "-fvisibility=hidden",
110 "-fwhole-program-vtables", // requires ThinLTO
111 ],
112 lto: {
113 thin: true,
114 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700115 // TODO(b/131771163): Fix broken fuzzer support with LTO.
116 sanitize: {
117 fuzzer: false,
118 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700119}
120
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800121cc_library_headers {
122 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800123 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800124 static_libs: ["libserviceutils"],
125 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800126}
Kalle Raitaa099a242017-01-11 11:17:29 -0800127
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800128filegroup {
129 name: "libsurfaceflinger_sources",
130 srcs: [
131 "BufferLayer.cpp",
132 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700133 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700134 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700135 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800136 "Client.cpp",
137 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800138 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "DisplayDevice.cpp",
140 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700141 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "DisplayHardware/FramebufferSurface.cpp",
143 "DisplayHardware/HWC2.cpp",
144 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100145 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800147 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800148 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700149 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800150 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800151 "Layer.cpp",
152 "LayerProtoHelper.cpp",
153 "LayerRejecter.cpp",
154 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800155 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700156 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700157 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800158 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700159 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700160 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700161 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700162 "Scheduler/EventControlThread.cpp",
163 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700164 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100165 "Scheduler/LayerHistory.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700166 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700167 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700168 "Scheduler/PhaseOffsets.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800169 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700170 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100171 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800172 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700173 "Scheduler/VSyncDispatchTimerQueue.cpp",
174 "Scheduler/VSyncPredictor.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700175 "Scheduler/VSyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800176 "Scheduler/VSyncReactor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800177 "StartPropertySetThread.cpp",
178 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700179 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800180 "SurfaceInterceptor.cpp",
181 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700182 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800183 ],
184}
185
186cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700187 // Please use libsurfaceflinger_defaults to configure how the sources are
188 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800189 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700190 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800191 srcs: [
192 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700193
194 // Note: SurfaceFlingerFactory is not in the default sources so that it
195 // can be easily replaced.
196 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800197 ],
mamik94e91f62019-08-19 09:11:33 -0700198 cflags: [
199 "-DUSE_VR_COMPOSER=1",
200 ],
201 // VrComposer is not used when building surfaceflinger for vendors
202 target: {
203 vendor: {
204 cflags: [
205 "-DUSE_VR_COMPOSER=0",
206 ],
207 },
208 },
Lloyd Piquef58625d2017-12-19 13:22:33 -0800209 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800210}
211
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700212cc_defaults {
213 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800214 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700215 cflags: [
216 "-DLOG_TAG=\"SurfaceFlinger\"",
217 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800218 shared_libs: [
219 "android.frameworks.displayservice@1.0",
220 "android.hardware.configstore-utils",
221 "android.hardware.configstore@1.0",
222 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800223 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800224 "libbinder",
225 "libcutils",
226 "libdisplayservicehidl",
227 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700228 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800229 "liblayers_proto",
230 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700231 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800232 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800233 "libutils",
234 ],
235 static_libs: [
236 "libserviceutils",
237 "libtrace_proto",
238 ],
239 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700240}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800241
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700242filegroup {
243 name: "surfaceflinger_binary_sources",
244 srcs: ["main_surfaceflinger.cpp"],
245}
246
247cc_binary {
248 name: "surfaceflinger",
249 defaults: ["libsurfaceflinger_binary"],
250 init_rc: ["surfaceflinger.rc"],
251 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900252 shared_libs: [
253 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900254 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800256}
257
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800258subdirs = [
259 "layerproto",
260 "tests",
261]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900262
263cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900264 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900265 srcs: [
266 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900267 ],
268 shared_libs: [
269 "android.hardware.configstore-utils",
270 "android.hardware.configstore@1.0",
271 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900272 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900273 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900274 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900275 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900276 "liblog",
277 ],
278 static_libs: [
279 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900280 ],
281 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900282 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900283 "libhidlbase",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900284 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900285 export_static_lib_headers: [
286 "SurfaceFlingerProperties",
287 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900288}