I've had my HTC One X since May 2012 and this problem has now hit mine. I only noticed when checking out some photos in my gallery the other day and it wouldn't auto rotate. Obviously hit the Google machine and found this thread. Tried all the tips you lot have posted but none worked for me. G sensor calibration just wasn't having it. However, the following did work:
Turn off auto rotate, restart into safe mode, turn on auto rotate, run G sensor calibration in safe mode, restart into normal mode and all back working.
Just thought I would add that to the list. I couldn't get G sensor calibration to work in normal mode or safe mode but the toggle with the auto rotate option seemed to do the trick this time.
Going to take the advice of everyone here and send it off for repair as it seems the problem wont get solved without a fix. Pretty annoying as I could do without the hassle. Won't be able to do it for another month as I'm moving home start of April.
This is not my first issue with the phone either. First one I had 5 days and had a yellow/orange spot which was pretty big. Got a replacement free of charge. Then in November my Wifi played up and I could hardly get a signal. Instead of sending the second phone off I fixed this myself by opening it up and using some tin foil. Wifi been perfect since. But now this!!
I had a HTC Desire before and had no issues (apart from lack of memory) and that phone is the reason why I stuck with HTC rather than jump over to samsung galaxy SIII. Wish I jumped now. Got this phone until November 2013 too (18 month contract). Just frustrating really as it's such a great phone but seemingly went through a poorly rushed bad production.