Skip to content

Instantly share code, notes, and snippets.

@matiaspl
Last active April 9, 2021 12:37
Show Gist options
  • Save matiaspl/6b90b3306f6a4cc93fd7f04f67a4ea4c to your computer and use it in GitHub Desktop.
Save matiaspl/6b90b3306f6a4cc93fd7f04f67a4ea4c to your computer and use it in GitHub Desktop.
5.5" AMOLED WaveShare on Pi4 with FKMS video driver

Derived from screen's EDID (which seems to be wrong - bad checksum) using wxEDID, cvt_modeline_calculator. It's a pitty the embedded controller doesn't have hardware rotation because the screens orientation (portrait) seems to be the source of all evil.

On Windows machines the screen does run in FHD, HD and QHD modes. The resolutions below are only full HD, the "b" mode worked best for me.

export DISPLAY=:0

xrandr --newmode "a" 116.148  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --newmode "b" 137.533440  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --newmode "c" 114.611200  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync

xrandr --addmode HDMI-1 "a"
xrandr --output HDMI-1 --mode "a"

xrandr --verbose
Windows
a (0x374) 116.148MHz -HSync +VSync
        h: width  1080 start 1112 end 1144 total 1184 skew    0 clock  98.10KHz
        v: height 1920 start 1928 end 1932 total 1936           clock  50.67Hz
Linux 60Hz
b (0x37b) 137.533MHz -HSync +VSync
        h: width  1080 start 1112 end 1144 total 1184 skew    0 clock 116.16KHz
        v: height 1920 start 1928 end 1932 total 1936           clock  60.00Hz
Linux 50Hz
c (0x37e) 114.611MHz -HSync +VSync *current
        h: width  1080 start 1112 end 1144 total 1184 skew    0 clock  96.80KHz
        v: height 1920 start 1928 end 1932 total 1936           clock  50.00Hz

Sidenote - correct 60Hz mode for non-FKMS (legacy) video driver

[pi4]
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2
hdmi_driver=2
hdmi_group=2
hdmi_mode=87
max_framebuffer_width=1080
max_framebuffer_height=1920
display_rotate=0
max_usb_current=1
config_hdmi_boost:0=10
hdmi_force_hotplug=1
hdmi_timings:0=1080 1 26 4 50 1920 1 8 2 6 0 0 0 60 0 135580000 3

xrandr --newmode "b" 137.533440  1080 1112 1144 1184 1920 1928 1932 1936 -HSync +VSync
xrandr --addmode HDMI-1 b
xrandr --output HDMI-1 --mode b

xrandr --newmode "1080x1920_60.00_rb2" 137.46 1080 1088 1120 1160 1920 1961 1969 1975 +hsync -vsync
xrandr --addmode HDMI-1 "1080x1920_60.00_rb2"
xrandr --output HDMI-1 --mode "1080x1920_60.00_rb2"

xrandr --newmode "b" 165  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "b"
xrandr --output HDMI-1 --mode b

xrandr --newmode "bb" 148  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "bb"
xrandr --output HDMI-1 --mode bb

xrandr --newmode "bbb" 149  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "bbb"
xrandr --output HDMI-1 --mode bbb

xrandr --newmode "bbbb" 138  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "bbbb"
xrandr --output HDMI-1 --mode bbbb

xrandr --newmode "c" 139  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "c"
xrandr --output HDMI-1 --mode c

xrandr --newmode "d" 137.533440  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "d"
xrandr --output HDMI-1 --mode d

xrandr --newmode "e" 138.5  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "e"
xrandr --output HDMI-1 --mode e

xrandr --newmode "f" 138.8  1080 1112 1144 1184  1920 1928 1932 1936  -HSync +VSync
xrandr --addmode HDMI-1 "f"
xrandr --output HDMI-1 --mode f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment