blob: fb6307ee591a3fdd18adfc8e3321b00954dc5261 [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
Pablo Ceballos69a1a382016-03-30 15:28:05 -070047#LOCAL_CFLAGS += -DENABLE_FENCE_TRACKING
Dan Stoza9e56aa02015-11-02 13:00:03 -080048
49USE_HWC2 := false
50ifeq ($(USE_HWC2),true)
51 LOCAL_CFLAGS += -DUSE_HWC2
52 LOCAL_SRC_FILES += \
53 SurfaceFlinger.cpp \
54 DisplayHardware/HWComposer.cpp
55else
56 LOCAL_SRC_FILES += \
57 SurfaceFlinger_hwc1.cpp \
58 DisplayHardware/HWComposer_hwc1.cpp
59endif
60
Mathias Agopian5df99622012-06-18 17:27:56 -070061ifeq ($(TARGET_BOARD_PLATFORM),omap4)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080062 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian57bf9e72011-10-07 15:42:53 -070063endif
Mathias Agopian5df99622012-06-18 17:27:56 -070064ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080065 LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
Mathias Agopian7f42a9c2012-04-23 20:00:16 -070066endif
67
Mathias Agopian5df99622012-06-18 17:27:56 -070068ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080069 LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
Mathias Agopian67226812010-10-11 17:54:43 -070070endif
71
Jesse Hallc354eff2013-10-25 10:44:41 -070072ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
73 LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
Naseer Ahmed6a968462013-10-04 16:15:22 -040074endif
75
Jamie Genniscdbaecb2012-10-12 14:18:10 -070076ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
Andreas Gampe89fd4f72014-11-13 14:18:56 -080077 LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
Jamie Genniscdbaecb2012-10-12 14:18:10 -070078endif
79
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070080ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
81 LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
82endif
83
84# See build/target/board/generic/BoardConfig.mk for a description of this setting.
85ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
86 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
87else
88 LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=0
89endif
90
Jamie Gennis0a645cc2013-10-14 20:52:46 -070091# See build/target/board/generic/BoardConfig.mk for a description of this setting.
92ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
93 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
94else
95 LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=0
96endif
97
Jamie Gennisfaf77cc2013-07-30 15:10:32 -070098ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
99 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
100else
101 LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
102endif
103
Dan Stoza1f3efb12014-10-15 16:34:55 -0700104ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
105 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
106else
107 LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
108endif
109
Michael Lentine7306c672014-07-30 13:00:37 -0700110LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
Pablo Ceballos40845df2016-01-25 17:41:15 -0800111LOCAL_CFLAGS += -std=c++14
Mathias Agopianb6df7d02013-05-09 14:53:35 -0700112
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700113LOCAL_STATIC_LIBRARIES := libvkjson
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800114LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800115 libcutils \
116 liblog \
117 libdl \
118 libhardware \
119 libutils \
120 libEGL \
121 libGLESv1_CM \
122 libGLESv2 \
123 libbinder \
124 libui \
125 libgui \
Jesse Hall8b0d55e2016-03-31 19:29:36 -0700126 libpowermanager \
127 libvulkan
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800128
Dan Stoza01049c82014-11-11 10:32:31 -0800129LOCAL_MODULE := libsurfaceflinger
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800130
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800131LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
132
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800133include $(BUILD_SHARED_LIBRARY)
Keun young Park63f165f2012-08-31 10:53:36 -0700134
135###############################################################
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700136# build surfaceflinger's executable
137include $(CLEAR_VARS)
138
Dan Stoza01049c82014-11-11 10:32:31 -0800139LOCAL_CLANG := true
Mathias Agopian4f4f0942013-08-19 17:26:18 -0700140
Dan Stoza01049c82014-11-11 10:32:31 -0800141LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
142LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800143LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800144
Tom Cherry74155992015-08-14 13:01:23 -0700145LOCAL_INIT_RC := surfaceflinger.rc
146
Tim Murrayac8d2392015-11-10 14:29:45 -0800147ifneq ($(ENABLE_CPUSETS),)
148 LOCAL_CFLAGS += -DENABLE_CPUSETS
149endif
150
Dan Stoza01049c82014-11-11 10:32:31 -0800151LOCAL_SRC_FILES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800152 main_surfaceflinger.cpp
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700153
154LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800155 libsurfaceflinger \
156 libcutils \
157 liblog \
158 libbinder \
159 libutils \
160 libdl
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700161
Dmitriy Ivanov4340a142014-10-20 14:17:26 -0700162LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
163
Dan Stoza01049c82014-11-11 10:32:31 -0800164LOCAL_MODULE := surfaceflinger
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700165
Colin Cross89450d42014-02-20 15:36:21 -0800166ifdef TARGET_32_BIT_SURFACEFLINGER
167LOCAL_32_BIT_ONLY := true
168endif
169
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800170LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
171
Mathias Agopian7ffaa7c2013-07-22 12:20:28 -0700172include $(BUILD_EXECUTABLE)
173
174###############################################################
Keun young Park63f165f2012-08-31 10:53:36 -0700175# uses jni which may not be available in PDK
176ifneq ($(wildcard libnativehelper/include),)
177include $(CLEAR_VARS)
Mathias Agopian1b3aeb42012-10-07 16:41:12 -0700178
Dan Stoza01049c82014-11-11 10:32:31 -0800179LOCAL_CLANG := true
180
181LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
Pablo Ceballos40845df2016-01-25 17:41:15 -0800182LOCAL_CPPFLAGS := -std=c++14
Dan Stoza01049c82014-11-11 10:32:31 -0800183
184LOCAL_SRC_FILES := \
Keun young Park63f165f2012-08-31 10:53:36 -0700185 DdmConnection.cpp
186
187LOCAL_SHARED_LIBRARIES := \
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800188 libcutils \
189 liblog \
190 libdl
Keun young Park63f165f2012-08-31 10:53:36 -0700191
Dan Stoza01049c82014-11-11 10:32:31 -0800192LOCAL_MODULE := libsurfaceflinger_ddmconnection
Keun young Park63f165f2012-08-31 10:53:36 -0700193
Andreas Gampe89fd4f72014-11-13 14:18:56 -0800194LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
195
Keun young Park63f165f2012-08-31 10:53:36 -0700196include $(BUILD_SHARED_LIBRARY)
197endif # libnativehelper