vnd: Disable GLX if no vendors successfully initialized

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2018-04-23 16:19:14 -04:00
parent fc25bceb51
commit 818885e619
3 changed files with 12 additions and 3 deletions

View File

@ -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.

View File

@ -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

View File

@ -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);