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
This commit is contained in:
LuK1337 2024-02-12 12:58:30 +01:00 committed by basamaryan
parent d0c51f6735
commit b4eec28a20
No known key found for this signature in database
GPG Key ID: 0A28C6D8648B81DD
4 changed files with 9 additions and 30 deletions

View File

@ -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 += \

View File

@ -1,8 +0,0 @@
cc_library_shared {
name: "libsdmcore-shim",
srcs: [
"display_builtin.cpp"
],
required: ["libsdmcore-patch"],
vendor: true,
}

View File

@ -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)

View File

@ -1,3 +1,3 @@
#include <stdint.h>
extern "C" void _ZN3sdm14DisplayBuiltIn14SetRefreshCustEjb(uint32_t, bool) {}
extern "C" void _ZN3sdm14DisplayBuiltIn14SetRefreshRateEjb(uint32_t, bool) {}