Skip to content

Commit ac296ae

Browse files
android-x86anholt
authored andcommitted
android: Depend on gallium_dri from EGL, instead of linking in gallium.
The Android gallium build used to use gallium_egl, which was removed back in March. Instead, we will now use a normal Mesa libEGL loader with dlopen()ing of a DRI module. v2: add a clean step to rebuild all dri modules properly. v3: Squish the 2 patches doing this together (change by anholt). Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
1 parent 933df3d commit ac296ae

File tree

3 files changed

+5
-85
lines changed

3 files changed

+5
-85
lines changed

Android.mk

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,9 @@ SUBDIRS := \
8989
src/glsl \
9090
src/mesa \
9191
src/util \
92-
src/egl/main
93-
94-
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
95-
SUBDIRS += \
92+
src/egl/main \
9693
src/egl/drivers/dri2 \
9794
src/mesa/drivers/dri
98-
endif
9995

10096
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
10197
SUBDIRS += src/gallium

CleanSpec.mk

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/libGLES_mesa_int
1313
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/mesa_*_intermediates)
1414
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/glsl_compiler_intermediates)
1515
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/STATIC_LIBRARIES/libmesa_*_intermediates)
16+
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/*_dri_intermediates)

src/egl/main/Android.mk

+3-80
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ LOCAL_CFLAGS := \
4343
-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
4444
-D_EGL_OS_UNIX=1
4545

46-
LOCAL_STATIC_LIBRARIES :=
47-
4846
LOCAL_SHARED_LIBRARIES := \
4947
libglapi \
5048
libdl \
@@ -62,95 +60,20 @@ ifneq ($(MESA_GPU_DRIVERS),swrast)
6260
LOCAL_SHARED_LIBRARIES += libdrm
6361
endif
6462

65-
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
6663
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
67-
LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2
6864

65+
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
6966
# require i915_dri and/or i965_dri
7067
LOCAL_REQUIRED_MODULES += \
7168
$(addsuffix _dri, $(filter i915 i965, $(MESA_GPU_DRIVERS)))
7269
endif # MESA_BUILD_CLASSIC
7370

7471
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
75-
76-
gallium_DRIVERS :=
77-
78-
# swrast
79-
gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android
80-
81-
# freedreno
82-
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
83-
gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno
84-
LOCAL_SHARED_LIBRARIES += libdrm_freedreno
85-
endif
86-
87-
# i915g
88-
ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),)
89-
gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915
90-
LOCAL_SHARED_LIBRARIES += libdrm_intel
91-
endif
92-
93-
# ilo
94-
ifneq ($(filter ilo, $(MESA_GPU_DRIVERS)),)
95-
gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo
96-
LOCAL_SHARED_LIBRARIES += libdrm_intel
97-
endif
98-
99-
# nouveau
100-
ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),)
101-
gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau
102-
LOCAL_SHARED_LIBRARIES += libdrm_nouveau
103-
LOCAL_SHARED_LIBRARIES += libstlport
104-
endif
105-
106-
# r300g/r600g/radeonsi
107-
ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),)
108-
gallium_DRIVERS += libmesa_winsys_radeon
109-
LOCAL_SHARED_LIBRARIES += libdrm_radeon
110-
ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
111-
gallium_DRIVERS += libmesa_pipe_r300
112-
endif # r300g
113-
ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),)
114-
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
115-
gallium_DRIVERS += libmesa_pipe_r600
116-
LOCAL_SHARED_LIBRARIES += libstlport
117-
endif # r600g
118-
ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),)
119-
gallium_DRIVERS += libmesa_pipe_radeonsi
120-
endif # radeonsi
121-
gallium_DRIVERS += libmesa_pipe_radeon
122-
endif # r600g || radeonsi
123-
endif # r300g || r600g || radeonsi
124-
125-
# vmwgfx
126-
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
127-
gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga
128-
endif
129-
130-
#
131-
# Notes about the order here:
132-
#
133-
# * libmesa_st_egl depends on libmesa_winsys_sw_android in $(gallium_DRIVERS)
134-
# * libmesa_pipe_r300 in $(gallium_DRIVERS) depends on libmesa_st_mesa and
135-
# libmesa_glsl
136-
# * libmesa_st_mesa depends on libmesa_glsl
137-
# * libmesa_glsl depends on libmesa_glsl_utils
138-
#
139-
LOCAL_STATIC_LIBRARIES := \
140-
libmesa_egl_gallium \
141-
libmesa_st_egl \
142-
$(gallium_DRIVERS) \
143-
libmesa_st_mesa \
144-
libmesa_util \
145-
libmesa_glsl \
146-
libmesa_glsl_utils \
147-
libmesa_gallium \
148-
$(LOCAL_STATIC_LIBRARIES)
149-
72+
LOCAL_REQUIRED_MODULES += gallium_dri
15073
endif # MESA_BUILD_GALLIUM
15174

15275
LOCAL_STATIC_LIBRARIES := \
153-
$(LOCAL_STATIC_LIBRARIES) \
76+
libmesa_egl_dri2 \
15477
libmesa_loader
15578

15679
LOCAL_MODULE := libGLES_mesa

0 commit comments

Comments
 (0)