• NetBSD
  • Problems with various AMD GPU generations and 2560x1440 screen

bbartlomiej Can you post the Xorg.0.log from the Thinkpad so that I verify that the EDID retrieved is the same?

Can you see if, say, FreeBSD 12.x (which should end up bringing in a DRMKMS of the same vintage as NetBSD (5.6) or maybe 5.10, now) manages to achieve the full resolution? Just install onto a spare USB flash drive or somesuch, then: pkg install xorg drm-kmod; sysrc kld_list="radeonkms"

    rvp I've uploaded Xorg.0.log from T480 for both intel driver and modesetting. By default it starts with intel but I've dropped in

    Section "Device"
            Identifier "intel"
            Driver "modesetting"
    EndSection

    and only the modesetting driver prints out EDID data. Seems the modeline printed for 2560x1440 is the same as for HD 8570 however the actual EDID hex data seems different. Weird!

    HD 8570:

    [   104.732] (II) modeset(0): EDID (in hex):
    [   104.732] (II) modeset(0): 	00ffffffffffff0030aee96100000000
    [   104.732] (II) modeset(0): 	0a200103803c22782e6665a9544c9d26
    [   104.732] (II) modeset(0): 	105054a1080081809500b300d1c0d100
    [   104.732] (II) modeset(0): 	a9c081c08100565e00a0a0a029503020
    [   104.732] (II) modeset(0): 	3500615d2100001a000000fc00503237
    [   104.732] (II) modeset(0): 	682d32300a2020202020000000fd0032
    [   104.732] (II) modeset(0): 	4c1e5a22000a202020202020000000ff
    [   104.732] (II) modeset(0): 	0056393039585759480a202020200190
    [   104.732] (II) modeset(0): 	02031ff14c01020304051413901f120e
    [   104.732] (II) modeset(0): 	0f23090f078301000065030c00100001
    [   104.732] (II) modeset(0): 	1d007251d01e206e2855005550210000
    [   104.732] (II) modeset(0): 	1e8c0ad08a20e02d10103e9600555021
    [   104.732] (II) modeset(0): 	00001800000000000000000000000000
    [   104.732] (II) modeset(0): 	00000000000000000000000000000000
    [   104.732] (II) modeset(0): 	00000000000000000000000000000000
    [   104.732] (II) modeset(0): 	00000000000000000000000000000094
    [   104.732] (II) modeset(0): Not using default mode "1920x1080" (bad mode clock/interlace/doublescan)
    [   104.732] (II) modeset(0): Not using default mode "2048x1152" (bad mode clock/interlace/doublescan)
    [   104.732] (II) modeset(0): Printing probed modes for output HDMI-1
    [   104.732] (II) modeset(0): Modeline "2560x1440"x60.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz eP)

    Intel GPU:

    [   389.991] (II) modeset(0): Number of EDID sections to follow: 1
    [   389.991] (II) modeset(0): EDID (in hex):
    [   389.991] (II) modeset(0): 	00ffffffffffff0030aee96100000000
    [   389.991] (II) modeset(0): 	0a200104a53c22783e6665a9544c9d26
    [   389.991] (II) modeset(0): 	105054a1080081c0810081809500a9c0
    [   389.991] (II) modeset(0): 	b300d1c00101565e00a0a0a029503020
    [   389.991] (II) modeset(0): 	3500615d2100001a000000fc00503237
    [   389.991] (II) modeset(0): 	682d32300a2020202020000000fd0032
    [   389.991] (II) modeset(0): 	4c1e5a24000a202020202020000000ff
    [   389.991] (II) modeset(0): 	0056393039585759480a202020200127
    [   389.991] (II) modeset(0): 	020318f14b9005040302011f13140e0f
    [   389.991] (II) modeset(0): 	23090f0783010000662156aa51001e30
    [   389.991] (II) modeset(0): 	468f33000f282100001eab22a0a05084
    [   389.991] (II) modeset(0): 	1a30302036000f282100001c7c2e90a0
    [   389.991] (II) modeset(0): 	601a1e40302036000f282100001c0000
    [   389.991] (II) modeset(0): 	00000000000000000000000000000000
    [   389.991] (II) modeset(0): 	00000000000000000000000000000000
    [   389.991] (II) modeset(0): 	0000000000000000000000000000006a
    [   389.991] (II) modeset(0): Printing probed modes for output DP-2
    [   389.991] (II) modeset(0): Modeline "2560x1440"x60.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz eP)

    I will do more tests with the adapter and FreeBSD over the weekend. I need to travel for work tomorrow.

    • rvp replied to this.

      bbartlomiej Seems the modeline printed for 2560x1440 is the same as for HD 8570 however the actual EDID hex data seems different. Weird!

      The monitor being connected via DisplayPort might account for that. However, there's something suggestive to be seen in a edid-decode -n output:

      $ edid-decode -n < edid1.txt
      [...]
      Native Video Resolution if only Block 0 is parsed:
        2560x1440
      
      ----------------
      
      Native Video Resolutions if Block 0 and CTA-861 Blocks are parsed:
        129x0                    # this looks like a bug
        1920x1080                # only this over HDMI?
      $ 

      Compare against edid-decode -p

      7 days later

      Not sure what that would mean. The screen supports 2560x1440 over HDMI since it works on HD 8570 (although with software only rendering).

      I tested with HD 7450 today and my DisplayPort-HDMI adapter but it didn't work at all (even in BIOS/UEFI). I am not getting any output when I use HDMI on GPU and plug it in DisplayPort port on the screen. Maybe it's a one-way adapter (DP -> HDMI, not HDMI -> DP)

      Testing now with FreeBSD 12.4.

      • rvp replied to this.

        bbartlomiej Not sure what that would mean. The screen supports 2560x1440 over HDMI since it works on HD 8570 (although with software only rendering).

        Yes, but the question is whether the other 2 cards can drive 2560x1440 over HDMI. Anyway, can you try passing this EDID blob to Xorg?

        00FFFFFFFFFFFF0030AEE96100000000
        0A200103803C22782E6665A9544C9D26
        105054A1080081809500B300D1C0D100
        A9C081C08100565E00A0A0A029503020
        3500615D2100001A000000FC00503237
        682D32300A2020202020000000FD0032
        4C1E5A22000A202020202020000000FF
        0056393039585759480A202020200190
        02031FF14C01020304051413101F120E
        0F23090F078301000065030C00100001
        1D007251D01E206E2855005550210000
        1E8C0AD08A20E02D10103E9600555021
        00001800000000000000000000000000
        00000000000000000000000000000000
        00000000000000000000000000000000
        00000000000000000000000000000014
        1. Convert to binary:

          $ printf "$(sed 's/../\\x&/g' edid.txt | tr -d '\n')" > HDMI-edid.bin
          $ edid-decode < HDMI-edid.bin          # check if correct
        2. Pass this blob to the radeon driver:

          Option "CustomEDID" "HDMI-0:/some/path/HDMI-edid.bin:digital"

          (Not sure if the :digital bit is reqd.)

        3. Post the Xorg.0.log files.

        I've just removed the "native" from the 1920x1080 resolution in the CTA-block. See if the Xorg server swallows this like a good boy.

          8 days later

          bbartlomiej Everything seems smooth BUT some applications like Firefox do not show all graphics correctly - like images missing on web pages, especially the ones with transparency. Some Firefox tabs also do not have the correct shape (missing rounded corners etc. also on web pages). This is very odd.

          Try starting Firefox in an English locale: env LANG=en_US.UTF-8 firefox or env LANG=en_GB.UTF-8 firefox. And, after you've picked your jaw up off the floor, file a PR.

            5 days later

            rvp Try starting Firefox in an English locale: env LANG=en_US.UTF-8 firefox or env LANG=en_GB.UTF-8 firefox. And, after you've picked your jaw up off the floor, file a PR.

            No, that didn't make any difference. On HD7450 using radeon driver it starts in 1920x1080 and screen has artifacts on XFCE4 desktop, menu entries and within Firefox's window - stuff missing from web pages. Added another screenshot to my Nextcloud link.

            rvp Option "CustomEDID" "HDMI-0:/some/path/HDMI-edid.bin:digital"

            I can't make Xorg read my custom file 🙁

            [   139.286] (WW) RADEON(0): Option "UseEDID" is not used
            [   139.286] (WW) RADEON(0): Option "CustomEDID" is not used

            Updating to 10.0_RC4 since there were some changes in GPU-related areas (although Intel-related). In the end I will raise a PR since I'm also out of ideas.

            • rvp replied to this.
            • Jay likes this.
              18 days later

              bbartlomiej I can't make Xorg read my custom file

              Ah, hell! I looked at the wrong radeon(4) man-page. Might have to fix this up in the kernel then. Did you try out FreeBSD or Linux on these cards?

                14 days later

                rvp I started testing with FreeBSD 12.4 but there are no packages available anymore and ports gives warning that it's too old to be supported and no guarantee stuff will compile so I stopped that.

                I did test with old Ubuntu with Linux 5.15.0 kernel and it seems to behave the same way on HD7450:

                • resolution is 1920x1080
                • Xorg.0.log shows modelines are read from the screen for 2560x1440 but are not used when I try to use xrandr
                • when I manually add a mode to xrandr using cvt, screen goes blank as on NetBSD.

                I've attached the dmesg and Xorg.0.log in the link I shared at the beginning but it looks like this version of DRM doesn't support this card with this screen properly. I tested with Ubuntu using Linux 6.x and it is the same.

                So my best shot is to wait for Radeon HD 8670 to get support in NetBSD as this did work on Linux 6.x.
                Or can any of you recommend another GPU that's supported by NetBSD and will work in 2560x1440?
                Thanks for all the help!

                • rvp replied to this.
                • Jay likes this.

                  bbartlomiej I did test with old Ubuntu with Linux 5.15.0 kernel and it seems to behave the same way on HD7450:

                  Hmm. What about the latest Ubuntu?

                  bbartlomiej Xorg.0.log shows modelines are read from the screen for 2560x1440 but are not used when I try to use xrandr

                  I wanted to ask about this before, then plumb forgot: Can you post the xrandr output, and the command you used to set the new mode?

                  bbartlomiej when I manually add a mode to xrandr using cvt, screen goes blank as on NetBSD.

                  Did you try the modeline printed/got from EDID? Is it the same as what's generated by cvt?

                  bbartlomiej Or can any of you recommend another GPU that's supported by NetBSD and will work in 2560x1440?

                  Answered in post #8.

                    rvp Hmm. What about the latest Ubuntu?

                    tried just now. Same thing (Ubuntu now is full Wayland).

                    rvp I wanted to ask about this before, then plumb forgot: Can you post the xrandr output, and the command you used to set the new mode?

                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr --newmode 2560x1440 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr --addmode HDMI-0 2560x1440
                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr
                    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
                    HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 609mm x 349mm
                    1920x1200 59.95
                    1920x1080 60.00* 60.00 50.00 59.94
                    1920x1080i 60.00 50.00 59.94
                    1680x1050 59.88
                    1600x900 60.00
                    1280x1024 60.02
                    1440x900 59.90
                    1280x800 59.91
                    1280x720 60.00 50.00 59.94
                    1024x768 60.00
                    1440x480 60.00 59.94
                    800x600 60.32
                    720x576 50.00
                    720x480 60.00 59.94
                    640x480 60.00 59.94
                    720x400 70.08
                    2560x1440 59.96
                    VGA-0 disconnected (normal left inverted right x axis y axis)
                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr --output HDMI-0 --mode 2560x1440
                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr --output HDMI-0 --auto
                    root@ubuntu:/sys/class/drm/card0-HDMI-A-1# uname -a
                    Linux ubuntu 6.5.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 7 01:35:40 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

                    Of course on xrandr output you see 2560x1440 beacause I manually added it to HDMI-0

                    rvp Did you try the modeline printed/got from EDID? Is it the same as what's generated by cvt?

                    I remember trying both with modeline from cvt and the one from Xorg.0.log - same issue on HD 7450

                    rvp Answered in post #8.

                    Is Intel Arc supported by NetBSD? I haven't seen it in man pages anywhere. It stopped on Iris I think? Since my CPU is AMD Ryzen 9 I can't really use the Intel iGPU. I could only go with discrete Intel Arc GPU.

                    • rvp replied to this.

                      bbartlomiej

                      root@ubuntu:/sys/class/drm/card0-HDMI-A-1# xrandr --newmode 2560x1440 312.25  2560 2752 3024 3488  1440 1443 1448 1493 -hsync +vsync

                      Hmm. That doesn't match what Xorg prints:

                      [   104.732] (II) modeset(0): Modeline "2560x1440"x60.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz eP)

                      Can you try with those?

                        5 days later

                        rvp
                        I did try with modelines from Xorg.0.log on NetBSD. The above snippets were from cvt just to show how I set it. Since it's Wayland-based I couldn't get the same logging information.

                        I tried with the same modeline on Ubuntu:

                        ubuntu@ubuntu:~$ xrandr --newmode 2560x1440 241.5 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
                        ubuntu@ubuntu:~$ xrandr
                        Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 16384 x 16384
                        HDMI-0 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 609mm x 349mm
                        1920x1200 59.95*
                        1920x1080 60.00 60.00 50.00 59.94
                        1920x1080i 60.00 50.00 59.94
                        1680x1050 59.88
                        1600x900 60.00
                        1280x1024 60.02
                        1440x900 59.90
                        1280x800 59.91
                        1280x720 60.00 50.00 59.94
                        1024x768 60.00
                        1440x480 60.00 59.94
                        800x600 60.32
                        720x576 50.00
                        720x480 60.00 59.94
                        640x480 60.00 59.94
                        720x400 70.08
                        VGA-0 disconnected (normal left inverted right x axis y axis)
                        2560x1440 (0x6da) 241.500MHz +HSync -VSync
                        h: width 2560 start 2608 end 2640 total 2720 skew 0 clock 88.79KHz
                        v: height 1440 start 1443 end 1448 total 1481 clock 59.95Hz
                        ubuntu@ubuntu:~$ xrandr --addmode HDMI-0 2560x1440
                        ubuntu@ubuntu:~$ xrandr --output HDMI-0 --mode 2560x1440

                        Still blank screen with mode out of range and I had to revert blind with:

                        ubuntu@ubuntu:~$ xrandr --output HDMI-0 --auto