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.