aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2023-07-15 08:31:14 +0000
committerJan Beich <jbeich@FreeBSD.org>2023-07-15 08:57:03 +0000
commit9bb1dbe677724f5a7a6bb29e6978842468387670 (patch)
treef1d712f644d843e19e536ac74f92278aef0ff1ca
parent8c3e03e40f25c5aee906148e655cfe2b3ebe4580 (diff)
downloadports-9bb1dbe677724f5a7a6bb29e6978842468387670.tar.gz
ports-9bb1dbe677724f5a7a6bb29e6978842468387670.zip
x11-wm/kwinft: support mac_priority(4) on Wayland
-rw-r--r--x11-wm/kwinft/Makefile2
-rw-r--r--x11-wm/kwinft/files/patch-main__wayland.cpp36
-rw-r--r--x11-wm/kwinft/pkg-message7
3 files changed, 44 insertions, 1 deletions
diff --git a/x11-wm/kwinft/Makefile b/x11-wm/kwinft/Makefile
index 56a796c3d84a..7535d04701aa 100644
--- a/x11-wm/kwinft/Makefile
+++ b/x11-wm/kwinft/Makefile
@@ -1,7 +1,7 @@
PORTNAME= kwinft
DISTVERSIONPREFIX= ${PORTNAME}@
DISTVERSION= 5.27.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11-wm wayland
MAINTAINER= jbeich@FreeBSD.org
diff --git a/x11-wm/kwinft/files/patch-main__wayland.cpp b/x11-wm/kwinft/files/patch-main__wayland.cpp
new file mode 100644
index 000000000000..df6a92432f05
--- /dev/null
+++ b/x11-wm/kwinft/files/patch-main__wayland.cpp
@@ -0,0 +1,36 @@
+- Emulate SCHED_RESET_ON_FORK via pthread_atfork
+- Switch to pthread_setschedparam as Linux sched_setscheduler
+ operates on threads contrary to POSIX
+
+--- main_wayland.cpp.orig 2023-02-17 14:50:58 UTC
++++ main_wayland.cpp
+@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.
+ #include <QDebug>
+ #include <QWindow>
+
+-#include <sched.h>
++#include <pthread.h>
+ #include <sys/resource.h>
+
+ #include <iostream>
+@@ -122,12 +122,17 @@ void gainRealTime()
+ namespace {
+ void gainRealTime()
+ {
+-#if HAVE_SCHED_RESET_ON_FORK
+ const int minPriority = sched_get_priority_min(SCHED_RR);
+ sched_param sp;
+ sp.sched_priority = minPriority;
+- sched_setscheduler(0, SCHED_RR | SCHED_RESET_ON_FORK, &sp);
+-#endif
++ if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp))
++ return;
++
++ pthread_atfork(NULL, NULL, []() {
++ sched_param sp;
++ sp.sched_priority = 0;
++ pthread_setschedparam(pthread_self(), SCHED_OTHER, &sp);
++ });
+ }
+ }
+
diff --git a/x11-wm/kwinft/pkg-message b/x11-wm/kwinft/pkg-message
index 68e3a0e9b0dd..969f9444a619 100644
--- a/x11-wm/kwinft/pkg-message
+++ b/x11-wm/kwinft/pkg-message
@@ -36,6 +36,13 @@ Replace KWin in Plasma Desktop:
$ pkg set -o x11-wm/plasma5-kwin:x11-wm/kwinft
$ pkg upgrade -f kwinft
$ pkg lock kwinft
+
+Improve Wayland responsiveness under high load:
+
+ $ sysrc kld_list+=mac_priority
+ $ service kld restart
+ $ pw groupmod realtime -m <user>
+ $ exit # log out to refresh group permissions
EOM
}
]