Custom resolution, 12.6" 1920x515

I’ve ran down a myriad of rabbit holes on how to set the display resolution on my Pi4 (lastest DietPi, 7.5.2) using LXDE with an HDMI (on HDMI0) 1920x515 display but I’ve had no success.

Maybe I’m missing something dumb. Is there a clear how-to to follow on this?

I found https://dietpi.com/forum/t/req-dietpi-config-custom-resolution-set-by-user-pls-1280x800/2941/1 (which led to https://www.raspberrypi.org/documentation/computers/configuration.html#setting-a-custom-hdmi-mode) but that wasn’t helpful as I need a very non-standard aspect ratio.

This display: https://www.amazon.com/dp/B08FJ33247

Out of frustration I searched blatantly for “raspberry pi” “1920x515” configuration which led me to:

https://twitter.com/sentoki/status/1363417413388148745

Some mild translating later:

The config when making this 1920x515 LCD vertical with Raspberry Pi is
disable_overscan = 1
hdmi_group = 2
hdmi_mode = 87
hdmi_cvt = 1920 515 60 6 0 0 0
display_hdmi_rotate = 3
was. It was simple. I thought it was a more complicated setting and lost time by trial and error. The photo is Yahoo seen on Lynx (Twitter is not supported)

/boot/config.txt

disable_overscan = 1
hdmi_group = 2
hdmi_mode = 87
hdmi_cvt = 1920 515 60 6 0 0 0
display_hdmi_rotate = 3

… man that is simple.

Custom HDMI modes are documented here: https://www.raspberrypi.org/documentation/computers/config_txt.html#custom-mode
The documentation got some major restructure some weeks ago, probably this is the reason why the old link wasn’t too helpful anymore. So yeah, hdmi_group=2 + hdmi_mode=87 enables the custom mode, hdmi_cvt defines it, and then based on the actual screen a rotation via display_hdmi_rotate may be required.

On RPi 4, when using the second HDMI port, those settings all need to be suffixed with :1, so e.g. hdmi_group:1=2