How to rotate display including mouse cursor on

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

Previous topic - Next topic

att2

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?


LubOlimex

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

SR-Digitronic

#2
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

SR-Digitronic

#3
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

att2

Hello,
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.


dlombardo

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

/usr/share/X11/xorg.conf.d/99-sunxifb.conf

# 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"
EndSection

And in

/media/587A-1A07/uEnv.txt

root=/dev/mmcblk0p2
# D. Lombardo adding options to rotate the screen
fbcon=rotate:2


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?

LubOlimex

#6
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:

https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/LCDs/LCD-OLinuXino-10TS/Hardware%20revision%20C1/LCD-OLINUXINO-10''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

dlombardo

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 https://www.thinkwiki.org/wiki/Xorg_RandR_1.2

and added X11 Xsession file
/etc/X11/Xsession.d/45xrandr-session

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.

REMARK:
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)

johannes.pfister

Thank you, @dlombardo, thanks to your posts i could finally solve my problem i wasted a lot of hours on (https://www.olimex.com/forum/index.php?topic=9261.msg38408#msg38408)