Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2 | include $(CLEAR_VARS) |
| 3 | |
Jesse Hall | 24cd98e | 2014-07-13 14:37:16 -0700 | [diff] [blame] | 4 | LOCAL_CLANG := true |
| 5 | |
Jesse Hall | e9b23b6 | 2014-07-14 15:32:59 -0700 | [diff] [blame] | 6 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 7 | LOCAL_SRC_FILES := \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 8 | Client.cpp \ |
| 9 | DisplayDevice.cpp \ |
Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 10 | DispSync.cpp \ |
Jamie Gennis | d170075 | 2013-10-14 12:22:52 -0700 | [diff] [blame] | 11 | EventControlThread.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 12 | EventThread.cpp \ |
Pablo Ceballos | 40845df | 2016-01-25 17:41:15 -0800 | [diff] [blame] | 13 | FenceTracker.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 14 | FrameTracker.cpp \ |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 15 | GpuService.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 16 | Layer.cpp \ |
| 17 | LayerDim.cpp \ |
Fabien Sanglard | 7b1563a | 2016-10-13 12:05:28 -0700 | [diff] [blame] | 18 | LayerRejecter.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 19 | MessageQueue.cpp \ |
Dan Stoza | b9b0883 | 2014-03-13 11:55:57 -0700 | [diff] [blame] | 20 | MonitoredProducer.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 21 | SurfaceFlingerConsumer.cpp \ |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 22 | SurfaceInterceptor.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 23 | Transform.cpp \ |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 24 | DisplayHardware/ComposerHal.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 25 | DisplayHardware/FramebufferSurface.cpp \ |
Dan Stoza | 651bf31 | 2015-10-23 17:03:17 -0700 | [diff] [blame] | 26 | DisplayHardware/HWC2.cpp \ |
Dan Stoza | c6998d2 | 2015-09-24 17:03:36 -0700 | [diff] [blame] | 27 | DisplayHardware/HWC2On1Adapter.cpp \ |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 28 | DisplayHardware/PowerHAL.cpp \ |
| 29 | DisplayHardware/VirtualDisplaySurface.cpp \ |
Mathias Agopian | ff2ed70 | 2013-09-01 21:36:12 -0700 | [diff] [blame] | 30 | Effects/Daltonizer.cpp \ |
Mathias Agopian | 85cce37 | 2013-06-04 21:50:31 -0700 | [diff] [blame] | 31 | EventLog/EventLogTags.logtags \ |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 32 | EventLog/EventLog.cpp \ |
Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 33 | RenderEngine/Description.cpp \ |
| 34 | RenderEngine/Mesh.cpp \ |
| 35 | RenderEngine/Program.cpp \ |
| 36 | RenderEngine/ProgramCache.cpp \ |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 37 | RenderEngine/GLExtensions.cpp \ |
| 38 | RenderEngine/RenderEngine.cpp \ |
Mathias Agopian | 49457ac | 2013-08-14 18:20:17 -0700 | [diff] [blame] | 39 | RenderEngine/Texture.cpp \ |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 40 | RenderEngine/GLES20RenderEngine.cpp \ |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 41 | |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 42 | LOCAL_MODULE := libsurfaceflinger |
Jesse Hall | 8b0d55e | 2016-03-31 19:29:36 -0700 | [diff] [blame] | 43 | LOCAL_C_INCLUDES := \ |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 44 | frameworks/native/vulkan/include \ |
| 45 | external/vulkan-validation-layers/libs/vkjson \ |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 47 | LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 48 | LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 49 | |
Fabien Sanglard | 9d96de4 | 2016-10-11 00:15:18 +0000 | [diff] [blame] | 50 | ifeq ($(TARGET_USES_HWC2),true) |
| 51 | LOCAL_CFLAGS += -DUSE_HWC2 |
| 52 | LOCAL_SRC_FILES += \ |
| 53 | SurfaceFlinger.cpp \ |
| 54 | DisplayHardware/HWComposer.cpp |
| 55 | else |
| 56 | LOCAL_SRC_FILES += \ |
| 57 | SurfaceFlinger_hwc1.cpp \ |
| 58 | DisplayHardware/HWComposer_hwc1.cpp |
| 59 | endif |
| 60 | |
Mathias Agopian | 5df9962 | 2012-06-18 17:27:56 -0700 | [diff] [blame] | 61 | ifeq ($(TARGET_BOARD_PLATFORM),omap4) |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 62 | LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY |
Mathias Agopian | 57bf9e7 | 2011-10-07 15:42:53 -0700 | [diff] [blame] | 63 | endif |
Mathias Agopian | 5df9962 | 2012-06-18 17:27:56 -0700 | [diff] [blame] | 64 | ifeq ($(TARGET_BOARD_PLATFORM),s5pc110) |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 65 | LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY |
Mathias Agopian | 7f42a9c | 2012-04-23 20:00:16 -0700 | [diff] [blame] | 66 | endif |
| 67 | |
Mathias Agopian | 5df9962 | 2012-06-18 17:27:56 -0700 | [diff] [blame] | 68 | ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true) |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 69 | LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING |
Mathias Agopian | 6722681 | 2010-10-11 17:54:43 -0700 | [diff] [blame] | 70 | endif |
| 71 | |
Jesse Hall | c354eff | 2013-10-25 10:44:41 -0700 | [diff] [blame] | 72 | ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) |
| 73 | LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS |
Naseer Ahmed | 6a96846 | 2013-10-04 16:15:22 -0400 | [diff] [blame] | 74 | endif |
| 75 | |
Jamie Gennis | cdbaecb | 2012-10-12 14:18:10 -0700 | [diff] [blame] | 76 | ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),) |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 77 | LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS) |
Jamie Gennis | cdbaecb | 2012-10-12 14:18:10 -0700 | [diff] [blame] | 78 | endif |
| 79 | |
Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 80 | ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true) |
| 81 | LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK |
| 82 | endif |
| 83 | |
Dan Stoza | 28ffe19 | 2016-09-09 13:50:19 -0700 | [diff] [blame] | 84 | # The following two BoardConfig variables define (respectively): |
| 85 | # |
| 86 | # - The phase offset between hardware vsync and when apps are woken up by the |
| 87 | # Choreographer callback |
| 88 | # - The phase offset between hardware vsync and when SurfaceFlinger wakes up |
| 89 | # to consume input |
| 90 | # |
| 91 | # Their values can be tuned to trade off between display pipeline latency (both |
| 92 | # overall latency and the lengths of the app --> SF and SF --> display phases) |
| 93 | # and frame delivery jitter (which typically manifests as "jank" or "jerkiness" |
| 94 | # while interacting with the device). The default values should produce a |
| 95 | # relatively low amount of jitter at the expense of roughly two frames of |
| 96 | # app --> display latency, and unless significant testing is performed to avoid |
| 97 | # increased display jitter (both manual investigation using systrace [1] and |
| 98 | # automated testing using dumpsys gfxinfo [2] are recommended), they should not |
| 99 | # be modified. |
| 100 | # |
| 101 | # [1] https://developer.android.com/studio/profile/systrace.html |
| 102 | # [2] https://developer.android.com/training/testing/performance.html |
| 103 | |
Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 104 | ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),) |
| 105 | LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS) |
| 106 | else |
Dan Stoza | 28ffe19 | 2016-09-09 13:50:19 -0700 | [diff] [blame] | 107 | LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000 |
Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 108 | endif |
| 109 | |
Jamie Gennis | 0a645cc | 2013-10-14 20:52:46 -0700 | [diff] [blame] | 110 | ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),) |
| 111 | LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS) |
| 112 | else |
Dan Stoza | 28ffe19 | 2016-09-09 13:50:19 -0700 | [diff] [blame] | 113 | LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000 |
Jamie Gennis | 0a645cc | 2013-10-14 20:52:46 -0700 | [diff] [blame] | 114 | endif |
| 115 | |
Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 116 | ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),) |
| 117 | LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS) |
| 118 | else |
| 119 | LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0 |
| 120 | endif |
| 121 | |
Dan Stoza | 1f3efb1 | 2014-10-15 16:34:55 -0700 | [diff] [blame] | 122 | ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),) |
| 123 | LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION) |
| 124 | else |
| 125 | LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0 |
| 126 | endif |
| 127 | |
Michael Lentine | 7306c67 | 2014-07-30 13:00:37 -0700 | [diff] [blame] | 128 | LOCAL_CFLAGS += -fvisibility=hidden -Werror=format |
Mathias Agopian | b6df7d0 | 2013-05-09 14:53:35 -0700 | [diff] [blame] | 129 | |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 130 | LOCAL_STATIC_LIBRARIES := libtrace_proto libvkjson |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 131 | LOCAL_SHARED_LIBRARIES := \ |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 132 | android.hardware.graphics.allocator@2.0 \ |
| 133 | android.hardware.graphics.composer@2.1 \ |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 134 | libcutils \ |
| 135 | liblog \ |
| 136 | libdl \ |
| 137 | libhardware \ |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 138 | libhidl \ |
| 139 | libhwbinder \ |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 140 | libutils \ |
| 141 | libEGL \ |
| 142 | libGLESv1_CM \ |
| 143 | libGLESv2 \ |
| 144 | libbinder \ |
| 145 | libui \ |
| 146 | libgui \ |
Jesse Hall | 8b0d55e | 2016-03-31 19:29:36 -0700 | [diff] [blame] | 147 | libpowermanager \ |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 148 | libvulkan \ |
Colin Cross | 6354938 | 2016-10-26 12:52:53 -0700 | [diff] [blame] | 149 | libprotobuf-cpp-lite \ |
Ruchi Kandoi | b5ee178 | 2016-10-04 17:51:50 -0700 | [diff] [blame] | 150 | libhidl \ |
| 151 | libhwbinder \ |
| 152 | libbase \ |
| 153 | libutils \ |
| 154 | android.hardware.power@1.0 |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 156 | LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \ |
| 157 | android.hardware.graphics.allocator@2.0 \ |
| 158 | android.hardware.graphics.composer@2.1 \ |
| 159 | libhidl \ |
| 160 | libhwbinder |
| 161 | |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 162 | LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code |
| 163 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 164 | include $(BUILD_SHARED_LIBRARY) |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 165 | |
| 166 | ############################################################### |
Mathias Agopian | 7ffaa7c | 2013-07-22 12:20:28 -0700 | [diff] [blame] | 167 | # build surfaceflinger's executable |
| 168 | include $(CLEAR_VARS) |
| 169 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 170 | LOCAL_CLANG := true |
Mathias Agopian | 4f4f094 | 2013-08-19 17:26:18 -0700 | [diff] [blame] | 171 | |
Dimitry Ivanov | f06248f | 2016-08-01 14:13:37 -0700 | [diff] [blame] | 172 | LOCAL_LDFLAGS_32 := -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic |
| 173 | LOCAL_LDFLAGS_64 := -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 174 | LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 175 | |
Tom Cherry | 7415599 | 2015-08-14 13:01:23 -0700 | [diff] [blame] | 176 | LOCAL_INIT_RC := surfaceflinger.rc |
| 177 | |
Tim Murray | ac8d239 | 2015-11-10 14:29:45 -0800 | [diff] [blame] | 178 | ifneq ($(ENABLE_CPUSETS),) |
| 179 | LOCAL_CFLAGS += -DENABLE_CPUSETS |
| 180 | endif |
| 181 | |
Fabien Sanglard | 9d96de4 | 2016-10-11 00:15:18 +0000 | [diff] [blame] | 182 | ifeq ($(TARGET_USES_HWC2),true) |
| 183 | LOCAL_CFLAGS += -DUSE_HWC2 |
| 184 | endif |
| 185 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 186 | LOCAL_SRC_FILES := \ |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 187 | main_surfaceflinger.cpp |
Mathias Agopian | 7ffaa7c | 2013-07-22 12:20:28 -0700 | [diff] [blame] | 188 | |
| 189 | LOCAL_SHARED_LIBRARIES := \ |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 190 | libsurfaceflinger \ |
| 191 | libcutils \ |
| 192 | liblog \ |
| 193 | libbinder \ |
| 194 | libutils \ |
| 195 | libdl |
Mathias Agopian | 7ffaa7c | 2013-07-22 12:20:28 -0700 | [diff] [blame] | 196 | |
Dmitriy Ivanov | 4340a14 | 2014-10-20 14:17:26 -0700 | [diff] [blame] | 197 | LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain |
Irvel | c274c63 | 2016-06-13 16:44:08 -0700 | [diff] [blame] | 198 | LOCAL_STATIC_LIBRARIES := libtrace_proto |
Dmitriy Ivanov | 4340a14 | 2014-10-20 14:17:26 -0700 | [diff] [blame] | 199 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 200 | LOCAL_MODULE := surfaceflinger |
Mathias Agopian | 7ffaa7c | 2013-07-22 12:20:28 -0700 | [diff] [blame] | 201 | |
Colin Cross | 89450d4 | 2014-02-20 15:36:21 -0800 | [diff] [blame] | 202 | ifdef TARGET_32_BIT_SURFACEFLINGER |
| 203 | LOCAL_32_BIT_ONLY := true |
| 204 | endif |
| 205 | |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 206 | LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code |
| 207 | |
Mathias Agopian | 7ffaa7c | 2013-07-22 12:20:28 -0700 | [diff] [blame] | 208 | include $(BUILD_EXECUTABLE) |
| 209 | |
| 210 | ############################################################### |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 211 | # uses jni which may not be available in PDK |
| 212 | ifneq ($(wildcard libnativehelper/include),) |
| 213 | include $(CLEAR_VARS) |
Mathias Agopian | 1b3aeb4 | 2012-10-07 16:41:12 -0700 | [diff] [blame] | 214 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 215 | LOCAL_CLANG := true |
| 216 | |
| 217 | LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 218 | |
| 219 | LOCAL_SRC_FILES := \ |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 220 | DdmConnection.cpp |
| 221 | |
| 222 | LOCAL_SHARED_LIBRARIES := \ |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 223 | libcutils \ |
| 224 | liblog \ |
| 225 | libdl |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 226 | |
Dan Stoza | 01049c8 | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 227 | LOCAL_MODULE := libsurfaceflinger_ddmconnection |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 228 | |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 229 | LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code |
| 230 | |
Keun young Park | 63f165f | 2012-08-31 10:53:36 -0700 | [diff] [blame] | 231 | include $(BUILD_SHARED_LIBRARY) |
| 232 | endif # libnativehelper |