Re: fix x11/compton with Mesa 18

2019-02-13 Thread Thomas Frohwein
On Tue, Feb 12, 2019 at 09:27:40PM +0100, Matthieu Herrb wrote:
> Hi,
> 
> the patch below (from https://github.com/yshui/compton/commit/bf29b2d)
> should fix weird color issues with mesa 18.3 in compton reported by
> Erling Westenvik.
> 
> Thanks to Thomas Frohwein for the hint.
> 
> ok?

Good job finding this fix! I didn't see it (and was too content with xrender).
ok thfr@, cc'ing maintainer

> 
> Index: Makefile
> ===
> RCS file: /cvs/OpenBSD/ports/x11/compton/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 Makefile
> --- Makefile  27 Jun 2018 21:04:07 -  1.5
> +++ Makefile  12 Feb 2019 20:17:27 -
> @@ -5,7 +5,7 @@ COMMENT = lightweight compositor for X, 
>  V =  0.1_beta2
>  PKGNAME =compton-${V}
>  DISTNAME =   compton-git-v0.1_beta2-2013-10-21
> -REVISION =   2
> +REVISION =   3
>  
>  CATEGORIES = x11
>  
> Index: patches/patch-src_opengl_c
> ===
> RCS file: patches/patch-src_opengl_c
> diff -N patches/patch-src_opengl_c
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-src_opengl_c12 Feb 2019 20:17:03 -
> @@ -0,0 +1,25 @@
> +$OpenBSD$
> +
> +https://github.com/yshui/compton/commit/bf29b2d
> +Avoid using 10bit FBConfigs
> +Fix weird color issue with Mesa 18.0
> +
> +--- src/opengl.c.origMon Oct 21 16:17:01 2013
>  src/opengl.c Tue Feb 12 21:14:44 2019
> +@@ -497,6 +497,16 @@
> + return -1;
> +   if (!pfbc_b)
> + return 1;
> ++  int tmpattr;
> ++
> ++  // Avoid 10-bit colors
> ++  glXGetFBConfigAttrib(ps->dpy, pfbc_a->cfg, GLX_RED_SIZE, );
> ++  if (tmpattr != 8)
> ++return -1;
> ++
> ++  glXGetFBConfigAttrib(ps->dpy, pfbc_b->cfg, GLX_RED_SIZE, );
> ++  if (tmpattr != 8)
> ++return 1;
> + 
> + #define P_CMPATTR_LT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
> pfbc_a, pfbc_b, (attr return -result; }
> + #define P_CMPATTR_GT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
> pfbc_a, pfbc_b, (attr return result; }
> 
> -- 
> Matthieu Herrb



Re: fix x11/compton with Mesa 18

2019-02-12 Thread Erling Westenvik
On Tue, Feb 12, 2019 at 09:27:40PM +0100, Matthieu Herrb wrote:
> the patch below (from https://github.com/yshui/compton/commit/bf29b2d)
> should fix weird color issues with mesa 18.3 in compton reported by
> Erling Westenvik.
> 
> Thanks to Thomas Frohwein for the hint.

Confirmed to fix the problem on my system. Thanks both of you!

Erling Westenvik

> ok?
> 
> Index: Makefile
> ===
> RCS file: /cvs/OpenBSD/ports/x11/compton/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 Makefile
> --- Makefile  27 Jun 2018 21:04:07 -  1.5
> +++ Makefile  12 Feb 2019 20:17:27 -
> @@ -5,7 +5,7 @@ COMMENT = lightweight compositor for X, 
>  V =  0.1_beta2
>  PKGNAME =compton-${V}
>  DISTNAME =   compton-git-v0.1_beta2-2013-10-21
> -REVISION =   2
> +REVISION =   3
>  
>  CATEGORIES = x11
>  
> Index: patches/patch-src_opengl_c
> ===
> RCS file: patches/patch-src_opengl_c
> diff -N patches/patch-src_opengl_c
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-src_opengl_c12 Feb 2019 20:17:03 -
> @@ -0,0 +1,25 @@
> +$OpenBSD$
> +
> +https://github.com/yshui/compton/commit/bf29b2d
> +Avoid using 10bit FBConfigs
> +Fix weird color issue with Mesa 18.0
> +
> +--- src/opengl.c.origMon Oct 21 16:17:01 2013
>  src/opengl.c Tue Feb 12 21:14:44 2019
> +@@ -497,6 +497,16 @@
> + return -1;
> +   if (!pfbc_b)
> + return 1;
> ++  int tmpattr;
> ++
> ++  // Avoid 10-bit colors
> ++  glXGetFBConfigAttrib(ps->dpy, pfbc_a->cfg, GLX_RED_SIZE, );
> ++  if (tmpattr != 8)
> ++return -1;
> ++
> ++  glXGetFBConfigAttrib(ps->dpy, pfbc_b->cfg, GLX_RED_SIZE, );
> ++  if (tmpattr != 8)
> ++return 1;
> + 
> + #define P_CMPATTR_LT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
> pfbc_a, pfbc_b, (attr return -result; }
> + #define P_CMPATTR_GT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
> pfbc_a, pfbc_b, (attr return result; }
> 
> -- 
> Matthieu Herrb



fix x11/compton with Mesa 18

2019-02-12 Thread Matthieu Herrb
Hi,

the patch below (from https://github.com/yshui/compton/commit/bf29b2d)
should fix weird color issues with mesa 18.3 in compton reported by
Erling Westenvik.

Thanks to Thomas Frohwein for the hint.

ok?

Index: Makefile
===
RCS file: /cvs/OpenBSD/ports/x11/compton/Makefile,v
retrieving revision 1.5
diff -u -p -u -r1.5 Makefile
--- Makefile27 Jun 2018 21:04:07 -  1.5
+++ Makefile12 Feb 2019 20:17:27 -
@@ -5,7 +5,7 @@ COMMENT =   lightweight compositor for X, 
 V =0.1_beta2
 PKGNAME =  compton-${V}
 DISTNAME = compton-git-v0.1_beta2-2013-10-21
-REVISION = 2
+REVISION = 3
 
 CATEGORIES =   x11
 
Index: patches/patch-src_opengl_c
===
RCS file: patches/patch-src_opengl_c
diff -N patches/patch-src_opengl_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_opengl_c  12 Feb 2019 20:17:03 -
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+https://github.com/yshui/compton/commit/bf29b2d
+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 @@
+ return -1;
+   if (!pfbc_b)
+ return 1;
++  int tmpattr;
++
++  // Avoid 10-bit colors
++  glXGetFBConfigAttrib(ps->dpy, pfbc_a->cfg, GLX_RED_SIZE, );
++  if (tmpattr != 8)
++return -1;
++
++  glXGetFBConfigAttrib(ps->dpy, pfbc_b->cfg, GLX_RED_SIZE, );
++  if (tmpattr != 8)
++return 1;
+ 
+ #define P_CMPATTR_LT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
pfbc_a, pfbc_b, (attr return -result; }
+ #define P_CMPATTR_GT(attr) { if ((result = glx_cmp_fbconfig_cmpattr(ps, 
pfbc_a, pfbc_b, (attr return result; }

-- 
Matthieu Herrb