From e07bd8321e36d0521f5fcbd5fc85fc5ee34b3a03 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Tue, 31 Oct 2023 12:53:22 +0000 Subject: [PATCH] g12-common: Run systemcontrol_static in recovery mode This is done to ensure that proper display resolution is set while device is in recovery mode. Meson config file is required, so import it into the device tree in order to avoid uncommon copy rules. Change-Id: I3a14e02f8b857a8007a34fbbe902949ead3373a2 --- configs/mesondisplay.cfg | 11 +++++++++++ g12.mk | 4 ++++ init-files/init.recovery.amlogic.rc | 4 ++++ proprietary-files.txt | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 configs/mesondisplay.cfg diff --git a/configs/mesondisplay.cfg b/configs/mesondisplay.cfg new file mode 100644 index 0000000..9e5f7d9 --- /dev/null +++ b/configs/mesondisplay.cfg @@ -0,0 +1,11 @@ +# 1.device type [MID | MBOX | TV] +# 2.soc type [meson3 | meson6 | meson8 | meson8b | meson8m2] +# +# 3.if the device is MID, need set fb0 & fb1 width height fbbits triplebuffer +# example: MID meson8b 768 1024 32 1 1280 720 32 1 +# busybox fbset -fb /dev/graphics/fb0 -g 768 1024 768 3072 32 +# busybox fbset -fb /dev/graphics/fb1 -g 1280 720 1280 2160 32 +# +# if the device is MBOX, need set default ui [720p | 1080p] + +MBOX g12a 1080p diff --git a/g12.mk b/g12.mk index 78b4df0..f782ee8 100644 --- a/g12.mk +++ b/g12.mk @@ -74,6 +74,10 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \ frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/mesondisplay.cfg:$(TARGET_COPY_OUT_RECOVERY)/root/system/etc/mesondisplay.cfg \ + $(LOCAL_PATH)/configs/mesondisplay.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/mesondisplay.cfg + ## Health PRODUCT_PACKAGES += \ android.hardware.health@2.1.vendor diff --git a/init-files/init.recovery.amlogic.rc b/init-files/init.recovery.amlogic.rc index 951821b..167abf4 100644 --- a/init-files/init.recovery.amlogic.rc +++ b/init-files/init.recovery.amlogic.rc @@ -20,6 +20,10 @@ on boot write /config/usb_gadget/g1/strings/0x409/product ${ro.product.board} write /config/usb_gadget/g1/configs/b.1/MaxPower 500 +service systemcontrol /system/bin/systemcontrol_static /system/etc/mesondisplay.cfg + oneshot + seclabel u:r:recovery:s0 + # USB accessory configuration on property:sys.usb.config=accessory && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 diff --git a/proprietary-files.txt b/proprietary-files.txt index 30c6717..702bb33 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -83,7 +83,6 @@ vendor/lib/libam_adp.so # Graphics vendor/bin/hw/android.hardware.graphics.allocator@4.0-service vendor/etc/init/android.hardware.graphics.allocator@4.0-service.rc -vendor/etc/mesondisplay.cfg vendor/lib/arm.graphics-V1-ndk_platform.so vendor/lib/egl/libGLES_mali.so vendor/lib/hw/android.hardware.graphics.allocator@4.0-impl-arm.so @@ -208,6 +207,7 @@ vendor/lib/libge2d.so odm/etc/firmware/firmware.le odm/etc/tvconfig/pq/pq.db odm/etc/tvconfig/pq/pq_default.ini +recovery/root/system/bin/systemcontrol_static|f4ad06b9486cbe9d4a67fa3c2b55a1e821183f8e vendor/bin/hdcp_tx22 vendor/bin/systemcontrol vendor/etc/init/systemcontrol.rc -- 2.20.1