Bug 461565 - kwin_wayland doesn't appear to display anything on a simpledrm device
Summary: kwin_wayland doesn't appear to display anything on a simpledrm device
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-08 00:18 UTC by bluescreenavenger
Modified: 2022-11-10 20:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2022-11-08 00:18:37 UTC
SUMMARY
It appears that kwin doesn't draw anything to the screen on simpledrm anymore, I am not sure when this started, but this build of kwin was built on 2022-11-03

STEPS TO REPRODUCE
1. Ensure you are using simpledrm, if your kernel was built with it enabled, you can actually use it with the nomodeset option. It could also be a module you need to load, although distros that enable it don't seem to be enabling it as a module.
2. start `kwin_xwayland --xwayland xterm`
3. Observe the blank screen 

OBSERVED RESULT
exporting QT_LOGGING_RULES=*=true and then running kwin, and then grepping `drm` in the log output

```
No backend specified, automatically choosing drm
kwin_wayland_drm: adding GPU /dev/dri/card0
kwin_wayland_drm: drmModeAddFB2WithModifiers is supported on GPU "/dev/dri/card0"
kwin_wayland_drm: Using Atomic Mode Setting on gpu "/dev/dri/card0"
kwin_wayland_drm: Number of planes on GPU "/dev/dri/card0" : 1
kwin_wayland_drm: Plane 32 has properties type=Primary, SRC_X=0, SRC_Y=0, SRC_W=1024, SRC_H=768, CRTC_X=0, CRTC_Y=0, CRTC_W=1024, CRTC_H=768, FB_ID=0, CRTC_ID=0, rotation not found, IN_FORMATS=33
kwin_wayland_drm: Crtc 34 has properties MODE_ID=0, ACTIVE=0, VRR_ENABLED=0, GAMMA_LUT not found, GAMMA_LUT_SIZE not found
kwin_wayland_drm: Could not find edid for connector DrmConnector(id=31, gpu=KWin::DrmGpu(0x5613bf542c80), name="Unknown-1-unknown", connection="Connected", countMode=1)
kwin_wayland_drm: Connector 31 has properties CRTC_ID=0, non-desktop=0, DPMS=3, EDID=0, overscan not found, vrr_capable not found, underscan not found, underscan vborder not found, underscan hborder not found, Broadcast RGB not found, max bpc not found, link-status=Good, content type not found
kwin_wayland_drm: New output on GPU /dev/dri/card0: Unknown-1-unknown
kwin_wayland_drm: Failed to create framebuffer: Invalid argument
kwin_wayland_drm: Failed to create gamma blob! Invalid argument
```


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.0.7
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.100
Qt Version: 5.15

ADDITIONAL INFORMATION
It's not a crash, so I have no stack trace to give

drm_info: https://drmdb.emersion.fr/snapshots/4aae6a4ad7d3

Mesa is also pretty recent
Comment 1 Zamundaaa 2022-11-10 18:03:14 UTC
This is a kernel bug, simpledrm reports buffer formats it can't actually display. Until the fix reaches your distro, a workaround is to set either KWIN_DRM_PREFER_COLOR_DEPTH=24 (in 5.26.3+) or KWIN_DRM_NO_AMS=1.
Comment 2 bluescreenavenger 2022-11-10 20:21:26 UTC
Dang, I use https://gitlab.com/linux-kernel/stable/-/blob/linux-6.0.y although I didn't try 6.0.8 yet, looks fairly new