1 LOCAL_PATH := $(call my-dir)
6 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
11 EventControlThread.cpp \
12 StartBootAnimThread.cpp \
21 MonitoredProducer.cpp \
22 SurfaceFlingerConsumer.cpp \
23 SurfaceInterceptor.cpp \
25 DisplayHardware/ComposerHal.cpp \
26 DisplayHardware/FramebufferSurface.cpp \
27 DisplayHardware/HWC2.cpp \
28 DisplayHardware/PowerHAL.cpp \
29 DisplayHardware/VirtualDisplaySurface.cpp \
30 Effects/Daltonizer.cpp \
31 EventLog/EventLogTags.logtags \
32 EventLog/EventLog.cpp \
33 RenderEngine/Description.cpp \
34 RenderEngine/Mesh.cpp \
35 RenderEngine/Program.cpp \
36 RenderEngine/ProgramCache.cpp \
37 RenderEngine/GLExtensions.cpp \
38 RenderEngine/RenderEngine.cpp \
39 RenderEngine/Texture.cpp \
40 RenderEngine/GLES20RenderEngine.cpp \
42 LOCAL_MODULE := libsurfaceflinger
44 frameworks/native/vulkan/include \
45 external/vulkan-validation-layers/libs/vkjson \
46 system/libhwbinder/fast_msgq/include \
48 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
49 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
51 ifeq ($(TARGET_USES_HWC2),true)
52 LOCAL_CFLAGS += -DUSE_HWC2
55 VrStateCallbacks.cpp \
56 DisplayHardware/HWComposer.cpp
57 ifeq ($(TARGET_USES_HWC2ON1ADAPTER), true)
58 LOCAL_CFLAGS += -DBYPASS_IHWC
61 LOCAL_CFLAGS += -DBYPASS_IHWC
63 SurfaceFlinger_hwc1.cpp \
64 DisplayHardware/HWComposer_hwc1.cpp
67 ifeq ($(TARGET_BOARD_PLATFORM),omap4)
68 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
70 ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
71 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
74 ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
75 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
78 ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
79 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
82 ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
83 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
86 # The following two BoardConfig variables define (respectively):
88 # - The phase offset between hardware vsync and when apps are woken up by the
89 # Choreographer callback
90 # - The phase offset between hardware vsync and when SurfaceFlinger wakes up
93 # Their values can be tuned to trade off between display pipeline latency (both
94 # overall latency and the lengths of the app --> SF and SF --> display phases)
95 # and frame delivery jitter (which typically manifests as "jank" or "jerkiness"
96 # while interacting with the device). The default values should produce a
97 # relatively low amount of jitter at the expense of roughly two frames of
98 # app --> display latency, and unless significant testing is performed to avoid
99 # increased display jitter (both manual investigation using systrace [1] and
100 # automated testing using dumpsys gfxinfo [2] are recommended), they should not
103 # [1] https://developer.android.com/studio/profile/systrace.html
104 # [2] https://developer.android.com/training/testing/performance.html
106 # These are left just for non-treble devices
107 ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
108 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
110 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000
113 ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
114 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
116 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000
119 ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
120 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
122 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
125 ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
126 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
128 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
131 LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
133 LOCAL_HEADER_LIBRARIES := \
134 android.hardware.configstore-utils
136 LOCAL_STATIC_LIBRARIES := \
137 libhwcomposer-command-buffer \
143 LOCAL_SHARED_LIBRARIES := \
144 android.dvr.composer@1.0 \
145 android.hardware.graphics.allocator@2.0 \
146 android.hardware.graphics.composer@2.1 \
147 android.hardware.configstore@1.0 \
167 libprotobuf-cpp-lite \
169 android.hardware.power@1.0
171 LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
172 android.hardware.graphics.allocator@2.0 \
173 android.hardware.graphics.composer@2.1 \
178 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
180 include $(BUILD_SHARED_LIBRARY)
182 ###############################################################
183 # build surfaceflinger's executable
184 include $(CLEAR_VARS)
188 LOCAL_LDFLAGS_32 := -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic
189 LOCAL_LDFLAGS_64 := -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic
190 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
192 LOCAL_INIT_RC := surfaceflinger.rc
194 ifeq ($(TARGET_USES_HWC2),true)
195 LOCAL_CFLAGS += -DUSE_HWC2
199 main_surfaceflinger.cpp
201 LOCAL_SHARED_LIBRARIES := \
210 LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
211 LOCAL_STATIC_LIBRARIES := libtrace_proto
213 LOCAL_MODULE := surfaceflinger
215 ifdef TARGET_32_BIT_SURFACEFLINGER
216 LOCAL_32_BIT_ONLY := true
219 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
221 include $(BUILD_EXECUTABLE)
223 ###############################################################
224 # uses jni which may not be available in PDK
225 ifneq ($(wildcard libnativehelper/include),)
226 include $(CLEAR_VARS)
230 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
235 LOCAL_SHARED_LIBRARIES := \
240 LOCAL_MODULE := libsurfaceflinger_ddmconnection
242 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
244 include $(BUILD_SHARED_LIBRARY)
245 endif # libnativehelper