blob: c39c98326d17aabc01eaad99bd842023aaa6354d [file] [log] [blame]
Bob Badour2e671852021-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",
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",
28 "skia_deps",
29 ],
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",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080042 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070043 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070044 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070045 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080046 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010047 "android.hardware.power@1.3",
Jeongik Cha830c5002021-01-28 00:49:48 +090048 "android.hardware.power-V1-cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080049 "libbase",
50 "libbinder",
51 "libcutils",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080052 "libEGL",
53 "libfmq",
54 "libGLESv1_CM",
55 "libGLESv2",
56 "libgui",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080058 "liblayers_proto",
59 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090060 "libnativewindow",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070061 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080062 "libprotobuf-cpp-lite",
Alec Mouri989ddbe2020-02-06 09:26:19 -080063 "libstatslog",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080064 "libsync",
Yiwei Zhangd7927052020-01-13 16:05:01 -080065 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080066 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070067 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080068 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090069 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080070 ],
71 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070072 "libcompositionengine",
Adithya Srinivasanf279e042020-08-17 14:56:27 -070073 "libframetimeline",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070074 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070075 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080076 "libserviceutils",
77 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080078 ],
79 header_libs: [
80 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070081 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070082 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080083 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080084 ],
85 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070086 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070087 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080088 "libserviceutils",
89 ],
90 export_shared_lib_headers: [
91 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080092 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070093 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080094 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070095 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070096 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070097 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010098 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080099 "libhidlbase",
Yiwei Zhangd7927052020-01-13 16:05:01 -0800100 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800101 ],
Marissa Wall48586522019-11-19 14:01:36 -0800102 // TODO (marissaw): this library is not used by surfaceflinger. This is here so
103 // the library compiled in a way that is accessible to system partition when running
104 // IMapper's VTS.
105 required: ["libgralloctypes"]
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800106}
107
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700108cc_defaults {
109 name: "libsurfaceflinger_production_defaults",
110 defaults: ["libsurfaceflinger_defaults"],
111 cflags: [
112 "-fvisibility=hidden",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700113 ],
114 lto: {
115 thin: true,
116 },
Yi Kongbf2aa782020-09-21 01:25:16 +0800117 whole_program_vtables: true, // Requires ThinLTO
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700118 // TODO(b/131771163): Fix broken fuzzer support with LTO.
119 sanitize: {
120 fuzzer: false,
121 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700122}
123
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800124cc_library_headers {
125 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800126 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800127 static_libs: ["libserviceutils"],
128 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800129}
Kalle Raitaa099a242017-01-11 11:17:29 -0800130
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131filegroup {
132 name: "libsurfaceflinger_sources",
133 srcs: [
134 "BufferLayer.cpp",
135 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700136 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700137 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700138 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "Client.cpp",
Vishnu Nairfa247b12020-02-11 08:58:26 -0800140 "EffectLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800141 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "DisplayDevice.cpp",
143 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700144 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800145 "DisplayHardware/FramebufferSurface.cpp",
146 "DisplayHardware/HWC2.cpp",
147 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100148 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800149 "DisplayHardware/VirtualDisplaySurface.cpp",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200150 "DisplayRenderArea.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",
Marin Shalamanovf6b5d182020-06-12 02:08:51 +0200158 "LayerRenderArea.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800159 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800160 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700161 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700162 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800163 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700164 "RenderArea.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700165 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700166 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700167 "Scheduler/OneShotTimer.cpp",
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100168 "Scheduler/LayerHistory.cpp",
169 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700170 "Scheduler/MessageQueue.cpp",
Ady Abrahamb4b1e0a2019-11-20 18:25:35 -0800171 "Scheduler/RefreshRateConfigs.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700172 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100173 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800174 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700175 "Scheduler/VSyncDispatchTimerQueue.cpp",
176 "Scheduler/VSyncPredictor.cpp",
Dominik Laskowskia93a5312020-07-23 15:10:03 -0700177 "Scheduler/VsyncModulator.cpp",
Kevin DuBoisb2501ba2019-11-12 14:20:29 -0800178 "Scheduler/VSyncReactor.cpp",
Ady Abrahamc581d3c2020-08-06 17:34:27 -0700179 "Scheduler/VsyncConfiguration.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800180 "StartPropertySetThread.cpp",
181 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700182 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800183 "SurfaceInterceptor.cpp",
184 "SurfaceTracing.cpp",
Robert Carr9a803c32021-01-14 16:57:58 -0800185 "TransactionCallbackInvoker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800186 ],
187}
188
John Reck8b1ae3f2020-09-10 17:01:09 +0000189cc_defaults {
190 name: "libsurfaceflinger_binary",
191 defaults: [
192 "surfaceflinger_defaults",
193 "libsurfaceflinger_production_defaults",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800194 ],
mamik94e91f62019-08-19 09:11:33 -0700195 cflags: [
John Reck8b1ae3f2020-09-10 17:01:09 +0000196 "-DLOG_TAG=\"SurfaceFlinger\"",
mamik94e91f62019-08-19 09:11:33 -0700197 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800198 shared_libs: [
199 "android.frameworks.displayservice@1.0",
200 "android.hardware.configstore-utils",
201 "android.hardware.configstore@1.0",
202 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800203 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800204 "libbinder",
205 "libcutils",
206 "libdisplayservicehidl",
207 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700208 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800209 "liblayers_proto",
210 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700211 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800212 "libsync",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800213 "libutils",
214 ],
215 static_libs: [
216 "libserviceutils",
217 "libtrace_proto",
218 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700219}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800220
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700221filegroup {
222 name: "surfaceflinger_binary_sources",
John Reck8b1ae3f2020-09-10 17:01:09 +0000223 srcs: [
224 ":libsurfaceflinger_sources",
Lloyd Piqued777be42020-09-11 15:38:53 -0700225 "main_surfaceflinger.cpp",
John Reck8b1ae3f2020-09-10 17:01:09 +0000226 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700227}
228
229cc_binary {
230 name: "surfaceflinger",
231 defaults: ["libsurfaceflinger_binary"],
232 init_rc: ["surfaceflinger.rc"],
Lloyd Piqued777be42020-09-11 15:38:53 -0700233 srcs: [
234 ":surfaceflinger_binary_sources",
235 // Note: SurfaceFlingerFactory is not in the filegroup so that it
236 // can be easily replaced.
237 "SurfaceFlingerFactory.cpp",
238 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900239 shared_libs: [
Inseob Kimd6e835b2019-02-14 12:33:30 +0900240 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900241 ],
Alec Mouri0a9bc472020-09-10 18:03:43 -0700242
243 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800244}
245
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800246subdirs = [
247 "layerproto",
248 "tests",
249]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900250
251cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900252 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900253 srcs: [
254 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255 ],
256 shared_libs: [
257 "android.hardware.configstore-utils",
258 "android.hardware.configstore@1.0",
259 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900260 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900261 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900262 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900263 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900264 "liblog",
265 ],
266 static_libs: [
267 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900268 ],
269 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900270 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900271 "libhidlbase",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900272 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900273 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900274 export_static_lib_headers: [
275 "SurfaceFlingerProperties",
276 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900277}