freebsd / drm-kmod

drm driver for FreeBSD
148 stars 68 forks source link

Disconnecting/reconnecting a screen restores X in text mode #262

Open khorben opened 8 months ago

khorben commented 8 months ago

Describe the bug

On a triple-head setup with a dual-screen KVM, with an AMD RX 570 graphics card.

After switching once to a text-based console (e.g., vt01) and back to X in graphics mode (e.g., on vt09), power-cycling the KVM results in an empty text-mode display (black screen, white cursor on top left) even though X is still active and processing keyboard input.

Switching again to a text-based console and back to X restores the graphics mode as expected.

FreeBSD version

Output of uname -aKU:

FreeBSD kwarx.office.defora 14.0-STABLE FreeBSD 14.0-STABLE #0 stable/14-n265273-803f088147d3: Fri Sep 29 17:41:17 CEST 2023     khorben@kwarx.office.defora:/usr/obj/home/khorben/Projects/FreeBSD/src-14/amd64.amd64/sys/GENERIC amd64 140500 1400500

PCI Info

Output of pciconf -lv:

hostb0@pci0:0:0:0:      class=0x060000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x29e0 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82X38/X48 Express DRAM Controller'
    class      = bridge 
    subclass   = HOST-PCI
pcib1@pci0:0:1:0:       class=0x060400 rev=0x01 hdr=0x01 vendor=0x8086 device=0x29e1 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82X38/X48 Express Host-Primary PCI Express Bridge'
    class      = bridge 
    subclass   = PCI-PCI
none0@pci0:0:3:0:       class=0x078000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x29e4 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82X38/X48 Express MEI Controller'
    class      = simple comms
pcib2@pci0:0:6:0:       class=0x060400 rev=0x01 hdr=0x01 vendor=0x8086 device=0x29e9 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82X38/X48 Express Host-Secondary PCI Express Bridge'
    class      = bridge 
    subclass   = PCI-PCI
em0@pci0:0:25:0:        class=0x020000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x10bd subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82566DM-2 Gigabit Network Connection'
    class      = network
    subclass   = ethernet
uhci0@pci0:0:26:0:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2937 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
uhci1@pci0:0:26:1:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2938 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
uhci2@pci0:0:26:2:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2939 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
ehci0@pci0:0:26:7:      class=0x0c0320 rev=0x02 hdr=0x00 vendor=0x8086 device=0x293c subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB2 EHCI Controller'
    class      = serial bus
    subclass   = USB
hdac1@pci0:0:27:0:      class=0x040300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x293e subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) HD Audio Controller'
    class      = multimedia
    subclass   = HDA
pcib3@pci0:0:28:0:      class=0x060400 rev=0x02 hdr=0x01 vendor=0x8086 device=0x2940 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) PCI Express Port 1'
    class      = bridge
    subclass   = PCI-PCI
uhci3@pci0:0:29:0:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2934 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
uhci4@pci0:0:29:1:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2935 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
uhci5@pci0:0:29:2:      class=0x0c0300 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2936 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB UHCI Controller'
    class      = serial bus
    subclass   = USB
ehci1@pci0:0:29:7:      class=0x0c0320 rev=0x02 hdr=0x00 vendor=0x8086 device=0x293a subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) USB2 EHCI Controller'
    class      = serial bus
    subclass   = USB
pcib7@pci0:0:30:0:      class=0x060401 rev=0x92 hdr=0x01 vendor=0x8086 device=0x244e subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801 PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:      class=0x060100 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2916 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801IR (ICH9R) LPC Interface Controller'
    class      = bridge
    subclass   = PCI-ISA
ahci0@pci0:0:31:2:      class=0x010601 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2922 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]'
    class      = mass storage
    subclass   = SATA
ichsmb0@pci0:0:31:3:    class=0x0c0500 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2930 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) SMBus Controller'
    class      = serial bus
    subclass   = SMBus
none1@pci0:0:31:6:      class=0x118000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2932 subvendor=0x108e subdevice=0x5351
    vendor     = 'Intel Corporation'
    device     = '82801I (ICH9 Family) Thermal Subsystem'
    class      = dasp
vgapci0@pci0:1:0:0:     class=0x030000 rev=0xef hdr=0x00 vendor=0x1002 device=0x67df subvendor=0x1da2 subdevice=0xe343
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]'
    class      = display
    subclass   = VGA
hdac0@pci0:1:0:1:       class=0x040300 rev=0x00 hdr=0x00 vendor=0x1002 device=0xaaf0 subvendor=0x1da2 subdevice=0xaaf0
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]'
    class      = multimedia
    subclass   = HDA
pcib4@pci0:3:0:0:       class=0x060400 rev=0x04 hdr=0x01 vendor=0x111d device=0x8018 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Microsemi / PMC / IDT'
    device     = 'PES12N3A 12-lane 3-Port PCI Express Switch'
    class      = bridge
    subclass   = PCI-PCI
pcib5@pci0:4:0:0:       class=0x060400 rev=0x04 hdr=0x01 vendor=0x111d device=0x8018 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Microsemi / PMC / IDT'
    device     = 'PES12N3A 12-lane 3-Port PCI Express Switch'
    class      = bridge
    subclass   = PCI-PCI
pcib6@pci0:4:1:0:       class=0x060400 rev=0x04 hdr=0x01 vendor=0x111d device=0x8018 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Microsemi / PMC / IDT'
    device     = 'PES12N3A 12-lane 3-Port PCI Express Switch'
    class      = bridge
    subclass   = PCI-PCI
em1@pci0:5:0:0: class=0x020000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x10bc subvendor=0x8086 subdevice=0x11bc
    vendor     = 'Intel Corporation'
    device     = '82571EB/82571GB Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
em2@pci0:5:0:1: class=0x020000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x10bc subvendor=0x8086 subdevice=0x11bc
    vendor     = 'Intel Corporation'
    device     = '82571EB/82571GB Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
em3@pci0:6:0:0: class=0x020000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x10bc subvendor=0x8086 subdevice=0x11bc
    vendor     = 'Intel Corporation'
    device     = '82571EB/82571GB Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
em4@pci0:6:0:1: class=0x020000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x10bc subvendor=0x8086 subdevice=0x11bc
    vendor     = 'Intel Corporation'
    device     = '82571EB/82571GB Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
none2@pci0:7:4:0:       class=0x0c0010 rev=0x00 hdr=0x00 vendor=0x104c device=0x8023 subvendor=0x108e subdevice=0x5351
    vendor     = 'Texas Instruments'
    device     = 'TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]'
    class      = serial bus
    subclass   = FireWire

DRM KMOD version

Output of pkg query -x '%n %v' 'drm.*kmod':

drm-510-kmod 5.10.163_7

To Reproduce

Steps to reproduce the behavior:

Additional context

The behaviour is normal if I do not use a text-based console after starting X. X is started by slim at boot on this system. (Sun Ultra 24, Intel Core 2 Quad)

The issue also happens if I simply disconnect/reconnect one display cable.

khorben commented 7 months ago

Another interesting twist: I usually run xscreensaver to lock the screen before switching the KVM off, and when switching it back on and moving the mouse, the cursor is displayed correctly on top of the empty text console.