Android Jelly Bean(4.2) locks HDMI rotation by default. You can unlock by the instruction of this commit.
--
Author: Jeff Brown <jeffbrown@google.com>
Date: Wed Oct 17 18:32:34 2012 -0700
Add special mirroring modes for demonstration purposes.
Assume rotation of HDMI display is portait.
$ adb shell setprop persist.demo.hdmirotation portrait
Don't lock rotation while HDMI is plugged in.
$ adb shell setprop persist.demo.hdmirotationlock false
Hide secondary displays from apps but continue mirroring to them.
$ adb shell setprop persist.demo.singledisplay true
Bug: 7326281
Change-Id: I8f9a3b0bc19821a3a01043b0f516806dac82ce53