On Thu, May 23, 2019 at 09:40:14PM +0000, Mr. Me0w wrote: [...] > Understood. I just made a patch against the current ports CVS. It is attached > to this email.
Thanks, one more nit - ports updates are generally sent inline at the bottom of the email (like in this case). > Yes, it does fix a bug I've encountered. When using compton to handle vsync, > the DRM option doesn't work by default because it assumes it is running on > Linux and that the DRM device is located at /dev/dri/card0, but on OpenBSD it > is located at /dev/drm0. Sadly, this can't be overriden in the compton.conf > either. Netiquette: 72 characters per line (does protonmail mess with this?) https://www.openbsd.org/mail.html > Before patch: > > $ compton --vsync drm > vsync_drm_init(): Failed to open device. > $ > > After patch: > > $ compton --vsync drm > > (Works.. GPU-accelerated compositing and tear-free display.) I can confirm this works here, too. I think this patch should go in. Thanks for the work, Mr. Me0w! I have combined this into the same patch file that already existed for src/compton.c. Also REVISION bump and take MAINTAINER if no objection. (By the way, I found an active fork of compton that may serve to update this port later: https://github.com/yshui/compton) ok? Index: Makefile =================================================================== RCS file: /cvs/ports/x11/compton/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile 9 May 2019 21:13:26 -0000 1.7 +++ Makefile 24 May 2019 05:31:39 -0000 @@ -5,11 +5,13 @@ COMMENT = lightweight compositor for X, V = 0.1_beta2 PKGNAME = compton-${V} DISTNAME = compton-git-v0.1_beta2-2013-10-21 -REVISION = 4 +REVISION = 5 CATEGORIES = x11 HOMEPAGE = https://github.com/chjj/compton + +MAINTAINER = Thomas Frohwein <t...@openbsd.org> # MIT PERMIT_PACKAGE_CDROM = Yes Index: patches/patch-src_compton_c =================================================================== RCS file: /cvs/ports/x11/compton/patches/patch-src_compton_c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-src_compton_c --- patches/patch-src_compton_c 27 Oct 2014 11:21:49 -0000 1.1.1.1 +++ patches/patch-src_compton_c 24 May 2019 05:31:39 -0000 @@ -1,6 +1,7 @@ $OpenBSD: patch-src_compton_c,v 1.1.1.1 2014/10/27 11:21:49 sthen Exp $ ---- src/compton.c.orig Mon Oct 21 19:47:01 2013 -+++ src/compton.c Sun Oct 26 00:56:53 2014 +Index: src/compton.c +--- src/compton.c.orig ++++ src/compton.c @@ -1665,6 +1665,8 @@ win_paint_win(session_t *ps, win *w, XserverRegion reg reg_paint, pcache_reg); break; @@ -10,6 +11,15 @@ $OpenBSD: patch-src_compton_c,v 1.1.1.1 } } +@@ -5825,7 +5827,7 @@ static bool + vsync_drm_init(session_t *ps) { + #ifdef CONFIG_VSYNC_DRM + // Should we always open card0? +- if (ps->drm_fd < 0 && (ps->drm_fd = open("/dev/dri/card0", O_RDWR)) < 0) { ++ if (ps->drm_fd < 0 && (ps->drm_fd = open("/dev/drm0", O_RDWR)) < 0) { + printf_errf("(): Failed to open device."); + return false; + } @@ -6165,6 +6167,8 @@ init_filters(session_t *ps) { return false; } Index: patches/patch-src_opengl_c =================================================================== RCS file: /cvs/ports/x11/compton/patches/patch-src_opengl_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-src_opengl_c --- patches/patch-src_opengl_c 13 Feb 2019 20:36:08 -0000 1.1 +++ patches/patch-src_opengl_c 24 May 2019 05:31:39 -0000 @@ -4,9 +4,10 @@ https://github.com/yshui/compton/commit/ Avoid using 10bit FBConfigs Fix weird color issue with Mesa 18.0 ---- src/opengl.c.orig Mon Oct 21 16:17:01 2013 -+++ src/opengl.c Tue Feb 12 21:14:44 2019 -@@ -497,6 +497,16 @@ +Index: src/opengl.c +--- src/opengl.c.orig ++++ src/opengl.c +@@ -497,6 +497,16 @@ glx_cmp_fbconfig(session_t *ps, return -1; if (!pfbc_b) return 1;