1 $NetBSD: patch-src_glx_glxext.c,v 1.2 2022/03/13 15:50:05 tnn Exp $
3 * Patch from FreeBSD ports graphics/mesa-dri 18.0.0
5 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
7 * Extended to DragonFly and NetBSD. Other OSes might need this as well.
9 * Added logging statements to note dri3 initialization being invoked.
11 --- src/glx/glxext.c.orig 2021-07-14 20:04:55.750010300 +0000
13 @@ -819,7 +819,11 @@ AllocAndFetchScreenConfigs(Display * dpy
14 #if defined(GLX_USE_DRM)
15 #if defined(HAVE_DRI3)
16 if (priv->dri3Display)
17 + InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: priv->dri3Display\n");
18 + if (priv->dri3Display)
19 psc = (*priv->dri3Display->createScreen) (i, priv);
20 + if (psc != NULL && priv->dri3Display)
21 + InfoMessageF("glxext.c: AllocAndFetchScreenConfigs: psc set by priv->dri3Display\n");
22 #endif /* HAVE_DRI3 */
23 if (psc == NULL && priv->dri2Display)
24 psc = (*priv->dri2Display->createScreen) (i, priv);
25 @@ -925,8 +929,13 @@ __glXInitialize(Display * dpy)
26 #if defined(GLX_USE_DRM)
27 if (glx_direct && glx_accel) {
28 #if defined(HAVE_DRI3)
29 - if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
30 +#if ((defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)) || defined(__DragonFly__) || defined(__NetBSD__)
31 + if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
33 + if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) {
34 + InfoMessageF("glxext.c: __glxInitialize: dpyPriv->dri3Display = dri3_create_display\n");
35 dpyPriv->dri3Display = dri3_create_display(dpy);
37 #endif /* HAVE_DRI3 */
38 if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
39 dpyPriv->dri2Display = dri2CreateDisplay(dpy);