aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-02-25 22:13:47 +0100
committerdec05eba <dec05eba@protonmail.com>2024-02-25 22:13:47 +0100
commit72ee065cedbec3074ea20b19741ce8f2ba9d2947 (patch)
treebef6a61ac75463ce7f72cbed456adb9aef4a2523
parent752dac41390df3aaccf822fdd404af1c89ce3a3d (diff)
Dont prioritize gsr egl context over other processes
-rwxr-xr-xdebug-install.sh2
-rwxr-xr-xinstall.sh2
-rw-r--r--src/egl.c16
3 files changed, 0 insertions, 20 deletions
diff --git a/debug-install.sh b/debug-install.sh
index 720d7ec..3177ace 100755
--- a/debug-install.sh
+++ b/debug-install.sh
@@ -14,7 +14,5 @@ if [ -d "/usr/lib/systemd/user" ]; then
fi
# Not necessary, but removes the password prompt when trying to record a monitor on amd/intel or nvidia wayland
setcap cap_sys_admin+ep /usr/bin/gsr-kms-server
-# Not ncessary, but allows use of EGL_CONTEXT_PRIORITY_LEVEL_IMG which might decrease performance impact on the system
-setcap cap_sys_nice+ep /usr/bin/gpu-screen-recorder
echo "Successfully installed gpu-screen-recorder (debug)"
diff --git a/install.sh b/install.sh
index 0d413ee..adc9230 100755
--- a/install.sh
+++ b/install.sh
@@ -16,7 +16,5 @@ if [ -d "/usr/lib/systemd/user" ]; then
fi
# Not necessary, but removes the password prompt when trying to record a monitor on amd/intel or nvidia wayland
setcap cap_sys_admin+ep /usr/bin/gsr-kms-server
-# Not ncessary, but allows use of EGL_CONTEXT_PRIORITY_LEVEL_IMG which might decrease performance impact on the system
-setcap cap_sys_nice+ep /usr/bin/gpu-screen-recorder
echo "Successfully installed gpu-screen-recorder"
diff --git a/src/egl.c b/src/egl.c
index 7971dbd..ec6f91c 100644
--- a/src/egl.c
+++ b/src/egl.c
@@ -9,7 +9,6 @@
#include <wayland-client.h>
#include <wayland-egl.h>
#include <unistd.h>
-#include <sys/capability.h>
// Move this shit to a separate wayland file, and have a separate file for x11.
@@ -119,18 +118,6 @@ static struct wl_registry_listener registry_listener = {
.global_remove = registry_remove_object,
};
-static void reset_cap_nice(void) {
- cap_t caps = cap_get_proc();
- if(!caps)
- return;
-
- const cap_value_t cap_to_remove = CAP_SYS_NICE;
- cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap_to_remove, CAP_CLEAR);
- cap_set_flag(caps, CAP_PERMITTED, 1, &cap_to_remove, CAP_CLEAR);
- cap_set_proc(caps);
- cap_free(caps);
-}
-
// TODO: Create egl context without surface (in other words, x11/wayland agnostic, doesn't require x11/wayland dependency)
static bool gsr_egl_create_window(gsr_egl *self, bool wayland) {
EGLConfig ecfg;
@@ -144,7 +131,6 @@ static bool gsr_egl_create_window(gsr_egl *self, bool wayland) {
const int32_t ctxattr[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG, /* requires cap_sys_nice, ignored otherwise */
EGL_NONE
};
@@ -219,11 +205,9 @@ static bool gsr_egl_create_window(gsr_egl *self, bool wayland) {
goto fail;
}
- reset_cap_nice();
return true;
fail:
- reset_cap_nice();
gsr_egl_unload(self);
return false;
}