NVIDIA PRIME BadValue (integer parameter out of range for operation)

This is a Schenker Compact 15 (2019 model) with an RTX 2070 and a 4K OLED screen (based on a Clevo barebone PB51RF).

The system is running FreeBSD 13.2-STABLE (stable/13-n255602-e6c1e181ba7f) running:

Xorg server 21.1.8
NVIDIA driver 525.116.03

The OLED is connected to the internal intel GPU (according to the vendor, because the NVIDIA GPU cannot drive the OLED screen brightness PWM, which sounds like a bullshit reason to me), which is using the modesetting driver.

I want to use the NVIDIA GPU as the primary driver and output to the internal screen via PRIME unfortunately an xrandr --setprovideroutputsource command involving the NVIDIA GPU fails:

kamikaze# xrandr
Screen 0: minimum 8 x 8, current 8 x 8, maximum 32767 x 32767
DP-0 disconnected primary (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
DP-6 disconnected (normal left inverted right x axis y axis)
kamikaze# xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b7 cap: 0x0 crtcs: 4 outputs: 8 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x1e6 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting
kamikaze# xrandr --setprovideroutputsource modesetting NVIDIA-0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x1b7
  Serial number of failed request:  16
  Current serial number in output stream:  17
kamikaze# xrandr --setprovideroutputsource 1 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x1b7
  Serial number of failed request:  16
  Current serial number in output stream:  17
kamikaze# xrandr --setprovideroutputsource 0 1
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x1b7
  Serial number of failed request:  16
  Current serial number in output stream:  17
kamikaze# xrandr --setprovideroutputsource modesetting
kamikaze# xrandr
Screen 0: minimum 8 x 8, current 8 x 8, maximum 32767 x 32767
DP-0 disconnected primary (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
DP-6 disconnected (normal left inverted right x axis y axis)
kamikaze# xrandr --setprovideroutputsource NVIDIA-0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x1b7
  Serial number of failed request:  16
  Current serial number in output stream:  17
kamikaze#

nvidia-bug-report.log.gz (49.6 KB)

I retried with nvidia-driver-535.54.03, got exactly the same behaviour.

I repeated the exercise with nvidia-driver-535.86.05 on FreeBSD 13.2-STABLE stable/13-n255881-8557b8ba15b9, same results.

The NVIDIA driver does not advertise the Source/Sink Output capabilities, I assume this is the problem?