Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate Screen? #9

Open
Gd1230 opened this issue Mar 3, 2024 · 2 comments
Open

Rotate Screen? #9

Gd1230 opened this issue Mar 3, 2024 · 2 comments

Comments

@Gd1230
Copy link

Gd1230 commented Mar 3, 2024

All is working great, except using the official 7inch screen, it's upside down. Everything I find says to add lcd_rotate=2 to /boot/firmware/config.txt, but this is not solving the issue.

@ostat
Copy link

ostat commented Mar 16, 2024

I am using the 7" official screen, on a pi4.
I agree, the suggestion found online is to edit /boot/firmware/config.txt adding lcd_rotate=2, however it does not work.
As its booting you can see the screen started flipped as desired, however it then reverts before it finishing booting.

After some investigation I found the answer here
https://www.raspberrypi.com/documentation/accessories/display.html

Also this was helpful
https://www.reddit.com/r/raspberry_pi/comments/u0nakb/7_screen_rotation_wo_gui_tried_all_the_tricks/

What I did was (from here https://www.raspberrypi.com/documentation/accessories/display.html)

Rotate screen without a desktop
To set the screen orientation on a device that lacks a desktop environment, edit the /boot/firmware/cmdline.txt configuration file to pass an orientation to the system. Add the following line to cmdline.txt:
video=DSI-1:800x480@60,rotate=<rotation-value>

Rotate touch input

Rotation of touch input is independent of the orientation of the display itself. To change this you need to manually add a dtoverlay instruction in /boot/firmware/config.txt. Add the following line in config.txt:
dtoverlay=vc4-kms-dsi-7inch,invx,invy

Then, disable automatic display detection by removing the following line from config.txt, if it exists:
display_auto_detect=1

@LazyEggtart
Copy link

So I'm using a Waveshare 11.9" DSI touch screen and it has a default portrait resolution of 320x1480. Getting the screen to work in portrait was simple, but after a lengthy dive, I finally got it to work in landscape

Editing /boot/firmware/cmdline.txt config file and adding video=DSI-1:320x1480M@60,rotate=90 rotated only my CLI and every time Xorg server started it would default back to the portrait resolution.

Rotating display in Xorg server
This helped me in getting the kiosk rotated 90 degrees. Adding the following to /etc/X11/xorg.conf.d/10-blanking.conf created a static rotation.

Section "Device"
        Identifier "RpiFB"
        Driver "fbdev"
        Option "rotate" "CCW"  # As in, counterclockwise
EndSection

Rotating touch input in Xorg server
Adding dtoverlay lines in my config.txt didn't seem to work at all, my touch inputs were still off the default portrait resolution, which meant it didn't carry into Xorg.
I found this post which allowed me to rotate touch inputs in Xorg. I added below the lines for screen rotation in /etc/X11/xorg.conf.d/10-blanking.conf

Section "InputClass"
            Identifier "Coordinate Transformation Matrix"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            MatchDriver "libinput"
            Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
EndSection

I had to set touch input rotation inputs to 270 to match the CCW display rotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants