blob: 170faa8139484a7ffe308427b024b0f8953b945f [file] [log] [blame]
Dan Stoza01049c82014-11-11 10:32:31 -08001LOCAL_PATH := $(call my-dir)
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08002include $(CLEAR_VARS)
3
Jesse Hall24cd98e2014-07-13 14:37:16 -07004LOCAL_CLANG := true
5
Jesse Halle9b23b62014-07-14 15:32:59 -07006LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Stoza01049c82014-11-11 10:32:31 -08007LOCAL_SRC_FILES := \
Jesse Hall99c7dbb2013-03-14 14:29:29 -07008 Client.cpp \
9 DisplayDevice.cpp \
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070010 DispSync.cpp \
Jamie Gennisd1700752013-10-14 12:22:52 -070011 EventControlThread.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070012 EventThread.cpp \
Pablo Ceballos40845df2016-01-25 17:41:15 -080013 FenceTracker.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070014 FrameTracker.cpp \
Jesse Hallfc038bd2016-03-26 22:20:22 -070015 GpuService.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070016 Layer.cpp \
17 LayerDim.cpp \
18 MessageQueue.cpp \
Dan Stozab9b08832014-03-13 11:55:57 -070019 MonitoredProducer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070020 SurfaceFlingerConsumer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070021 Transform.cpp \
22 DisplayHardware/FramebufferSurface.cpp \
Dan Stoza651bf312015-10-23 17:03:17 -070023 DisplayHardware/HWC2.cpp \
Dan Stozac6998d22015-09-24 17:03:36 -070024 DisplayHardware/HWC2On1Adapter.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070025 DisplayHardware/PowerHAL.cpp \
26 DisplayHardware/VirtualDisplaySurface.cpp \
Mathias Agopianff2ed702013-09-01 21:36:12 -070027 Effects/Daltonizer.cpp \
Mathias Agopian85cce372013-06-04 21:50:31 -070028 EventLog/EventLogTags.logtags \
Mathias Agopian875d8e12013-06-07 15:35:48 -070029 EventLog/EventLog.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070030 RenderEngine/Description.cpp \
31 RenderEngine/Mesh.cpp \
32 RenderEngine/Program.cpp \
33 RenderEngine/ProgramCache.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070034 RenderEngine/GLExtensions.cpp \
35 RenderEngine/RenderEngine.cpp \
Mathias Agopian49457ac2013-08-14 18:20:17 -070036 RenderEngine/Texture.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070037 RenderEngine/GLES10RenderEngine.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070038 RenderEngine/GLES11RenderEngine.cpp \
39 RenderEngine/GLES20RenderEngine.cpp
Mathias Agopian875d8e12013-06-07 15:35:48 -070040
Jesse Hall8b0d55e2016-03-31 19:29:36 -070041LOCAL_C_INCLUDES := \
42 frameworks/native/vulkan/include \
43 external/vulkan-validation-layers/libs/vkjson
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080044
Dan Stoza01049c82014-11-11 10:32:31 -080045LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Mathias Agopian076b1cc2009-04-10 14:24:30 -070046LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
Dan Stoza9e56aa02015-11-02 13:00:03 -080047
Dan Stozaf9d7e1a2016-06-21 10:00:37 -070048ifeq ($(TARGET_USES_HWC2),true)
Dan Stoza9e56aa02015-11-02 13:00:03 -080049 LOCAL_CFLAGS += -DUSE_HWC2
50 LOCAL_SRC_FILES += \
51 SurfaceFlinger.cpp \
52 DisplayHardware/HWComposer.cpp
53else
54 LOCAL_SRC_FILES += \
55 SurfaceFlinger_hwc1.cpp \
56 DisplayHardware/HWComposer_hwc1.cpp
57endif
58
Mathias Agopian5df99622012-06-18 17:27:56 -070059ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080060 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian57bf9e72011-10-07 15:42:53 -070061endif
Mathias Agopian5df99622012-06-18 17:27:56 -070062ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080063 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070064endif
65
Mathias Agopian5df99622012-06-18 17:27:56 -070066ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080067 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
Mathias Agopian67226812010-10-11 17:54:43 -070068endif
69
Jesse Hallc354eff2013-10-25 10:44:41 -070070ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
71 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040072endif
73
Jamie Genniscdbaecb2012-10-12 14:18:10 -070074ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080075 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
Jamie Genniscdbaecb2012-10-12 14:18:10 -070076endif
77
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070078ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
79 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
80endif
81
Dan Stoza28ffe192016-09-09 13:50:19 -070082# 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 Gennisfaf77cc2013-07-30 15:10:32 -0700102ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
103 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
104else
Dan Stoza28ffe192016-09-09 13:50:19 -0700105 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700106endif
107
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700108ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
109 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
110else
Dan Stoza28ffe192016-09-09 13:50:19 -0700111 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700112endif
113
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700114ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
115 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
116else
117 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
118endif
119
Dan Stoza1f3efb12014-10-15 16:34:55 -0700120ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
121 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
122else
123 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
124endif
125
Michael Lentine7306c672014-07-30 13:00:37 -0700126LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Mathias Agopianb6df7d02013-05-09 14:53:35 -0700127
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700128LOCAL_STATIC_LIBRARIES := libvkjson
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800129LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800130 libcutils \
131 liblog \
132 libdl \
133 libhardware \
134 libutils \
135 libEGL \
136 libGLESv1_CM \
137 libGLESv2 \
138 libbinder \
139 libui \
140 libgui \
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700141 libpowermanager \
142 libvulkan
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800143
Dan Stoza01049c82014-11-11 10:32:31 -0800144LOCAL_MODULE := libsurfaceflinger
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800145
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800146LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
147
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800148include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700149
150###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700151# build surfaceflinger's executable
152include $(CLEAR_VARS)
153
Dan Stoza01049c82014-11-11 10:32:31 -0800154LOCAL_CLANG := true
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700155
Dimitry Ivanovf06248f2016-08-01 14:13:37 -0700156LOCAL_LDFLAGS_32 := -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic
157LOCAL_LDFLAGS_64 := -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic
Dan Stoza01049c82014-11-11 10:32:31 -0800158LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Dan Stoza01049c82014-11-11 10:32:31 -0800159
Tom Cherry74155992015-08-14 13:01:23 -0700160LOCAL_INIT_RC := surfaceflinger.rc
161
Tim Murrayac8d2392015-11-10 14:29:45 -0800162ifneq ($(ENABLE_CPUSETS),)
163 LOCAL_CFLAGS += -DENABLE_CPUSETS
164endif
165
Dan Stoza10d3fb22016-07-27 15:05:38 -0700166ifeq ($(TARGET_USES_HWC2),true)
167 LOCAL_CFLAGS += -DUSE_HWC2
168endif
169
Dan Stoza01049c82014-11-11 10:32:31 -0800170LOCAL_SRC_FILES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800171 main_surfaceflinger.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700172
173LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800174 libsurfaceflinger \
175 libcutils \
176 liblog \
177 libbinder \
178 libutils \
179 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700180
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700181LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
182
Dan Stoza01049c82014-11-11 10:32:31 -0800183LOCAL_MODULE := surfaceflinger
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700184
Colin Cross89450d42014-02-20 15:36:21 -0800185ifdef TARGET_32_BIT_SURFACEFLINGER
186LOCAL_32_BIT_ONLY := true
187endif
188
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800189LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
190
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700191include $(BUILD_EXECUTABLE)
192
193###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700194# uses jni which may not be available in PDK
195ifneq ($(wildcard libnativehelper/include),)
196include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700197
Dan Stoza01049c82014-11-11 10:32:31 -0800198LOCAL_CLANG := true
199
200LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Dan Stoza01049c82014-11-11 10:32:31 -0800201
202LOCAL_SRC_FILES := \
Keun young Park63f165f2012-08-31 10:53:36 -0700203 DdmConnection.cpp
204
205LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800206 libcutils \
207 liblog \
208 libdl
Keun young Park63f165f2012-08-31 10:53:36 -0700209
Dan Stoza01049c82014-11-11 10:32:31 -0800210LOCAL_MODULE := libsurfaceflinger_ddmconnection
Keun young Park63f165f2012-08-31 10:53:36 -0700211
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800212LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
213
Keun young Park63f165f2012-08-31 10:53:36 -0700214include $(BUILD_SHARED_LIBRARY)
215endif # libnativehelper