blob: 6b3bf8d8654881740b2f2873f3f4a5a0d59b9369 [file] [log] [blame]
Bob Badour3c538232021-02-12 21:26:48 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_native_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_native_license"],
8}
9
Lloyd Pique66ce40d2018-01-23 16:42:19 -080010cc_defaults {
11 name: "surfaceflinger_defaults",
12 cflags: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -080013 "-Wall",
14 "-Werror",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070015 "-Wformat",
Lloyd Pique755e3192018-01-31 16:46:15 -080016 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080017 "-Wunused",
18 "-Wunreachable-code",
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080019 "-Wconversion",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080020 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080021}
22
23cc_defaults {
24 name: "libsurfaceflinger_defaults",
25 defaults: ["surfaceflinger_defaults"],
26 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070027 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080028 "-DGL_GLEXT_PROTOTYPES",
29 "-DEGL_EGLEXT_PROTOTYPES",
30 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080031 shared_libs: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -080032 "android.hardware.configstore-utils",
33 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080034 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080035 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080036 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070037 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080038 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070039 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070040 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070041 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080042 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010043 "android.hardware.power@1.3",
Jeongik Cha204e03d2021-01-26 22:34:54 +090044 "android.hardware.power-V1-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080045 "libbase",
46 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080047 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080048 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080049 "libEGL",
50 "libfmq",
51 "libGLESv1_CM",
52 "libGLESv2",
53 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080054 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080055 "liblayers_proto",
56 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090057 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080058 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070059 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080060 "libprotobuf-cpp-lite",
Alec Mouri989ddbe2020-02-06 09:26:19 -080061 "libstatslog",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080062 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080063 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080064 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070065 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080066 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090067 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080068 ],
69 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070070 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070071 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070072 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080073 "libserviceutils",
74 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080075 ],
76 header_libs: [
77 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070078 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070079 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080080 "android.hardware.graphics.composer@2.4-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",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700110 ],
111 lto: {
112 thin: true,
113 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800114 whole_program_vtables: true, // Requires ThinLTO
Yi Kong2598f202021-02-19 17:48:33 +0800115 pgo: {
116 sampling: true,
117 profile_file: "surfaceflinger/surfaceflinger.profdata",
118 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700119 // TODO(b/131771163): Fix broken fuzzer support with LTO.
120 sanitize: {
121 fuzzer: false,
122 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700123}
124
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800125cc_library_headers {
126 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800127 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800128 static_libs: ["libserviceutils"],
129 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800130}
Kalle Raitaa099a242017-01-11 11:17:29 -0800131
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800132filegroup {
133 name: "libsurfaceflinger_sources",
134 srcs: [
135 "BufferLayer.cpp",
136 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700137 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700138 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700139 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800140 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800141 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800142 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143 "DisplayDevice.cpp",
144 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700145 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 "DisplayHardware/FramebufferSurface.cpp",
147 "DisplayHardware/HWC2.cpp",
148 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100149 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800150 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800151 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800152 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700153 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800154 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800155 "Layer.cpp",
156 "LayerProtoHelper.cpp",
157 "LayerRejecter.cpp",
158 "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 Krulecfefcb582018-08-07 14:22:37 -0700164 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700165 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700166 "Scheduler/EventControlThread.cpp",
167 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700168 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100169 "Scheduler/LayerHistory.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800170 "Scheduler/LayerHistoryV2.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700171 "Scheduler/LayerInfo.cpp",
Ady Abraham8a82ba62020-01-17 12:43:17 -0800172 "Scheduler/LayerInfoV2.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700173 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700174 "Scheduler/PhaseOffsets.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800175 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700176 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100177 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800178 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700179 "Scheduler/VSyncDispatchTimerQueue.cpp",
180 "Scheduler/VSyncPredictor.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700181 "Scheduler/VSyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800182 "Scheduler/VSyncReactor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800183 "StartPropertySetThread.cpp",
184 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700185 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800186 "SurfaceInterceptor.cpp",
187 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700188 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800189 ],
190}
191
192cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700193 // Please use libsurfaceflinger_defaults to configure how the sources are
194 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800195 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700196 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800197 srcs: [
198 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700199
200 // Note: SurfaceFlingerFactory is not in the default sources so that it
201 // can be easily replaced.
202 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800203 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800204 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800205}
206
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700207cc_defaults {
208 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800209 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700210 cflags: [
211 "-DLOG_TAG=\"SurfaceFlinger\"",
212 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800213 shared_libs: [
214 "android.frameworks.displayservice@1.0",
215 "android.hardware.configstore-utils",
216 "android.hardware.configstore@1.0",
217 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800218 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800219 "libbinder",
220 "libcutils",
221 "libdisplayservicehidl",
222 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700223 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800224 "liblayers_proto",
225 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700226 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800227 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800228 "libutils",
229 ],
230 static_libs: [
231 "libserviceutils",
232 "libtrace_proto",
233 ],
234 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700235}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800236
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700237filegroup {
238 name: "surfaceflinger_binary_sources",
239 srcs: ["main_surfaceflinger.cpp"],
240}
241
242cc_binary {
243 name: "surfaceflinger",
244 defaults: ["libsurfaceflinger_binary"],
245 init_rc: ["surfaceflinger.rc"],
246 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900247 shared_libs: [
248 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900249 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900250 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800251}
252
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800253subdirs = [
254 "layerproto",
255 "tests",
256]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900257
258cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900259 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900260 srcs: [
261 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900262 ],
263 shared_libs: [
264 "android.hardware.configstore-utils",
265 "android.hardware.configstore@1.0",
266 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900267 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900268 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900269 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900271 "liblog",
272 ],
273 static_libs: [
274 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900275 ],
276 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900277 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900278 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900279 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900280 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900281 export_static_lib_headers: [
282 "SurfaceFlingerProperties",
283 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900284}