Debian rotate screen

Started by zhao, December 17, 2014, 11:52:09 PM

Previous topic - Next topic

zhao

We have one project which is using A20-OLinuXino-LIME.
I run debian(Linux a20-74 3.4.90+ #9 SMP PREEMPT) with 4.3 inch and 10.3 inch touch screen.
We need rotate screen.
Is there anyway we can do it?

Thanks

Chax

It probably depends on 'what' you are running. When running X, you can try the 'xrandr' program. I've only used the A10 with the frame buffer device and briefly looked into this, not sure if it was possible but you might look at something like 'echo 1 > /sys/class/graphics/fbcon/rotate'

MBR

The frame buffer rotation support must be enabled, in the kernel config it's the Device Drivers/Graphics support/Console display driver support/Framebuffer Console Rotation (option CONFIG_FRAMEBUFFER_CONSOLE_ROTATION). If you can see the rotate file in /sys, it is (probably) enabled.

But this is done purely in the software and for text console only, so if you want to draw someting by yourself, you must do your own rotation. Fortunately it's a quite simple operation - all you need is to reorder the scanlines in the framebuffer so the first one will be the last one and so on (and most graphics libraries have some functions for doing that). Or - a smarter (and faster) solution - draw everything upside down. This even makes drawing somewhat simpler for those not used to low-level computer graphics, becasuse the point 0,0 is now in the lower left corner (normally it's the upper left corner).