Bug 408964 - Wayland fractional scaling - very pixelated by default
Summary: Wayland fractional scaling - very pixelated by default
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: git
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-20 18:48 UTC by Greg Varsanyi
Modified: 2019-09-17 21:04 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.0


Attachments
screen shot of the info app - as taken by spectacle at 1.5x scaling (109.54 KB, image/png)
2019-06-20 18:48 UTC, Greg Varsanyi
Details
(Before) screenshot from kwin 5.16.5 without D23669.diff applied. 4k @ 1.5x (3.39 MB, image/jpeg)
2019-09-11 17:33 UTC, Lewis Lakerink
Details
(After) screenshot from kwin 5.16.5 with D23669.diff applied. 4k @ 1.5x (3.70 MB, image/jpeg)
2019-09-11 17:35 UTC, Lewis Lakerink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Varsanyi 2019-06-20 18:48:14 UTC
Created attachment 121044 [details]
screen shot of the info app - as taken by spectacle at 1.5x scaling

SUMMARY
wayland fractional scaling works for the most part, but produces *very* pixelated visuals. Interestlingly, the image of any window becomes practically perfect while moving a window with the "Wobbly Windows" effect on.


STEPS TO REPRODUCE
1. Use a hi-res monitor, set 2x scaling, turn on wobbly windows effect
2. Change scaling to 1.5x (`kscreen-doctor output.1.scale.1.5`), see the pixelated fonts (no anti-alias? wrong re-sampling algorithm?)
3. Start moving a window around

OBSERVED RESULT
"Wobbly Windows" probably uses a re-sampling algorithm that makes the pixelated looks go away

EXPECTED RESULT
Fancy looks without having to move the window :)


SOFTWARE/OS VERSIONS
Linux: KDE Neon Dev/Unstable w/ kernel 5.1.6
KDE Plasma Version: 5.16.80
KDE Frameworks Version: 5.60.0
Qt Version: 5.12.3
Comment 1 Greg Varsanyi 2019-06-20 18:55:49 UTC
sorry, disregard the attached screen shot - Spectacle seems to have taken it downsampled to 1x, so it doesn't really show the problem.
Comment 2 David Edmundson 2019-06-21 10:25:32 UTC
Thanks for the feedback

>Interestlingly, the image of any window becomes practically perfect while moving a window with the "Wobbly Windows" effect on.

That's very good to know. 

Kwin has some optimised routes when the window size matches the rendered size - however this code is based purely on logical size, not buffer size.

I tried once to patch that but frankly it looked the same to me. Would you be able to test a patch if I uploaded one?
Comment 3 Greg Varsanyi 2019-06-23 06:26:16 UTC
I appreciate your care for this bit, thank you.
Of course, I'm glad to help if you have something in store to try.
Comment 4 Brian 2019-07-30 16:32:54 UTC
I can confirm this issue. Kscreen-doctor has not been working for me at all for the longest time, but with a recent update it has started working. That said, everything is extremely pixelated unlike with xrandr on xorg, and it is also inconsistent in UI elements (it's not scaling everything, and some elements are not scaled properly).

At 1.25 scale, the mouse cursor is sometimes blown up to 4x the size it's supposed to be depending on where i move it on the screen (if i open the calendar part of the panel clock, the mouse blows up when hovering over the dates), and the panel did not scale to the proper size, with the icons all being pixelated as well.
Comment 5 Brian 2019-07-30 17:28:21 UTC
https://imgur.com/a/1MdMVvt

Here's a bunch of images i made (not perfect, but you should be able to see the differences).

Interestingly the application menu scales just fine in kscreen-doctor on wayland. The issue however is that the panel and other elements do not as you see in the album, and the text and icons are pixelated in the menu still.

Also it seems it's just rendering incorrectly, as any screenshots seem to show perfect scaling.
Comment 6 Lewis Lakerink 2019-08-27 00:54:27 UTC
I can also confirm this issue. Using kscreen-doctor with 1.25x under wayland causes exactly the same pixelated fonts as your screenshots, Brian.

I first encountered this issue some 12-18 months ago, and it is a show stopper for me using Plasma as I have a dell xps 4k with 2 external 4k monitors, which exceeds the maximum buffer size for the modesetting xorg driver (when scaling with xrandr). And the intel xorg driver is noticeably laggy at this resolution.

Sadly, I have since moved over to using Gnome 3.32 with wayland which has been working well, but I'd still like to come back Plasma when this issue can be resolved.
Comment 7 Brian 2019-09-10 15:58:24 UTC
(In reply to Lewis Lakerink from comment #6)
> I can also confirm this issue. Using kscreen-doctor with 1.25x under wayland
> causes exactly the same pixelated fonts as your screenshots, Brian.
> 
> I first encountered this issue some 12-18 months ago, and it is a show
> stopper for me using Plasma as I have a dell xps 4k with 2 external 4k
> monitors, which exceeds the maximum buffer size for the modesetting xorg
> driver (when scaling with xrandr). And the intel xorg driver is noticeably
> laggy at this resolution.
> 
> Sadly, I have since moved over to using Gnome 3.32 with wayland which has
> been working well, but I'd still like to come back Plasma when this issue
> can be resolved.

Well it seems roman might have some patches in the works for solving the blurriness, but they'll need some revision. (https://phabricator.kde.org/D23669) Thankfully fractional scaling just got added the UI for plasma 5.17 by him as well, so there will definitely be more people reporting this issue if it's a widespread one. Definitely exciting to see all this progress.
Comment 8 David Edmundson 2019-09-10 16:28:42 UTC
Are you able to test the patch.
Comment 9 Lewis Lakerink 2019-09-10 23:22:02 UTC
Certainly. Give me a day or so to build and install with the patch.
Comment 10 Lewis Lakerink 2019-09-11 17:33:47 UTC
Created attachment 122603 [details]
(Before) screenshot from kwin 5.16.5 without D23669.diff applied. 4k @ 1.5x
Comment 11 Lewis Lakerink 2019-09-11 17:35:12 UTC
Created attachment 122604 [details]
(After) screenshot from kwin 5.16.5 with D23669.diff applied. 4k @ 1.5x
Comment 12 Lewis Lakerink 2019-09-11 17:38:53 UTC
I can confirm that the patch D23669.diff to force the mipmaps works very well. The fonts are no longer pixelated. I've attached a before and after, they could be less blurry, but you can clearly see that the fonts are now significantly better.
Comment 13 Greg Varsanyi 2019-09-17 20:45:49 UTC
Just checked with latest Neon dev. Works like a charm! Thank you so much, this makes a huge deal of difference for everyone on Wayland and with non-integer scaled screens.
Big-huge thanks!