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