Bug 472142 - External screen mirrored vertically with multi-gpu on wayland
Summary: External screen mirrored vertically with multi-gpu on wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-10 20:22 UTC by raffarti
Modified: 2023-07-12 09:08 UTC (History)
0 users

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 raffarti 2023-07-10 20:22:17 UTC
SOFTWARE/OS VERSIONS
Using kde opensuse unstable kde repositories + Plasma/5.27 branch from git
Mesa git main branch

ADDITIONAL INFORMATION
Laptop AMD 5800H+6600M
I am using KWIN_DRM_NO_DIRECT_SCANOUT=1 to workaround Bug #461824

Only bugged when using iGPU+dGPU and wayland (no bug with iGPU disabled)

External monitor connected through HDMI is rendered flipped vertically (cursor moves non-flipped, but cannot reach the top of the screen, sinks in the bottom. probably because the laptop screen has higher resolution).

Laptop screen is completely fine.

Bug only manifests at commit fdbcb184ae914d67483264401eaf3d5e88015fb2
Comment 1 raffarti 2023-07-10 20:23:52 UTC
> Using kde opensuse unstable kde repositories + Plasma/5.27 branch from git
only kwin from git
Comment 2 Bug Janitor Service 2023-07-11 13:12:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4245
Comment 3 Zamundaaa 2023-07-12 09:08:12 UTC
Git commit 73c112e983000a4894ec11d414a5db0350852587 by Xaver Hugl.
Committed on 11/07/2023 at 13:03.
Pushed by zamundaaa into branch 'Plasma/5.27'.

Revert "backends/drm: use glReadPixels for CPU copy"

This reverts commit fdbcb184ae914d67483264401eaf3d5e88015fb2. It didn't
take into account that the framebuffer y axis is inverted in comparison
to git master, so using glReadPixels causes the image to be inverted in 5.27.
Fixing that by always copying into an intermediary buffer is possible, but
would also negate most or all of the performance improvements, so reverting
the commit is the best way to deal with this issue.

M  +14   -23   src/backends/drm/drm_egl_layer_surface.cpp
M  +0    -1    src/backends/drm/drm_egl_layer_surface.h

https://invent.kde.org/plasma/kwin/-/commit/73c112e983000a4894ec11d414a5db0350852587