OSDN Git Service

89779afa7555f7a7bd8bb74d16dbb2eb02c55aec
[android-x86/frameworks-native.git] / services / surfaceflinger / Android.mk
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     StartBootAnimThread.cpp \
13     EventThread.cpp \
14     FrameTracker.cpp \
15     GpuService.cpp \
16     Layer.cpp \
17     LayerDim.cpp \
18     LayerRejecter.cpp \
19     LayerVector.cpp \
20     MessageQueue.cpp \
21     MonitoredProducer.cpp \
22     SurfaceFlingerConsumer.cpp \
23     SurfaceInterceptor.cpp \
24     Transform.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 \
41
42 LOCAL_MODULE := libsurfaceflinger
43 LOCAL_C_INCLUDES := \
44     frameworks/native/vulkan/include \
45     external/vulkan-validation-layers/libs/vkjson \
46     system/libhwbinder/fast_msgq/include \
47
48 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
49 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
50
51 ifeq ($(TARGET_USES_HWC2),true)
52     LOCAL_CFLAGS += -DUSE_HWC2
53     LOCAL_SRC_FILES += \
54         SurfaceFlinger.cpp \
55         VrStateCallbacks.cpp \
56         DisplayHardware/HWComposer.cpp
57     ifeq ($(TARGET_USES_HWC2ON1ADAPTER), true)
58         LOCAL_CFLAGS += -DBYPASS_IHWC
59     endif
60 else
61     LOCAL_CFLAGS += -DBYPASS_IHWC
62     LOCAL_SRC_FILES += \
63         SurfaceFlinger_hwc1.cpp \
64         DisplayHardware/HWComposer_hwc1.cpp
65 endif
66
67 ifeq ($(TARGET_BOARD_PLATFORM),omap4)
68     LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
69 endif
70 ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
71     LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
72 endif
73
74 ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
75     LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
76 endif
77
78 ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
79     LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
80 endif
81
82 ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
83     LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
84 endif
85
86 # The following two BoardConfig variables define (respectively):
87 #
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
91 #     to consume input
92 #
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
101 # be modified.
102 #
103 # [1] https://developer.android.com/studio/profile/systrace.html
104 # [2] https://developer.android.com/training/testing/performance.html
105
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)
109 else
110     LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=1000000
111 endif
112
113 ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
114     LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
115 else
116     LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=1000000
117 endif
118
119 ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
120     LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
121 else
122     LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
123 endif
124
125 ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
126     LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
127 else
128     LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
129 endif
130
131 LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
132
133 LOCAL_HEADER_LIBRARIES := \
134     android.hardware.configstore-utils
135
136 LOCAL_STATIC_LIBRARIES := \
137     libhwcomposer-command-buffer \
138     libtrace_proto \
139     libvkjson \
140     libvr_manager \
141     libvrflinger
142
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 \
148     libcutils \
149     liblog \
150     libdl \
151     libfmq \
152     libhardware \
153     libhwc2on1adapter \
154     libhidlbase \
155     libhidltransport \
156     libhwbinder \
157     libutils \
158     libEGL \
159     libGLESv1_CM \
160     libGLESv2 \
161     libbinder \
162     libui \
163     libgui \
164     libpowermanager \
165     libvulkan \
166     libsync \
167     libprotobuf-cpp-lite \
168     libbase \
169     android.hardware.power@1.0
170
171 LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
172     android.hardware.graphics.allocator@2.0 \
173     android.hardware.graphics.composer@2.1 \
174     libhidlbase \
175     libhidltransport \
176     libhwbinder
177
178 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
179
180 include $(BUILD_SHARED_LIBRARY)
181
182 ###############################################################
183 # build surfaceflinger's executable
184 include $(CLEAR_VARS)
185
186 LOCAL_CLANG := true
187
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\"
191
192 LOCAL_INIT_RC := surfaceflinger.rc
193
194 ifeq ($(TARGET_USES_HWC2),true)
195     LOCAL_CFLAGS += -DUSE_HWC2
196 endif
197
198 LOCAL_SRC_FILES := \
199     main_surfaceflinger.cpp
200
201 LOCAL_SHARED_LIBRARIES := \
202     libsurfaceflinger \
203     libcutils \
204     liblog \
205     libbinder \
206     libutils \
207     libui \
208     libdl
209
210 LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
211 LOCAL_STATIC_LIBRARIES := libtrace_proto
212
213 LOCAL_MODULE := surfaceflinger
214
215 ifdef TARGET_32_BIT_SURFACEFLINGER
216 LOCAL_32_BIT_ONLY := true
217 endif
218
219 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
220
221 include $(BUILD_EXECUTABLE)
222
223 ###############################################################
224 # uses jni which may not be available in PDK
225 ifneq ($(wildcard libnativehelper/include),)
226 include $(CLEAR_VARS)
227
228 LOCAL_CLANG := true
229
230 LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
231
232 LOCAL_SRC_FILES := \
233     DdmConnection.cpp
234
235 LOCAL_SHARED_LIBRARIES := \
236     libcutils \
237     liblog \
238     libdl
239
240 LOCAL_MODULE := libsurfaceflinger_ddmconnection
241
242 LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
243
244 include $(BUILD_SHARED_LIBRARY)
245 endif # libnativehelper