summaryrefslogtreecommitdiff
path: root/lib/mesa/src/glx
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:34:57 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:34:57 +0000
commit32aeb3c41fedbbd7b11aacfec48e8f699d16bff0 (patch)
treefc5893a490729ebf6b87b83eebf5d4ebfdfccf27 /lib/mesa/src/glx
parent286ec9d289bada8abb84753c461cfa3432866e98 (diff)
Import Mesa 23.1.9
Diffstat (limited to 'lib/mesa/src/glx')
-rw-r--r--lib/mesa/src/glx/apple/apple_glapi.c1
-rw-r--r--lib/mesa/src/glx/apple/apple_xgl_api_read.c1
-rw-r--r--lib/mesa/src/glx/apple/apple_xgl_api_stereo.c1
-rw-r--r--lib/mesa/src/glx/apple/apple_xgl_api_viewport.c1
-rw-r--r--lib/mesa/src/glx/applegl_glx.c10
-rw-r--r--lib/mesa/src/glx/clientattrib.c25
-rw-r--r--lib/mesa/src/glx/clientinfo.c15
-rw-r--r--lib/mesa/src/glx/compsize.c25
-rw-r--r--lib/mesa/src/glx/create_context.c49
-rw-r--r--lib/mesa/src/glx/dri2_priv.h3
-rw-r--r--lib/mesa/src/glx/dri_common.h3
-rw-r--r--lib/mesa/src/glx/dri_common_query_renderer.c4
-rw-r--r--lib/mesa/src/glx/drisw_priv.h2
-rw-r--r--lib/mesa/src/glx/driwindows_glx.c5
-rw-r--r--lib/mesa/src/glx/eval.c25
-rw-r--r--lib/mesa/src/glx/glxext.c105
-rw-r--r--lib/mesa/src/glx/glxextensions.c10
-rw-r--r--lib/mesa/src/glx/indirect_glx.c74
-rw-r--r--lib/mesa/src/glx/packrender.h25
-rw-r--r--lib/mesa/src/glx/packsingle.h25
-rw-r--r--lib/mesa/src/glx/pixel.c25
-rw-r--r--lib/mesa/src/glx/pixelstore.c25
-rw-r--r--lib/mesa/src/glx/render2.c25
-rw-r--r--lib/mesa/src/glx/renderpix.c25
-rw-r--r--lib/mesa/src/glx/single2.c25
-rw-r--r--lib/mesa/src/glx/singlepix.c25
-rw-r--r--lib/mesa/src/glx/tests/clientinfo_unittest.cpp52
-rw-r--r--lib/mesa/src/glx/tests/create_context_unittest.cpp3
-rw-r--r--lib/mesa/src/glx/tests/fake_glx_screen.h1
-rw-r--r--lib/mesa/src/glx/tests/indirect_api.cpp2
-rw-r--r--lib/mesa/src/glx/tests/meson.build2
-rw-r--r--lib/mesa/src/glx/vertarr.c25
-rw-r--r--lib/mesa/src/glx/xfont.c2
33 files changed, 142 insertions, 504 deletions
diff --git a/lib/mesa/src/glx/apple/apple_glapi.c b/lib/mesa/src/glx/apple/apple_glapi.c
index f2248ab01..075231d3f 100644
--- a/lib/mesa/src/glx/apple/apple_glapi.c
+++ b/lib/mesa/src/glx/apple/apple_glapi.c
@@ -38,7 +38,6 @@
#include <GL/gl.h>
-#include "main/glheader.h"
#include "glapi.h"
#include "glapitable.h"
diff --git a/lib/mesa/src/glx/apple/apple_xgl_api_read.c b/lib/mesa/src/glx/apple/apple_xgl_api_read.c
index 4a9a20d34..612f5f7b0 100644
--- a/lib/mesa/src/glx/apple/apple_xgl_api_read.c
+++ b/lib/mesa/src/glx/apple/apple_xgl_api_read.c
@@ -37,7 +37,6 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
-#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
diff --git a/lib/mesa/src/glx/apple/apple_xgl_api_stereo.c b/lib/mesa/src/glx/apple/apple_xgl_api_stereo.c
index 0d2f6fa65..11a17a86a 100644
--- a/lib/mesa/src/glx/apple/apple_xgl_api_stereo.c
+++ b/lib/mesa/src/glx/apple/apple_xgl_api_stereo.c
@@ -40,7 +40,6 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
-#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
diff --git a/lib/mesa/src/glx/apple/apple_xgl_api_viewport.c b/lib/mesa/src/glx/apple/apple_xgl_api_viewport.c
index c40061df4..ccc896ef1 100644
--- a/lib/mesa/src/glx/apple/apple_xgl_api_viewport.c
+++ b/lib/mesa/src/glx/apple/apple_xgl_api_viewport.c
@@ -30,7 +30,6 @@
#include "glxclient.h"
#include "apple_glx_context.h"
#include "apple_xgl_api.h"
-#include "main/glheader.h"
#include "glapitable.h"
extern struct _glapi_table * __ogl_framework_api;
diff --git a/lib/mesa/src/glx/applegl_glx.c b/lib/mesa/src/glx/applegl_glx.c
index d8b2d13dd..0b2e722b6 100644
--- a/lib/mesa/src/glx/applegl_glx.c
+++ b/lib/mesa/src/glx/applegl_glx.c
@@ -50,13 +50,13 @@ applegl_destroy_context(struct glx_context *gc)
static int
applegl_bind_context(
- struct glx_context *gc, struct glx_context *old,
+ struct glx_context *gc,
GLXDrawable draw, GLXDrawable read)
{
Display *dpy = gc->psc->dpy;
bool error = apple_glx_make_current_context(
dpy,
- (old && old != &dummyContext) ? old->driContext : NULL,
+ NULL,
gc ? gc->driContext : NULL, draw);
apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO");
@@ -69,7 +69,7 @@ applegl_bind_context(
}
static void
-applegl_unbind_context(struct glx_context *gc, struct glx_context *new)
+applegl_unbind_context(struct glx_context *gc)
{
Display *dpy;
bool error;
@@ -78,10 +78,6 @@ applegl_unbind_context(struct glx_context *gc, struct glx_context *new)
if (!gc)
return;
- /* If we have a new context, keep this one around and remove it during bind. */
- if (new)
- return;
-
dpy = gc->psc->dpy;
error = apple_glx_make_current_context(
diff --git a/lib/mesa/src/glx/clientattrib.c b/lib/mesa/src/glx/clientattrib.c
index 181ad0604..e0ff57947 100644
--- a/lib/mesa/src/glx/clientattrib.c
+++ b/lib/mesa/src/glx/clientattrib.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include <assert.h>
diff --git a/lib/mesa/src/glx/clientinfo.c b/lib/mesa/src/glx/clientinfo.c
index 9ea7cb2d8..31c62ad98 100644
--- a/lib/mesa/src/glx/clientinfo.c
+++ b/lib/mesa/src/glx/clientinfo.c
@@ -28,8 +28,8 @@
#include <xcb/glx.h>
#include <X11/Xlib-xcb.h>
-_X_HIDDEN void
-__glX_send_client_info(struct glx_display *glx_dpy)
+void
+glxSendClientInfo(struct glx_display *glx_dpy, int screen)
{
const unsigned ext_length = strlen("GLX_ARB_create_context");
const unsigned prof_length = strlen("_profile");
@@ -96,7 +96,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
/* There are three possible flavors of the client info structure that the
* client could send to the server. The version sent depends on the
* combination of GLX versions and extensions supported by the client and
- * the server. This client only supports GLX major version 1.
+ * the server. This client only supports GLX version >= 1.3.
*
* Server supports Client sends
* ----------------------------------------------------------------------
@@ -117,9 +117,6 @@ __glX_send_client_info(struct glx_display *glx_dpy)
* requirement in this case does not seem like a limitation.
*/
- if (glx_dpy->minorVersion == 0)
- return;
-
/* Determine whether any screen on the server supports either of the
* create-context extensions.
*/
@@ -155,11 +152,7 @@ __glX_send_client_info(struct glx_display *glx_dpy)
}
}
- gl_extension_string = __glXGetClientGLExtensionString();
- if (gl_extension_string == NULL) {
- return;
- }
-
+ gl_extension_string = __glXGetClientGLExtensionString(screen);
gl_extension_length = strlen(gl_extension_string) + 1;
c = XGetXCBConnection(glx_dpy->dpy);
diff --git a/lib/mesa/src/glx/compsize.c b/lib/mesa/src/glx/compsize.c
index 805591914..f84bb5b4d 100644
--- a/lib/mesa/src/glx/compsize.c
+++ b/lib/mesa/src/glx/compsize.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include <GL/gl.h>
diff --git a/lib/mesa/src/glx/create_context.c b/lib/mesa/src/glx/create_context.c
index 471321641..1c2bbb1cf 100644
--- a/lib/mesa/src/glx/create_context.c
+++ b/lib/mesa/src/glx/create_context.c
@@ -54,7 +54,7 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
struct glx_screen *psc;
xcb_generic_error_t *err;
xcb_void_cookie_t cookie;
- unsigned dummy_err = 0;
+ unsigned error = BadImplementation;
uint32_t xid, share_xid;
int screen = -1;
@@ -100,25 +100,35 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
direct = true;
}
-
+#ifdef GLX_USE_APPLEGL
+ gc = applegl_create_context(psc, cfg, share, 0);
+#else
if (direct && psc->vtable->create_context_attribs) {
- /* GLX drops the error returned by the driver. The expectation is that
- * an error will also be returned by the server. The server's error
- * will be delivered to the application.
- */
gc = psc->vtable->create_context_attribs(psc, cfg, share, num_attribs,
- (const uint32_t *) attrib_list,
- &dummy_err);
+ (const uint32_t *) attrib_list,
+ &error);
+ } else if (!direct) {
+ gc = indirect_create_context_attribs(psc, cfg, share, num_attribs,
+ (const uint32_t *) attrib_list,
+ &error);
}
+#endif
if (gc == NULL) {
-#ifdef GLX_USE_APPLEGL
- gc = applegl_create_context(psc, cfg, share, 0);
-#else
- gc = indirect_create_context_attribs(psc, cfg, share, num_attribs,
- (const uint32_t *) attrib_list,
- &dummy_err);
-#endif
+ /* Increment dpy->request in order to give a unique serial number to the error.
+ * This may break creating contexts on some video cards, if libx11 <1.7.4 is used.
+ * However, this fixes creating contexts (on some video cards) if libx11 >=1.7.4 is used.
+ */
+ XNoOp(dpy);
+ /* -1 isn't a legal XID, which is sort of the point, we've failed
+ * before we even got to XID allocation.
+ */
+ if (error == GLXBadContext || error == GLXBadFBConfig ||
+ error == GLXBadProfileARB)
+ __glXSendError(dpy, error, -1, 0, False);
+ else
+ __glXSendError(dpy, error, -1, 0, True);
+ return NULL;
}
xid = xcb_generate_id(c);
@@ -150,15 +160,6 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
__glXSendErrorForXcb(dpy, err);
free(err);
- } else if (!gc) {
- /* the server thought the context description was okay, but we failed
- * somehow on the client side. clean up the server resource and panic.
- */
- xcb_glx_destroy_context(c, xid);
- /* increment dpy->request in order to give a unique serial number to the
- * error */
- XNoOp(dpy);
- __glXSendError(dpy, GLXBadFBConfig, xid, 0, False);
} else {
gc->xid = xid;
gc->share_xid = share_xid;
diff --git a/lib/mesa/src/glx/dri2_priv.h b/lib/mesa/src/glx/dri2_priv.h
index e8f1b64b8..837709fa5 100644
--- a/lib/mesa/src/glx/dri2_priv.h
+++ b/lib/mesa/src/glx/dri2_priv.h
@@ -37,6 +37,8 @@
extern "C" {
#endif
+#include "GL/internal/mesa_interface.h"
+
struct dri2_screen {
struct glx_screen base;
@@ -44,6 +46,7 @@ struct dri2_screen {
__GLXDRIscreen vtable;
const __DRIdri2Extension *dri2;
const __DRIcoreExtension *core;
+ const __DRImesaCoreExtension *mesa;
const __DRI2flushExtension *f;
const __DRI2configQueryExtension *config;
diff --git a/lib/mesa/src/glx/dri_common.h b/lib/mesa/src/glx/dri_common.h
index 000282032..d762308a4 100644
--- a/lib/mesa/src/glx/dri_common.h
+++ b/lib/mesa/src/glx/dri_common.h
@@ -77,6 +77,9 @@ struct dri_ctx_attribs {
int no_error;
};
+extern unsigned
+dri_context_error_to_glx_error(unsigned error);
+
extern int
dri_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
struct dri_ctx_attribs *dca);
diff --git a/lib/mesa/src/glx/dri_common_query_renderer.c b/lib/mesa/src/glx/dri_common_query_renderer.c
index 672e3bf31..6d2a06689 100644
--- a/lib/mesa/src/glx/dri_common_query_renderer.c
+++ b/lib/mesa/src/glx/dri_common_query_renderer.c
@@ -137,7 +137,7 @@ dri3_query_renderer_integer(struct glx_screen *base, int attribute,
if (psc->rendererQuery == NULL)
return -1;
- ret = psc->rendererQuery->queryInteger(psc->driScreen, dri_attribute,
+ ret = psc->rendererQuery->queryInteger(psc->driScreenRenderGPU, dri_attribute,
value);
dri_convert_context_profile_bits(attribute, value);
@@ -159,7 +159,7 @@ dri3_query_renderer_string(struct glx_screen *base, int attribute,
if (psc->rendererQuery == NULL)
return -1;
- return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value);
+ return psc->rendererQuery->queryString(psc->driScreenRenderGPU, dri_attribute, value);
}
#endif /* HAVE_DRI3 */
diff --git a/lib/mesa/src/glx/drisw_priv.h b/lib/mesa/src/glx/drisw_priv.h
index a75f2c5f5..d1f445bc0 100644
--- a/lib/mesa/src/glx/drisw_priv.h
+++ b/lib/mesa/src/glx/drisw_priv.h
@@ -28,6 +28,7 @@
#include <X11/extensions/XShm.h>
#include "kopper_interface.h"
+#include "GL/internal/mesa_interface.h"
struct drisw_display
{
@@ -42,6 +43,7 @@ struct drisw_screen
__DRIscreen *driScreen;
__GLXDRIscreen vtable;
const __DRIcoreExtension *core;
+ const __DRImesaCoreExtension *mesa;
const __DRIswrastExtension *swrast;
const __DRIkopperExtension *kopper;
const __DRI2flushExtension *f;
diff --git a/lib/mesa/src/glx/driwindows_glx.c b/lib/mesa/src/glx/driwindows_glx.c
index 3eb961dae..0c5540f38 100644
--- a/lib/mesa/src/glx/driwindows_glx.c
+++ b/lib/mesa/src/glx/driwindows_glx.c
@@ -79,8 +79,7 @@ driwindows_destroy_context(struct glx_context *context)
}
static int
-driwindows_bind_context(struct glx_context *context, struct glx_context *old,
- GLXDrawable draw, GLXDrawable read)
+driwindows_bind_context(struct glx_context *context, GLXDrawable draw, GLXDrawable read)
{
struct driwindows_context *pcp = (struct driwindows_context *) context;
struct driwindows_drawable *pdraw, *pread;
@@ -101,7 +100,7 @@ driwindows_bind_context(struct glx_context *context, struct glx_context *old,
}
static void
-driwindows_unbind_context(struct glx_context *context, struct glx_context *new)
+driwindows_unbind_context(struct glx_context *context)
{
struct driwindows_context *pcp = (struct driwindows_context *) context;
diff --git a/lib/mesa/src/glx/eval.c b/lib/mesa/src/glx/eval.c
index 226fb7df2..78963a540 100644
--- a/lib/mesa/src/glx/eval.c
+++ b/lib/mesa/src/glx/eval.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "packrender.h"
diff --git a/lib/mesa/src/glx/glxext.c b/lib/mesa/src/glx/glxext.c
index 4d59ec28b..fb4a77045 100644
--- a/lib/mesa/src/glx/glxext.c
+++ b/lib/mesa/src/glx/glxext.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
/**
@@ -285,6 +262,9 @@ glx_display_free(struct glx_display *priv)
gc = __glXGetCurrentContext();
if (priv->dpy == gc->currentDpy) {
+ if (gc != &dummyContext)
+ gc->vtable->unbind(gc);
+
gc->vtable->destroy(gc);
__glXSetCurrentContextNull();
}
@@ -303,22 +283,22 @@ glx_display_free(struct glx_display *priv)
/* Free the direct rendering per display data */
if (priv->driswDisplay)
- (*priv->driswDisplay->destroyDisplay) (priv->driswDisplay);
+ priv->driswDisplay->destroyDisplay(priv->driswDisplay);
priv->driswDisplay = NULL;
#if defined (GLX_USE_DRM)
if (priv->dri2Display)
- (*priv->dri2Display->destroyDisplay) (priv->dri2Display);
+ priv->dri2Display->destroyDisplay(priv->dri2Display);
priv->dri2Display = NULL;
if (priv->dri3Display)
- (*priv->dri3Display->destroyDisplay) (priv->dri3Display);
+ priv->dri3Display->destroyDisplay(priv->dri3Display);
priv->dri3Display = NULL;
#endif /* GLX_USE_DRM */
#if defined(GLX_USE_WINDOWSGL)
if (priv->windowsdriDisplay)
- (*priv->windowsdriDisplay->destroyDisplay) (priv->windowsdriDisplay);
+ priv->windowsdriDisplay->destroyDisplay(priv->windowsdriDisplay);
priv->windowsdriDisplay = NULL;
#endif /* GLX_USE_WINDOWSGL */
@@ -674,18 +654,15 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
m = modes;
for (i = 0; i < nvisuals; i++) {
_XRead(dpy, (char *) props, prop_size);
-#ifdef GLX_USE_APPLEGL
- /* Older X servers don't send this so we default it here. */
- m->drawableType = GLX_WINDOW_BIT;
-#else
- /*
- * The XQuartz 2.3.2.1 X server doesn't set this properly, so
- * set the proper bits here.
- * AppleSGLX supports windows, pixmaps, and pbuffers with all config.
+ /* If this is GLXGetVisualConfigs then the reply will not include
+ * any drawable type info, but window support is implied because
+ * that's what a Visual describes, and pixmap support is implied
+ * because you almost certainly have a pixmap format corresponding
+ * to your visual format.
*/
- m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT;
-#endif
- __glXInitializeVisualConfigFromTags(m, nprops, props,
+ if (!tagged_only)
+ m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
+ __glXInitializeVisualConfigFromTags(m, nprops, props,
tagged_only, GL_TRUE);
m->screen = screen;
m = m->next;
@@ -730,8 +707,6 @@ static GLboolean
getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen)
{
xGLXGetFBConfigsReq *fb_req;
- xGLXGetFBConfigsSGIXReq *sgi_req;
- xGLXVendorPrivateWithReplyReq *vpreq;
xGLXGetFBConfigsReply reply;
Display *dpy = priv->dpy;
@@ -744,24 +719,10 @@ getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen)
LockDisplay(dpy);
psc->configs = NULL;
- if (priv->minorVersion >= 3) {
- GetReq(GLXGetFBConfigs, fb_req);
- fb_req->reqType = priv->codes.major_opcode;
- fb_req->glxCode = X_GLXGetFBConfigs;
- fb_req->screen = screen;
- }
- else if (strstr(psc->serverGLXexts, "GLX_SGIX_fbconfig") != NULL) {
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXGetFBConfigsSGIXReq -
- sz_xGLXVendorPrivateWithReplyReq, vpreq);
- sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq;
- sgi_req->reqType = priv->codes.major_opcode;
- sgi_req->glxCode = X_GLXVendorPrivateWithReply;
- sgi_req->vendorCode = X_GLXvop_GetFBConfigsSGIX;
- sgi_req->screen = screen;
- }
- else
- goto out;
+ GetReq(GLXGetFBConfigs, fb_req);
+ fb_req->reqType = priv->codes.major_opcode;
+ fb_req->glxCode = X_GLXGetFBConfigs;
+ fb_req->screen = screen;
if (!_XReply(dpy, (xReply *) & reply, 0, False))
goto out;
@@ -836,29 +797,37 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
#if defined(GLX_USE_DRM)
#if defined(HAVE_DRI3)
if (priv->dri3Display)
- psc = (*priv->dri3Display->createScreen) (i, priv);
+ psc = priv->dri3Display->createScreen(i, priv);
#endif /* HAVE_DRI3 */
if (psc == NULL && priv->dri2Display)
- psc = (*priv->dri2Display->createScreen) (i, priv);
+ psc = priv->dri2Display->createScreen(i, priv);
#endif /* GLX_USE_DRM */
#ifdef GLX_USE_WINDOWSGL
if (psc == NULL && priv->windowsdriDisplay)
- psc = (*priv->windowsdriDisplay->createScreen) (i, priv);
+ psc = priv->windowsdriDisplay->createScreen(i, priv);
#endif
if (psc == NULL && priv->driswDisplay)
- psc = (*priv->driswDisplay->createScreen) (i, priv);
+ psc = priv->driswDisplay->createScreen(i, priv);
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
+ bool indirect = false;
+
#if defined(GLX_USE_APPLEGL)
if (psc == NULL)
psc = applegl_create_screen(i, priv);
#else
if (psc == NULL)
- psc = indirect_create_screen(i, priv);
+ {
+ psc = indirect_create_screen(i, priv);
+ indirect = true;
+ }
#endif
priv->screens[i] = psc;
+
+ if(indirect) /* Load extensions required only for indirect glx */
+ glxSendClientInfo(priv, i);
}
SyncHandle();
return GL_TRUE;
@@ -899,13 +868,11 @@ __glXInitialize(Display * dpy)
dpyPriv->codes = *codes;
dpyPriv->dpy = dpy;
- /* This GLX implementation requires X_GLXQueryExtensionsString
- * and X_GLXQueryServerString, which are new in GLX 1.1.
- */
+ /* This GLX implementation requires GLX 1.3 */
if (!QueryVersion(dpy, dpyPriv->codes.major_opcode,
&majorVersion, &dpyPriv->minorVersion)
|| (majorVersion != 1)
- || (majorVersion == 1 && dpyPriv->minorVersion < 1)) {
+ || (majorVersion == 1 && dpyPriv->minorVersion < 3)) {
free(dpyPriv);
return NULL;
}
@@ -970,7 +937,7 @@ __glXInitialize(Display * dpy)
return NULL;
}
- __glX_send_client_info(dpyPriv);
+ glxSendClientInfo(dpyPriv, -1);
/* Grab the lock again and add the dispay private, unless somebody
* beat us to initializing on this display in the meantime. */
diff --git a/lib/mesa/src/glx/glxextensions.c b/lib/mesa/src/glx/glxextensions.c
index d72d286eb..b731042cd 100644
--- a/lib/mesa/src/glx/glxextensions.c
+++ b/lib/mesa/src/glx/glxextensions.c
@@ -35,12 +35,12 @@
#include "glxextensions.h"
#include "util/driconf.h"
+#include "util/macros.h"
#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0)
-#define CONCAT(a,b) a ## b
-#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit)
+#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, PASTE2(n,_bit)
#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit
#define Y 1
#define N 0
@@ -192,7 +192,6 @@ static const struct extension_info known_gl_extensions[] = {
{ GL(EXT_texture_lod), N, N },
{ GL(EXT_texture_lod_bias), N, N },
{ GL(EXT_texture_mirror_clamp), N, N },
- { GL(EXT_texture_object), N, N },
{ GL(EXT_texture_rectangle), N, N },
{ GL(EXT_vertex_array), N, N },
{ GL(3DFX_texture_compression_FXT1), N, N },
@@ -763,7 +762,10 @@ __glXCalculateUsableGLExtensions(struct glx_context * gc,
* supported by the client to the server.
*/
char *
-__glXGetClientGLExtensionString(void)
+__glXGetClientGLExtensionString(int screen)
{
+ if (screen < 0)
+ return strdup("");
+
return __glXGetStringFromTable(known_gl_extensions, NULL);
}
diff --git a/lib/mesa/src/glx/indirect_glx.c b/lib/mesa/src/glx/indirect_glx.c
index 3e39a801f..16dacc352 100644
--- a/lib/mesa/src/glx/indirect_glx.c
+++ b/lib/mesa/src/glx/indirect_glx.c
@@ -100,40 +100,15 @@ SendMakeCurrentRequest(Display * dpy, GLXContextID gc_id,
req->oldContextTag = gc_tag;
}
else {
- struct glx_display *priv = __glXInitialize(dpy);
+ xGLXMakeContextCurrentReq *req;
- /* If the server can support the GLX 1.3 version, we should
- * perfer that. Not only that, some servers support GLX 1.3 but
- * not the SGI extension.
- */
-
- if (priv->minorVersion >= 3) {
- xGLXMakeContextCurrentReq *req;
-
- GetReq(GLXMakeContextCurrent, req);
- req->reqType = opcode;
- req->glxCode = X_GLXMakeContextCurrent;
- req->drawable = draw;
- req->readdrawable = read;
- req->context = gc_id;
- req->oldContextTag = gc_tag;
- }
- else {
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXMakeCurrentReadSGIReq *req;
-
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXMakeCurrentReadSGIReq -
- sz_xGLXVendorPrivateWithReplyReq, vpreq);
- req = (xGLXMakeCurrentReadSGIReq *) vpreq;
- req->reqType = opcode;
- req->glxCode = X_GLXVendorPrivateWithReply;
- req->vendorCode = X_GLXvop_MakeCurrentReadSGI;
- req->drawable = draw;
- req->readable = read;
- req->context = gc_id;
- req->oldContextTag = gc_tag;
- }
+ GetReq(GLXMakeContextCurrent, req);
+ req->reqType = opcode;
+ req->glxCode = X_GLXMakeContextCurrent;
+ req->drawable = draw;
+ req->readdrawable = read;
+ req->context = gc_id;
+ req->oldContextTag = gc_tag;
}
ret = _XReply(dpy, (xReply *) &reply, 0, False);
@@ -148,21 +123,13 @@ SendMakeCurrentRequest(Display * dpy, GLXContextID gc_id,
}
static int
-indirect_bind_context(struct glx_context *gc, struct glx_context *old,
+indirect_bind_context(struct glx_context *gc,
GLXDrawable draw, GLXDrawable read)
{
- GLXContextTag tag;
Display *dpy = gc->psc->dpy;
Bool sent;
- if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy) {
- tag = old->currentContextTag;
- old->currentContextTag = 0;
- } else {
- tag = 0;
- }
-
- sent = SendMakeCurrentRequest(dpy, gc->xid, tag, draw, read,
+ sent = SendMakeCurrentRequest(dpy, gc->xid, 0, draw, read,
&gc->currentContextTag);
if (sent) {
@@ -191,22 +158,12 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
}
static void
-indirect_unbind_context(struct glx_context *gc, struct glx_context *new)
+indirect_unbind_context(struct glx_context *gc)
{
Display *dpy = gc->psc->dpy;
- if (gc == new)
- return;
-
- /* We are either switching to no context, away from an indirect
- * context to a direct context or from one dpy to another and have
- * to send a request to the dpy to unbind the previous context.
- */
- if (!new || new->isDirect || new->psc->dpy != dpy) {
- SendMakeCurrentRequest(dpy, None, gc->currentContextTag, None, None,
- NULL);
- gc->currentContextTag = 0;
- }
+ SendMakeCurrentRequest(dpy, None, gc->currentContextTag, None, None, NULL);
+ gc->currentContextTag = 0;
}
static void
@@ -290,6 +247,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
opcode = __glXSetupForCommand(psc->dpy);
if (!opcode) {
+ *error = BadImplementation;
return NULL;
}
@@ -312,6 +270,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
if (mask != GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB ||
major != 1 ||
minor > 4) {
+ *error = GLXBadFBConfig;
return NULL;
}
@@ -322,6 +281,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
/* Allocate our context record */
gc = calloc(1, sizeof *gc);
if (!gc) {
+ *error = BadAlloc;
/* Out of memory */
return NULL;
}
@@ -334,6 +294,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
if (state == NULL) {
/* Out of memory */
+ *error = BadAlloc;
free(gc);
return NULL;
}
@@ -350,6 +311,7 @@ indirect_create_context_attribs(struct glx_screen *psc,
bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq;
gc->buf = malloc(bufSize);
if (!gc->buf) {
+ *error = BadAlloc;
free(gc->client_state_private);
free(gc);
return NULL;
diff --git a/lib/mesa/src/glx/packrender.h b/lib/mesa/src/glx/packrender.h
index 912c80415..43dd31261 100644
--- a/lib/mesa/src/glx/packrender.h
+++ b/lib/mesa/src/glx/packrender.h
@@ -5,30 +5,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "glxclient.h"
diff --git a/lib/mesa/src/glx/packsingle.h b/lib/mesa/src/glx/packsingle.h
index 403d11fab..9f87f117e 100644
--- a/lib/mesa/src/glx/packsingle.h
+++ b/lib/mesa/src/glx/packsingle.h
@@ -5,30 +5,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "packrender.h"
diff --git a/lib/mesa/src/glx/pixel.c b/lib/mesa/src/glx/pixel.c
index d508d6207..6766ccf35 100644
--- a/lib/mesa/src/glx/pixel.c
+++ b/lib/mesa/src/glx/pixel.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "packrender.h"
diff --git a/lib/mesa/src/glx/pixelstore.c b/lib/mesa/src/glx/pixelstore.c
index dc33ff300..efdcf9b5c 100644
--- a/lib/mesa/src/glx/pixelstore.c
+++ b/lib/mesa/src/glx/pixelstore.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "glxclient.h"
diff --git a/lib/mesa/src/glx/render2.c b/lib/mesa/src/glx/render2.c
index 3dfee7c46..372c7e45e 100644
--- a/lib/mesa/src/glx/render2.c
+++ b/lib/mesa/src/glx/render2.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#ifndef GLX_USE_APPLEGL
diff --git a/lib/mesa/src/glx/renderpix.c b/lib/mesa/src/glx/renderpix.c
index e367a9349..f8cc937c0 100644
--- a/lib/mesa/src/glx/renderpix.c
+++ b/lib/mesa/src/glx/renderpix.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
/*
diff --git a/lib/mesa/src/glx/single2.c b/lib/mesa/src/glx/single2.c
index 375367b4a..978f7a288 100644
--- a/lib/mesa/src/glx/single2.c
+++ b/lib/mesa/src/glx/single2.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include <stdio.h>
diff --git a/lib/mesa/src/glx/singlepix.c b/lib/mesa/src/glx/singlepix.c
index ad0fec5a7..f48802932 100644
--- a/lib/mesa/src/glx/singlepix.c
+++ b/lib/mesa/src/glx/singlepix.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "packsingle.h"
diff --git a/lib/mesa/src/glx/tests/clientinfo_unittest.cpp b/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
index e99960801..f7a147e3f 100644
--- a/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
+++ b/lib/mesa/src/glx/tests/clientinfo_unittest.cpp
@@ -210,7 +210,7 @@ xcb_glx_set_client_info_2arb(xcb_connection_t *c,
}
extern "C" char *
-__glXGetClientGLExtensionString()
+__glXGetClientGLExtensionString(int screen)
{
char *str = (char *) malloc(sizeof(ext));
@@ -279,7 +279,7 @@ glX_send_client_info_test::common_protocol_expected_false_test(unsigned major,
bool *value)
{
create_single_screen_display(major, minor, glx_ext);
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_FALSE(*value);
}
@@ -290,26 +290,18 @@ glX_send_client_info_test::common_protocol_expected_true_test(unsigned major,
bool *value)
{
create_single_screen_display(major, minor, glx_ext);
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_TRUE(*value);
}
-TEST_F(glX_send_client_info_test, doesnt_send_ClientInfo_for_1_0)
-{
- /* The glXClientInfo protocol was added in GLX 1.1. Verify that no
- * glXClientInfo is sent to a GLX server that only has GLX 1.0.
- */
- common_protocol_expected_false_test(1, 0, "", &ClientInfo_was_sent);
-}
-
-TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfoARB_for_1_0)
+TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfoARB_for_1_3)
{
/* The glXSetClientInfoARB protocol was added in GLX 1.4 with the
* GLX_ARB_create_context extension. Verify that no glXSetClientInfoARB is
- * sent to a GLX server that only has GLX 1.0 regardless of the extension
+ * sent to a GLX server that only has GLX 1.3 regardless of the extension
* setting.
*/
- common_protocol_expected_false_test(1, 0,
+ common_protocol_expected_false_test(1, 3,
"GLX_ARB_create_context",
&SetClientInfoARB_was_sent);
}
@@ -318,10 +310,10 @@ TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfoARB_for_1_1)
{
/* The glXSetClientInfoARB protocol was added in GLX 1.4 with the
* GLX_ARB_create_context extension. Verify that no glXSetClientInfoARB is
- * sent to a GLX server that only has GLX 1.0 regardless of the extension
+ * sent to a GLX server that only has GLX 1.3 regardless of the extension
* setting.
*/
- common_protocol_expected_false_test(1, 1,
+ common_protocol_expected_false_test(1, 3,
"GLX_ARB_create_context",
&SetClientInfoARB_was_sent);
}
@@ -379,14 +371,14 @@ TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfoARB_for_1_4_with_prof
&SetClientInfoARB_was_sent);
}
-TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfo2ARB_for_1_0)
+TEST_F(glX_send_client_info_test, doesnt_send_SetClientInfo2ARB_for_1_3)
{
/* The glXSetClientInfo2ARB protocol was added in GLX 1.4 with the
* GLX_ARB_create_context_profile extension. Verify that no
- * glXSetClientInfo2ARB is sent to a GLX server that only has GLX 1.0
+ * glXSetClientInfo2ARB is sent to a GLX server that only has GLX 1.3
* regardless of the extension setting.
*/
- common_protocol_expected_false_test(1, 0,
+ common_protocol_expected_false_test(1, 3,
"GLX_ARB_create_context_profile",
&SetClientInfo2ARB_was_sent);
}
@@ -502,14 +494,14 @@ TEST_F(glX_send_client_info_test, does_send_SetClientInfo2ARB_for_1_4_with_both_
TEST_F(glX_send_client_info_test, uses_correct_connection)
{
create_single_screen_display(1, 1, "");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ((xcb_connection_t *) 0xdeadbeef, connection_used);
}
TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string)
{
create_single_screen_display(1, 1, "");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
ASSERT_EQ((int) sizeof(ext), gl_ext_length);
ASSERT_NE((char *) 0, gl_ext_string);
@@ -519,7 +511,7 @@ TEST_F(glX_send_client_info_test, sends_correct_gl_extension_string)
TEST_F(glX_send_client_info_test, gl_versions_are_sane)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
ASSERT_NE(0, num_gl_versions);
@@ -560,7 +552,7 @@ TEST_F(glX_send_client_info_test, gl_versions_are_sane)
TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context_profile");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
ASSERT_NE(0, num_gl_versions);
@@ -629,7 +621,7 @@ TEST_F(glX_send_client_info_test, gl_versions_and_profiles_are_sane)
TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1)
{
create_single_screen_display(1, 1, "");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ(1, glx_major);
EXPECT_EQ(4, glx_minor);
@@ -638,7 +630,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_1)
TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4)
{
create_single_screen_display(1, 4, "");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ(1, glx_major);
EXPECT_EQ(4, glx_minor);
@@ -647,7 +639,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4)
TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ(1, glx_major);
EXPECT_EQ(4, glx_minor);
@@ -656,7 +648,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con
TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_context_profile)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context_profile");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ(1, glx_major);
EXPECT_EQ(4, glx_minor);
@@ -665,7 +657,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_4_with_ARB_create_con
TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5)
{
create_single_screen_display(1, 5, "");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
EXPECT_EQ(1, glx_major);
EXPECT_EQ(4, glx_minor);
@@ -674,7 +666,7 @@ TEST_F(glX_send_client_info_test, glx_version_is_1_4_for_1_5)
TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
ASSERT_NE(0, glx_ext_length);
ASSERT_NE((char *) 0, glx_ext_string);
@@ -700,7 +692,7 @@ TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context)
TEST_F(glX_send_client_info_test, glx_extensions_has_GLX_ARB_create_context_profile)
{
create_single_screen_display(1, 4, "GLX_ARB_create_context_profile");
- __glX_send_client_info(this->glx_dpy);
+ glxSendClientInfo(this->glx_dpy, -1);
ASSERT_NE(0, glx_ext_length);
ASSERT_NE((char *) 0, glx_ext_string);
diff --git a/lib/mesa/src/glx/tests/create_context_unittest.cpp b/lib/mesa/src/glx/tests/create_context_unittest.cpp
index f78a0f997..f17e805f7 100644
--- a/lib/mesa/src/glx/tests/create_context_unittest.cpp
+++ b/lib/mesa/src/glx/tests/create_context_unittest.cpp
@@ -43,7 +43,6 @@ glx_context_init(struct glx_context *gc,
struct glx_screen *psc, struct glx_config *config)
{
gc->majorOpcode = 123;
- gc->screen = psc->scr;
gc->psc = psc;
gc->config = config;
gc->isDirect = GL_TRUE;
@@ -507,7 +506,7 @@ TEST_F(glXCreateContextAttribARB_test, correct_context_screen_number)
struct glx_context *gc = (struct glx_context *) ctx;
- EXPECT_EQ(7, gc->screen);
+ EXPECT_EQ(7, gc->psc->scr);
}
TEST_F(glXCreateContextAttribARB_test, correct_context_screen_pointer)
diff --git a/lib/mesa/src/glx/tests/fake_glx_screen.h b/lib/mesa/src/glx/tests/fake_glx_screen.h
index 8e5c9cfef..9d1738d2a 100644
--- a/lib/mesa/src/glx/tests/fake_glx_screen.h
+++ b/lib/mesa/src/glx/tests/fake_glx_screen.h
@@ -74,7 +74,6 @@ public:
this->vtable = &fake_glx_context::vt;
this->majorOpcode = 123;
- this->screen = psc->scr;
this->psc = psc;
this->config = mode;
this->isDirect = false;
diff --git a/lib/mesa/src/glx/tests/indirect_api.cpp b/lib/mesa/src/glx/tests/indirect_api.cpp
index bbff9449a..f3bc792a0 100644
--- a/lib/mesa/src/glx/tests/indirect_api.cpp
+++ b/lib/mesa/src/glx/tests/indirect_api.cpp
@@ -44,7 +44,7 @@
*/
#include <gtest/gtest.h>
-#include "main/glheader.h"
+#include "util/glheader.h"
#include "../indirect_init.h"
#include "glapi/glapi.h"
#include "../../mesa/main/dispatch.h"
diff --git a/lib/mesa/src/glx/tests/meson.build b/lib/mesa/src/glx/tests/meson.build
index e068fe0c5..3f7064676 100644
--- a/lib/mesa/src/glx/tests/meson.build
+++ b/lib/mesa/src/glx/tests/meson.build
@@ -50,6 +50,6 @@ if with_shared_glapi
dependencies : [dep_libdrm, dep_glproto, dep_thread, idep_gtest]
),
suite : ['glx'],
- protocol : gtest_test_protocol,
+ protocol : 'gtest',
)
endif
diff --git a/lib/mesa/src/glx/vertarr.c b/lib/mesa/src/glx/vertarr.c
index 066bf59f7..a30b17fbb 100644
--- a/lib/mesa/src/glx/vertarr.c
+++ b/lib/mesa/src/glx/vertarr.c
@@ -2,30 +2,7 @@
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
+ * SPDX-License-Identifier: SGI-B-2.0
*/
#include "glxclient.h"
diff --git a/lib/mesa/src/glx/xfont.c b/lib/mesa/src/glx/xfont.c
index fdf8f9921..f7f112e34 100644
--- a/lib/mesa/src/glx/xfont.c
+++ b/lib/mesa/src/glx/xfont.c
@@ -231,7 +231,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
int i;
dpy = CC->currentDpy;
- screen = CC->screen;
+ screen = CC->psc->scr;
fs = XQueryFont(dpy, font);
if (!fs) {