1 LOCAL_PATH := $(call my-dir) 2 include $(CLEAR_VARS) 3 4 LOCAL_CLANG := true 5 6 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 7 LOCAL_SRC_FILES := \ 8 Client.cpp \ 9 DisplayDevice.cpp \ 10 DispSync.cpp \ 11 EventControlThread.cpp \ 12 EventThread.cpp \ 13 FenceTracker.cpp \ 14 FrameTracker.cpp \ 15 GpuService.cpp \ 16 Layer.cpp \ 17 LayerDim.cpp \ 18 MessageQueue.cpp \ 19 MonitoredProducer.cpp \ 20 SurfaceFlingerConsumer.cpp \ 21 Transform.cpp \ 22 DisplayHardware/FramebufferSurface.cpp \ 23 DisplayHardware/HWC2.cpp \ 24 DisplayHardware/HWC2On1Adapter.cpp \ 25 DisplayHardware/PowerHAL.cpp \ 26 DisplayHardware/VirtualDisplaySurface.cpp \ 27 Effects/Daltonizer.cpp \ 28 EventLog/EventLogTags.logtags \ 29 EventLog/EventLog.cpp \ 30 RenderEngine/Description.cpp \ 31 RenderEngine/Mesh.cpp \ 32 RenderEngine/Program.cpp \ 33 RenderEngine/ProgramCache.cpp \ 34 RenderEngine/GLExtensions.cpp \ 35 RenderEngine/RenderEngine.cpp \ 36 RenderEngine/Texture.cpp \ 37 RenderEngine/GLES10RenderEngine.cpp \ 38 RenderEngine/GLES11RenderEngine.cpp \ 39 RenderEngine/GLES20RenderEngine.cpp 40 41 LOCAL_C_INCLUDES := \ 42 frameworks/native/vulkan/include \ 43 external/vulkan-validation-layers/libs/vkjson 44 45 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" 46 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES 47 48 ifeq ($(TARGET_USES_HWC2),true) 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 59 ifeq ($(TARGET_BOARD_PLATFORM),omap4) 60 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY 61 endif 62 ifeq ($(TARGET_BOARD_PLATFORM),s5pc110) 63 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY 64 endif 65 66 ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true) 67 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING 68 endif 69 70 ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) 71 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS 72 endif 73 74 ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),) 75 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS) 76 endif 77 78 ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true) 79 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK 80 endif 81 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 102 ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),) 103 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS) 104 else 105 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000 106 endif 107 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 111 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000 112 endif 113 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 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 126 LOCAL_CFLAGS += -fvisibility=hidden -Werror=format 127 LOCAL_CFLAGS += -std=c++14 128 129 LOCAL_STATIC_LIBRARIES := libvkjson 130 LOCAL_SHARED_LIBRARIES := \ 131 libcutils \ 132 liblog \ 133 libdl \ 134 libhardware \ 135 libutils \ 136 libEGL \ 137 libGLESv1_CM \ 138 libGLESv2 \ 139 libbinder \ 140 libui \ 141 libgui \ 142 libpowermanager \ 143 libvulkan 144 145 LOCAL_MODULE := libsurfaceflinger 146 147 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code 148 149 include $(BUILD_SHARED_LIBRARY) 150 151 ############################################################### 152 # build surfaceflinger's executable 153 include $(CLEAR_VARS) 154 155 LOCAL_CLANG := true 156 157 LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic 158 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" 159 LOCAL_CPPFLAGS := -std=c++14 160 161 LOCAL_INIT_RC := surfaceflinger.rc 162 163 ifneq ($(ENABLE_CPUSETS),) 164 LOCAL_CFLAGS += -DENABLE_CPUSETS 165 endif 166 167 ifeq ($(TARGET_USES_HWC2),true) 168 LOCAL_CFLAGS += -DUSE_HWC2 169 endif 170 171 LOCAL_SRC_FILES := \ 172 main_surfaceflinger.cpp 173 174 LOCAL_SHARED_LIBRARIES := \ 175 libsurfaceflinger \ 176 libcutils \ 177 liblog \ 178 libbinder \ 179 libutils \ 180 libdl 181 182 LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain 183 184 LOCAL_MODULE := surfaceflinger 185 186 ifdef TARGET_32_BIT_SURFACEFLINGER 187 LOCAL_32_BIT_ONLY := true 188 endif 189 190 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code 191 192 include $(BUILD_EXECUTABLE) 193 194 ############################################################### 195 # uses jni which may not be available in PDK 196 ifneq ($(wildcard libnativehelper/include),) 197 include $(CLEAR_VARS) 198 199 LOCAL_CLANG := true 200 201 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\" 202 LOCAL_CPPFLAGS := -std=c++14 203 204 LOCAL_SRC_FILES := \ 205 DdmConnection.cpp 206 207 LOCAL_SHARED_LIBRARIES := \ 208 libcutils \ 209 liblog \ 210 libdl 211 212 LOCAL_MODULE := libsurfaceflinger_ddmconnection 213 214 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code 215 216 include $(BUILD_SHARED_LIBRARY) 217 endif # libnativehelper 218