glx: move private definitions from vndserver.h to vndserver_priv.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1292>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-02-09 19:19:26 +01:00 committed by Marge Bot
parent eda769f34c
commit 28669adef8
5 changed files with 121 additions and 92 deletions

View File

@ -30,7 +30,7 @@
#include <dix-config.h> #include <dix-config.h>
#include "hashtable.h" #include "hashtable.h"
#include "vndserver.h" #include "vndserver_priv.h"
#include "vndservervendor.h" #include "vndservervendor.h"
/** /**

View File

@ -27,7 +27,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/ */
#include "vndserver.h" #include "vndserver_priv.h"
#include <string.h> #include <string.h>
#include <scrnintstr.h> #include <scrnintstr.h>

View File

@ -36,95 +36,6 @@
#define GLXContextID CARD32 #define GLXContextID CARD32
#define GLXDrawable CARD32 #define GLXDrawable CARD32
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct GlxScreenPrivRec {
GlxServerVendor *vendor;
} GlxScreenPriv;
typedef struct GlxContextTagInfoRec {
GLXContextTag tag;
ClientPtr client;
GlxServerVendor *vendor;
void *data;
GLXContextID context;
GLXDrawable drawable;
GLXDrawable readdrawable;
} GlxContextTagInfo;
typedef struct GlxClientPrivRec {
GlxContextTagInfo *contextTags;
unsigned int contextTagCount;
/**
* The vendor handles for each screen.
*/
GlxServerVendor **vendors;
} GlxClientPriv;
extern int GlxErrorBase;
extern RESTYPE idResource;
extern ExtensionEntry *GlxExtensionEntry;
Bool GlxDispatchInit(void);
void GlxDispatchReset(void);
/**
* Handles a request from the client.
*
* This function will look up the correct handler function and forward the
* request to it.
*/
int GlxDispatchRequest(ClientPtr client);
/**
* Looks up the GlxClientPriv struct for a client. If we don't have a
* GlxClientPriv struct yet, then allocate one.
*/
GlxClientPriv *GlxGetClientData(ClientPtr client);
/**
* Frees any data that's specific to a client. This should be called when a
* client disconnects.
*/
void GlxFreeClientData(ClientPtr client);
Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor);
GlxServerVendor * GlxGetXIDMap(XID id);
void GlxRemoveXIDMap(XID id);
/**
* Records the client that sent the current request. This is needed in
* GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a
* regular X window.
*/
void GlxSetRequestClient(ClientPtr client);
GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor);
GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag);
void GlxFreeContextTag(GlxContextTagInfo *tagInfo);
Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor);
Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen);
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen);
static inline CARD32 GlxCheckSwap(ClientPtr client, CARD32 value)
{
if (client->swapped)
{
value = ((value & 0XFF000000) >> 24) | ((value & 0X00FF0000) >> 8)
| ((value & 0X0000FF00) << 8) | ((value & 0X000000FF) << 24);
}
return value;
}
#if defined(__cplusplus)
}
#endif
_X_EXPORT const GlxServerExports *glvndGetExports(void); _X_EXPORT const GlxServerExports *glvndGetExports(void);
#endif // VNDSERVER_H #endif // VNDSERVER_H

118
glx/vndserver_priv.h Normal file
View File

@ -0,0 +1,118 @@
/*
* Copyright (c) 2016, NVIDIA CORPORATION.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* unaltered in all copies or substantial portions of the Materials.
* Any additions, deletions, or changes to the original source files
* must be clearly indicated in accompanying documentation.
*
* If only executable code is distributed, then the accompanying
* documentation must state that "this software is based in part on the
* work of the Khronos Group."
*
* THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef _XSERVER_VNDSERVER_PRIV_H
#define _XSERVER_VNDSERVER_PRIV_H
#include <dix-config.h>
#include "glxvndabi.h"
#include "vndserver.h"
typedef struct GlxScreenPrivRec {
GlxServerVendor *vendor;
} GlxScreenPriv;
typedef struct GlxContextTagInfoRec {
GLXContextTag tag;
ClientPtr client;
GlxServerVendor *vendor;
void *data;
GLXContextID context;
GLXDrawable drawable;
GLXDrawable readdrawable;
} GlxContextTagInfo;
typedef struct GlxClientPrivRec {
GlxContextTagInfo *contextTags;
unsigned int contextTagCount;
/**
* The vendor handles for each screen.
*/
GlxServerVendor **vendors;
} GlxClientPriv;
extern int GlxErrorBase;
extern RESTYPE idResource;
extern ExtensionEntry *GlxExtensionEntry;
Bool GlxDispatchInit(void);
void GlxDispatchReset(void);
/**
* Handles a request from the client.
*
* This function will look up the correct handler function and forward the
* request to it.
*/
int GlxDispatchRequest(ClientPtr client);
/**
* Looks up the GlxClientPriv struct for a client. If we don't have a
* GlxClientPriv struct yet, then allocate one.
*/
GlxClientPriv *GlxGetClientData(ClientPtr client);
/**
* Frees any data that's specific to a client. This should be called when a
* client disconnects.
*/
void GlxFreeClientData(ClientPtr client);
Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor);
GlxServerVendor * GlxGetXIDMap(XID id);
void GlxRemoveXIDMap(XID id);
/**
* Records the client that sent the current request. This is needed in
* GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a
* regular X window.
*/
void GlxSetRequestClient(ClientPtr client);
GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor);
GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag);
void GlxFreeContextTag(GlxContextTagInfo *tagInfo);
Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor);
Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen);
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen);
static inline CARD32 GlxCheckSwap(ClientPtr client, CARD32 value)
{
if (client->swapped)
{
value = ((value & 0XFF000000) >> 24) | ((value & 0X00FF0000) >> 8)
| ((value & 0X0000FF00) << 8) | ((value & 0X000000FF) << 24);
}
return value;
}
#endif /* _XSERVER_VNDSERVER_PRIV_H */

View File

@ -27,7 +27,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/ */
#include "vndserver.h" #include "vndserver_priv.h"
#include <pixmapstr.h> #include <pixmapstr.h>