VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h@ 39603

最後變更 在這個檔案從39603是 39603,由 vboxsync 提交於 13 年 前

crHgsmi: cleanup

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 4.1 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_SERVER_H
8#define CR_SERVER_H
9
10#include "cr_protocol.h"
11#include "cr_glstate.h"
12#include "spu_dispatch_table.h"
13
14#include "state/cr_currentpointers.h"
15
16#include "cr_server.h"
17
18#ifdef VBOX_WITH_CRHGSMI
19# include <VBox/VBoxVideo.h>
20
21extern uint8_t* g_pvVRamBase;
22extern uint32_t g_cbVRam;
23extern HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion;
24extern PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion;
25
26#define VBOXCRHGSMI_PTR(_off, _t) ((_t*)(g_pvVRamBase + (_off)))
27#define VBOXCRHGSMI_PTR_SAFE(_off, _cb, _t) ((_t*)crServerCrHgsmiPtrGet(_off, _cb))
28
29DECLINLINE(void*) crServerCrHgsmiPtrGet(VBOXVIDEOOFFSET offBuffer, uint32_t cbBuffer)
30{
31 return ((offBuffer) + (cbBuffer) <= g_cbVRam ? VBOXCRHGSMI_PTR(offBuffer, void) : NULL);
32}
33
34DECLINLINE(void) crServerCrHgsmiCmdComplete(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, int cmdProcessingRc)
35{
36 g_pfnCrHgsmiCompletion(g_hCrHgsmiCompletion, pCmd, cmdProcessingRc);
37}
38
39#define VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc) do { \
40 CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData); \
41 CRVBOXHGSMI_CMDDATA_RC(_pData, _rc); \
42 crServerCrHgsmiCmdComplete((_pData)->pCmd, VINF_SUCCESS); \
43 } while (0)
44
45#define VBOXCRHGSMI_CMD_CHECK_COMPLETE(_pData, _rc) do { \
46 if (CRVBOXHGSMI_CMDDATA_IS_SET(_pData)) { \
47 VBOXCRHGSMI_CMD_COMPLETE(_pData, _rc); \
48 } \
49 } while (0)
50
51#endif
52
53/*
54 * This is the base number for window and context IDs
55 */
56#define MAGIC_OFFSET 5000
57
58extern CRServer cr_server;
59
60/* Semaphore wait queue node */
61typedef struct _wqnode {
62 RunQueue *q;
63 struct _wqnode *next;
64} wqnode;
65
66typedef struct {
67 GLuint count;
68 GLuint num_waiting;
69 RunQueue **waiting;
70} CRServerBarrier;
71
72typedef struct {
73 GLuint count;
74 wqnode *waiting, *tail;
75} CRServerSemaphore;
76
77typedef struct {
78 GLuint id;
79 GLint projParamStart;
80 GLfloat projMat[16]; /* projection matrix, accumulated via calls to */
81 /* glProgramLocalParameterARB, glProgramParameterNV */
82} CRServerProgram;
83
84typedef struct {
85 char *pszDpyName;
86 GLint visualBits;
87 int32_t internalID;
88} CRCreateInfo_t;
89
90void crServerSetVBoxConfiguration();
91void crServerSetVBoxConfigurationHGCM();
92void crServerInitDispatch(void);
93void crServerReturnValue( const void *payload, unsigned int payload_len );
94void crServerWriteback(void);
95int crServerRecv( CRConnection *conn, CRMessage *msg, unsigned int len );
96void crServerSerializeRemoteStreams(void);
97void crServerAddToRunQueue( CRClient *client );
98void crServerDeleteClient( CRClient *client );
99
100
101void crServerApplyBaseProjection( const CRmatrix *baseProj );
102void crServerApplyViewMatrix( const CRmatrix *view );
103void crServerSetOutputBounds( const CRMuralInfo *mural, int extNum );
104void crServerComputeViewportBounds( const CRViewportState *v, CRMuralInfo *mural );
105
106GLboolean crServerInitializeBucketing(CRMuralInfo *mural);
107
108void crComputeOverlapGeom(double *quads, int nquad, CRPoly ***res);
109void crComputeKnockoutGeom(double *quads, int nquad, int my_quad_idx, CRPoly **res);
110
111int crServerGetCurrentEye(void);
112
113GLboolean crServerClientInBeginEnd(const CRClient *client);
114
115GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID);
116GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID);
117
118void crServerCreateInfoDeleteCB(void *data);
119
120GLint crServerGenerateID(GLint *pCounter);
121
122GLint crServerSPUWindowID(GLint serverWindow);
123
124GLuint crServerTranslateProgramID(GLuint id);
125
126void crServerSetupOutputRedirect(CRMuralInfo *mural);
127void crServerCheckMuralGeometry(CRMuralInfo *mural);
128GLboolean crServerSupportRedirMuralFBO(void);
129void crServerRedirMuralFBO(CRMuralInfo *mural, GLboolean redir);
130void crServerCreateMuralFBO(CRMuralInfo *mural);
131void crServerDeleteMuralFBO(CRMuralInfo *mural);
132void crServerPresentFBO(CRMuralInfo *mural);
133GLboolean crServerIsRedirectedToFBO();
134
135int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer);
136
137#endif /* CR_SERVER_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette