blob: 4e291726092c3d4ab4c0a1ffda90726d5f32379c [file] [log] [blame]
Bob Badour3306e492021-02-25 15:35:37 -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",
Marin Shalamanovbed7fd32020-12-21 20:02:20 +010015 "-Wextra",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070016 "-Wformat",
Lloyd Pique755e3192018-01-31 16:46:15 -080017 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080018 "-Wunused",
19 "-Wunreachable-code",
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080020 "-Wconversion",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080021 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080022}
23
24cc_defaults {
25 name: "libsurfaceflinger_defaults",
John Reck67b1e2b2020-08-26 13:17:24 -070026 defaults: [
27 "surfaceflinger_defaults",
Leon Scroggins IIIe4169c82021-04-28 11:31:50 -040028 "skia_renderengine_deps",
John Reck67b1e2b2020-08-26 13:17:24 -070029 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080030 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070031 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080032 "-DGL_GLEXT_PROTOTYPES",
33 "-DEGL_EGLEXT_PROTOTYPES",
34 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080035 shared_libs: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -080036 "android.hardware.configstore-utils",
37 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080038 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080039 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080040 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070041 "android.hardware.graphics.common@1.2",
Ady Abrahame7385f72021-09-05 00:54:25 -070042 "android.hardware.common-V2-ndk",
43 "android.hardware.common.fmq-V1-ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080044 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070045 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070046 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070047 "android.hardware.graphics.composer@2.4",
Ady Abrahame7385f72021-09-05 00:54:25 -070048 "android.hardware.graphics.composer3-V1-ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080049 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010050 "android.hardware.power@1.3",
Matt Buckley06f299a2021-09-24 19:43:51 +000051 "android.hardware.power-V2-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080052 "libbase",
53 "libbinder",
Ady Abrahame7385f72021-09-05 00:54:25 -070054 "libbinder_ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080055 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libEGL",
57 "libfmq",
58 "libGLESv1_CM",
59 "libGLESv2",
60 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080061 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080062 "liblayers_proto",
63 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090064 "libnativewindow",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070065 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080066 "libprotobuf-cpp-lite",
67 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080068 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080069 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070070 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080071 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090072 "libSurfaceFlingerProp",
rnlee81d32602021-07-27 13:24:07 -070073 "server_configurable_flags",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080074 ],
75 static_libs: [
Ady Abrahame7385f72021-09-05 00:54:25 -070076 "libaidlcommonsupport",
Lloyd Pique70d91362018-10-18 16:02:55 -070077 "libcompositionengine",
Adithya Srinivasanf279e042020-08-17 14:56:27 -070078 "libframetimeline",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070079 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070080 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080081 "libserviceutils",
82 "libtrace_proto",
Ady Abrahame7385f72021-09-05 00:54:25 -070083 "libaidlcommonsupport",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080084 ],
85 header_libs: [
86 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070087 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070088 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080089 "android.hardware.graphics.composer@2.4-command-buffer",
Ady Abrahame7385f72021-09-05 00:54:25 -070090 "android.hardware.graphics.composer3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080091 ],
92 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070093 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070094 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080095 "libserviceutils",
96 ],
97 export_shared_lib_headers: [
98 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080099 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -0700100 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800101 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -0700102 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700103 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -0700104 "android.hardware.graphics.composer@2.4",
Ady Abrahame7385f72021-09-05 00:54:25 -0700105 "android.hardware.graphics.composer3-V1-ndk",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100106 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800107 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -0800108 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800109 ],
Marissa Wall48586522019-11-19 14:01:36 -0800110 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
111 // the library compiled in a way that is accessible to system partition when running
112 // IMapper's VTS.
Vishnu Nair6b591152021-10-08 11:45:14 -0700113 required: ["libgralloctypes"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800114}
115
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700116cc_defaults {
117 name: "libsurfaceflinger_production_defaults",
118 defaults: ["libsurfaceflinger_defaults"],
119 cflags: [
120 "-fvisibility=hidden",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700121 ],
122 lto: {
123 thin: true,
124 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800125 whole_program_vtables: true, // Requires ThinLTO
Yi Kong2598f202021-02-19 17:48:33 +0800126 pgo: {
127 sampling: true,
128 profile_file: "surfaceflinger/surfaceflinger.profdata",
129 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700130 // TODO(b/131771163): Fix broken fuzzer support with LTO.
131 sanitize: {
132 fuzzer: false,
133 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700134}
135
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800136cc_library_headers {
137 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800138 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800139 static_libs: ["libserviceutils"],
140 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800141}
Kalle Raitaa099a242017-01-11 11:17:29 -0800142
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143filegroup {
144 name: "libsurfaceflinger_sources",
145 srcs: [
146 "BufferLayer.cpp",
147 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700148 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700149 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700150 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800151 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800152 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800153 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800154 "DisplayDevice.cpp",
Ady Abrahame7385f72021-09-05 00:54:25 -0700155 "DisplayHardware/AidlComposerHal.cpp",
Ady Abraham9fc28052021-10-14 17:21:38 -0700156 "DisplayHardware/HidlComposerHal.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800157 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700158 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800159 "DisplayHardware/FramebufferSurface.cpp",
Jason Macnak56973c42021-07-16 13:57:41 -0700160 "DisplayHardware/Hash.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800161 "DisplayHardware/HWC2.cpp",
162 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100163 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800164 "DisplayHardware/VirtualDisplaySurface.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200165 "DisplayRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800166 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800167 "EventLog/EventLog.cpp",
rnlee81d32602021-07-27 13:24:07 -0700168 "FlagManager.cpp",
Alec Mouriadebf5c2021-01-05 12:57:36 -0800169 "FpsReporter.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700170 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800171 "FrameTracker.cpp",
John Reck88270902021-03-18 11:27:35 -0400172 "HdrLayerInfoReporter.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500173 "WindowInfosListenerInvoker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800174 "Layer.cpp",
175 "LayerProtoHelper.cpp",
176 "LayerRejecter.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200177 "LayerRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800178 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800179 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700180 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700181 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800182 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700183 "RenderArea.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700184 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700185 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700186 "Scheduler/OneShotTimer.cpp",
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100187 "Scheduler/LayerHistory.cpp",
188 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700189 "Scheduler/MessageQueue.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800190 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700191 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100192 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800193 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700194 "Scheduler/VSyncDispatchTimerQueue.cpp",
195 "Scheduler/VSyncPredictor.cpp",
Dominik Laskowskia93a5312020-07-23 15:10:03 -0700196 "Scheduler/VsyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800197 "Scheduler/VSyncReactor.cpp",
Ady Abrahamc581d3c2020-08-06 17:34:27 -0700198 "Scheduler/VsyncConfiguration.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800199 "StartPropertySetThread.cpp",
200 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700201 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800202 "SurfaceInterceptor.cpp",
Vishnu Nair00b90132021-11-05 14:03:40 -0700203 "Tracing/LayerTracing.cpp",
Vishnu Nair6b591152021-10-08 11:45:14 -0700204 "Tracing/TransactionProtoParser.cpp",
Robert Carr9a803c32021-01-14 16:57:58 -0800205 "TransactionCallbackInvoker.cpp",
Galia Peycheva8f04b302021-04-27 13:25:38 +0200206 "TunnelModeEnabledReporter.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800207 ],
208}
209
John Reck8b1ae3f2020-09-10 17:01:09 +0000210cc_defaults {
211 name: "libsurfaceflinger_binary",
212 defaults: [
213 "surfaceflinger_defaults",
214 "libsurfaceflinger_production_defaults",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215 ],
mamik94e91f62019-08-19 09:11:33 -0700216 cflags: [
John Reck8b1ae3f2020-09-10 17:01:09 +0000217 "-DLOG_TAG=\"SurfaceFlinger\"",
mamik94e91f62019-08-19 09:11:33 -0700218 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800219 shared_libs: [
220 "android.frameworks.displayservice@1.0",
221 "android.hardware.configstore-utils",
222 "android.hardware.configstore@1.0",
223 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800224 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800225 "libbinder",
226 "libcutils",
227 "libdisplayservicehidl",
228 "libhidlbase",
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 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700239}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800240
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700241filegroup {
242 name: "surfaceflinger_binary_sources",
John Reck8b1ae3f2020-09-10 17:01:09 +0000243 srcs: [
244 ":libsurfaceflinger_sources",
Lloyd Piqued777be42020-09-11 15:38:53 -0700245 "main_surfaceflinger.cpp",
John Reck8b1ae3f2020-09-10 17:01:09 +0000246 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700247}
248
249cc_binary {
250 name: "surfaceflinger",
251 defaults: ["libsurfaceflinger_binary"],
252 init_rc: ["surfaceflinger.rc"],
Lloyd Piqued777be42020-09-11 15:38:53 -0700253 srcs: [
254 ":surfaceflinger_binary_sources",
255 // Note: SurfaceFlingerFactory is not in the filegroup so that it
256 // can be easily replaced.
257 "SurfaceFlingerFactory.cpp",
258 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900259 shared_libs: [
Inseob Kimd6e835b2019-02-14 12:33:30 +0900260 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900261 ],
Alec Mouri0a9bc472020-09-10 18:03:43 -0700262
Vishnu Nair6b591152021-10-08 11:45:14 -0700263 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800264}
265
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800266subdirs = [
267 "layerproto",
268 "tests",
269]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270
271cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900272 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900273 srcs: [
274 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900275 ],
276 shared_libs: [
277 "android.hardware.configstore-utils",
278 "android.hardware.configstore@1.0",
279 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900280 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900281 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900282 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900283 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900284 "liblog",
285 ],
286 static_libs: [
287 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900288 ],
289 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900290 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900291 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900292 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900293 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900294 export_static_lib_headers: [
295 "SurfaceFlingerProperties",
296 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900297}