@michel8166 That meets my suspicion that lightdm and/or the modifications to /etc/rc.local were interfering. Good that it is cleared up.
To summarize: If one wants to use the Touch Display plugin don’t install lightdm and don’t modify /etc/local.rc as proposed in the OP.
Regarding your specific display: As far as I can see it runs in portrait mode by default, i.e. when rotation is 0 deg. It seems it has the X-axis and Y-axis inverted with the result that it rotates counterclockwise.
Since the “rotate” parameter of the tft35a overlay only affects the (visual) display rotating the touchscreen is done by the Xserver.
The various “99-calibration.conf-35-x” files in goodtft’s GitHub repo for 0, 90, 180 and 270 deg. achieve this by different orderings of the values for minX, maxX, minY and maxY you can see after the option “Calibration” together with the option “SwapAxes”.
The Touch Display plugin rotates the touchscreen using the “TransformationMatrix” option in /etc/X11/xorg.conf.d/95-touch_display-plugin.conf
.
What I would like to know:
Is your touchscreen properly aligned to the display if you use
Option "Calibration" "268 3880 227 3936"
Option "SwapAxes" "0"
in /etc/X11/xorg.conf.d/99-calibration.conf
and set the rotation in the plugin to 270 deg.?