How to rotate display including mouse cursor on

Started by att2, June 15, 2017, 11:51:51 pm

Previous topic - Next topic


I have an olimex a20 olinuxino lime2 with emmc;
OS=debian 8.3 jessie;

I want to rotate the screen ;
I changed usr/share/X11/xorg.conf/99-something.conf and added

Quoteoption "rotate" "cw"

Now the screen is rotated but the mouse cursor is not rotated.

The mouse position is incorrect. When you e.g. select a rectangle the upper left corner of the
rectangle does not match the mouse position. Neither does the movement of the mouse direction match the actually moved mouse. You select a totally different rectangle than you would guess, and you select it in a totally different direction opposite to your real mouse movements.

So how to get the mouse right once you have rotated the display?


Are you using a real mouse or you are using the touchscreen and meaning the mouse cursor? For the first touchscreen calibration after you have rotated the display - use a mouse instead of the touchscreen. Alternatively, again edit 99-calibration.conf (or create it if it is missing) and enter manually the coordinates, they should come as number in this line:

Option "Calibration" "236 26301 169 16412" - note that these are not actual values that I have tested; just pointing out where the calibration variables are stored - the four numbers are the coordinates of the crosses that you need to press during calibration.
Technical support and documentation manager at Olimex


September 06, 2017, 11:32:42 am #2 Last Edit: September 22, 2017, 03:42:46 pm by SR-Digitronic
I can confirm this issue.
I added also added that to my xorg.conf and use a 4 inch LCD display with touch.
        Option          "Rotate" "UD"
Mouse cursor is turned upside down.
The cursor is displayed where I pressed with my finger, but the click gets registered at a different location.
ts_calibrate is displayed upside down, which is not a surprise since it does not use Xorg.

And when I invert the cursor via xorg, the clicks are still slightly off
        Option "InvertX" "on"
        Option "InvertY" "on"

So this maybe results from using an rotated framebuffer together with tslib. fbturbo uses a shadow framebuffer to realize the rotation.

Edit: It's the same when I use a hardware mouse via x2x
Edit: confused upside down and clockwise


September 22, 2017, 04:38:34 pm #3 Last Edit: September 22, 2017, 04:40:44 pm by SR-Digitronic
I finally got it fixed!

Quote from: att2 on June 15, 2017, 11:51:51 pm
When you e.g. select a rectangle the upper left corner of the rectangle does not match the mouse position.

If you want Xorg to draw the cursor: (Cursor is where the click happens and gets displayed rotated)
        Option          "HWCursor" "false"

Quote from: att2 on June 15, 2017, 11:51:51 pm
you select it in a totally different direction opposite to your real mouse movements.

This needs some changes in /usr/share/X11/xorg.conf.d/90-calibration.conf

90° / CW:
Option "InvertY" "on"
Option "SwapAxes" "1"

180° / UD:
Option "InvertX" "on"
Option "InvertY" "on"

If it is still a bit off, try
su olimex -c "DISPLAY=:0.0 xinput_calibrator"

Important: xinput_calibrator does not permanently change your X settings, you have to manually write it to 90-calibration.conf


I still have the same problem: The mouse cursor is not rotated.
Moving the mouse I can see that the mouse system "believes" it is working in non-rotated mode.
The symptoms of this unwanted behaviour are as following: I cannot move the mouse cursor up to the upper/left edge of the screen. The upper/left edge is displaced by Y coordinate approximately 400 pixels (my guess).
Even if I can move the mouse around (in a wrong way) and if I click on a button or window, the clicked area is displaced from the locaction on the screen by seveal hundred pixels. I cannot click on the "start" button, because this is displaced.
I have tried everything that is written in here: a) edit xorg.conf with hwcursor false
b) edit 90-calibration.conf with all sort of options (rotate ccw, etc.)
c) change option calibration values

Nothing helped. So please, please help me again, the mouse cursor problem is really annoying.

I am using a real mouse connected on the USB port and not the touch screen.


For the old 3.4 Kernel Olimex Debian 7 image for A20-Micro we were successfully rotating the LCD-10 screen by editing:


# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.

Section "Device"
        Identifier      "Allwinner A10/A13 FBDEV"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb0"

        Option          "SwapbuffersWait" "true"
# D. Lombardo adding options to rotate the screen
#        Option          "Rotate" "UD"
#        Option        "HWCursor" "false"

And in


# D. Lombardo adding options to rotate the screen

How to do the same on new Mainline kernel?

Is it possible to rotate the screen of the LCD-10 on the Mainline kernel image, without e.g. editing and rebuilding the Device Tree file?


October 08, 2021, 09:03:01 am #6 Last Edit: October 08, 2021, 09:10:02 am by LubOlimex
What display do you have exactly? Is it one of the Olimex-made ones? Which one exactly?

Our displays have hardware jumpers for the orientation. For example, check the schematic of our 10 inch display LCD-OLinuXino-10TS:''TS_Rev_C.pdf

Focus on the part that says "Scanning Mode: Up to Down, Left to Right".  We can change the picture orientation by modifying R24, R25, R30, R31.
Technical support and documentation manager at Olimex


We are mostly using LCD-OLINUXINO-10 without Touch.
We are using separate USB IR Touch screen.

Firstly, thank you for pointing out the 'jumper' pads on the electronics board for screen orientation, might come handy some other time.

Secondly, setting the orientation on the Mainline kernel linux works great with xrandr that is allready installed on Olimex image (Avg. 21).
xrandr -o inverted
For bootup in inverted X windows I did follow instructions from

and added X11 Xsession file

with inverting only the LCD display
# Custom xrandr settings for monitor(s) setup
# Inverting screen on LCD-OLINUXINO-10 - D.Lombardo
xrandr --output None-1 --rotate inverted

This way if I boot with also HDMI connected, then HDMI starts as secondary (right) monitor.

1. if I use LCD and HDMI at the same time, then I get occasionally some lines on the LCD distorted
2. on the console view before X session starts the LCD is not inverted (as expected ;) and good enough for my case)