配置:樹莓派4+raspberry pi系統,HDMI顯示,非觸屏。
問題:想將屏幕旋轉90°,按網上說的,
方法一:在config.txt文件中添加display_rotate=1,或者添加display_hdmi_rotate=1,保存后reboot系統。不管用?
方法二:修改GPU顯存,官方文檔說如果顯存小于16M,反轉屏幕是不起作用的。
Note that the 90 and 270 degree rotation options require additional memory on the GPU, so these will not work with the 16MB GPU split.
顯存設置為64M,reboot。不管用??

繼續翻看官方文檔,發現在樹莓派4之前的版本上,屏幕旋轉用的是修改config.txt文件,而在樹莓派4上,因為改了驅動程序,再修改config.txt文件就不起作用了。
最新方法一:在“application menu”→“preferences”→“screen configuration”中點擊“configure”,然后在“screen”→“HDMI”→“orientation”中選擇要轉動的方向,然后確認就行了。
最新方法二:使用xrandr命令設置屏幕旋轉的方向,下面命令分別對應0°、-90°、+90°、180°的旋轉方向:
xrandr --output HDMI-1 --rotate normal
xrandr --output HDMI-1 --rotate left
xrandr --output HDMI-1 --rotate right
xrandr --output HDMI-1 --rotate inverted
設置好命令就可以了。
文檔鏈接如下:
https://www.raspberrypi.org/documentation/configuration/config-txt/video.md