With latest kernel, primary monitor auto resets to DPMI0. Should be DP0

System is Fedora 42 Workstation , Xorg, with Cinnamon desktop. Asrock B550m Pro4 board with Ryzen 5 5600GT. 3 monitors: Primary display DP0, 2nd monitor HDMI0, TV DP1 (VGA). TV is usually unplugged from mains. HDMI0 is connected to mains but I seldom use it.

$ inxi -Fzxx 
System:
  Kernel: 6.18.13-100.fc42.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 15.2.1
  Desktop: Cinnamon v: 6.4.9 tk: GTK v: 3.24.49 wm: Muffin dm: 1: GDM
    2: LightDM note: stopped Distro: Fedora Linux 42 (Workstation Edition)
Machine:
  Type: Desktop Mobo: ASRock model: B550M Pro4 serial: <superuser required>
    Firmware: BIOS vendor: American Megatrends LLC. v: P3.40 date: 01/18/2024
Battery:
  Device-1: hidpp_battery_0 model: Logitech G305 Lightspeed Wireless Gaming
    Mouse serial: <filter> charge: 100% (should be ignored)
    status: discharging
CPU:
  Info: 6-core model: AMD Ryzen 5 5600GT with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3 rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 16 MiB
  Speed (MHz): avg: 4641 min/max: 422/4669 boost: enabled cores: 1: 4641
    2: 4641 3: 4641 4: 4641 5: 4641 6: 4641 7: 4641 8: 4641 9: 4641 10: 4641
    11: 4641 12: 4641 bogomips: 86241
  Flags-basic: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a
    ssse3 svm
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Cezanne [Radeon Vega Series /
    Radeon Mobile Series] driver: amdgpu v: kernel arch: GCN-5 pcie:
    speed: 8 GT/s lanes: 16 ports: active: DP-1 off: DP-2,HDMI-A-1 empty: none
    bus-ID: 05:00.0 chip-ID: 1002:1638 temp: 38.0 C
  Display: x11 server: X.Org v: 21.1.21 with: Xwayland v: 24.1.9 driver: X:
    loaded: amdgpu unloaded: modesetting,radeon alternate: fbdev,vesa
    dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96
  Monitor-1: DP-1 mapped: DisplayPort-0 pos: primary model: Philips 273PQPY
    res: 1920x1080 hz: 60 dpi: 82 diag: 685mm (27")
  Monitor-2: DP-2 mapped: DisplayPort-1 note: disabled model: DP2VGA V235
    res: 1920x1080 dpi: 43 diag: 690mm (27.2")
  Monitor-3: HDMI-A-1 mapped: HDMI-A-0 note: disabled
    model: Lenovo LEN T24i-20 res: 1920x1080 dpi: 93 diag: 604mm (23.8")
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
    gbm: drv: kms_swrast surfaceless: drv: radeonsi x11: drv: radeonsi
    inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.1.9 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon Graphics (radeonsi renoir ACO DRM
    3.64 6.18.13-100.fc42.x86_64) device-ID: 1002:1638
  API: Vulkan v: 1.4.313 surfaces: N/A device: 0 type: integrated-gpu
    driver: mesa radv device-ID: 1002:1638 device: 1 type: cpu
    driver: mesa llvmpipe device-ID: 10005:0000
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo x11: xdriinfo, xdpyinfo,
    xprop, xrandr
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir/Cezanne HDMI/DP Audio
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 05:00.1 chip-ID: 1002:1637
  Device-2: Advanced Micro Devices [AMD] Ryzen HD Audio vendor: ASRock
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 05:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.18.13-100.fc42.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.4.10 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASRock driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: f000 bus-ID: 03:00.0 chip-ID: 10ec:8168
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: wg0 state: unknown speed: N/A duplex: N/A mac: N/A
Drives:
  Local Storage: total: 2.73 TiB used: 1.64 TiB (59.9%)
  ID-1: /dev/nvme0n1 vendor: Crucial model: CT500P310SSD8 size: 465.76 GiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 33.9 C
  ID-2: /dev/sda vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB
    speed: 6.0 Gb/s serial: <filter>
  ID-3: /dev/sdb vendor: Crucial model: CT2000MX500SSD1 size: 1.82 TiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 455.4 GiB used: 221.56 GiB (48.7%) fs: ext4 dev: /dev/dm-0
    mapped: luks-0140d69f-4781-4439-9339-94a101794e2e
  ID-2: /boot size: 1.93 GiB used: 354.1 MiB (17.9%) fs: ext4
    dev: /dev/nvme0n1p2
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 47.6 C mobo: N/A gpu: amdgpu temp: 39.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 32 GiB note: est. available: 30.71 GiB used: 8.5 GiB (27.7%)
  Processes: 476 Power: uptime: 29m wakeups: 0 Init: systemd v: 257
    target: graphical (5) default: graphical
  Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 66
    Compilers: N/A Shell: Bash v: 5.2.37 running-in: gnome-terminal inxi: 3.3.40

With kernel 6.18.13, I can set the primary monitor to DP0 and it stays there:

$ cat bin/pc.sh#!/bin/bash#pcxrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal --output DisplayPort-1 --off --output HDMI-A-0 --off;

With kernel 6.18.16 or any of the 6.12.* serie, whenever I set the primary display to DP0 like above, it auto resets to DPMI0. In loop. No idea what to look for. Autorandr has been uninstalled.

Kernel 6.18.13:

$ journalctl -b --no-hostname | grep -iE 'amdgpu.*(hotplug|connector|ddc|edid|dp|hdmi|randr|primary)'
mar 08 12:29:50 kernel: amdgpu 0000:05:00.0: amdgpu: [drm] DP-HDMI FRL PCON supported
mar 08 12:29:50 kernel: amdgpu 0000:05:00.0: amdgpu: [drm] Failed to setup vendor infoframe on connector HDMI-A-1: -22
mar 08 12:29:50 kernel: fbcon: amdgpudrmfb (fb0) is primary device
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Output HDMI-A-0 has no monitor section
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID for output HDMI-A-0
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID Version: 1.3
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): DPMS capabilities: Off
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Default color space is primary color space
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Number of EDID sections to follow: 1
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Printing probed modes for output HDMI-A-0
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID for output DisplayPort-0
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID Version: 1.4
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): DPMS capabilities: Off
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Number of EDID sections to follow: 1
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID for output DisplayPort-1
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID Version: 1.4
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): No DPMS capabilities specified; RGB/Color Display
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Monitor name: DP2VGA V235
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Output HDMI-A-0 connected
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Output HDMI-A-0 using initial mode 1920x1080 +0+0
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (==) AMDGPU(0): DPI set to (96, 96)
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (==) AMDGPU(0): DPMS enabled
mar 08 12:30:06 /usr/libexec/gdm-x-session[3277]: (WW) AMDGPU(0): Option "HotplugDriver" is not used
mar 08 12:30:07 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:30:07 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:30:20 /usr/libexec/gdm-x-session[3277]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:30:20 /usr/libexec/gdm-x-session[3277]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:30:20 /usr/libexec/gdm-x-session[3277]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:30:20 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:30:20 /usr/libexec/gdm-x-session[3277]: (II) AMDGPU(0): Printing DDC gathered Modelines:

Kernel 6.18.16:

$ journalctl -b -1 --no-hostname | grep -iE 'amdgpu.*(hotplug|connector|ddc|edid|dp|hdmi|randr|primary)'
mar 08 12:27:29 kernel: amdgpu 0000:05:00.0: amdgpu: [drm] DP-HDMI FRL PCON supported
mar 08 12:27:29 kernel: amdgpu 0000:05:00.0: amdgpu: [drm] Failed to setup vendor infoframe on connector HDMI-A-1: -22
mar 08 12:27:30 kernel: fbcon: amdgpudrmfb (fb0) is primary device
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Output HDMI-A-0 has no monitor section
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID for output HDMI-A-0
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID Version: 1.3
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): DPMS capabilities: Off
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Default color space is primary color space
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Number of EDID sections to follow: 1
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing probed modes for output HDMI-A-0
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID for output DisplayPort-0
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID Version: 1.4
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): DPMS capabilities: Off
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Number of EDID sections to follow: 1
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID for output DisplayPort-1
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID Version: 1.4
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): No DPMS capabilities specified; RGB/Color Display
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Monitor name: DP2VGA V235
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID (in hex):
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Output HDMI-A-0 connected
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Output HDMI-A-0 using initial mode 1920x1080 +0+0
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (==) AMDGPU(0): DPI set to (96, 96)
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (==) AMDGPU(0): DPMS enabled
mar 08 12:27:45 /usr/libexec/gdm-x-session[2972]: (WW) AMDGPU(0): Option "HotplugDriver" is not used
mar 08 12:27:46 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:27:46 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:27:59 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:27:59 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:27:59 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:27:59 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:27:59 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:09 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:10 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:10 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:22 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:22 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:22 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:22 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:22 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:32 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:33 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:33 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:37 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:37 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:37 /usr/libexec/gdm-x-session[2972]: (EE) AMDGPU(0): drmmode_do_crtc_dpms cannot get last vblank counter
mar 08 12:28:37 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:37 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "PHL", prod id 49302
mar 08 12:28:47 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:48 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:48 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:
mar 08 12:28:48 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): EDID vendor "ITE", prod id 25878
mar 08 12:28:48 /usr/libexec/gdm-x-session[2972]: (II) AMDGPU(0): Printing DDC gathered Modelines:

It has to be the kernel.

For the record, whenever I need dual display, I use that:

$ cat bin/bureau.sh 
#!/bin/bash
xrandr --newmode "1728x972_60.00" 139.25 1728 1840 2016 2304 972 975 980 1009 -hsync +vsync 2>/dev/null || true

xrandr --addmode HDMI-A-0 "1728x972_60.00" 2>/dev/null || true

xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal \
--output HDMI-A-0 --mode "1728x972_60.00" --pos 1920x+60 --rate 60.00 --rotate normal \
--output DisplayPort-1 --off

No .config/monitors.xml nor .config/cinnamon-monitors.xml on this machine. They have been removed. They were obsolete anyway (2023).

bump

This is extremely serious guys and I need some help.

Kernel 6.19.6 is out and has the same issue. I’m therefore stuck with kernel 6.18.13.

I tried turning the HDMI monitor off but although I can get the display to switch to the DP monitor with xrandr while the HDMI is turned off, there is no mouse on my display!

And above all this, when I turn the HDMI monitor back on, I can’t do useful dual monitor work because the HDMI is 24’“ whereas the DP is 27”. I need the primary display to be the DP and someting in this computer resets it to HDMI a few seconds after I set it up my way. It’s automatic. And a major nuisance. I want that disabled and the kernel 6.18.13 was able to do just that.

I don’t have any explanation for the monitor by comparing the Xorg.log, I have some for the mouse though:

$ diff -ubB Xorg.0.log.old Xorg.0.log

-(II) event7  - 2.4G Composite Devic System Control: is tagged by udev as: Keyboard
-(II) event7  - 2.4G Composite Devic System Control: device is a keyboard
-(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=3 (/dev/input/event10)
-(II) No input driver specified, ignoring this device.
-(II) This device may have been added with another device file.
-(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=7 (/dev/input/event11)
-(II) No input driver specified, ignoring this device.
-(II) This device may have been added with another device file.
-(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=8 (/dev/input/event12)
-(II) No input driver specified, ignoring this device.
-(II) This device may have been added with another device file.
-(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=9 (/dev/input/event13)
+(II) event8  - 2.4G Composite Devic System Control: is tagged by udev as: Keyboard
+(II) event8  - 2.4G Composite Devic System Control: device is a keyboard
+(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=3 (/dev/input/event9)
+(II) No input driver specified, ignoring this device.
+(II) This device may have been added with another device file.
+(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=7 (/dev/input/event10)
+(II) No input driver specified, ignoring this device.
+(II) This device may have been added with another device file.
+(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=8 (/dev/input/event14)
+(II) No input driver specified, ignoring this device.
+(II) This device may have been added with another device file.
+(II) config/udev: Adding input device HD-Audio Generic HDMI/DP,pcm=9 (/dev/input/event15)
+(II) No input driver specified, ignoring this device.
+(II) This device may have been added with another device file.
+(II) config/udev: Adding input device Logitech G305 (/dev/input/event19)
+(**) Logitech G305: Applying InputClass "evdev pointer catchall"
+(**) Logitech G305: Applying InputClass "evdev keyboard catchall"
+(**) Logitech G305: Applying InputClass "libinput pointer catchall"
+(**) Logitech G305: Applying InputClass "libinput keyboard catchall"
+(**) Logitech G305: Applying InputClass "system-keyboard"
+(II) Using input driver 'libinput' for 'Logitech G305'
+(II) systemd-logind: got fd for /dev/input/event19 13:83 fd 35 paused 0
+(**) Logitech G305: always reports core events
+(**) Option "Device" "/dev/input/event19"
+(II) event19 - Logitech G305: is tagged by udev as: Keyboard Mouse
+(II) event19 - Logitech G305: device is a pointer
+(II) event19 - Logitech G305: device is a keyboard
+(II) event19 - Logitech G305: device removed
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(II) libinput: Logitech G305: needs a virtual subdevice
+(**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb3/3-2/3-2.2/3-2.2.3/3-2.2.3:1.2/0003:046D:C53F.0006/0003:046D:4074.0007/input/input29/event19"
+(II) XINPUT: Adding extended input device "Logitech G305" (type: MOUSE, id 13)
+(**) Option "AccelerationScheme" "none"
+(**) Logitech G305: (accel) selected scheme none/0
+(**) Logitech G305: (accel) acceleration factor: 2.000
+(**) Logitech G305: (accel) acceleration threshold: 4
+(II) event19 - Logitech G305: is tagged by udev as: Keyboard Mouse
+(II) event19 - Logitech G305: device is a pointer
+(II) event19 - Logitech G305: device is a keyboard
+(II) config/udev: Adding input device Logitech G305 (/dev/input/mouse1)
+(**) Logitech G305: Applying InputClass "system-keyboard"

(...)

-(**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-7/1-7.4/1-7.4.1/1-7.4.1.1/1-7.4.1.1:1.1/0003:4037:2804.0003/input/input6/event6"
-(II) XINPUT: Adding extended input device "2.4G Composite Devic Consumer Control" (type: KEYBOARD, id 14)
+(**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-7/1-7.4/1-7.4.1/1-7.4.1.1/1-7.4.1.1:1.1/0003:4037:2804.0004/input/input7/event7"
+(II) XINPUT: Adding extended input device "2.4G Composite Devic Consumer Control" (type: KEYBOARD, id 15)
+(**) Option "xkb_layout" "us"
+(**) Logitech G305: Applying InputClass "evdev pointer catchall"
+(**) Logitech G305: Applying InputClass "evdev keyboard catchall"
+(**) Logitech G305: Applying InputClass "libinput pointer catchall"
+(**) Logitech G305: Applying InputClass "libinput keyboard catchall"
+(**) Logitech G305: Applying InputClass "system-keyboard"
+(II) Using input driver 'libinput' for 'Logitech G305'
+(II) systemd-logind: returning pre-existing fd for /dev/input/event19 13:83
+(**) Logitech G305: always reports core events
+(**) Option "Device" "/dev/input/event19"
+(II) libinput: Logitech G305: is a virtual subdevice
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(II) libinput: Logitech G305: Step value 0 was provided, libinput Fallback acceleration function is used.
+(**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.3/usb3/3-2/3-2.2/3-2.2.3/3-2.2.3:1.2/0003:046D:C53F.0006/0003:046D:4074.0007/input/input29/event19"
+(II) XINPUT: Adding extended input device "Logitech G305" (type: KEYBOARD, id 16)

bug reported

Workaround:

cat > /etc/X11/xorg.conf.d/10-primary-dp.conf << 'EOF'
Section "Device"
    Identifier "AMDGPU"
    Driver "amdgpu"
    Option "Monitor-DisplayPort-0" "PrimaryMonitor"
EndSection

Section "Monitor"
    Identifier "PrimaryMonitor"
    Option "Primary" "true"
EndSection
EOF

Given the lack of interest, I interrogated LLMs

Curiously, Grok and Perplexity failed miserably to solve the issue, giving instructions with obsolete commands. The chinese AI, Kimi, solved it quite remarquably I’d say, at first try.

Here we go.


$ nano ~/bin/fix-monitors.sh

$ cat ~/bin/fix-monitors.sh
#!/bin/bash
# Script de configuration d'écrans pour Cinnamon sur Fedora 42
# Force la persistance contre la restauration automatique du kernel/DRM

LOGFILE="$HOME/.local/share/monitor-fix.log"
mkdir -p "$(dirname "$LOGFILE")"
CONFIG_DIR="$HOME/.config"
CONFIG_FILE="$CONFIG_DIR/monitor-config.state"
mkdir -p "$CONFIG_DIR"

log() {
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOGFILE"
}

log "Démarrage fix-monitors (PID: $$)"

# Attendre que le serveur X soit prêt
for i in {1..30}; do
    if xrandr >/dev/null 2>&1; then
        break
    fi
    sleep 0.5
done

# Vérifier si on est dans une session graphique
if [ -z "$DISPLAY" ]; then
    export DISPLAY=:0
fi

# Désactiver le gestionnaire d'écran de Cinnamon
gsettings set org.cinnamon.settings-daemon.plugins.xrandr active false 2>/dev/null || true

# Créer le mode personnalisé pour HDMI-A-0 si nécessaire
if ! xrandr | grep -q '1728x972_60.00'; then
    xrandr --newmode "1728x972_60.00" 139.25 1728 1840 2016 2304 972 975 980 1009 -hsync +vsync 2>/dev/null || log "Mode existe déjà ou erreur"
fi

# Ajouter le mode à HDMI-A-0 si pas déjà présent
if xrandr | grep -q "HDMI-A-0"; then
    if ! xrandr | sed -n '/HDMI-A-0/,/^[^ ]/p' | grep -q '1728x972_60.00'; then
        xrandr --addmode HDMI-A-0 "1728x972_60.00" 2>/dev/null || log "Addmode échoué ou déjà présent"
        sleep 0.3
    fi
fi

# Fonction pour appliquer la configuration avec retry
apply_config() {
    local config_type="$1"
    local max_attempts=5
    local success=false
    
    for ((attempt=1; attempt<=max_attempts; attempt++)); do
        log "Tentative $attempt/$max_attempts pour config: $config_type"
        
        case "$config_type" in
            "solo")
                # Moniteur principal seul (DisplayPort-0)
                xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal \
                       --output DisplayPort-1 --off \
                       --output HDMI-A-0 --off 2>/dev/null
                ;;
            "dual")
                # Double écran: principal + HDMI-A-0
                xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 0x0 --rate 60.00 --rotate normal \
                       --output HDMI-A-0 --mode "1728x972_60.00" --pos 1920x60 --rate 60.00 --rotate normal \
                       --output DisplayPort-1 --off 2>/dev/null
                ;;
            "tv")
                # Télé SD (1366x768 ou fallback 1360x768) sur DisplayPort-1
                if xrandr | grep -q "1366x768"; then
                    xrandr --output DisplayPort-1 --primary --mode 1366x768 --pos 0x0 --rate 59.96 --rotate normal \
                           --output DisplayPort-0 --off \
                           --output HDMI-A-0 --off 2>/dev/null && success=true
                else
                    xrandr --output DisplayPort-1 --primary --mode 1360x768 --pos 0x0 --rate 59.96 --rotate normal \
                           --output DisplayPort-0 --off \
                           --output HDMI-A-0 --off 2>/dev/null && success=true
                fi
                ;;
            "tv-hd")
                # Télé HD (1920x1080) sur DisplayPort-1
                xrandr --output DisplayPort-1 --primary --mode 1920x1080 --pos 0x0 --rate 59.96 --rotate normal \
                       --output DisplayPort-0 --off \
                       --output HDMI-A-0 --off 2>/dev/null
                ;;
        esac
        
        # Vérifier si la config a été appliquée
        sleep 0.8
        case "$config_type" in
            "solo")
                xrandr | grep -q "DisplayPort-0 connected primary" && success=true
                ;;
            "dual")
                xrandr | grep -q "HDMI-A-0 connected.*1728x972" && success=true
                ;;
            "tv"|"tv-hd")
                xrandr | grep -q "DisplayPort-1 connected primary" && success=true
                ;;
        esac
        
        if [ "$success" = true ]; then
            log "Configuration $config_type appliquée avec succès"
            return 0
        fi
        
        sleep 0.5
    done
    
    log "ÉCHEC après $max_attempts tentatives pour $config_type"
    return 1
}

# Déterminer la configuration à appliquer
if [ -n "$1" ]; then
    CURRENT_CONFIG="$1"
    echo "$CURRENT_CONFIG" > "$CONFIG_FILE"
elif [ -f "$CONFIG_FILE" ]; then
    CURRENT_CONFIG=$(cat "$CONFIG_FILE")
else
    CURRENT_CONFIG="solo"
fi

# Validation du mode
if [[ ! "$CURRENT_CONFIG" =~ ^(solo|dual|tv|tv-hd)$ ]]; then
    log "Mode invalide: $CURRENT_CONFIG, fallback à solo"
    CURRENT_CONFIG="solo"
fi

log "Application de la configuration: $CURRENT_CONFIG"
apply_config "$CURRENT_CONFIG"

# Réactiver le gestionnaire Cinnamon mais bloquer ses changements automatiques
gsettings set org.cinnamon.settings-daemon.plugins.xrandr active false 2>/dev/null || true

log "Configuration terminée: $CURRENT_CONFIG"

$ nano ~/bin/set-monitors.sh

$ cat ~/bin/set-monitors.sh
#!/bin/bash
# Usage: set-monitors.sh [solo|dual|tv|tv-hd]

MODE="${1:-solo}"

if [[ ! "$MODE" =~ ^(solo|dual|tv|tv-hd)$ ]]; then
    echo "Usage: $0 [solo|dual|tv|tv-hd]"
    echo ""
    echo "Modes disponibles:"
    echo "  solo   - Moniteur principal (DisplayPort-0) seul, 1920x1080@60"
    echo "  dual   - Principal + HDMI-A-0 (1728x972@60 à droite)"
    echo "  tv     - Télé SD sur DisplayPort-1 (1366x768@59.96 ou 1360x768 fallback)"
    echo "  tv-hd  - Télé HD sur DisplayPort-1 (1920x1080@59.96)"
    exit 1
fi

echo "$MODE" > ~/.config/monitor-config.state
~/bin/fix-monitors.sh "$MODE"

if [ $? -eq 0 ]; then
    echo "✓ Configuration '$MODE' appliquée avec succès"
else
    echo "✗ Échec de l'application de '$MODE'"
    exit 1
fi


$ chmod +x ~/bin/set-monitors.sh ~/bin/fix-monitors.sh

$ mkdir -p ~/.config/systemd/user
$ nano ~/.config/systemd/user/monitor-guard.service
$ cat ~/.config/systemd/user/monitor-guard.service
[Unit]
Description=Monitor Configuration Guard
After=graphical-session.target
Wants=graphical-session.target

[Service]
Type=simple
ExecStart=/bin/bash -c 'while true; do ~/bin/fix-monitors.sh; sleep 3; done'
Restart=always
RestartSec=2

[Install]
WantedBy=default.target


$ systemctl --user daemon-reload
$ systemctl --user enable monitor-guard.service
$ systemctl --user start monitor-guard.service
$ echo "solo" > ~/.config/monitor-config.state
# Creation de raccouris


| Nom        | Commande                                | Raccourci suggéré |
| ---------- | --------------------------------------- | ----------------- |
| Écran Solo | `/home/$USER/bin/set-monitors.sh solo`  | Ctrl+Alt+1        |
| Écran Dual | `/home/$USER/bin/set-monitors.sh dual`  | Ctrl+Alt+2        |
| Télé SD    | `/home/$USER/bin/set-monitors.sh tv`    | Ctrl+Alt+3        |
| Télé HD    | `/home/$USER/bin/set-monitors.sh tv-hd` | Ctrl+Alt+4        |

Last, keep the `/etc/X11/xorg.conf.d/10-primary-dp.conf: it selects the primary monitor (DP0).