My Hi10 Air (201908xxxx) must via xandr be set to 'right' orientation to have proper landscape orientation. But 'xandr -o right' results in wrong resolution. The panel is 224 dpi, regardless orientation. So after any rotation detection and xandr action 'xandr --dpi 224' must be issued.
After touchscreen calibration, in regular landscape mode, that matrix ends up in what is called Coordinate Transformation Matrix (170), as shown by the 'xinput list-props silead_ts' command.
It is put there from an InputClass section in xorg.conf.d
libinput makes yet another transformation using 'libinput Calibration Matrix (325)'. That is the one 2in1screen is writing into. But with incorrect scaling, incorrect offsets, and incorrect rotation.
Reference is xserver's 'right' orientation which is our landscape. So 'right' has to correspond to doing nothing, i.e. 1 0 0 0 1 0 0 0 1. Because we correct all the time to get back to 224 dpi all transformations away from the landscape situation need to adapt for the different scalings and offsets. What works fine here:
'normal' 0 1.6 0 -0.625 0 0.3125 0 0 1
'inverted' 0 -1.6 0.5 0.625 0 0 0 0 1
'left' -1 0 0.5 0 -1 0.3125 0 0 1
The numbers stem from the 16:10 aspect ratio, maintaining 224 dpi.
Two issues:
My Hi10 Air (201908xxxx) must via xandr be set to 'right' orientation to have proper landscape orientation. But 'xandr -o right' results in wrong resolution. The panel is 224 dpi, regardless orientation. So after any rotation detection and xandr action 'xandr --dpi 224' must be issued.
After touchscreen calibration, in regular landscape mode, that matrix ends up in what is called Coordinate Transformation Matrix (170), as shown by the 'xinput list-props silead_ts' command. It is put there from an InputClass section in xorg.conf.d
libinput makes yet another transformation using 'libinput Calibration Matrix (325)'. That is the one 2in1screen is writing into. But with incorrect scaling, incorrect offsets, and incorrect rotation. Reference is xserver's 'right' orientation which is our landscape. So 'right' has to correspond to doing nothing, i.e. 1 0 0 0 1 0 0 0 1. Because we correct all the time to get back to 224 dpi all transformations away from the landscape situation need to adapt for the different scalings and offsets. What works fine here: 'normal' 0 1.6 0 -0.625 0 0.3125 0 0 1 'inverted' 0 -1.6 0.5 0.625 0 0 0 0 1 'left' -1 0 0.5 0 -1 0.3125 0 0 1
The numbers stem from the 16:10 aspect ratio, maintaining 224 dpi.
The lines edited: sprintf(command, "xrandr -o %s ; xrandr --dpi 224", ROT[current_state]); and char *TOUCH[] = {"-1 0 0.5 0 -1 0.3125 0 0 1", "1 0 0 0 1 0 0 0 1", "0 1.6 0 -0.625 0 0.3125 0 0 1", "0 -1.6 0.5 0.625 0 0 0 0 1"};