PiTFT on Raspberry Pi 3 under Jessie

I’ve been using successfully my 2.8″ 320×240 uTouch PiTFT with Raspberry Pi 1 and 2, but recently I’ve tried it with Pi 3 and got a 90-degree rotated touch input.

I’ve installed PiTFT support using adafruit-pitft-helper and this instruction at Adafruit. However, if did not help with the rotated input issue.

What did help was this StackOverflow answer and this manual on transformation matrix.

In short, I had to edit /usr/share/X11/xorg.conf.d/40-libinput.conf adding this to “libinput touchscreen catchall” section:

Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"

This is a transformation matrix for 90 degree rotation of screen, which was the case for me.

Once done, the touchscreen input has got proper rotation.