Bug 478670

Summary: black screen when starting plasma after logging in to sddm on Lenovo P14sGen4/amd
Product: [Plasma] kwin Reporter: slartibart70
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.27.10   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
URL: https://gitlab.freedesktop.org/drm/amd/-/issues/2935
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description slartibart70 2023-12-17 23:32:19 UTC
I recently bought a new lenovo laptop P14s/gen4 amd 7840u with integrated radeon graphics and OLED (2880x1800) screen

Using fedora39 (latest updates, kernel 6.6.6 and 6.6.7) i encounter a black screen when booting and when trying to start the kde-session after sddm-login
Let me give some details:

The problem seems to be the oled-laptop screen, which (maybe) provides improper edid data for the boot process.
Using 
ls /sys/class/drm/card*
i found the name of my screen (card1-eDP-1) and using this
cat /sys/class/drm/card1-eDP-1/edid | edid-decode 
i found those timing settings:
 Detailed Timing Descriptors:
    DTD 1:  2880x1800   90.001438 Hz  16:10   169.203 kHz    500.840000 MHz (302 mm x 189 mm)
                 Hfront    8 Hsync  32 Hback   40 Hpol P
                 Vfront    8 Vsync   8 Vback   64 Vpol N
    DTD 2:  2880x1800   60.000958 Hz  16:10   169.203 kHz    500.840000 MHz (302 mm x 189 mm)
                 Hfront    8 Hsync  32 Hback   40 Hpol P
                 Vfront    8 Vsync   8 Vback 1004 Vpol N

For the bootup procedure (and for seeing any kind of display output at all) i 'fixed' grub with this
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_GFXMODE="2880x1800@60"
GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-5b8a9e98-d8a7-4d51-b04c-88113d062065 rd.lvm.lv=vg0/root video=card1-eDP-1:2880x1800@60  rhgb vconsole.font=ter-128b"

This gives me the graphical grub menu and (note the missing 'quiet' in the commandline) some output in text form when booting - including the graphical screen asking for the luks-encryption password.
(This, btw, if you remove 'rhgb' as well, is never shown on the laptop screen in text format - you can enter the necessary password on a black screen without any feedback and it continues booting. So, the rhgb is an improvement here)

The sddm login screen also appears, i can use the options (reboot, more, etc) and can successfully log-in.
BUT ... Then plasma only shows a black screen again.

What also works is entering a vconsole (ctrl-alt F3) as long as you did not(!) logon to sddm.
After logging in, vconsole as well as plasma stays black with no way to recover any output on the display.

I can, however, add 'nomodeset' to the grub-commandline.
Then, plasma starts successfully, i can switch to vconsoles back and forth.
BUT (yes, another but)... this is very bad, as i cannot change any display resolution or screen brightness with plasma.

Interestingly, a fedora-39 live usb boot seems to work pretty nice, plasma comes up after sddm, i can change the default 200% zoom to any other level or change the screen resolution and refresh rates using systemsettings

Questions:
How can i use plasma without 'nomodeset'?
What does the live-usb iso of fedora make so much better than the fresh fedora39 installation it did by itself on this machine???
What do i need to change to use my new laptop???

Any help is appreciated,
if there is any additional information i can provide please ask...

----
currently i am using a fresh net-install with
Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.6.6-200.fc39.x86_64 (64-bit)

but i also tried updating to kernel 6.6.7 and kde 5.27.10, adding rpmfusion repos, added zawertun-kde repo for other updates, but this did not help at all for this problem.
Comment 1 Zamundaaa 2023-12-17 23:53:54 UTC
This sounds like you've maybe switched to Xorg on your setup? The live iso is using Wayland, and so is SDDM
Comment 2 slartibart70 2023-12-18 01:12:52 UTC
update:
no, definitevly wayland. I tried x11 as well, but no difference (black screen for plasma remains the same)

Another thing:
I am currently using a hdmi or dp(usb-c) cable with an external 4K monitor.
This gives me at least the plasma desktop.

Interestingly, having both (laptop and 4k display) active, the laptop display sometimes 'awakes' and shows also in systemsettings.
But, any change to the resolution or refresh-rate (90/60hz) on the laptop-display kills it instantly (going black with no return, not even logoff/logon)
Comment 3 slartibart70 2023-12-18 01:20:30 UTC
updated the system again, no change in behaviour

Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.11
Kernel Version: 6.6.7-200.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 58,6 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
System Version: ThinkPad P14s Gen 4
Comment 4 slartibart70 2023-12-18 01:25:54 UTC
another interesting finding:

The laptop screen wakes up, if i use a ssh-remote session to the machine (4k display attached, both 4k and laptop active in systemsettings) and ... do a 'sudo poweroff' ?!?

This is definitely very strange...
Comment 5 slartibart70 2023-12-18 22:21:59 UTC
another finding:

the sudo via ssh was not reliable, i found a better solution to wake up the screen: suspend!
The thing is, suspend does not work on this machine (yet), so it immediately recovers which brings the display back to life.

Still not satisfying to say the least...

dmesg-log after pressing suspend:
[ 1150.240394] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1150.250863] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1150.251177] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.048704] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.050213] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.050476] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.229903] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.240783] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.240925] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1167.379141] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1167.446104] wlp2s0: deauthenticating from 3c:7c:3f:31:3a:fc by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1167.874353] PM: suspend entry (s2idle)
[ 1167.887141] Filesystems sync: 0.012 seconds
[ 1167.970992] Freezing user space processes
[ 1167.972716] Freezing user space processes completed (elapsed 0.001 seconds)
[ 1167.972720] OOM killer disabled.
[ 1167.972720] Freezing remaining freezable tasks
[ 1167.974042] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 1167.974045] printk: Suspending console(s) (use no_console_suspend to debug)
[ 1168.691592] PM: suspend devices took 0.717 seconds
[ 1168.694695] ACPI: EC: interrupt blocked
[ 1169.397336] ACPI: EC: interrupt unblocked
[ 1169.595645] nvme nvme0: 16/0/0 default/read/poll queues
[ 1169.704792] [drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=14
[ 1169.705073] [drm:amdgpu_mes_reg_write_reg_wait [amdgpu]] *ERROR* failed to reg_write_reg_wait
[ 1169.707422] [drm] PCIE GART of 512M enabled (table at 0x00000080FFD00000).
[ 1169.707517] amdgpu 0000:64:00.0: amdgpu: SMU is resuming...
[ 1169.712404] amdgpu 0000:64:00.0: amdgpu: SMU is resumed successfully!
[ 1170.347817] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 1170.347923] amdgpu 0000:64:00.0: [drm:jpeg_v4_0_hw_init [amdgpu]] JPEG decode initialized successfully.
[ 1170.348267] amdgpu 0000:64:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 1170.348270] amdgpu 0000:64:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 1170.348271] amdgpu 0000:64:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 1170.348273] amdgpu 0000:64:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[ 1170.348274] amdgpu 0000:64:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[ 1170.348275] amdgpu 0000:64:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[ 1170.348276] amdgpu 0000:64:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[ 1170.348277] amdgpu 0000:64:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[ 1170.348278] amdgpu 0000:64:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[ 1170.348279] amdgpu 0000:64:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[ 1170.348281] amdgpu 0000:64:00.0: amdgpu: ring vcn_unified_0 uses VM inv eng 0 on hub 8
[ 1170.348282] amdgpu 0000:64:00.0: amdgpu: ring jpeg_dec uses VM inv eng 1 on hub 8
[ 1170.348283] amdgpu 0000:64:00.0: amdgpu: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
[ 1170.354592] [drm] ring gfx_32772.1.1 was added
[ 1170.355156] [drm] ring compute_32772.2.2 was added
[ 1170.355786] [drm] ring sdma_32772.3.3 was added
[ 1170.355871] [drm] ring gfx_32772.1.1 ib test pass
[ 1170.355909] [drm] ring compute_32772.2.2 ib test pass
[ 1170.355987] [drm] ring sdma_32772.3.3 ib test pass
[ 1170.363317] PM: resume devices took 0.791 seconds
[ 1170.363565] OOM killer enabled.
[ 1170.363566] Restarting tasks ... done.
[ 1170.365284] random: crng reseeded on system resumption
[ 1170.389517] PM: suspend exit
[ 1170.431811] Generic FE-GE Realtek PHY r8169-0-100:00: attached PHY driver (mii_bus:phy_addr=r8169-0-100:00, irq=MAC)
[ 1170.562235] r8169 0000:01:00.0 enp1s0f0: Link is Down
[ 1173.557307] wlp2s0: authenticate with 3c:7c:3f:31:3a:fc
[ 1173.619617] wlp2s0: send auth to 3c:7c:3f:31:3a:fc (try 1/3)
[ 1173.622625] wlp2s0: authenticated
[ 1173.623750] wlp2s0: associate with 3c:7c:3f:31:3a:fc (try 1/3)
[ 1173.625877] wlp2s0: RX AssocResp from 3c:7c:3f:31:3a:fc (capab=0x1011 status=0 aid=2)
[ 1173.643455] wlp2s0: associated
[ 1173.644106] wlp2s0: Limiting TX power to 23 (23 - 0) dBm as advertised by 3c:7c:3f:31:3a:fc
Comment 6 slartibart70 2023-12-18 22:22:14 UTC
another finding:

the sudo via ssh was not reliable, i found a better solution to wake up the screen: suspend!
The thing is, suspend does not work on this machine (yet), so it immediately recovers which brings the display back to life.

Still not satisfying to say the least...

dmesg-log after pressing suspend:
[ 1150.240394] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1150.250863] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1150.251177] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.048704] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.050213] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.050476] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.229903] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.240783] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1157.240925] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1167.379141] Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
[ 1167.446104] wlp2s0: deauthenticating from 3c:7c:3f:31:3a:fc by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1167.874353] PM: suspend entry (s2idle)
[ 1167.887141] Filesystems sync: 0.012 seconds
[ 1167.970992] Freezing user space processes
[ 1167.972716] Freezing user space processes completed (elapsed 0.001 seconds)
[ 1167.972720] OOM killer disabled.
[ 1167.972720] Freezing remaining freezable tasks
[ 1167.974042] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 1167.974045] printk: Suspending console(s) (use no_console_suspend to debug)
[ 1168.691592] PM: suspend devices took 0.717 seconds
[ 1168.694695] ACPI: EC: interrupt blocked
[ 1169.397336] ACPI: EC: interrupt unblocked
[ 1169.595645] nvme nvme0: 16/0/0 default/read/poll queues
[ 1169.704792] [drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=14
[ 1169.705073] [drm:amdgpu_mes_reg_write_reg_wait [amdgpu]] *ERROR* failed to reg_write_reg_wait
[ 1169.707422] [drm] PCIE GART of 512M enabled (table at 0x00000080FFD00000).
[ 1169.707517] amdgpu 0000:64:00.0: amdgpu: SMU is resuming...
[ 1169.712404] amdgpu 0000:64:00.0: amdgpu: SMU is resumed successfully!
[ 1170.347817] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 1170.347923] amdgpu 0000:64:00.0: [drm:jpeg_v4_0_hw_init [amdgpu]] JPEG decode initialized successfully.
[ 1170.348267] amdgpu 0000:64:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 1170.348270] amdgpu 0000:64:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[ 1170.348271] amdgpu 0000:64:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[ 1170.348273] amdgpu 0000:64:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[ 1170.348274] amdgpu 0000:64:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[ 1170.348275] amdgpu 0000:64:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[ 1170.348276] amdgpu 0000:64:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[ 1170.348277] amdgpu 0000:64:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[ 1170.348278] amdgpu 0000:64:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[ 1170.348279] amdgpu 0000:64:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[ 1170.348281] amdgpu 0000:64:00.0: amdgpu: ring vcn_unified_0 uses VM inv eng 0 on hub 8
[ 1170.348282] amdgpu 0000:64:00.0: amdgpu: ring jpeg_dec uses VM inv eng 1 on hub 8
[ 1170.348283] amdgpu 0000:64:00.0: amdgpu: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
[ 1170.354592] [drm] ring gfx_32772.1.1 was added
[ 1170.355156] [drm] ring compute_32772.2.2 was added
[ 1170.355786] [drm] ring sdma_32772.3.3 was added
[ 1170.355871] [drm] ring gfx_32772.1.1 ib test pass
[ 1170.355909] [drm] ring compute_32772.2.2 ib test pass
[ 1170.355987] [drm] ring sdma_32772.3.3 ib test pass
[ 1170.363317] PM: resume devices took 0.791 seconds
[ 1170.363565] OOM killer enabled.
[ 1170.363566] Restarting tasks ... done.
[ 1170.365284] random: crng reseeded on system resumption
[ 1170.389517] PM: suspend exit
[ 1170.431811] Generic FE-GE Realtek PHY r8169-0-100:00: attached PHY driver (mii_bus:phy_addr=r8169-0-100:00, irq=MAC)
[ 1170.562235] r8169 0000:01:00.0 enp1s0f0: Link is Down
[ 1173.557307] wlp2s0: authenticate with 3c:7c:3f:31:3a:fc
[ 1173.619617] wlp2s0: send auth to 3c:7c:3f:31:3a:fc (try 1/3)
[ 1173.622625] wlp2s0: authenticated
[ 1173.623750] wlp2s0: associate with 3c:7c:3f:31:3a:fc (try 1/3)
[ 1173.625877] wlp2s0: RX AssocResp from 3c:7c:3f:31:3a:fc (capab=0x1011 status=0 aid=2)
[ 1173.643455] wlp2s0: associated
[ 1173.644106] wlp2s0: Limiting TX power to 23 (23 - 0) dBm as advertised by 3c:7c:3f:31:3a:fc
Comment 7 slartibart70 2023-12-18 22:26:21 UTC
it's also interesting to see that wayland 'jumps' between vkonsoles:
if the UI is initially running on vkonsole1 (ctrl-alt-f1) then after suspend it is on another one, say F3 or F5.

Does this help to isolate the problem?
Comment 8 slartibart70 2023-12-20 11:25:04 UTC
after stumbling upon this:
https://gitlab.freedesktop.org/drm/amd/-/issues/2935#note_2179276

i am currently on kernel 6.7.0-0.rc6.48.fc40.x86_64 (rawhide) which kind of solves this problem.

Still not able to suspend properly, though
Comment 9 Zamundaaa 2023-12-20 14:41:07 UTC
Ah, that's a driver bug then. Thanks for following up on it
Comment 10 slartibart70 2023-12-20 15:08:16 UTC
@Zamundaaa
by chance, do you know the difference between systemsetting>energy>sleep 'suspend' and 'systemctl suspend'?
Leaving the laptop auto-suspend as setup with systemsettings is fine, but systemctl suspend wakes up immediately.

Any source i could look up? (maybe plasma calls dbus commands?)
Comment 11 Zamundaaa 2023-12-21 22:12:36 UTC
I don't think there is any difference between those, powerdevil will end up calling on systemd to do the suspending too