Commit 818885e6 authored by Adam Jackson's avatar Adam Jackson 🎧
Browse files

vnd: Disable GLX if no vendors successfully initialized


Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent fc25bceb
......@@ -472,6 +472,8 @@ void GlxDispatchReset(void)
int GlxDispatchRequest(ClientPtr client)
{
REQUEST(xReq);
if (GlxExtensionEntry->base == 0)
return BadRequest;
if (stuff->data < OPCODE_ARRAY_LEN) {
if (dispatchFuncs[stuff->data] == NULL) {
// Try to find a dispatch stub.
......
......@@ -39,6 +39,7 @@
#include <GL/glxproto.h>
#include "vndservervendor.h"
ExtensionEntry *GlxExtensionEntry;
int GlxErrorBase = 0;
static CallbackListRec vndInitCallbackList;
static CallbackListPtr vndInitCallbackListPtr = &vndInitCallbackList;
......@@ -202,6 +203,7 @@ void
GlxExtensionInit(void)
{
ExtensionEntry *extEntry;
GlxExtensionEntry = NULL;
// Init private keys, per-screen data
if (!dixRegisterPrivateKey(&glvXGLVScreenPrivKey, PRIVATE_SCREEN, 0))
......@@ -228,8 +230,15 @@ GlxExtensionInit(void)
return;
}
GlxExtensionEntry = extEntry;
GlxErrorBase = extEntry->errorBase;
CallCallbacks(&vndInitCallbackListPtr, extEntry);
/* We'd better have found at least one vendor */
for (int i = 0; i < screenInfo.numScreens; i++)
if (GlxGetVendorForScreen(serverClient, screenInfo.screens[i]))
return;
extEntry->base = 0;
}
static int
......
......@@ -62,9 +62,7 @@ typedef struct GlxClientPrivRec {
extern int GlxErrorBase;
extern RESTYPE idResource;
// Defined in glxext.c.
const ExtensionEntry *GlxGetExtensionEntry(void);
extern ExtensionEntry *GlxExtensionEntry;
Bool GlxDispatchInit(void);
void GlxDispatchReset(void);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment