VirtualBox

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

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

CrOpenGL: avoid blocked client polling & extra memcpy (block hgsmi command until completion)

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

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