Sometimes there is a requirement to make display work in portrait mode when physical panel is in landscap mode.
setprop persist.demo.rotationlock true
setprop persist.demo.remoterotation portrait
The above codes can be set in init.rc to take effect when android boot up.