Changeset 45348 in vbox for trunk/src/VBox/GuestHost
- Timestamp:
- Apr 4, 2013 7:46:29 PM (12 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h
r45201 r45348 116 116 } 117 117 118 DECLINLINE(GLint) CrBltGetVisBits(PCR_BLITTER pBlitter) 119 { 120 return pBlitter->CtxInfo.Base.visualBits; 121 } 122 123 118 124 DECLINLINE(GLboolean) CrBltIsEverEntered(PCR_BLITTER pBlitter) 119 125 { -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r45248 r45348 22 22 #include <iprt/err.h> 23 23 #include <iprt/string.h> 24 #include <iprt/list.h> 25 #include <iprt/thread.h> 26 #include <iprt/critsect.h> 27 #include <iprt/semaphore.h> 24 28 25 29 #include <VBox/vmm/ssm.h> … … 87 91 } CRCreateInfo_t; 88 92 93 94 /* VRAM->RAM worker thread */ 95 96 typedef enum 97 { 98 CR_SERVER_RPW_STATE_UNINITIALIZED = 0, 99 CR_SERVER_RPW_STATE_INITIALIZING, 100 CR_SERVER_RPW_STATE_INITIALIZED, 101 CR_SERVER_RPW_STATE_UNINITIALIZING, 102 } CR_SERVER_RPW_STATE; 103 104 /* worker control command */ 105 typedef enum 106 { 107 CR_SERVER_RPW_CTL_TYPE_UNDEFINED = 0, 108 CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE, 109 CR_SERVER_RPW_CTL_TYPE_TERM 110 } CR_SERVER_RPW_CTL_TYPE; 111 112 struct CR_SERVER_RPW_ENTRY; 113 114 typedef struct CR_SERVER_RPW_CTL { 115 CR_SERVER_RPW_CTL_TYPE enmType; 116 int rc; 117 RTSEMEVENT hCompleteEvent; 118 /* valid for *_WAIT_COMPLETE and *_CANCEL */ 119 struct CR_SERVER_RPW_ENTRY *pEntry; 120 } CR_SERVER_RPW_CTL; 121 122 123 struct CR_SERVER_RPW_ENTRY; 124 125 typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData); 126 127 typedef struct CR_SERVER_RPW_ENTRY 128 { 129 RTRECTSIZE Size; 130 /* We have to use 4 textures here. 131 * 132 * 1. iDrawTex - the texture clients can draw to and then submit it for contents acquisition via crServerRpwEntrySubmit 133 * 2. iSubmittedTex - the texture submitted to the worker for processing and, whose processing has not start yet, 134 * i.e. it is being in the queue and can be safely removed/replaced [from] there 135 * 3. iWorkerTex - the texture being prepared & passed by the worker to the GPU (stage 1 of a worker contents acquisition process) 136 * 4. iGpuTex - the texture passed/processed to/by the GPU, whose data is then acquired by the server (stage 2 of a worker contents acquisition process) 137 * 138 * - There can be valid distinct iGpuTex, iWorkerTex, iSubmittedTex and iDrawTex present simultaneously. 139 * - Either or both of iSubmittedTex and iFreeTex are always valid 140 * 141 * Detail: 142 * 143 * - iSubmittedTex and iFreeTex modifications are performed under CR_SERVER_RPW::CritSect lock. 144 * 145 * - iDrawTex can only be changed by client side (i.e. the crServerRpwEntrySubmit caller), this is why client thread can access it w/o a lock 146 * - iSubmittedTex and iFreeTex can be modified by both client and worker, so lock is always required 147 * 148 * - iDrawTex can be accessed by client code only 149 * - iWorkerTex and iGpuTex can be accessed by worker code only 150 * - iSubmittedTex and iFreeTex can be accessed under CR_SERVER_RPW::CritSect lock only 151 * - either or both of iSubmittedTex and iFreeTex are always valid (see below for more explanation), 152 * this is why client can easily determine the new iDrawTex value on Submit, i.e. : 153 * 154 * (if initial iSubmittedTex was valid) 155 * --------------- 156 * | ^ 157 * > | 158 * Submit-> iDrawTex -> iSubmittedTex 159 * ^ 160 * | (if initial iSubmittedTex was NOT valid) 161 * iFreeTex 162 * 163 * - The worker can invalidate the iSubmittedTex (i.e. do iSubmittedTex -> iWorkerTex) only after it is done 164 * with the last iWorkerTex -> iGpuTex transformation freeing the previously used iGpuTex to iFreeTex. 165 * 166 * - A simplified worker iXxxTex transformation logic is: 167 * 1. iFreeTex is initially valid 168 * 2. iSubmittedTex -> iWorkerTex; 169 * 3. submit iWorkerTex acquire request to the GPU 170 * 4. complete current iGpuTex 171 * 5. iGpuTex -> iFreeTex 172 * 6. iWorkerTex -> iGpuTex 173 * 7. goto 1 174 * 175 * */ 176 int8_t iTexDraw; 177 int8_t iTexSubmitted; 178 int8_t iTexWorker; 179 int8_t iTexGpu; 180 int8_t iCurPBO; 181 GLuint aidWorkerTexs[4]; 182 GLuint aidPBOs[2]; 183 RTLISTNODE WorkEntry; 184 RTLISTNODE WorkerWorkEntry; 185 RTLISTNODE GpuSubmittedEntry; 186 PFNCR_SERVER_RPW_DATA pfnData; 187 } CR_SERVER_RPW_ENTRY; 188 189 typedef struct CR_SERVER_RPW { 190 RTLISTNODE WorkList; 191 RTCRITSECT CritSect; 192 RTSEMEVENT hSubmitEvent; 193 /* only one outstanding command is supported, 194 * and ctl requests must be cynchronized, hold it right here */ 195 CR_SERVER_RPW_CTL Ctl; 196 int ctxId; 197 GLint ctxVisBits; 198 RTTHREAD hThread; 199 } CR_SERVER_RPW; 200 /* */ 201 202 89 203 /** 90 204 * Mural info … … 142 256 VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry; 143 257 VBOXVR_SCR_COMPOSITOR RootVrCompositor; 258 259 CR_SERVER_RPW_ENTRY RpwEntry; 144 260 145 261 /* bitfield representing contexts the mural has been ever current with … … 269 385 270 386 /* */ 387 271 388 /* BFB (BlitFramebuffer Blitter) flags 272 389 * so far only CR_SERVER_BFB_ON_ALWAIS is supported and is alwais used if any flag is set */ … … 336 453 uint32_t fBlitterMode; 337 454 CR_BLITTER Blitter; 455 456 CR_SERVER_RPW RpwWorker; 338 457 339 458 /** configuration options */ … … 395 514 *using callback above to update vbox framebuffers*/ 396 515 GLuint fPresentModeDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/ 516 GLuint fVramPresentModeDefault; 397 517 GLboolean bUsePBOForReadback; /*Use PBO's for data readback*/ 398 518
Note:
See TracChangeset
for help on using the changeset viewer.