Bug 484939 - hearts of iron 4 output not scaling correctly
Summary: hearts of iron 4 output not scaling correctly
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-02 18:20 UTC by Harald Sitter
Modified: 2024-04-02 19:31 UTC (History)
1 user (show)

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


Attachments
drm_info output while windows is fullscreen (99.79 KB, text/plain)
2024-04-02 18:22 UTC, Harald Sitter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2024-04-02 18:20:16 UTC
SUMMARY
When the game hearts of iron 4 is configured to a lower resolution than that of the desktop the remaining screen is filled with artifacts instead of scaled correctly

STEPS TO REPRODUCE
1. get hoi4 on steam & install & start
2. go to options
3. change resolution to one lower than the desktop (in my case from 2160 to 1080). display mode is fullscreen FWIW. 
4. restart game

OBSERVED RESULT
output broken, mouse input is also not matching up with the actual correctly painted part of the screen

EXPECTED RESULT
output should be 1080

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.1.0
Qt Version: 6.6.3
Kernel Version: 6.8.2-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT

ADDITIONAL INFORMATION
Parts of the screen seem to redraw somewhat consistently on alt-tabbing revealing that the top left corner is where input gets received but the bottom left corner is the one that gets painted to.

I have a three display setup but the two side screens are currently disabled via the kscreen kcm.
Comment 1 Harald Sitter 2024-04-02 18:21:56 UTC
screenshot https://imgur.com/a/fzwJeTI
Comment 2 Harald Sitter 2024-04-02 18:22:22 UTC
Created attachment 168066 [details]
drm_info output while windows is fullscreen
Comment 3 Zamundaaa 2024-04-02 18:56:18 UTC
The game seems to get direct scanout, judging by the XRGB8888 format. Given that, this looks quite wrong:
    │       ├───"SRC_W" (atomic): range [0, UINT32_MAX] = 3840
    │       ├───"SRC_H" (atomic): range [0, UINT32_MAX] = 2160
Comment 4 Zamundaaa 2024-04-02 19:31:56 UTC
I managed to reproduce this in Half Life 2 and KWin seems to do everything correctly; we get a full resolution buffer from Xwayland... and it's very similar to https://gitlab.freedesktop.org/xorg/xserver/-/issues/1595, so I'm pretty confident it's that Xwayland bug