summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-02-09 19:19:26 +0100
committerMarge Bot <emma+marge@anholt.net>2024-02-22 23:52:03 +0000
commit28669adef835ca30f769454989e4bcda8193d2f3 (patch)
tree262e5f9ea497fa92fdd01cabd34112b2081a0c9c /glx
parenteda769f34ca5c56ac1ef7e3d74944382cd8cda11 (diff)
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>
Diffstat (limited to 'glx')
-rw-r--r--glx/vndcmds.c2
-rw-r--r--glx/vndext.c2
-rw-r--r--glx/vndserver.h89
-rw-r--r--glx/vndserver_priv.h118
-rw-r--r--glx/vndservermapping.c2
5 files changed, 121 insertions, 92 deletions
diff --git a/glx/vndcmds.c b/glx/vndcmds.c
index d1e088973..cb3732d2a 100644
--- a/glx/vndcmds.c
+++ b/glx/vndcmds.c
@@ -30,7 +30,7 @@
#include <dix-config.h>
#include "hashtable.h"
-#include "vndserver.h"
+#include "vndserver_priv.h"
#include "vndservervendor.h"
/**
diff --git a/glx/vndext.c b/glx/vndext.c
index 0513733b6..770aff6bb 100644
--- a/glx/vndext.c
+++ b/glx/vndext.c
@@ -27,7 +27,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
-#include "vndserver.h"
+#include "vndserver_priv.h"
#include <string.h>
#include <scrnintstr.h>
diff --git a/glx/vndserver.h b/glx/vndserver.h
index 772b458a1..181288cbd 100644
--- a/glx/vndserver.h
+++ b/glx/vndserver.h
@@ -36,95 +36,6 @@
#define GLXContextID 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);
#endif // VNDSERVER_H
diff --git a/glx/vndserver_priv.h b/glx/vndserver_priv.h
new file mode 100644
index 000000000..3f5b9a22f
--- /dev/null
+++ b/glx/vndserver_priv.h
@@ -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 */
diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c
index e5b9e6b2a..1a76e52a8 100644
--- a/glx/vndservermapping.c
+++ b/glx/vndservermapping.c
@@ -27,7 +27,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
-#include "vndserver.h"
+#include "vndserver_priv.h"
#include <pixmapstr.h>