nvidia: monitor mode validation regression between 580.95.05 and 580.105.08

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 12 Nov 2025 13:54:06 UTC
Yesterday I upgraded nvidia packages from 580.95.05 to 580.105.08 and that broke 
one of monitors in my dual monitor setup.
I could spot the source of the issue in Xorg.log file and fix / work around it.

For "reasons", the affected monitor had a specific mode configured in Xorg 
configuration, 1920x1080_75.  It worked without any issues for years, up until 
the latest upgrade.

Previously, the nvidia driver (userland, I presume) was completely happy to use 
that mode:
(II) NVIDIA(GPU-0):   Validating Mode "1920x1080_75":
(II) NVIDIA(GPU-0):     Mode Source: EDID
(II) NVIDIA(GPU-0):     1920 x 1080 @ 75 Hz
(II) NVIDIA(GPU-0):       Pixel Clock      : 174.50 MHz
(II) NVIDIA(GPU-0):       HRes, HSyncStart : 1920, 1968
(II) NVIDIA(GPU-0):       HSyncEnd, HTotal : 2000, 2080
(II) NVIDIA(GPU-0):       VRes, VSyncStart : 1080, 1083
(II) NVIDIA(GPU-0):       VSyncEnd, VTotal : 1088, 1119
(II) NVIDIA(GPU-0):       Sync Polarity    : +H -V
(II) NVIDIA(GPU-0):     DSCPassThrough: No
(II) NVIDIA(GPU-0):     DualHead Mode: No
(II) NVIDIA(GPU-0):     Viewport                 1920x1080+0+0
(II) NVIDIA(GPU-0):       Horizontal Taps        2
(II) NVIDIA(GPU-0):       Vertical Taps          2
(II) NVIDIA(GPU-0):     Mode "1920x1080_75" is valid.

However, after the upgrade the mode is no longer considered valid:
(WW) NVIDIA(GPU-0):   Validating Mode "1920x1080_75":
(WW) NVIDIA(GPU-0):     Mode Source: EDID
(WW) NVIDIA(GPU-0):     1920 x 1080 @ 75 Hz
(WW) NVIDIA(GPU-0):       Pixel Clock      : 174.50 MHz
(WW) NVIDIA(GPU-0):       HRes, HSyncStart : 1920, 1968
(WW) NVIDIA(GPU-0):       HSyncEnd, HTotal : 2000, 2080
(WW) NVIDIA(GPU-0):       VRes, VSyncStart : 1080, 1083
(WW) NVIDIA(GPU-0):       VSyncEnd, VTotal : 1088, 1119
(WW) NVIDIA(GPU-0):       Sync Polarity    : +H -V
(WW) NVIDIA(GPU-0):     Mode is rejected: PixelClock (174.5 MHz) too high for
(WW) NVIDIA(GPU-0):     Display Device (Max: 165.0 MHz).
(WW) NVIDIA(GPU-0):     GPU extended capability check failed.
(WW) NVIDIA(GPU-0):     Mode "1920x1080_75" is invalid.

So, I had to downgrade the mode to 1920x1080_60 to get X back.

The monitor is connected via an HDMI port:
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 476mm 
x 268mm
    1920x1080     60.00*+  59.94    50.00

The monitor's documentation says only that 55 - 75 Hz vertical frequencies are 
supported, but has no mention of the pixel clock.

The card, GTX 1660, supports HDMI 2.0.
The monitor claims to support HDMI 1.4.
Both standards should support 340 MHz or greater.

So, I think that there is a bug in the mode validation code.

I can provide any additional diagnostic info.

-- 
Andriy Gapon