1

I have three identical 1680x1050 monitors and am trying to use them via the “HP G5 USB-C dock” on my Razer Blade 15" 2018 laptop and its Thunderbolt 3 port. With xrandr I can get all displays working simultaneously sometimes, but never in the resolutions I want to.

If I build modelines myself, I can run all three with 1680x1050 with 49Hz. Are 60Hz not possible? Maybe it is a pixel clock issue.

xrandr | egrep '^[^ ]' | grep -v 'Screen 0:' | sed -e 's/ (.*//'

prints this without the dock connected:

eDP-1 connected primary 1920x1080+0+0
DP-1 disconnected
DP-2 disconnected
HDMI-1-1 disconnected
DP-1-3 disconnected

after hotplugging the dock I see:

eDP-1 connected primary 1920x1080+0+0
DP-1 disconnected
DP-2 disconnected
DP-1-1 connected
DP-1-2 connected
DP-1-3 disconnected
HDMI-1-1 disconnected

booting with the dock shows:

eDP-1 connected primary 1920x1080+0+0
DP-1 disconnected
DP-2 disconnected
DP-1-1 connected
DP-1-2 connected
DP-1-3 connected
HDMI-1-1 disconnected
DP-1-6 disconnected

With the dock hotplugged I can’t configure xrandr --output DP-1-3 --auto. I get xrandr: cannot find preferred mode. Booting with it works, though.

Trying to enable the third monitor with 1680x1050@60 produces xrandr: Configure crtc 0 failed. I even used a modeline generated with cvt -r. I think the monitors are too old for CVT-RBv2.

[asking for a friend @bain]

1 Answers1

3
My findings
  1. That HP G5 dock (spec) does only USB-C. The video signal will be transmitted with that famous USB-C Alternate mode for DisplayPort; the Thunderbolt 3 functionality from the laptop (same port, different mode of operation) is not used.

  2. The tripple 1680x1050 resolution is a strong hint that the laptop is limited to DisplayPort 1.2 over USB-C and uses only 2 lanes. It allows a bandwidth of 8.64Gb/s, for which a tripple 1680x1050 is a tight fit, but 60Hz are possible. What makes you so sure that CVT-RBv2 timings would not work? The error xrandr: Configure crtc 0 failed indicates that the GPU could not be configured to do what you want. If the monitor were actually not able to handle the mode, it could only indicate that on it’s own screen, flicker strangely or go dark etc. For generating useful modelines cvt is useless for this case (and many others). Further, its -r switch generates “v1” timings only.

  1. The hotplug issue seems to be an unrelated bug. If you look at the ports without the dock, you can see the odd DP-1-3 port. I’m not sure what it represents, especially without DP-1-1 and DP-1-2 around.—I believe that this odd entry is the same as the DP-1-6 entry in the coldplug case (the number always being +3 of the last DP-1-x). In the hotplug event the enumeration over DP-1 clashes after DP-1-1 and DP-1-2 with that spurious DP-1-3 and fails to register with that name and does not attempt any other name, it seems, making it impossible to see/handle the last video port of the dock.
How to proceed
60Hz refresh

(The following text shows ways to get things going. Read and understand and adapt to your environment. Copy&paste might not work.)

Let’s get all monitors to 60Hz. First, make sure you’re coldplugged and that all 3 external monitors work in some resolution. To avoid bottle neck issues or hitting other limits of the GPU (we want to test the monitors!), work on the internal screen and switch all others off

for no in 1 2 3; do xrandr --output DP-1-$no --off; done

Now lets add “my” modelines:¹

xrandr --newmode h160 119    1680 1728 1760 1840 1050 1053 1059 1080 +HSync -VSync
xrandr --newmode h80 114.048 1680 1688 1720 1760 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h60 112.752 1680 1688 1710 1740 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h50 112.104 1680 1688 1705 1730 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h40 111.456 1680 1688 1702 1720 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h30 110.808 1680 1682 1690 1710 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h25 110.484 1680 1682 1690 1705 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h20 110.16  1680 1682 1690 1700 1050 1066 1074 1080 +HSync -VSync
xrandr --newmode h12 109.642 1680 1684 1688 1692 1050 1066 1074 1080 +HSync -VSync

Add them to your preferred monitor now (and to the others eventually):

for name in h160 h80 h60 h50 h40 h30 h25 h20 h12; do xrandr --addmode DP-1-1 $name; done

Now test them!

xrandr --output DP-1-1 --mode h160

h160 should work. It’s the boring CVT-RB timing from cvt -r 1680 1050 60. Then test h80. This is CVT-RBv2. I have four mediocre old monitors, they can all do that. Further:

  • on h60 my crappy Medion brand Full-HD monitor gets an unsteady image
  • h30 is the last modeline for this BenQ brand Full-HD monitor
  • h20 HP Full-HD monitor (ok)
  • h12 Dell office 1680x1050 monitor (working!)

Then try enabling all three on the last modeline you have working.

60Hz alternative solution

As mentioned, the bandwidth limit is also dictated by the USB-C Displayport Alternate Mode version and setup. For more bandwidth use DP 1.3+ and/or 4 lanes (maximum) instead of 2 of the USB-C wiring. The former can not be changed on the same hardware, the latter sometimes can in the firmware setup utility (“BIOS”), look for “USB-C High Resolution Mode” or something... In the 4-lane-mode no USB 3.x is available next to the DisplayPort video signal, only USB 2.0.

hotplugging the dock

For the same 3 states (no dock, hotplugged, coldplugged), please send the output of

(cd /sys/class/drm; ls */edid)

I have

card0-DP-1/edid     card0-DVI-I-2/edid
card0-DVI-I-1/edid  card0-HDMI-A-1/edid

E.g. totally different names compared to xrandr | egrep '^[^ ]' | grep -v 'Screen 0:' | sed -e 's/ (.*//'

DisplayPort-0 connected primary 1680x1050+0+1080
HDMI-0 connected 1680x1050+1920+1080
DVI-0 connected 1680x1050+3840+1080
DVI-1 connected 1680x1050+1920+0

Maybe it sheds some light on what is what. The Razer Blade 15" Base (2018) is supposed to have the internal display, 1×Thunderbolt3/USB-C, 1×HDMI 2.0 and 1×Mini DisplayPort 1.4.

That explains eDP-1, HDMI-1-1 (albeit not its naming) and DP-1 is related to USB-C, as we know. Leaves DP-2 and DP-1-3. I guess DP-2 is the Mini DisplayPort. And maybe DP-1-3 is the Thunderbolt side of that dual-use Thunderbolt/USB port. If there is an interdependency, let’s confirm it by enabling them first individually, then together. Disconnect the dock and switch --off all outputs. Then

xrandr --addmode DP-1 0x74  # some 800x600 standard modeline on my system
xrandr --output DP-1 --mode 0x74  # does this work?
xrandr --output DP-1 --off  # afterwards

This way you can force the GPU to output something there. Try DP-1-3 next. Does it work? Can you enable both at the same time? Also on different (low-res) resolutions (e.g. no mirroring)? Could you borrow a Thunderbolt to DP converter? Check if this adapter uses DP-1-3.

Anyway... if this all turns out to be true, it seems that the Xserver did a bad call on handing out conflicting names for some kind of internal output splitter. Would be interesting to see if you could only restart the Xserver after hotplugging the dock without full reboot. If it turns working, then the kernel GPU driver does not seem to provoke the problem, but indeed the enumeration in X11.


¹ Pixel clock calculated with Tom's video timing calculator and hand-molded into a modeline.

  • Thank you - another excellent answer! h40 was the lowest modeline that worked, I now have 60fps on all three monitors. To answer your questions: – bain Feb 28 '23 at 16:08
  • disconnected: card0-DP-1 card0-DP-2 card0-eDP-1 card1-DP-3 card1-HDMI-A-1 – bain Feb 28 '23 at 16:08
  • coldplugged: card0-DP-1 card0-DP-2 card0-DP-7 card0-DP-8 card0-DP-9 card0-eDP-1 card1-DP-6 card1-HDMI-A-1 – bain Feb 28 '23 at 16:08
  • hotplugged: card0-DP-1 card0-DP-2 card0-DP-4 card0-DP-5 card0-DP-6 card0-eDP-1 card1-DP-3 card1-HDMI-A-1 – bain Feb 28 '23 at 16:09
  • For hotplug, DP-1-[123] correspond to card0-DP[456]. All have valid EDID. card0-DP4 and 5 are "connected" and functional but card1-DP-6 is "disconnected" (despite correct EDID) and available CRTCs (from xrandr -q --verbose) match the discrete nVidia GPU not the integrated Intel. I wonder if it requires some extra "switcheroo" type configuration to connect that port to the Intel GPU. – bain Feb 28 '23 at 16:09
  • HDMI-1-1 is physical HDMI port connected to card1-HDMI-A-1. – bain Feb 28 '23 at 16:09
  • On dock disconnected boot, DP-1-3 is the physical miniDP port connected to card1-DP-3. On coldplug boot, DP-1-6 is the physical miniDP port connected to card1-DP-6. DP-1-3 is card0-DP-3. (There's only one physical miniDP port) – bain Feb 28 '23 at 16:09
  • DP-1 and DP-2 don't appear to be connected to anything on the laptop. Trying to set a mode results in "xrandr: cannot find output 0x9f". – bain Feb 28 '23 at 16:09
  • I tried just restarting xorg after hotplug, but it didn't change anything. So, it looks like, if the dock isn't coldplugged, either the BIOS or kernel configure a port from the (card1) nVidia GPU to the monitor on the dock. /sys/class/drm/card1-DP-6/edid is present and valid, so there is some kind of connection, but it should be the (card0) Intel GPU that gets connected to the external monitor. – bain Feb 28 '23 at 16:27
  • and functional but card1-DP-6 is "disconnected" - I made a typo here, it's card0 not card1. Sometimes it shows up as card0-DP-[567] instead of [456]. cat card0-DP-[567]/status shows "connected" three times, but xrandr shows DP-1-3 "disconnected" and with the nVidia CRTCs. So it's possible that the kernel side is working here, and for some reason the third Intel port just isn't showing up in xorg because DP-1-3 maps to the nVidia card1-DP-3 which is the physical miniDP port. – bain Feb 28 '23 at 16:57
  • I think you are correct that there is a name collision in Xorg for DP-1-3. When hotplugged, log shows (II) modeset(G0): Output DP-1-3 has no monitor section modeset(0): Output DP-1-3 connected and shows the edid, then later modeset(G0): Output DP-1-3 has no monitor section. G0 being the nVidia card. When hotplugged, DP-1-3 in xrandr is the nVidia miniDP port, when coldplugged this appears on DP-1-6. If I blacklist the nouveau kernel module, then xrandr shows DP-1-3 correctly with Intel CRTCs, but the desktop doesn't start for some reason. – bain Feb 28 '23 at 19:43
  • @bain What model/brand monitor do you have? (Curiosity at this point.)—I’m convinced now that I was right with my suspicion: the name mapping/enumeration code has bugs. Especially as DP-1 is another GPU than DP-1-6 (or DP-1-3 in some cases), so the relationship by name does not make any sense. Further: one port is missing in xrandr after hotplug, while it is not on the kernel side. The blacklisting idea sounds like a decent workaround: if you do not need that card1, avoiding the kernel to pick it up at all should work. Otherwise: a bug report might help (mine often do not... :-o ) – Robert Siemer Mar 01 '23 at 00:43
  • @bain Another thing: could you ramp up one monitor towards h160 1-by-1? And then the 2nd, then the 3rd? Don’t stop on the first error: continue with the 2nd/3rd monitor. I’m curious which is the last configuration that is not rejected (always with xrandr: Configure crtc X failed, I guess).—And if you haven’t reached an “all different” config yet with this method, could you test different (lower) resolutions on each monitor (with different pixel clocks)? I believe that on DP with MST only one clock is used (and another for the internal laptop display) and no limit will be reached here. Works? – Robert Siemer Mar 01 '23 at 00:54
  • I will, but it'll be a week until I have the laptop again. – bain Apr 06 '23 at 13:17
  • The monitors are Dell 2209WA. The last configuration that is not rejected is (h160,h80,h40). (h160,h80,h50) fails. Sorry for the late reply. – bain Apr 26 '23 at 11:18
  • 1
    @bain Interesting: The last mode combo you got through has a bandwidth of 8,268 Mb/s and the one which didn’t has 8,283 Mb/s. Both are shy of 96% of the usable bandwidth of your configuration (supposedly 8,640 Mb/s). The MST signaling or something seem to eat up another 4% or a static ~370Mb/s. Nice to know. – Robert Siemer Apr 26 '23 at 11:52