blob: f008099a2f04c4754567fd426c7f4d6935cb3c85 [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 \
Fabien Sanglard90f92342016-10-03 10:58:20 -070020 SurfaceFlinger.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070021 SurfaceFlingerConsumer.cpp \
Irvelc274c632016-06-13 16:44:08 -070022 SurfaceInterceptor.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070023 Transform.cpp \
24 DisplayHardware/FramebufferSurface.cpp \
Dan Stoza651bf312015-10-23 17:03:17 -070025 DisplayHardware/HWC2.cpp \
Dan Stozac6998d22015-09-24 17:03:36 -070026 DisplayHardware/HWC2On1Adapter.cpp \
Fabien Sanglard90f92342016-10-03 10:58:20 -070027 DisplayHardware/HWComposer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070028 DisplayHardware/PowerHAL.cpp \
29 DisplayHardware/VirtualDisplaySurface.cpp \
Mathias Agopianff2ed702013-09-01 21:36:12 -070030 Effects/Daltonizer.cpp \
Mathias Agopian85cce372013-06-04 21:50:31 -070031 EventLog/EventLogTags.logtags \
Mathias Agopian875d8e12013-06-07 15:35:48 -070032 EventLog/EventLog.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070033 RenderEngine/Description.cpp \
34 RenderEngine/Mesh.cpp \
35 RenderEngine/Program.cpp \
36 RenderEngine/ProgramCache.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070037 RenderEngine/GLExtensions.cpp \
38 RenderEngine/RenderEngine.cpp \
Mathias Agopian49457ac2013-08-14 18:20:17 -070039 RenderEngine/Texture.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070040 RenderEngine/GLES10RenderEngine.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070041 RenderEngine/GLES11RenderEngine.cpp \
Irvelc274c632016-06-13 16:44:08 -070042 RenderEngine/GLES20RenderEngine.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070043
Irvelc274c632016-06-13 16:44:08 -070044LOCAL_MODULE := libsurfaceflinger
Jesse Hall8b0d55e2016-03-31 19:29:36 -070045LOCAL_C_INCLUDES := \
Irvelc274c632016-06-13 16:44:08 -070046 frameworks/native/vulkan/include \
47 external/vulkan-validation-layers/libs/vkjson \
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080048
Dan Stoza01049c82014-11-11 10:32:31 -080049LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Mathias Agopian076b1cc2009-04-10 14:24:30 -070050LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
Dan Stoza9e56aa02015-11-02 13:00:03 -080051
Mathias Agopian5df99622012-06-18 17:27:56 -070052ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080053 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian57bf9e72011-10-07 15:42:53 -070054endif
Mathias Agopian5df99622012-06-18 17:27:56 -070055ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080056 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070057endif
58
Mathias Agopian5df99622012-06-18 17:27:56 -070059ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080060 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
Mathias Agopian67226812010-10-11 17:54:43 -070061endif
62
Jesse Hallc354eff2013-10-25 10:44:41 -070063ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
64 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040065endif
66
Jamie Genniscdbaecb2012-10-12 14:18:10 -070067ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080068 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
Jamie Genniscdbaecb2012-10-12 14:18:10 -070069endif
70
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070071ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
72 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
73endif
74
Dan Stoza28ffe192016-09-09 13:50:19 -070075# The following two BoardConfig variables define (respectively):
76#
77# - The phase offset between hardware vsync and when apps are woken up by the
78# Choreographer callback
79# - The phase offset between hardware vsync and when SurfaceFlinger wakes up
80# to consume input
81#
82# Their values can be tuned to trade off between display pipeline latency (both
83# overall latency and the lengths of the app --> SF and SF --> display phases)
84# and frame delivery jitter (which typically manifests as "jank" or "jerkiness"
85# while interacting with the device). The default values should produce a
86# relatively low amount of jitter at the expense of roughly two frames of
87# app --> display latency, and unless significant testing is performed to avoid
88# increased display jitter (both manual investigation using systrace [1] and
89# automated testing using dumpsys gfxinfo [2] are recommended), they should not
90# be modified.
91#
92# [1] https://developer.android.com/studio/profile/systrace.html
93# [2] https://developer.android.com/training/testing/performance.html
94
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070095ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
96 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
97else
Dan Stoza28ffe192016-09-09 13:50:19 -070098 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070099endif
100
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700101ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
102 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
103else
Dan Stoza28ffe192016-09-09 13:50:19 -0700104 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700105endif
106
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700107ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
108 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
109else
110 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
111endif
112
Dan Stoza1f3efb12014-10-15 16:34:55 -0700113ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
114 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
115else
116 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
117endif
118
Michael Lentine7306c672014-07-30 13:00:37 -0700119LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Pablo Ceballos40845df2016-01-25 17:41:15 -0800120LOCAL_CFLAGS += -std=c++14
Mathias Agopianb6df7d02013-05-09 14:53:35 -0700121
Irvelc274c632016-06-13 16:44:08 -0700122LOCAL_STATIC_LIBRARIES := libtrace_proto libvkjson
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800123LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800124 libcutils \
125 liblog \
126 libdl \
127 libhardware \
128 libutils \
129 libEGL \
130 libGLESv1_CM \
131 libGLESv2 \
132 libbinder \
133 libui \
134 libgui \
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700135 libpowermanager \
Irvelc274c632016-06-13 16:44:08 -0700136 libvulkan \
137 libprotobuf-cpp-full
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800138
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800139LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
140
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800141include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700142
143###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700144# build surfaceflinger's executable
145include $(CLEAR_VARS)
146
Dan Stoza01049c82014-11-11 10:32:31 -0800147LOCAL_CLANG := true
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700148
Dimitry Ivanovf06248f2016-08-01 14:13:37 -0700149LOCAL_LDFLAGS_32 := -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic
150LOCAL_LDFLAGS_64 := -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic
Dan Stoza01049c82014-11-11 10:32:31 -0800151LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800152LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800153
Tom Cherry74155992015-08-14 13:01:23 -0700154LOCAL_INIT_RC := surfaceflinger.rc
155
Tim Murrayac8d2392015-11-10 14:29:45 -0800156ifneq ($(ENABLE_CPUSETS),)
157 LOCAL_CFLAGS += -DENABLE_CPUSETS
158endif
159
Dan Stoza01049c82014-11-11 10:32:31 -0800160LOCAL_SRC_FILES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800161 main_surfaceflinger.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700162
163LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800164 libsurfaceflinger \
165 libcutils \
166 liblog \
167 libbinder \
168 libutils \
169 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700170
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700171LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
Irvelc274c632016-06-13 16:44:08 -0700172LOCAL_STATIC_LIBRARIES := libtrace_proto
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700173
Dan Stoza01049c82014-11-11 10:32:31 -0800174LOCAL_MODULE := surfaceflinger
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700175
Colin Cross89450d42014-02-20 15:36:21 -0800176ifdef TARGET_32_BIT_SURFACEFLINGER
177LOCAL_32_BIT_ONLY := true
178endif
179
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800180LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
181
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700182include $(BUILD_EXECUTABLE)
183
184###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700185# uses jni which may not be available in PDK
186ifneq ($(wildcard libnativehelper/include),)
187include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700188
Dan Stoza01049c82014-11-11 10:32:31 -0800189LOCAL_CLANG := true
190
191LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800192LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800193
194LOCAL_SRC_FILES := \
Keun young Park63f165f2012-08-31 10:53:36 -0700195 DdmConnection.cpp
196
197LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800198 libcutils \
199 liblog \
200 libdl
Keun young Park63f165f2012-08-31 10:53:36 -0700201
Dan Stoza01049c82014-11-11 10:32:31 -0800202LOCAL_MODULE := libsurfaceflinger_ddmconnection
Keun young Park63f165f2012-08-31 10:53:36 -0700203
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800204LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
205
Keun young Park63f165f2012-08-31 10:53:36 -0700206include $(BUILD_SHARED_LIBRARY)
207endif # libnativehelper