Rotate LCD for the framebuffer

Hello

I have an application that writes to the linux frame buffer /dev/fb0. No X-Server running.
On the custom board the lcd works perfect with these settings:

fw_setenv vidargs  'video=tegrafb0:640x480-32@60'
reboot

root@colibri-t30:~# fbset -fb /dev/fb0
fbset -fb /dev/fb0
mode "640x480-61"
	# D: 25.176 MHz, H: 31.469 kHz, V: 60.987 Hz
	geometry 640 480 640 960 32
	timings 39721 48 16 33 1 96 2
	accel false
	rgba 8/0,8/8,8/16,8/24
    endmode
        
root@colibri-t30:~# cat /proc/cmdline
core_edp_mv=1300 usb_high_speed=1 user_debug=30 ip=off root=/dev/mmcblk0p2 ro rootfstype=ext3 rootwait asix_mac=00:14:2d:29:00:ae consoleblank=0 no_console_suspend=1 console=tty1 console=ttyS0,115200n8 debug_uartport=lsport,3 vmalloc=128M mem=1012M@2048M fbmem=12M@3060M video=tegrafb0:640x480-32@60

Now I need to rotate the display. I tried the following:

fw_setenv vidargs  'video=tegrafb0:480x640-32@60'
reboot

root@colibri-t30:~# fbset -fb /dev/fb0

mode "480x640-54"
	# D: 18.000 MHz, H: 35.157 kHz, V: 53.592 Hz
	geometry 480 640 480 1280 32
	timings 55555 20 8 7 8 4 1
	accel false
	rgba 8/0,8/8,8/16,8/24
endmode

The display is still messed up!

Then I tried:

root@colibri-t30:~# echo 1 | tee  /sys/class/graphics/fb0/rotate 
1
[  308.263239] tegradc tegradc.0: switching framebuffer to 480x640
[  308.263263] tegradc tegradc.0: Calculated sync href=0 vref=1
[  308.263284] tegradc tegradc.0: using mode 480x640 pclk=18000000 href=0 vref=1

[  308.329084] tegradc tegradc.0: switching framebuffer to 480x640
[  308.329107] tegradc tegradc.0: Calculated sync href=0 vref=1
[  308.329129] tegradc tegradc.0: using mode 480x640 pclk=18000000 href=0 vref=1

Still a messed up.

Can someone tell me what is wrong with my settings ?

Thanks for answers and advices.

Andreas

Found a solution:

  • Build the application using SDL.
  • Use console-tdx-image
  • Start X
  • xrandr -o left
  • start application

Hi @ubx

Perfect. Thanks for your Input.

Best regards,
Jaski