Hi experts,
I need my imx8mq board android system display vertically at startup. Do you have any suggestions?
I tried as below:
I can set "settings put system user_rotation 3" manully by adb. And it can rotate 270 degree.
But I need display vertically at startup not manually.
So I added a service in /vendor/etc/init/hw/init.nxp.rc
service rotate-screen /vendor/bin/rotate-screen.sh
class main
user root
group root system
disabled
oneshot
on post-fs-data
start rotate-screen
And contents in rotate-screen.sh is:
settings put system user_rotation 3
But it does now work. it seems the rotate-screen.sh not executed.
Thanks
Try to change /device/nxp/xxx/build.prop
ro.sf.hwrotation = 180/270/90
There is no build.prop file in imx-android-11.0.0_2.0.0/android_build/device/nxp and recursive folder.
Actually I had tried to add blew contents in imx-android-11.0.0_2.0.0/android_build/device/nxp/imx8m/evk_8mq/init.rc before
on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
setprop ro.sf.hwrotation 270
But it did not work.
Thanks for your reply.
You mean just modifying the vendor/nxp-opensource/imx/display/display/Composer.cpp to support sufaceflinger rotation?
Yes,and the go file.
Do you have any update?
I followed your suggestions and did like below:
1. add
BOARD_HAVE_VPU \
+SF_PRIMARY_DISPLAY_ORIENTATION
+SOONG_CONFIG_IMXPLUGIN_SF_PRIMARY_DISPLAY_ORIENTATION = 270
SOONG_CONFIG_IMXPLUGIN_BOARD_PLATFORM = imx8
in device/nxp/imx8m/BoardConfigCommon.mk
2. add
+SF_PRIMARY_DISPLAY_ORIENTATION := 270
BOARD_PREBUILT_DTBOIMAGE := $(OUT_DIR)/target/product/$(PRODUCT_DEVICE)/dtbo-imx8mq.img
in device/nxp/imx8m/evk_8mq/BoardConfig.mk
3. modified vendor/nxp-opensource/imx/display/display/Composer.cpp and vendor/nxp-opensource/imx/display/display/display.go file as you said.
But it still did not work.
And I dig the log, at least the log of below
ALOGV("index:%d, i:%d sourceCrop(l:%d,t:%d,r:%d,b:%d), "
"visible(l:%d,t:%d,r:%d,b:%d), "
"display(l:%d,t:%d,r:%d,b:%d)", layer->index, (int)i,
srect.left, srect.top, srect.right, srect.bottom,
clip.left, clip.top, clip.right, clip.bottom,
drect.left, drect.top, drect.right, drect.bottom);
did not apper.
Thanks, I will try right row.
Hello, Were you able to rotate your screen ?
I am using Android 11 aosp
I was able to make a service file with "settings put system user_rotation 2" and it rotates the screen to 180 degree but the rotation is clearly visible after booting is done.
So I want to make the changes directly in build and don't want to use service file.
And even for me "ro.sf.hwrotation = 180" didn't work