blob: c9c0143c7dbec41bdc7c399f4577a9d6dbee10ea [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",
Ady Abrahamd11bade2022-08-01 16:18:03 -070021 "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080022 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080023}
24
25cc_defaults {
26 name: "libsurfaceflinger_defaults",
John Reck67b1e2b2020-08-26 13:17:24 -070027 defaults: [
Sally Qi6920a2f2022-08-26 10:40:05 -070028 "android.hardware.graphics.composer3-ndk_shared",
John Reck67b1e2b2020-08-26 13:17:24 -070029 "surfaceflinger_defaults",
Leon Scroggins IIIe4169c82021-04-28 11:31:50 -040030 "skia_renderengine_deps",
John Reck67b1e2b2020-08-26 13:17:24 -070031 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080032 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070033 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080034 "-DGL_GLEXT_PROTOTYPES",
35 "-DEGL_EGLEXT_PROTOTYPES",
36 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080037 shared_libs: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -080038 "android.hardware.configstore-utils",
39 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080040 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080041 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080042 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070043 "android.hardware.graphics.common@1.2",
Ady Abrahame7385f72021-09-05 00:54:25 -070044 "android.hardware.common-V2-ndk",
45 "android.hardware.common.fmq-V1-ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080046 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070047 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070048 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070049 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080050 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010051 "android.hardware.power@1.3",
Matt Buckley06f299a2021-09-24 19:43:51 +000052 "android.hardware.power-V2-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080053 "libbase",
54 "libbinder",
Ady Abrahame7385f72021-09-05 00:54:25 -070055 "libbinder_ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libEGL",
58 "libfmq",
59 "libGLESv1_CM",
60 "libGLESv2",
61 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080062 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080063 "liblayers_proto",
64 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090065 "libnativewindow",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070066 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080067 "libprotobuf-cpp-lite",
68 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080069 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080070 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070071 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090073 "libSurfaceFlingerProp",
rnlee81d32602021-07-27 13:24:07 -070074 "server_configurable_flags",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080075 ],
76 static_libs: [
Ady Abrahame7385f72021-09-05 00:54:25 -070077 "libaidlcommonsupport",
Lloyd Pique70d91362018-10-18 16:02:55 -070078 "libcompositionengine",
Adithya Srinivasanf279e042020-08-17 14:56:27 -070079 "libframetimeline",
Huihong Luo9e84f332021-12-16 14:33:46 -080080 "libgui_aidl_static",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070081 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070082 "librenderengine",
Dominik Laskowskif6b4ba62021-11-09 12:46:10 -080083 "libscheduler",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080084 "libserviceutils",
Alec Mouri492c85c2021-11-19 15:58:10 -080085 "libshaders",
Alec Mouri465b2962021-10-08 16:22:21 -070086 "libtonemap",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080087 ],
88 header_libs: [
89 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070090 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070091 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080092 "android.hardware.graphics.composer@2.4-command-buffer",
Ady Abrahame7385f72021-09-05 00:54:25 -070093 "android.hardware.graphics.composer3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080094 ],
95 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070096 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070097 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080098 "libserviceutils",
99 ],
100 export_shared_lib_headers: [
101 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800102 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -0700103 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800104 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -0700105 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700106 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -0700107 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100108 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800109 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -0800110 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800111 ],
Marissa Wall48586522019-11-19 14:01:36 -0800112 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
113 // the library compiled in a way that is accessible to system partition when running
114 // IMapper's VTS.
Vishnu Nair6b591152021-10-08 11:45:14 -0700115 required: ["libgralloctypes"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800116}
117
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700118cc_defaults {
119 name: "libsurfaceflinger_production_defaults",
120 defaults: ["libsurfaceflinger_defaults"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700121 lto: {
122 thin: true,
123 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800124 whole_program_vtables: true, // Requires ThinLTO
Yi Kong5cb3bb62022-01-06 16:01:18 +0800125 afdo: true,
Mitch Phillips21499ce2022-03-02 01:25:22 +0000126 // TODO(b/131771163): Fix broken fuzzer support with LTO.
127 sanitize: {
128 fuzzer: false,
129 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700130}
131
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800132cc_library_headers {
133 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800134 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800135 static_libs: ["libserviceutils"],
136 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800137}
Kalle Raitaa099a242017-01-11 11:17:29 -0800138
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139filegroup {
140 name: "libsurfaceflinger_sources",
141 srcs: [
Vishnu Nair34eb9ca2021-11-18 15:23:23 -0800142 "BackgroundExecutor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143 "Client.cpp",
Dominik Laskowskib363c4c2022-08-02 14:03:41 -0700144 "ClientCache.cpp",
145 "Display/DisplaySnapshot.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 "DisplayDevice.cpp",
Ady Abrahame7385f72021-09-05 00:54:25 -0700147 "DisplayHardware/AidlComposerHal.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800148 "DisplayHardware/ComposerHal.cpp",
149 "DisplayHardware/FramebufferSurface.cpp",
150 "DisplayHardware/HWC2.cpp",
151 "DisplayHardware/HWComposer.cpp",
Dominik Laskowskib363c4c2022-08-02 14:03:41 -0700152 "DisplayHardware/HidlComposerHal.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100153 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800154 "DisplayHardware/VirtualDisplaySurface.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200155 "DisplayRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800156 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800157 "EventLog/EventLog.cpp",
Vishnu Naira61e4fb2022-10-18 18:29:37 +0000158 "FrontEnd/TransactionHandler.cpp",
rnlee81d32602021-07-27 13:24:07 -0700159 "FlagManager.cpp",
Alec Mouriadebf5c2021-01-05 12:57:36 -0800160 "FpsReporter.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700161 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800162 "FrameTracker.cpp",
John Reck88270902021-03-18 11:27:35 -0400163 "HdrLayerInfoReporter.cpp",
Vishnu Nair397a0e32022-07-26 00:01:48 +0000164 "HwcSlotGenerator.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500165 "WindowInfosListenerInvoker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800166 "Layer.cpp",
Vishnu Naire14c6b32022-08-06 04:20:15 +0000167 "LayerFE.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800168 "LayerProtoHelper.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200169 "LayerRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800170 "LayerVector.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700171 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700172 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800173 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700174 "RenderArea.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700175 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700176 "Scheduler/EventThread.cpp",
Andy Yu2ae6b6b2021-11-18 14:51:06 -0800177 "Scheduler/FrameRateOverrideMappings.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700178 "Scheduler/OneShotTimer.cpp",
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100179 "Scheduler/LayerHistory.cpp",
180 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700181 "Scheduler/MessageQueue.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800182 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700183 "Scheduler/Scheduler.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700184 "Scheduler/VSyncDispatchTimerQueue.cpp",
185 "Scheduler/VSyncPredictor.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800186 "Scheduler/VSyncReactor.cpp",
Ady Abrahamc581d3c2020-08-06 17:34:27 -0700187 "Scheduler/VsyncConfiguration.cpp",
Dominik Laskowski068173d2021-08-11 17:22:59 -0700188 "Scheduler/VsyncModulator.cpp",
189 "Scheduler/VsyncSchedule.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800190 "StartPropertySetThread.cpp",
191 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700192 "SurfaceFlingerDefaultFactory.cpp",
Vishnu Nair00b90132021-11-05 14:03:40 -0700193 "Tracing/LayerTracing.cpp",
Vishnu Nair7891e962021-11-11 12:07:21 -0800194 "Tracing/TransactionTracing.cpp",
Vishnu Nair6b591152021-10-08 11:45:14 -0700195 "Tracing/TransactionProtoParser.cpp",
Robert Carr9a803c32021-01-14 16:57:58 -0800196 "TransactionCallbackInvoker.cpp",
Galia Peycheva8f04b302021-04-27 13:25:38 +0200197 "TunnelModeEnabledReporter.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800198 ],
199}
200
John Reck8b1ae3f2020-09-10 17:01:09 +0000201cc_defaults {
202 name: "libsurfaceflinger_binary",
203 defaults: [
204 "surfaceflinger_defaults",
205 "libsurfaceflinger_production_defaults",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800206 ],
mamik94e91f62019-08-19 09:11:33 -0700207 cflags: [
John Reck8b1ae3f2020-09-10 17:01:09 +0000208 "-DLOG_TAG=\"SurfaceFlinger\"",
mamik94e91f62019-08-19 09:11:33 -0700209 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800210 shared_libs: [
211 "android.frameworks.displayservice@1.0",
212 "android.hardware.configstore-utils",
213 "android.hardware.configstore@1.0",
214 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800215 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800216 "libbinder",
217 "libcutils",
218 "libdisplayservicehidl",
219 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800220 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700221 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800222 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800223 "libutils",
224 ],
225 static_libs: [
226 "libserviceutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800227 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700228}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800229
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700230filegroup {
231 name: "surfaceflinger_binary_sources",
John Reck8b1ae3f2020-09-10 17:01:09 +0000232 srcs: [
233 ":libsurfaceflinger_sources",
Lloyd Piqued777be42020-09-11 15:38:53 -0700234 "main_surfaceflinger.cpp",
John Reck8b1ae3f2020-09-10 17:01:09 +0000235 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700236}
237
238cc_binary {
239 name: "surfaceflinger",
240 defaults: ["libsurfaceflinger_binary"],
241 init_rc: ["surfaceflinger.rc"],
Lloyd Piqued777be42020-09-11 15:38:53 -0700242 srcs: [
243 ":surfaceflinger_binary_sources",
244 // Note: SurfaceFlingerFactory is not in the filegroup so that it
245 // can be easily replaced.
246 "SurfaceFlingerFactory.cpp",
247 ],
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
Vishnu Nair6b591152021-10-08 11:45:14 -0700252 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: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000276 "libSurfaceFlingerProperties",
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: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000284 "libSurfaceFlingerProperties",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900285 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900286}