blob: afaccd2b5cf1f91d3c8f6ac5ba82a5e7552ce2cd [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 \
Wei Wangb254fa32017-01-31 17:43:23 -080012 StartBootAnimThread.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070013 EventThread.cpp \
14 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 \
Fabien Sanglard7b1563a2016-10-13 12:05:28 -070018 LayerRejecter.cpp \
Robert Carr2047fae2016-11-28 14:09:09 -080019 LayerVector.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070020 MessageQueue.cpp \
Dan Stozab9b08832014-03-13 11:55:57 -070021 MonitoredProducer.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070022 SurfaceFlingerConsumer.cpp \
Irvelc274c632016-06-13 16:44:08 -070023 SurfaceInterceptor.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070024 Transform.cpp \
Chia-I Wuaab99f52016-10-05 12:59:58 +080025 DisplayHardware/ComposerHal.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070026 DisplayHardware/FramebufferSurface.cpp \
Dan Stoza651bf312015-10-23 17:03:17 -070027 DisplayHardware/HWC2.cpp \
Dan Stozac6998d22015-09-24 17:03:36 -070028 DisplayHardware/HWC2On1Adapter.cpp \
Jesse Hall99c7dbb2013-03-14 14:29:29 -070029 DisplayHardware/PowerHAL.cpp \
30 DisplayHardware/VirtualDisplaySurface.cpp \
Mathias Agopianff2ed702013-09-01 21:36:12 -070031 Effects/Daltonizer.cpp \
Mathias Agopian85cce372013-06-04 21:50:31 -070032 EventLog/EventLogTags.logtags \
Mathias Agopian875d8e12013-06-07 15:35:48 -070033 EventLog/EventLog.cpp \
Mathias Agopian3f844832013-08-07 21:24:32 -070034 RenderEngine/Description.cpp \
35 RenderEngine/Mesh.cpp \
36 RenderEngine/Program.cpp \
37 RenderEngine/ProgramCache.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070038 RenderEngine/GLExtensions.cpp \
39 RenderEngine/RenderEngine.cpp \
Mathias Agopian49457ac2013-08-14 18:20:17 -070040 RenderEngine/Texture.cpp \
Irvelc274c632016-06-13 16:44:08 -070041 RenderEngine/GLES20RenderEngine.cpp \
Mathias Agopian875d8e12013-06-07 15:35:48 -070042
Irvelc274c632016-06-13 16:44:08 -070043LOCAL_MODULE := libsurfaceflinger
Jesse Hall8b0d55e2016-03-31 19:29:36 -070044LOCAL_C_INCLUDES := \
Irvelc274c632016-06-13 16:44:08 -070045 frameworks/native/vulkan/include \
46 external/vulkan-validation-layers/libs/vkjson \
Chia-I Wucd8d7f02016-11-16 11:02:31 +080047 system/libhwbinder/fast_msgq/include \
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
Fabien Sanglard9d96de42016-10-11 00:15:18 +000052ifeq ($(TARGET_USES_HWC2),true)
53 LOCAL_CFLAGS += -DUSE_HWC2
54 LOCAL_SRC_FILES += \
55 SurfaceFlinger.cpp \
Hendrik Wagenaar87670ff2017-02-01 12:10:46 -080056 VrStateCallbacks.cpp \
Fabien Sanglard9d96de42016-10-11 00:15:18 +000057 DisplayHardware/HWComposer.cpp
Fabien Sanglardb7432cc2016-11-11 09:40:27 -080058 ifeq ($(TARGET_USES_HWC2ON1ADAPTER), true)
59 LOCAL_CFLAGS += -DBYPASS_IHWC
60 endif
Fabien Sanglard9d96de42016-10-11 00:15:18 +000061else
Fabien Sanglardb7432cc2016-11-11 09:40:27 -080062 LOCAL_CFLAGS += -DBYPASS_IHWC
Fabien Sanglard9d96de42016-10-11 00:15:18 +000063 LOCAL_SRC_FILES += \
64 SurfaceFlinger_hwc1.cpp \
65 DisplayHardware/HWComposer_hwc1.cpp
66endif
67
Mathias Agopian5df99622012-06-18 17:27:56 -070068ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080069 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian57bf9e72011-10-07 15:42:53 -070070endif
Mathias Agopian5df99622012-06-18 17:27:56 -070071ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080072 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070073endif
74
Jesse Hallc354eff2013-10-25 10:44:41 -070075ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
76 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040077endif
78
Jamie Genniscdbaecb2012-10-12 14:18:10 -070079ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080080 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
Jamie Genniscdbaecb2012-10-12 14:18:10 -070081endif
82
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070083ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
84 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
85endif
86
Dan Stoza28ffe192016-09-09 13:50:19 -070087# The following two BoardConfig variables define (respectively):
88#
89# - The phase offset between hardware vsync and when apps are woken up by the
90# Choreographer callback
91# - The phase offset between hardware vsync and when SurfaceFlinger wakes up
92# to consume input
93#
94# Their values can be tuned to trade off between display pipeline latency (both
95# overall latency and the lengths of the app --> SF and SF --> display phases)
96# and frame delivery jitter (which typically manifests as "jank" or "jerkiness"
97# while interacting with the device). The default values should produce a
98# relatively low amount of jitter at the expense of roughly two frames of
99# app --> display latency, and unless significant testing is performed to avoid
100# increased display jitter (both manual investigation using systrace [1] and
101# automated testing using dumpsys gfxinfo [2] are recommended), they should not
102# be modified.
103#
104# [1] https://developer.android.com/studio/profile/systrace.html
105# [2] https://developer.android.com/training/testing/performance.html
106
Jiyong Park4b20c2e2017-01-14 19:45:11 +0900107# These are left just for non-treble devices
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700108ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
109 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
110else
Dan Stoza28ffe192016-09-09 13:50:19 -0700111 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700112endif
113
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700114ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
115 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
116else
Dan Stoza28ffe192016-09-09 13:50:19 -0700117 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000
Jamie Gennis0a645cc2013-10-14 20:52:46 -0700118endif
119
Jamie Gennisfaf77cc2013-07-30 15:10:32 -0700120ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
121 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
122else
123 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
124endif
125
Dan Stoza1f3efb12014-10-15 16:34:55 -0700126ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
127 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
128else
129 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
130endif
131
Michael Lentine7306c672014-07-30 13:00:37 -0700132LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Mathias Agopianb6df7d02013-05-09 14:53:35 -0700133
Jaesoo Lee6c9875d2017-02-27 13:46:40 +0900134LOCAL_HEADER_LIBRARIES := \
135 android.hardware.configstore-utils
136
Hendrik Wagenaar87670ff2017-02-01 12:10:46 -0800137LOCAL_STATIC_LIBRARIES := \
138 libhwcomposer-command-buffer \
139 libtrace_proto \
140 libvkjson \
141 libvr_manager \
142 libvrflinger
143
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800144LOCAL_SHARED_LIBRARIES := \
Daniel Nicoara2f5f8a52016-12-20 16:11:58 -0500145 android.dvr.composer@1.0 \
Chia-I Wuaab99f52016-10-05 12:59:58 +0800146 android.hardware.graphics.allocator@2.0 \
147 android.hardware.graphics.composer@2.1 \
Jiyong Park4b20c2e2017-01-14 19:45:11 +0900148 android.hardware.configstore@1.0 \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800149 libcutils \
150 liblog \
151 libdl \
Chia-I Wucd8d7f02016-11-16 11:02:31 +0800152 libfmq \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800153 libhardware \
Yifan Hong67a47622016-11-17 13:02:06 -0800154 libhidlbase \
155 libhidltransport \
Chia-I Wuaab99f52016-10-05 12:59:58 +0800156 libhwbinder \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800157 libutils \
158 libEGL \
159 libGLESv1_CM \
160 libGLESv2 \
161 libbinder \
162 libui \
163 libgui \
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700164 libpowermanager \
Irvelc274c632016-06-13 16:44:08 -0700165 libvulkan \
Chia-I Wucd8d7f02016-11-16 11:02:31 +0800166 libsync \
Colin Cross63549382016-10-26 12:52:53 -0700167 libprotobuf-cpp-lite \
Ruchi Kandoib5ee1782016-10-04 17:51:50 -0700168 libbase \
Ruchi Kandoib5ee1782016-10-04 17:51:50 -0700169 android.hardware.power@1.0
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800170
Chia-I Wuaab99f52016-10-05 12:59:58 +0800171LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
172 android.hardware.graphics.allocator@2.0 \
173 android.hardware.graphics.composer@2.1 \
Yifan Hong67a47622016-11-17 13:02:06 -0800174 libhidlbase \
175 libhidltransport \
Chia-I Wuaab99f52016-10-05 12:59:58 +0800176 libhwbinder
177
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800178LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
179
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800180include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700181
182###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700183# build surfaceflinger's executable
184include $(CLEAR_VARS)
185
Dan Stoza01049c82014-11-11 10:32:31 -0800186LOCAL_CLANG := true
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700187
Dimitry Ivanovf06248f2016-08-01 14:13:37 -0700188LOCAL_LDFLAGS_32 := -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic
189LOCAL_LDFLAGS_64 := -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic
Dan Stoza01049c82014-11-11 10:32:31 -0800190LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Dan Stoza01049c82014-11-11 10:32:31 -0800191
Tom Cherry74155992015-08-14 13:01:23 -0700192LOCAL_INIT_RC := surfaceflinger.rc
193
Fabien Sanglard9d96de42016-10-11 00:15:18 +0000194ifeq ($(TARGET_USES_HWC2),true)
195 LOCAL_CFLAGS += -DUSE_HWC2
196endif
197
Dan Stoza01049c82014-11-11 10:32:31 -0800198LOCAL_SRC_FILES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800199 main_surfaceflinger.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700200
201LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800202 libsurfaceflinger \
203 libcutils \
204 liblog \
205 libbinder \
206 libutils \
Mathias Agopiana9347642017-02-13 16:42:28 -0800207 libui \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800208 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700209
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700210LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
Irvelc274c632016-06-13 16:44:08 -0700211LOCAL_STATIC_LIBRARIES := libtrace_proto
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700212
Dan Stoza01049c82014-11-11 10:32:31 -0800213LOCAL_MODULE := surfaceflinger
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700214
Colin Cross89450d42014-02-20 15:36:21 -0800215ifdef TARGET_32_BIT_SURFACEFLINGER
216LOCAL_32_BIT_ONLY := true
217endif
218
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800219LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
220
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700221include $(BUILD_EXECUTABLE)
222
223###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700224# uses jni which may not be available in PDK
225ifneq ($(wildcard libnativehelper/include),)
226include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700227
Dan Stoza01049c82014-11-11 10:32:31 -0800228LOCAL_CLANG := true
229
230LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Dan Stoza01049c82014-11-11 10:32:31 -0800231
232LOCAL_SRC_FILES := \
Keun young Park63f165f2012-08-31 10:53:36 -0700233 DdmConnection.cpp
234
235LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800236 libcutils \
237 liblog \
238 libdl
Keun young Park63f165f2012-08-31 10:53:36 -0700239
Dan Stoza01049c82014-11-11 10:32:31 -0800240LOCAL_MODULE := libsurfaceflinger_ddmconnection
Keun young Park63f165f2012-08-31 10:53:36 -0700241
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800242LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
243
Keun young Park63f165f2012-08-31 10:53:36 -0700244include $(BUILD_SHARED_LIBRARY)
245endif # libnativehelper