Bug 492830 - Fullscreen Games Not Displaying Properly
Summary: Fullscreen Games Not Displaying Properly
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.1
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-08 18:35 UTC by Nathaniel Graham
Modified: 2024-09-29 01:27 UTC (History)
1 user (show)

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


Attachments
journalctl --user-unit plasma-kwin_wayland --boot 0 (188.19 KB, text/plain)
2024-09-24 19:25 UTC, Nathaniel Graham
Details
sudo dmesg (242.46 KB, text/plain)
2024-09-24 19:25 UTC, Nathaniel Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathaniel Graham 2024-09-08 18:35:35 UTC
SUMMARY
When playing Shapez 2 (it's not the only game that does this, it's just an example. Though not all games do this), attempting to play in Fullscreen mode does not display properly. When attempting to get a screen recording with OBS, instead of recording the issue, it records the game as it *should* be, not as it *is*. As in, OBS sees the game playing, and I'm able to interact with the game completely normally with both keyboard and mouse, but my monitor does not see anything change. OBS does.

This only occurs on my external monitor. If I move the game to my laptop screen, this issue does not occur.

My monitor is connected via USB4 with a USB-C connection using the Display-Port protocol. On my laptop, this USB4 port is connected directly to my GPU (Framework 16).

STEPS TO REPRODUCE
1. Launch Shapez 2

OBSERVED RESULT
After a few seconds, the game appears to freeze. However, it is not really frozen, as the mouse can continue to interact with the game, provided you know what's supposed to be rendering. OBS can see what's actually happening, allowing me to interact with the settings menu to tinker.

EXPECTED RESULT
The game should render normally.

SOFTWARE/OS VERSIONS
Operating System: Nobara Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-200.fsync.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Memory: 62.0 GiB of RAM
Graphics Processor: AMD Radeon 780M + AMD Radeon 7700S

ADDITIONAL INFORMATION
I have also experienced this in Guild Wars 2 when on `kwin 6.1.3`. For some reason GW2 works fine on 6.1.1 but Shapez 2 does not.

I have a recording of this occurring on my phone. I've uploaded it to imgur, since its too big to upload here. Let me know if there is a better location for uploading it, I'm happy to do that too.

https://imgur.com/a/5jTZrSv
Comment 1 Nathaniel Graham 2024-09-08 18:45:16 UTC
Additionally, if the game is *unfocused*, the game continues to render properly. Focusing the application freezes it again.
Comment 2 Nathaniel Graham 2024-09-08 18:51:01 UTC
And actually, I want to be even more clear about what exactly OBS is recording. That's a *screen* capture, not a capture of the game itself. So Somehow, OBS can see what my monitor cannot. Particularly weird though is that the mouse works just fine on the screen, so it's not just failing to display anything at all
Comment 3 Zamundaaa 2024-09-19 20:55:34 UTC
Please attach the output of
> journalctl --user-unit plasma-kwin_wayland --boot 0
and
> sudo dmesg
after reproducing the issue.
Comment 4 Nathaniel Graham 2024-09-24 19:25:34 UTC
Created attachment 174043 [details]
journalctl --user-unit plasma-kwin_wayland --boot 0
Comment 5 Nathaniel Graham 2024-09-24 19:25:48 UTC
Created attachment 174044 [details]
sudo dmesg
Comment 6 Zamundaaa 2024-09-24 19:48:57 UTC
Ah, I've seen that before:
> [drm:amdgpu_dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -22

This is a driver bug. Please add your information to https://gitlab.freedesktop.org/drm/amd/-/issues/2075 about this.
You can work around it by putting KWIN_DRM_NO_DIRECT_SCANOUT=1 into /etc/environment and rebooting. It'll have some performance impact, but there shouldn't be any freezes at least.
Comment 7 Nathaniel Graham 2024-09-27 18:24:57 UTC
(In reply to Zamundaaa from comment #6)
> Ah, I've seen that before:
> > [drm:amdgpu_dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -22
> 
> This is a driver bug. Please add your information to
> https://gitlab.freedesktop.org/drm/amd/-/issues/2075 about this.
> You can work around it by putting KWIN_DRM_NO_DIRECT_SCANOUT=1 into
> /etc/environment and rebooting. It'll have some performance impact, but
> there shouldn't be any freezes at least.

This seems to have worked, thank you!

I am curious, what kind of performance impact should I be expecting? I haven't noticed anything yet, but just for knowledge's sake
Comment 8 Zamundaaa 2024-09-29 01:27:49 UTC
The performance impact depends a lot on the hw, but it's usually pretty small, not something to worry about too much.