El Sat, 03 Feb 2024 12:25:31 +0100
Omar Polo <o...@omarpolo.com> escribió:
> On 2024/01/24 11:07:12 +0100, Omar Polo <o...@omarpolo.com> wrote:
> > the changelog is available here:
> > 
> >     https://github.com/yshui/picom/releases/tag/v11-rc1
> > 
> > picom now tries to set itself as real-time.  I've commented out that
> > part since it uses a function we don't seem to provide
> > (sched_setscheduler), but it's not a big deal.
> > 
> > However, I had again issues with the visibility of OpenGL symbols.
> > This time the 'usual' workaround didn't work.  See the two diffs
> > below.  It's ugly, but at least I can confirm that the glx backend
> > works for me (amdgpu if it matters.)  Any help understanding this
> > is welcome :)
> 
> diff updated for 11.1, still no idea regarding the
> glGetQueryObjectui64v symbol issue.
> 

Update, I have successfully managed to compile and run picom-v11.1 with
the following changes. Take a look and feedback is welcome!


-- 
*********************************************************
Dios en su cielo, todo bien en la Tierra
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/picom/Makefile,v
retrieving revision 1.11
diff -u -p -u -r1.11 Makefile
--- Makefile	24 Apr 2023 11:42:49 -0000	1.11
+++ Makefile	4 Feb 2024 04:35:52 -0000
@@ -1,19 +1,16 @@
 COMMENT =	lightweight compositor for X11
 
-GH_ACCOUNT =	yshui
-GH_PROJECT =	picom
-GH_TAGNAME =	v10.2
-REVISION =	0
+DIST_TUPLE =   github yshui picom v11.1 .
 
 CATEGORIES =	x11
 
 # MPL 2.0
 PERMIT_PACKAGE =	Yes
 
-WANTLIB += EGL GL X11 X11-xcb c config dbus-1 ev m pcre pixman-1
-WANTLIB += xcb-composite xcb-damage xcb-glx xcb-image xcb-present
+WANTLIB += EGL GL X11 X11-xcb c config dbus-1 ev m pcre2-8 pixman-1
+WANTLIB += pthread xcb-composite xcb-damage xcb-glx xcb-image xcb-present
 WANTLIB += xcb-randr xcb-render-util xcb-render xcb-shape xcb-sync
-WANTLIB += xcb-xfixes xcb-xinerama xcb
+WANTLIB += xcb-xfixes xcb-util xcb
 
 MODULES =		devel/meson
 
@@ -29,7 +26,7 @@ RUN_DEPENDS =		x11/gtk+4,-guic \
 
 LIB_DEPENDS =		devel/libconfig \
 			devel/libev \
-			devel/pcre \
+			devel/pcre2 \
 			x11/dbus
 
 CONFIGURE_ARGS	+=	-Dwith_docs=true \
Index: distinfo
===================================================================
RCS file: /cvs/ports/x11/picom/distinfo,v
retrieving revision 1.7
diff -u -p -u -r1.7 distinfo
--- distinfo	24 Dec 2022 16:35:26 -0000	1.7
+++ distinfo	4 Feb 2024 04:35:52 -0000
@@ -1,2 +1,2 @@
-SHA256 (picom-10.2.tar.gz) = l0FXffATbYor5IAFyiuT7cFZE1KOGbzreYU1ykaDNBw=
-SIZE (picom-10.2.tar.gz) = 287166
+SHA256 (yshui-picom-v11.1.tar.gz) = lvKjOpMGSnS1V5QtAwCirHeshT9Q77v2RmhJ/MdULsg=
+SIZE (yshui-picom-v11.1.tar.gz) = 308617
Index: patches/patch-src_backend_gl_gl_common_c
===================================================================
RCS file: patches/patch-src_backend_gl_gl_common_c
diff -N patches/patch-src_backend_gl_gl_common_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_backend_gl_gl_common_c	4 Feb 2024 04:35:52 -0000
@@ -0,0 +1,13 @@
+--- src/backend/gl/gl_common.c.orig	Sat Feb  3 23:35:29 2024
++++ src/backend/gl/gl_common.c	Sat Feb  3 23:35:04 2024
+@@ -1186,8 +1186,8 @@ bool gl_last_render_time(backend_t *base, struct times
+ 		return false;
+ 	}
+ 
+-	GLuint64 time;
+-	glGetQueryObjectui64v(gd->frame_timing[gd->current_frame_timing ^ 1],
++	GLuint time;
++	glGetQueryObjectuiv(gd->frame_timing[gd->current_frame_timing ^ 1],
+ 	                      GL_QUERY_RESULT, &time);
+ 	ts->tv_sec = (long)(time / 1000000000);
+ 	ts->tv_nsec = (long)(time % 1000000000);
Index: patches/patch-src_picom_c
===================================================================
RCS file: patches/patch-src_picom_c
diff -N patches/patch-src_picom_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_picom_c	4 Feb 2024 04:35:52 -0000
@@ -0,0 +1,38 @@
+--- src/picom.c.orig	Sat Feb  3 23:35:20 2024
++++ src/picom.c	Sat Feb  3 23:34:40 2024
+@@ -2550,28 +2550,30 @@ err:
+ /// Make picom realtime to reduce latency, and make rendering times more predictable to
+ /// help pacing.
+ ///
+-/// This requires the user to set up permissions for the real-time scheduling. e.g. by
+-/// setting `ulimit -r`, or giving us the CAP_SYS_NICE capability.
+ void set_rr_scheduling(void) {
+ 	int priority = sched_get_priority_min(SCHED_RR);
+ 
++	int old_policy;
+ 	int ret;
+ 	struct sched_param param;
+ 
+-	ret = sched_getparam(0, &param);
++	ret = pthread_getschedparam(pthread_self(), &old_policy, &param);
+ 	if (ret != 0) {
+ 		log_debug("Failed to get old scheduling priority");
+ 		return;
+ 	}
+ 
+ 	param.sched_priority = priority;
+-	ret = sched_setscheduler(0, SCHED_RR, &param);
++	ret = pthread_setschedparam(pthread_self(), SCHED_RR, &param);
+ 	if (ret != 0) {
+-		log_info("Failed to set real-time scheduling priority to %d.", priority);
++		log_info("Failed to set real-time scheduling priority to %d. Consider "
++		         "giving picom the CAP_SYS_NICE capability",
++		         priority);
+ 		return;
+ 	}
+ 	log_info("Set real-time scheduling priority to %d", priority);
+ }
++
+ 
+ /**
+  * Destroy a session.

Reply via email to