Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931215 - kde-plasma/kwin should use +caps by default
Summary: kde-plasma/kwin should use +caps by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 926828
  Show dependency tree
 
Reported: 2024-05-04 21:17 UTC by Janne Grunau
Modified: 2024-10-17 03:51 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Grunau 2024-05-04 21:17:16 UTC
kwin_wayland needs CAP_SYS_NICE to reschedule its input and kms commit thread as real time threads. Not using real time threads doesn't cause obvious issues on kwin-5.
Kwin-6 uses explicit sync and tries to do KMS atomic commit as closely to vsync as possibly. Without a real time kms commit thread this can results in missed vsyncs and a full refresh duration of delay. This was noticed on Apple silicon systems with resizing a glxgears window constantly under kwin_wayland/Xwayland.
Comment 1 Andreas Sturmlechner gentoo-dev 2024-05-05 06:35:04 UTC
... or maybe it shouldn't be optional at all anymore then?
Comment 2 Larry the Git Cow gentoo-dev 2024-05-15 19:32:39 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=d10f89f7da3a36bf51d812978e14b17d6afad4aa

commit d10f89f7da3a36bf51d812978e14b17d6afad4aa
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-05-15 19:18:12 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-05-15 19:20:27 +0000

    kde-plasma/kwin: Drop IUSE caps, make it unconditional
    
    Necessary for kwin_wayland.
    
    Closes: https://bugs.gentoo.org/931215
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 kde-plasma/kwin/kwin-6.0.49.9999.ebuild | 5 ++---
 kde-plasma/kwin/kwin-9999.ebuild        | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
Comment 3 kingfared 2024-05-17 17:51:37 UTC
https://bugs.kde.org/show_bug.cgi?id=417227

This breaks shortcuts on musl/llvm profile on wayland.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-17 18:05:58 UTC
(In reply to kingfared from comment #3)
> https://bugs.kde.org/show_bug.cgi?id=417227
> 
> This breaks shortcuts on musl/llvm profile on wayland.

The discussion on that bug seems to be "there's a bug here, but it's not related to your caps thing". 

Did you really have USE=-caps until now on your musl system?
Comment 5 Andreas Sturmlechner gentoo-dev 2024-05-17 18:23:04 UTC
doubtful.
Comment 6 kingfared 2024-05-17 20:44:48 UTC
kwin was broken since a long time with +caps on musl/llvm
Not globally but locally for kwin
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-18 03:53:33 UTC
(In reply to kingfared from comment #6)
> kwin was broken since a long time with +caps on musl/llvm
> Not globally but locally for kwin

I do wish you or someone had reported this before. Did you and I missed it, or...?

Anyway, I must admit, on re-reading the bug, I think you're right: https://bugs.kde.org/show_bug.cgi?id=417227#c13 and https://bugs.kde.org/show_bug.cgi?id=417227#c16 in particular.

I think we should put USE=caps back and p.use.force it on !musl systems. Maybe even mask it on musl. I'll do that if asturm is fine with it.
Comment 8 Andreas Sturmlechner gentoo-dev 2024-05-18 08:42:51 UTC
(In reply to Sam James from comment #7)
> I think we should put USE=caps back and p.use.force it on !musl systems.
> Maybe even mask it on musl. I'll do that if asturm is fine with it.

That means we accept broken kwin_wayland on musl?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-18 08:56:00 UTC
Well, it's more broken right now (no shortcuts). musl users tend to be okay with somewhat-worse performance too. I agree it sucks.
Comment 10 Janne Grunau 2024-05-18 08:59:38 UTC
broken with a very wide interpretation of what broken means. Kwin was used for years without CAP_SYS_NICE on at least Fedora and Debian without anyone noticing. Granted that was only very briefly kwin 6 were it became more important due to kwin changes. I only noticed it because the asahi display driver used a slow (compared to direct HW reg programming) firmware interface for framebuffer swaps and thus locked closely at the timing. I'd expect that runs acceptable on most other hardware.
Kwin developers are to my understanding open to using rtkit for real-time threads but buggy GPU drivers are currently blocking this. The issue is that some driver only allow high priority OpenGL contexts with SYS_NICE.
Comment 11 Andreas Sturmlechner gentoo-dev 2024-05-20 15:13:55 UTC
(In reply to Sam James from comment #7)
> I think we should put USE=caps back and p.use.force it on !musl systems.
> Maybe even mask it on musl. I'll do that if asturm is fine with it.
Feel free to go ahead with that (p.use.force + mask on musl).

@Janne, should we mention degraded performance on detection of musl in an ewarn/einfo?
Comment 12 Larry the Git Cow gentoo-dev 2024-05-21 19:05:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2187d8ffaa43d8e236926dd2a47263487b7caada

commit 2187d8ffaa43d8e236926dd2a47263487b7caada
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-05-21 18:11:38 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-05-21 19:05:13 +0000

    kde-plasma/kwin: 6.0.5 version bump, re-add IUSE +caps
    
    Bug: https://bugs.gentoo.org/931215
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 kde-plasma/kwin/Manifest          |   1 +
 kde-plasma/kwin/kwin-6.0.5.ebuild | 140 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+)
Comment 13 Larry the Git Cow gentoo-dev 2024-05-30 17:21:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=7766de878755b75470ae2b0c4d4838891e49247d

commit 7766de878755b75470ae2b0c4d4838891e49247d
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2024-05-30 17:20:19 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2024-05-30 17:20:59 +0000

    kde-plasma/kwin: Re-add IUSE +caps
    
    Bug: https://bugs.gentoo.org/931215
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 kde-plasma/kwin/kwin-6.1.49.9999.ebuild | 5 +++--
 kde-plasma/kwin/kwin-9999.ebuild        | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
Comment 14 Andreas Sturmlechner gentoo-dev 2024-05-30 20:02:22 UTC
Sam, feel free to go ahead with the profile settings then.
Comment 15 Niklāvs Koļesņikovs 2024-05-30 21:01:32 UTC
Frankly speaking its for the best, if RTkit is not used, since it has canary thread starvation bugs that will probably never be fixed. Just my two cents.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-30 23:09:51 UTC
(In reply to Niklāvs Koļesņikovs from comment #15)
> Frankly speaking its for the best, if RTkit is not used, since it has canary
> thread starvation bugs that will probably never be fixed. Just my two cents.

I'm not sure what you're saying here but the previous discussion is already clear.
Comment 17 Larry the Git Cow gentoo-dev 2024-06-03 02:25:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e38fb7aa0827ecc78cdfe9b59f3928ca13f800a

commit 2e38fb7aa0827ecc78cdfe9b59f3928ca13f800a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-03 02:18:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-03 02:18:47 +0000

    profiles: package.use.force kwin[caps] except on musl
    
    It's needed for resonable rendering behaviour, but mask on musl
    because it doesn't work properly there (https://bugs.kde.org/show_bug.cgi?id=417227).
    
    Closes: https://bugs.gentoo.org/931215
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.use.force          | 4 ++++
 profiles/features/musl/package.use.force | 5 +++++
 profiles/features/musl/package.use.mask  | 5 +++++
 3 files changed, 14 insertions(+)