From 15bea329d7b909dccacc84c1c066281da731ee14 Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Fri, 27 Sep 2024 23:17:07 +0200 Subject: [PATCH] android: gbm: split the DRI backend into separate library Changes required after commit 514df444e dri_gbm module is installed as /vendor/lib{64}/dri_gbm.so to avoid changes in system/linkerconfig AOSP project gbm-backends-path option is set as /vendor/$(MESA3D_LIB_DIR) MESA3D_GBM_BINS variable simplifies dependencies declarations Test results: gbm_gralloc works again Fixes: 514df444e ("gbm: split the DRI backend into a separate library and unify backend handling") Reviewed-by: Eric Engestrom Reviewed-by: Roman Stratiienko Tested-by: Mauro Rossi Part-of: --- android/Android.mk | 1 + android/mesa3d_cross.mk | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/android/Android.mk b/android/Android.mk index be4186e204f..5ceca05f464 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -184,6 +184,7 @@ $(foreach driver,$(BOARD_MESA3D_VULKAN_DRIVERS), \ ifneq ($(filter true, $(BOARD_MESA3D_BUILD_LIBGBM)),) # Modules 'libgbm', produces '/vendor/lib{64}/libgbm.so' $(eval $(call mesa3d-lib,$(MESA_LIBGBM_NAME),,MESA3D_LIBGBM_BIN,$(MESA3D_TOP)/src/gbm/main)) +$(eval $(call mesa3d-lib,dri_gbm,,MESA3D_DRI_GBM_BIN)) endif #------------------------------------------------------------------------------- diff --git a/android/mesa3d_cross.mk b/android/mesa3d_cross.mk index acc5db4f3da..b83427927f4 100644 --- a/android/mesa3d_cross.mk +++ b/android/mesa3d_cross.mk @@ -57,6 +57,8 @@ link_deps := \ # Build mesa3d using intermediate variables provided by AOSP make/core internals M_TARGET_PREFIX := $(my_2nd_arch_prefix) +MESA3D_LIB_DIR := lib$(subst 32,,$(LOCAL_MULTILIB)) + MESON_OUT_DIR := $($(M_TARGET_PREFIX)TARGET_OUT_INTERMEDIATES)/MESON_MESA3D MESON_GEN_DIR := $(MESON_OUT_DIR)_GEN MESON_GEN_FILES_TARGET := $(MESON_GEN_DIR)/.timestamp @@ -68,8 +70,13 @@ $(M_TARGET_PREFIX)MESA3D_LIBGLESV1_BIN := $(MESON_OUT_DIR)/install/usr/local/l $(M_TARGET_PREFIX)MESA3D_LIBGLESV2_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libGLESv2.so $(M_TARGET_PREFIX)MESA3D_LIBGLAPI_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libglapi.so $(M_TARGET_PREFIX)MESA3D_LIBGBM_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/$(MESA_LIBGBM_NAME).so +$(M_TARGET_PREFIX)MESA3D_DRI_GBM_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/gbm/dri_gbm.so +MESA3D_GBM_BINS := \ + $($(M_TARGET_PREFIX)MESA3D_LIBGBM_BIN) \ + $($(M_TARGET_PREFIX)MESA3D_DRI_GBM_BIN) \ + MESA3D_GLES_BINS := \ $($(M_TARGET_PREFIX)MESA3D_GALLIUM_BIN) \ $($(M_TARGET_PREFIX)MESA3D_LIBEGL_BIN) \ @@ -86,6 +93,7 @@ MESON_GEN_NINJA := \ -Dgallium-drivers=$(subst $(space),$(comma),$(BOARD_MESA3D_GALLIUM_DRIVERS)) \ -Dvulkan-drivers=$(subst $(space),$(comma),$(subst radeon,amd,$(BOARD_MESA3D_VULKAN_DRIVERS))) \ -Dgbm=enabled \ + -Dgbm-backends-path=/vendor/$(MESA3D_LIB_DIR) \ -Degl=$(if $(BOARD_MESA3D_GALLIUM_DRIVERS),enabled,disabled) \ -Dllvm=$(if $(MESON_GEN_LLVM_STUB),enabled,disabled) \ -Dcpp_rtti=false \ @@ -289,7 +297,7 @@ $(MESON_OUT_DIR)/install/.install.timestamp: $(MESON_OUT_DIR)/.build.timestamp DESTDIR=$(call relative-to-absolute,$(dir $@)) $(MESON_BUILD) install touch $@ -$($(M_TARGET_PREFIX)MESA3D_LIBGBM_BIN) $(MESA3D_GLES_BINS): $(MESON_OUT_DIR)/install/.install.timestamp +$(MESA3D_GBM_BINS) $(MESA3D_GLES_BINS): $(MESON_OUT_DIR)/install/.install.timestamp echo "Build $@" touch $@