I'm able to rotate the screen inside the operating system, but I want to rotate the screen when booting, to be able to see what is displayed on the bootup screen.
Any pointers as to how I can do that?
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
-
- Posts: 7343
- Joined: Tue Jun 30, 2015 1:35 pm
Re: Rotate Screen on Boot
add the rotation parameter to your kernel command line.
The example below is for FHD on HDMI1, rotated by 180° (so it's upside down). Alter the command to the resolution and rotation (90/180/270 are valid options) of your choice. Same applies to the output you want to rotate; change as required.
The example below is for FHD on HDMI1, rotated by 180° (so it's upside down). Alter the command to the resolution and rotation (90/180/270 are valid options) of your choice. Same applies to the output you want to rotate; change as required.
Code: Select all
video=HDMI-A-1:1920x1080M@60D,rotate=180
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
This will only rotate after the kernel is loaded. I want to rotate before anything is loaded, to be able to see the screen that is shown before the kernel loads.
-
- Posts: 7283
- Joined: Sat Aug 18, 2012 2:33 pm
Re: Rotate Screen on Boot
there is no way to rotate the hdmi diagnostics screenfamadorian wrote: ↑Mon Apr 17, 2023 7:41 pmThis will only rotate after the kernel is loaded. I want to rotate before anything is loaded, to be able to see the screen that is shown before the kernel loads.
and start4.elf doesnt display any text, so rotation at that stage is rather pointless
the linux kernel then follows, and thats already answered
-
- Posts: 7343
- Joined: Tue Jun 30, 2015 1:35 pm
Re: Rotate Screen on Boot
Boot diagnostics screen i.e. is rendered by the firmware only. It will be shown with no uSD card present --> no uSD card, no settings for rotation!
As another example you will never be able to ratate the 'rainbow' screen; also rendered by FW.
NOTE: you can have firmware related settings active up to the point where KMS kicks in/out.
I have a screen which has some 'bad' EDID data. So, did a short test and added custom HDMI timings parameters for it to config.txt
As one can see the screen is a portrait mode screen, so as long as the firmware is active It will display in native orientation.
For KMS I want it to be rotated to landscape, that's why below gets added to the kernel command line (cmdline.txt)
Testing the result when booting to CLI first.
It should start portrait and at some point - when KMS takes over - be rotated to landscape.
That's working 'somehow' as expected -> screens starts in portrait and the get's rotated by KMS to landscape.
Seems firmware is igniring the frame buffer related settings as well as the rotation parameter!
Same is valid when using FKMS btw!
Anyhow, test with your screen (as you did not mention why it's mounted upside down).
As another example you will never be able to ratate the 'rainbow' screen; also rendered by FW.
NOTE: you can have firmware related settings active up to the point where KMS kicks in/out.
I have a screen which has some 'bad' EDID data. So, did a short test and added custom HDMI timings parameters for it to config.txt
Code: Select all
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=87
framebuffer_width=1080
framebuffer_height=1920
max_framebuffer_height=1920
max_framebuffer_width=1920
# ---------------------------------------------
# HDMI timing definitions
# ---------------------------------------------
hdmi_timings=1080 1 100 10 50 1920 1 2 2 2 0 0 0 60 0 144400000 3
display_hdmi_rotate=3
For KMS I want it to be rotated to landscape, that's why below gets added to the kernel command line (cmdline.txt)
Code: Select all
video=HDMI-A-1:1080x1920M@60D,rotate=90
It should start portrait and at some point - when KMS takes over - be rotated to landscape.
That's working 'somehow' as expected -> screens starts in portrait and the get's rotated by KMS to landscape.
Seems firmware is igniring the frame buffer related settings as well as the rotation parameter!
Same is valid when using FKMS btw!
Anyhow, test with your screen (as you did not mention why it's mounted upside down).
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
Hmm, a simple rotation as kernel parameters didn't even work for me
I just appended the video part to my cmdline.txt, but when it starts, it's still at the same rotation
console=serial0,115200 console=tty1 root=PARTUUID=5e7aee5a-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-console video=HDMI-A-1:1080x1920M@60D,rotate=90
Any ideas?;)
I'll try 180, to see what happens.
I just appended the video part to my cmdline.txt, but when it starts, it's still at the same rotation
console=serial0,115200 console=tty1 root=PARTUUID=5e7aee5a-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-console video=HDMI-A-1:1080x1920M@60D,rotate=90
Any ideas?;)
I'll try 180, to see what happens.
-
- Posts: 7343
- Joined: Tue Jun 30, 2015 1:35 pm
Re: Rotate Screen on Boot
Are you sure your screen is full HD in portrait mode (1080x1920pixels)?famadorian wrote: ↑Thu Apr 27, 2023 11:27 amHmm, a simple rotation as kernel parameters didn't even work for me
I just appended the video part to my cmdline.txt, but when it starts, it's still at the same rotation
console=serial0,115200 console=tty1 root=PARTUUID=5e7aee5a-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-console video=HDMI-A-1:1080x1920M@60D,rotate=90
Any ideas?;)
I'll try 180, to see what happens.
What I've posted is an my last post was an example only! So in case your screen is a standard FHD in landscape orientation (1920x1080) you need to use
Code: Select all
video=HDMI-A-1:1920x1080M@60D,rotate=90
And you also need to make sure you you're screen is connected to HDMI-1 (the output next to uSD on a Pi400!)
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
Ok, damn, this is so weird and it's not working.
Let me start off by saying that the initial screen when I boot, before the kernel loads is 90 CCW.
After the kernel boots, this is the result of changing the variable
| config | rotation |
| 0 | 90 degrees CCW |
| 90 | 90 degrees CCW |
| 180 | 90 degrees CW |
| 270 | 90 degrees CCW |
So, 0, 90 and 270 has no effect; screen is still 90 CCW.
If I, however, set the variable to 180, then the screen is 90 degrees CW;)
Damn, any pointers?;)
Let me start off by saying that the initial screen when I boot, before the kernel loads is 90 CCW.
After the kernel boots, this is the result of changing the variable
| config | rotation |
| 0 | 90 degrees CCW |
| 90 | 90 degrees CCW |
| 180 | 90 degrees CW |
| 270 | 90 degrees CCW |
So, 0, 90 and 270 has no effect; screen is still 90 CCW.
If I, however, set the variable to 180, then the screen is 90 degrees CW;)
Damn, any pointers?;)
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
ok, it's this monitor.
https://www.waveshare.com/wiki/21.5inch_FHD_Monitor
It says it's 1080 x 1920, so it's actually default in portrait mode, hmm.
I will try again with that other kernel line.
https://www.waveshare.com/wiki/21.5inch_FHD_Monitor
It says it's 1080 x 1920, so it's actually default in portrait mode, hmm.
I will try again with that other kernel line.
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
ok, I've now tried all the combinations and it's the same here. The screen is 90 CCW rotated for all 0,90 and 270 and 90 CW for 180
This is for both kernel lines:
video=HDMI-A-1:1920x1080M@60D,rotate=X
video=HDMI-A-1:1080x1920M@60D,rotate=X
So, I've tried 8 possible variations of that line.
I'm stumped. Any ideas what I can try?;)
This is for both kernel lines:
video=HDMI-A-1:1920x1080M@60D,rotate=X
video=HDMI-A-1:1080x1920M@60D,rotate=X
So, I've tried 8 possible variations of that line.
I'm stumped. Any ideas what I can try?;)
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
Ok, it's solved:
Comment out the dtoverlay line
# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
Now the orientation is correct, but what did I just comment out?;)
DRM VC4 V3D is not something I need?
What is it?;)
Comment out the dtoverlay line
# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
Now the orientation is correct, but what did I just comment out?;)
DRM VC4 V3D is not something I need?
What is it?;)
-
- Posts: 7283
- Joined: Sat Aug 18, 2012 2:33 pm
Re: Rotate Screen on Boot
that was the driver for doing all 2d and 3d acceleration, so now anything using the display will be cpu intensive
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
Ok, that sucks.
It won't rotate with that line enabled, so what we're gonna do with the drunken sailor?
It won't rotate with that line enabled, so what we're gonna do with the drunken sailor?
-
- Posts: 17
- Joined: Sun Jun 13, 2021 9:21 am
Re: Rotate Screen on Boot
I got this from support
thank you for your reply
If you want to modify the rotation parameters in the config file, you can only choose to comment out kms to use
Otherwise, you can only choose to use the rotation method of xrandr and the rotation method of the GUI interface, there is no other method
thank you for your reply
If you want to modify the rotation parameters in the config file, you can only choose to comment out kms to use
Otherwise, you can only choose to use the rotation method of xrandr and the rotation method of the GUI interface, there is no other method
Re: Rotate Screen on Boot
Using xrandr is clear enough, it is now the only way to make the screen rotate. However my question is "where is this supposed to be executed during boot?"
The reason this is tricky is the form of the command. xrandr needs to be told which DISPLAY is in use. Here is the prototype command that works:
Should this be execute in:
The reason this is tricky is the form of the command. xrandr needs to be told which DISPLAY is in use. Here is the prototype command that works:
Code: Select all
DISPLAY=:0 xrandr --output HDMI-1 --rotate inverted
- an autostart command
a systemd command
in a .bashrc or similar