Bug 457851 - Wayland: Screen corruption in full screen applications on secondary iGPU
Summary: Wayland: Screen corruption in full screen applications on secondary iGPU
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.25.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-13 18:44 UTC by Andrew Ammerlaan
Modified: 2022-08-15 17:14 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
wayland session log with QT_LOGGING_RULES=kwin_*.debug=true;kwin_libinput.debug=false (285.06 KB, text/plain)
2022-08-13 18:45 UTC, Andrew Ammerlaan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Ammerlaan 2022-08-13 18:44:29 UTC
SUMMARY

Applications that go into full screen mode are not rendered correctly if the window is on a display connected to the secondary integrated Intel GPU. The screen gets corrupted, weird lines and colours all over, I would make a screenshot but the window looks fine in the screenshot. Full screen does work when the window is on a display connected to the primary AMD GPU. Most, but not all, applications are affected. Konsole works fine in full screen, VLC and Firefox do not.


STEPS TO REPRODUCE
1. Start Plasma Wayland session
2. Open VLC
3. Press F11 to make the window full screen

OBSERVED RESULT

Screen is corrupted and unusable.

EXPECTED RESULT

The display shows the window in full screen mode without any screen corruption

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux running kernel 5.19.1 with mesa 22.1.6
KDE Plasma Version: 5.24.3
KDE Frameworks Version:  5.96.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION

See also Bug 433107
Comment 1 Andrew Ammerlaan 2022-08-13 18:45:46 UTC
Created attachment 151303 [details]
wayland session log with QT_LOGGING_RULES=kwin_*.debug=true;kwin_libinput.debug=false
Comment 2 Zamundaaa 2022-08-14 00:28:08 UTC
Does this also happen with KWIN_DRM_NO_DIRECT_SCANOUT=1 set?
Comment 3 Andrew Ammerlaan 2022-08-14 05:38:03 UTC
(In reply to Zamundaaa from comment #2)
> Does this also happen with KWIN_DRM_NO_DIRECT_SCANOUT=1 set?

It does not. With this variable in env fullscreen on wayland works just fine.
Comment 4 Bug Janitor Service 2022-08-14 17:58:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2817
Comment 5 Zamundaaa 2022-08-14 17:58:53 UTC
Most likely the problem is caused by one of your GPUs not supporting explicit modifiers. Can you test if that MR fixes it?
Comment 6 Andrew Ammerlaan 2022-08-14 20:37:27 UTC
(In reply to Zamundaaa from comment #5)
> Most likely the problem is caused by one of your GPUs not supporting
> explicit modifiers. Can you test if that MR fixes it?

Yes! It fixes the problem. Thanks for the very quick fix.
Comment 7 Zamundaaa 2022-08-15 12:21:48 UTC
Git commit 6cdb1e6f64c7b81806787670e3ddd3d49d62abc0 by Xaver Hugl.
Committed on 14/08/2022 at 17:53.
Pushed by zamundaaa into branch 'master'.

backends/drm: add stricter checks for direct scanout

Buffers with implicit modifiers from another GPU must not be imported, as
the layouts may not be compatible.
For buffers with incompatible modifiers, direct scanout can also be rejected
early, saving some computational power.

M  +5    -0    src/backends/drm/drm_backend.cpp
M  +1    -0    src/backends/drm/drm_backend.h
M  +1    -0    src/backends/drm/drm_buffer_gbm.cpp
M  +7    -0    src/backends/drm/drm_egl_layer.cpp

https://invent.kde.org/plasma/kwin/commit/6cdb1e6f64c7b81806787670e3ddd3d49d62abc0
Comment 8 Zamundaaa 2022-08-15 17:14:29 UTC
Git commit 5662bdb14cf0ebd290053a5989d1999e74dc6276 by Xaver Hugl.
Committed on 15/08/2022 at 17:14.
Pushed by zamundaaa into branch 'Plasma/5.25'.

backends/drm: add stricter checks for direct scanout

Buffers with implicit modifiers from another GPU must not be imported, as
the layouts may not be compatible.
For buffers with incompatible modifiers, direct scanout can also be rejected
early, saving some computational power.
(cherry picked from commit 6cdb1e6f64c7b81806787670e3ddd3d49d62abc0)

M  +5    -0    src/backends/drm/drm_backend.cpp
M  +1    -0    src/backends/drm/drm_backend.h
M  +1    -0    src/backends/drm/drm_buffer_gbm.cpp
M  +7    -0    src/backends/drm/egl_gbm_layer.cpp

https://invent.kde.org/plasma/kwin/commit/5662bdb14cf0ebd290053a5989d1999e74dc6276