blob: 5683a9280f03edbaa894125066f66e7aed995eeb [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",
Nolan Scobie8ef7e142022-10-14 10:52:43 -040029 "librenderengine_deps",
John Reck67b1e2b2020-08-26 13:17:24 -070030 "surfaceflinger_defaults",
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",
Matt Buckleyb10b7062022-11-01 21:01:06 +000050 "android.hardware.power-V4-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080051 "libbase",
52 "libbinder",
Ady Abrahame7385f72021-09-05 00:54:25 -070053 "libbinder_ndk",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080054 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080055 "libEGL",
56 "libfmq",
57 "libGLESv1_CM",
58 "libGLESv2",
59 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080060 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080061 "liblayers_proto",
62 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090063 "libnativewindow",
Matt Buckleycbfe23c2022-11-08 23:12:04 +000064 "libpowermanager",
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",
Huihong Luo9e84f332021-12-16 14:33:46 -080079 "libgui_aidl_static",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070080 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070081 "librenderengine",
Dominik Laskowskif6b4ba62021-11-09 12:46:10 -080082 "libscheduler",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080083 "libserviceutils",
Alec Mouri492c85c2021-11-19 15:58:10 -080084 "libshaders",
Alec Mouri465b2962021-10-08 16:22:21 -070085 "libtonemap",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080086 ],
87 header_libs: [
88 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070089 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070090 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080091 "android.hardware.graphics.composer@2.4-command-buffer",
Ady Abrahame7385f72021-09-05 00:54:25 -070092 "android.hardware.graphics.composer3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080093 ],
94 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070095 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070096 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080097 "libserviceutils",
98 ],
99 export_shared_lib_headers: [
100 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800101 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -0700102 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800103 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -0700104 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700105 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -0700106 "android.hardware.graphics.composer@2.4",
Matt Buckleycbfe23c2022-11-08 23:12:04 +0000107 "libpowermanager",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800108 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -0800109 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800110 ],
Marissa Wall48586522019-11-19 14:01:36 -0800111 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
112 // the library compiled in a way that is accessible to system partition when running
113 // IMapper's VTS.
Vishnu Nair6b591152021-10-08 11:45:14 -0700114 required: ["libgralloctypes"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800115}
116
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700117cc_defaults {
118 name: "libsurfaceflinger_production_defaults",
119 defaults: ["libsurfaceflinger_defaults"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700120 lto: {
121 thin: true,
122 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800123 whole_program_vtables: true, // Requires ThinLTO
Yi Kong5cb3bb62022-01-06 16:01:18 +0800124 afdo: true,
Mitch Phillips21499ce2022-03-02 01:25:22 +0000125 // TODO(b/131771163): Fix broken fuzzer support with LTO.
126 sanitize: {
127 fuzzer: false,
128 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700129}
130
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131cc_library_headers {
132 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800133 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800134 static_libs: ["libserviceutils"],
135 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800136}
Kalle Raitaa099a242017-01-11 11:17:29 -0800137
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800138filegroup {
139 name: "libsurfaceflinger_sources",
140 srcs: [
Vishnu Nair34eb9ca2021-11-18 15:23:23 -0800141 "BackgroundExecutor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "Client.cpp",
Dominik Laskowskib363c4c2022-08-02 14:03:41 -0700143 "ClientCache.cpp",
144 "Display/DisplaySnapshot.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800145 "DisplayDevice.cpp",
Ady Abrahame7385f72021-09-05 00:54:25 -0700146 "DisplayHardware/AidlComposerHal.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800147 "DisplayHardware/ComposerHal.cpp",
148 "DisplayHardware/FramebufferSurface.cpp",
149 "DisplayHardware/HWC2.cpp",
150 "DisplayHardware/HWComposer.cpp",
Dominik Laskowskib363c4c2022-08-02 14:03:41 -0700151 "DisplayHardware/HidlComposerHal.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100152 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800153 "DisplayHardware/VirtualDisplaySurface.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200154 "DisplayRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800155 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800156 "EventLog/EventLog.cpp",
Vishnu Naircb8be502022-10-12 19:03:23 +0000157 "FrontEnd/LayerCreationArgs.cpp",
Vishnu Nair07e2a482022-10-18 19:18:16 +0000158 "FrontEnd/LayerHandle.cpp",
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000159 "FrontEnd/LayerSnapshot.cpp",
160 "FrontEnd/LayerSnapshotBuilder.cpp",
Vishnu Nair04f89692022-11-16 23:21:05 +0000161 "FrontEnd/LayerHierarchy.cpp",
Vishnu Nairdc4d31b2022-11-17 03:20:58 +0000162 "FrontEnd/LayerLifecycleManager.cpp",
163 "FrontEnd/RequestedLayerState.cpp",
Vishnu Naira61e4fb2022-10-18 18:29:37 +0000164 "FrontEnd/TransactionHandler.cpp",
rnlee81d32602021-07-27 13:24:07 -0700165 "FlagManager.cpp",
Alec Mouriadebf5c2021-01-05 12:57:36 -0800166 "FpsReporter.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700167 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800168 "FrameTracker.cpp",
John Reck88270902021-03-18 11:27:35 -0400169 "HdrLayerInfoReporter.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500170 "WindowInfosListenerInvoker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800171 "Layer.cpp",
Vishnu Naire14c6b32022-08-06 04:20:15 +0000172 "LayerFE.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800173 "LayerProtoHelper.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200174 "LayerRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800175 "LayerVector.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700176 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700177 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800178 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700179 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700180 "Scheduler/EventThread.cpp",
Andy Yu2ae6b6b2021-11-18 14:51:06 -0800181 "Scheduler/FrameRateOverrideMappings.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700182 "Scheduler/OneShotTimer.cpp",
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100183 "Scheduler/LayerHistory.cpp",
184 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700185 "Scheduler/MessageQueue.cpp",
Dominik Laskowskid82e0f02022-10-26 15:23:04 -0400186 "Scheduler/RefreshRateSelector.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700187 "Scheduler/Scheduler.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700188 "Scheduler/VSyncDispatchTimerQueue.cpp",
189 "Scheduler/VSyncPredictor.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800190 "Scheduler/VSyncReactor.cpp",
Ady Abrahamc581d3c2020-08-06 17:34:27 -0700191 "Scheduler/VsyncConfiguration.cpp",
Dominik Laskowski068173d2021-08-11 17:22:59 -0700192 "Scheduler/VsyncModulator.cpp",
193 "Scheduler/VsyncSchedule.cpp",
Patrick Williams7584c6a2022-10-29 02:10:58 +0000194 "ScreenCaptureOutput.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800195 "StartPropertySetThread.cpp",
196 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700197 "SurfaceFlingerDefaultFactory.cpp",
Vishnu Nair00b90132021-11-05 14:03:40 -0700198 "Tracing/LayerTracing.cpp",
Vishnu Nair7891e962021-11-11 12:07:21 -0800199 "Tracing/TransactionTracing.cpp",
Vishnu Nair6b591152021-10-08 11:45:14 -0700200 "Tracing/TransactionProtoParser.cpp",
Robert Carr9a803c32021-01-14 16:57:58 -0800201 "TransactionCallbackInvoker.cpp",
Galia Peycheva8f04b302021-04-27 13:25:38 +0200202 "TunnelModeEnabledReporter.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800203 ],
204}
205
John Reck8b1ae3f2020-09-10 17:01:09 +0000206cc_defaults {
207 name: "libsurfaceflinger_binary",
208 defaults: [
209 "surfaceflinger_defaults",
210 "libsurfaceflinger_production_defaults",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800211 ],
mamik94e91f62019-08-19 09:11:33 -0700212 cflags: [
John Reck8b1ae3f2020-09-10 17:01:09 +0000213 "-DLOG_TAG=\"SurfaceFlinger\"",
mamik94e91f62019-08-19 09:11:33 -0700214 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215 shared_libs: [
216 "android.frameworks.displayservice@1.0",
217 "android.hardware.configstore-utils",
218 "android.hardware.configstore@1.0",
219 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800220 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800221 "libbinder",
222 "libcutils",
223 "libdisplayservicehidl",
224 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800225 "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",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800232 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700233}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800234
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700235filegroup {
236 name: "surfaceflinger_binary_sources",
John Reck8b1ae3f2020-09-10 17:01:09 +0000237 srcs: [
238 ":libsurfaceflinger_sources",
Lloyd Piqued777be42020-09-11 15:38:53 -0700239 "main_surfaceflinger.cpp",
John Reck8b1ae3f2020-09-10 17:01:09 +0000240 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700241}
242
243cc_binary {
244 name: "surfaceflinger",
245 defaults: ["libsurfaceflinger_binary"],
246 init_rc: ["surfaceflinger.rc"],
Lloyd Piqued777be42020-09-11 15:38:53 -0700247 srcs: [
248 ":surfaceflinger_binary_sources",
249 // Note: SurfaceFlingerFactory is not in the filegroup so that it
250 // can be easily replaced.
251 "SurfaceFlingerFactory.cpp",
252 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900253 shared_libs: [
Inseob Kimd6e835b2019-02-14 12:33:30 +0900254 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255 ],
Alec Mouri0a9bc472020-09-10 18:03:43 -0700256
Vishnu Nair6b591152021-10-08 11:45:14 -0700257 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800258}
259
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800260subdirs = [
261 "layerproto",
262 "tests",
263]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900264
265cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900266 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900267 srcs: [
268 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900269 ],
270 shared_libs: [
271 "android.hardware.configstore-utils",
272 "android.hardware.configstore@1.0",
273 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900274 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900275 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900276 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900277 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900278 "liblog",
279 ],
280 static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000281 "libSurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900282 ],
283 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900284 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900285 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900286 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900287 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900288 export_static_lib_headers: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000289 "libSurfaceFlingerProperties",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900290 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900291}