From b4eec28a20b87db517cef3489f463da7edc5bb8e Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 12 Feb 2024 12:58:30 +0100 Subject: [PATCH] sweet: Redo libsdmcore shim Instead of injecting custom dependency into libsdmcore.so, provide a custom hwcomposer implementation that overrides the *unwanted* symbol before loading the vendor implementation. Change-Id: Icc6551f9260a0eb8a7f7a616588c65472a9366e9 --- device.mk | 2 +- display/Android.bp | 8 -------- display/Android.mk | 27 +++++++-------------------- display/display_builtin.cpp | 2 +- 4 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 display/Android.bp diff --git a/device.mk b/device.mk index 245835d..5433b1a 100644 --- a/device.mk +++ b/device.mk @@ -34,7 +34,7 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/display/qdcm_calib_data_xiaomi_k6_38_0e_0b_fhd_dsc_video_dsi_panel.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_xiaomi_k6_38_0e_0b_fhd_dsc_video_dsi_panel.xml PRODUCT_PACKAGES += \ - libsdmcore-shim + hwcomposer.qcom # Init scripts PRODUCT_COPY_FILES += \ diff --git a/display/Android.bp b/display/Android.bp deleted file mode 100644 index 4362db8..0000000 --- a/display/Android.bp +++ /dev/null @@ -1,8 +0,0 @@ -cc_library_shared { - name: "libsdmcore-shim", - srcs: [ - "display_builtin.cpp" - ], - required: ["libsdmcore-patch"], - vendor: true, -} diff --git a/display/Android.mk b/display/Android.mk index 34f67dd..d279dea 100644 --- a/display/Android.mk +++ b/display/Android.mk @@ -1,24 +1,11 @@ LOCAL_PATH := $(call my-dir) -HWC := hwcomposer.$(TARGET_BOARD_PLATFORM) -LIBSDMCORE := $(TARGET_OUT_VENDOR)/lib64/libsdmcore.so -HWCOMPOSER := $(TARGET_OUT_VENDOR)/lib64/hw/$(HWC).so - -ORIGINAL_SYMBOL := _ZN3sdm14DisplayBuiltIn14SetRefreshRateEjb -CUSTOM_SYMBOL := _ZN3sdm14DisplayBuiltIn14SetRefreshCustEjb - include $(CLEAR_VARS) -LOCAL_MODULE := libsdmcore-patch -LOCAL_PREBUILT_MODULE_FILE := /dev/null -LOCAL_MODULE_CLASS := ETC -LOCAL_VENDOR_MODULE := true -LOCAL_REQUIRED_MODULES := $(HWC) libsdmcore +LOCAL_MODULE := hwcomposer.qcom +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_MODULE_TAGS := optional +LOCAL_SHARED_LIBRARIES := hwcomposer.$(TARGET_BOARD_PLATFORM) +LOCAL_SRC_FILES := display_builtin.cpp -LOCAL_POST_INSTALL_CMD := \ - cp $(PRODUCT_OUT)/symbols/vendor/lib64/libsdmcore.so $(LIBSDMCORE) && \ - cp $(PRODUCT_OUT)/symbols/vendor/lib64/hw/$(HWC).so $(HWCOMPOSER) && \ - sed -i s/$(ORIGINAL_SYMBOL)/$(CUSTOM_SYMBOL)/g $(LIBSDMCORE) && \ - sed -i s/libdisplaydebug/libsdmcore-shim/g $(HWCOMPOSER) && \ - rm $(TARGET_OUT_VENDOR)/etc/$(LOCAL_MODULE) - -include $(BUILD_PREBUILT) +include $(BUILD_SHARED_LIBRARY) diff --git a/display/display_builtin.cpp b/display/display_builtin.cpp index 9588293..ad356c7 100644 --- a/display/display_builtin.cpp +++ b/display/display_builtin.cpp @@ -1,3 +1,3 @@ #include -extern "C" void _ZN3sdm14DisplayBuiltIn14SetRefreshCustEjb(uint32_t, bool) {} +extern "C" void _ZN3sdm14DisplayBuiltIn14SetRefreshRateEjb(uint32_t, bool) {}