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.

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/x11/picom/Makefile,v
diff -u -p -r1.11 Makefile
--- Makefile    24 Apr 2023 11:42:49 -0000      1.11
+++ Makefile    3 Feb 2024 10:36:48 -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 += xcb-randr xcb-render-util xcb-render xcb-shape xcb-sync
-WANTLIB += xcb-xfixes xcb-xinerama xcb
+WANTLIB += EGL GL X11 X11-xcb c config dbus-1 ev m pcre2-8 pixman-1
+WANTLIB += pthread xcb xcb-composite xcb-damage xcb-dpms xcb-glx
+WANTLIB += xcb-image xcb-present xcb-randr xcb-render xcb-render-util
+WANTLIB += xcb-shape xcb-sync xcb-xfixes
 
 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: /home/cvs/ports/x11/picom/distinfo,v
diff -u -p -r1.7 distinfo
--- distinfo    24 Dec 2022 16:35:26 -0000      1.7
+++ distinfo    3 Feb 2024 10:36:53 -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_egl_c
===================================================================
RCS file: patches/patch-src_backend_gl_egl_c
diff -N patches/patch-src_backend_gl_egl_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_backend_gl_egl_c  24 Jan 2024 09:51:34 -0000
@@ -0,0 +1,27 @@
+ugly ugly ugly workaround
+
+Index: src/backend/gl/egl.c
+--- src/backend/gl/egl.c.orig
++++ src/backend/gl/egl.c
+@@ -37,6 +37,7 @@ struct egl_data {
+ };
+ 
+ static PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC glEGLImageTargetTexStorage = NULL;
++PFNGLGETQUERYOBJECTUI64VEXTPROC glEGLGetQueryObjectui64v = NULL;
+ static PFNEGLCREATEIMAGEKHRPROC eglCreateImageProc = NULL;
+ static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageProc = NULL;
+ static PFNEGLGETPLATFORMDISPLAYPROC eglGetPlatformDisplayProc = NULL;
+@@ -248,6 +249,13 @@ static backend_t *egl_init(session_t *ps, xcb_window_t
+                                                                   
"torageEXT");
+       if (glEGLImageTargetTexStorage == NULL) {
+               log_error("Failed to get glEGLImageTargetTexStorageEXT.");
++              goto end;
++      }
++
++      glEGLGetQueryObjectui64v =
++          
(PFNGLGETQUERYOBJECTUI64VPROC)eglGetProcAddress("glGetQueryObjectui64vEXT");
++      if (glGetQueryObjectui64v == NULL) {
++              log_error("Failed to get glGetQueryObjectui64vEXT.");
+               goto end;
+       }
+ 
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    24 Jan 2024 09:51:29 -0000
@@ -0,0 +1,23 @@
+ugly ugly ugly workaround
+
+Index: src/backend/gl/gl_common.c
+--- src/backend/gl/gl_common.c.orig
++++ src/backend/gl/gl_common.c
+@@ -22,6 +22,8 @@
+ #include "backend/backend_common.h"
+ #include "backend/gl/gl_common.h"
+ 
++extern PFNGLGETQUERYOBJECTUI64VEXTPROC glEGLGetQueryObjectui64v;
++
+ void gl_prepare(backend_t *base, const region_t *reg attr_unused) {
+       auto gd = (struct gl_data *)base;
+       glBeginQuery(GL_TIME_ELAPSED, 
gd->frame_timing[gd->current_frame_timing]);
+@@ -1187,7 +1189,7 @@ bool gl_last_render_time(backend_t *base, struct times
+       }
+ 
+       GLuint64 time;
+-      glGetQueryObjectui64v(gd->frame_timing[gd->current_frame_timing ^ 1],
++      glEGLGetQueryObjectui64v(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   3 Feb 2024 10:46:53 -0000
@@ -0,0 +1,22 @@
+it tries to gives itself real-time scheduling using an API we don't
+have.
+
+Index: src/picom.c
+--- src/picom.c.orig
++++ src/picom.c
+@@ -2553,6 +2553,7 @@ err:
+ /// 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) {
++#if 0
+       int priority = sched_get_priority_min(SCHED_RR);
+ 
+       int ret;
+@@ -2571,6 +2572,7 @@ void set_rr_scheduling(void) {
+               return;
+       }
+       log_info("Set real-time scheduling priority to %d", priority);
++#endif
+ }
+ 
+ /**

Reply via email to