On a Quadro 600 (GF108), any failed DisplayPort link training during a
modeset crashes the kernel with a divide error in
nv50_disp_super_2_2_dp(), because the supervisor divides by the lane
count that training left at 0. Two ways to get there:
- Xorg (modesetting) builds 3840x2160@60 (533 MHz) from the EDID of a
4K monitor and sets it on the card's DP 1.1 output, which can carry at
most 4 x 2.7 Gbit/s even at 6 bpc;
- a connector forced on while the monitor sleeps or is unplugged, then
any mode set on it.
Patch 1 stops the crash. Patch 2 makes atomic check reject DP modes that
cannot fit the link, so userspace gets -EINVAL instead of a dark screen.
Tested on Ubuntu's 7.0 kernel with a libdrm reproducer (SETCRTC with a
user-defined mode) and with Xorg; the patches apply unchanged on
drm-misc-fixes.
Written with help from Claude (Anthropic); reviewed and tested on
hardware.
Frédéric Mahé (2):
drm/nouveau/disp/nv50-: don't divide by zero when the DP link is not
trained
drm/nouveau/dispnv50: reject DP modes that don't fit the link
drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 +++++++++++++++
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c | 10 ++++++++++
2 files changed, 25 insertions(+)
--
2.53.0