server_rpw.cpp revision f0b06b8e4de2a0d9ddb10ac0a30d68fafd73d8c1
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * VBox crOpenGL: Read Pixels worker
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Copyright (C) 2010-2013 Oracle Corporation
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * available from http://www.virtualbox.org. This file is free software;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * you can redistribute it and/or modify it under the terms of the GNU
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * General Public License (GPL) as published by the Free Software
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic void crServerRpwWorkerGpuSubmit(PRTLISTNODE pWorkList)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEach(pWorkList, pCurEntry, CR_SERVER_RPW_ENTRY, WorkerWorkEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindTexture(GL_TEXTURE_2D, CR_SERVER_RPW_ENTRY_TEX(pCurEntry, Worker));
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, CR_SERVER_RPW_ENTRY_PBO_CUR(pCurEntry));
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /*read the texture, note pixels are NULL for PBO case as it's offset in the buffer*/
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.GetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync void *pvData = crAlloc(4*pCurEntry->Size.cx*pCurEntry->Size.cy);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.GetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_BYTE, pvData);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync cr_server.head_spu->dispatch_table.BindTexture(GL_TEXTURE_2D, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic void crServerRpwWorkerGpuComplete(PRTLISTNODE pGpuSubmitedList)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEach(pGpuSubmitedList, pCurEntry, CR_SERVER_RPW_ENTRY, GpuSubmittedEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync Assert(CR_SERVER_RPW_ENTRY_PBO_IS_ACTIVE(pCurEntry));
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, CR_SERVER_RPW_ENTRY_PBO_COMPLETED(pCurEntry));
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync void *pvData = cr_server.head_spu->dispatch_table.MapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.UnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic void crServerRpwWorkerGpuMarkGpuCompletedSubmitedLocked(PRTLISTNODE pGpuSubmitedList, PRTLISTNODE pWorkList)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEachSafe(pGpuSubmitedList, pCurEntry, pNextEntry, CR_SERVER_RPW_ENTRY, GpuSubmittedEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(pCurEntry, Gpu);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEachSafe(pWorkList, pCurEntry, pNextEntry, CR_SERVER_RPW_ENTRY, WorkerWorkEntry)
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync Assert(CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pCurEntry, Worker));
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync /* PBO mode, put to the GPU submitted queue*/
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync RTListAppend(pGpuSubmitedList, &pCurEntry->GpuSubmittedEntry);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync CR_SERVER_RPW_ENTRY_TEX_PROMOTE(pCurEntry, Worker, Gpu);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /* no PBO, we are already done entry data processing, free it right away */
e94ff1af89bf631c68367d4e291ddbb491b5e5c0vboxsync Assert(!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pCurEntry, Gpu));
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(pCurEntry, Worker);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic void crServerRpwWorkerGetWorkLocked(CR_SERVER_RPW *pWorker, PRTLISTNODE pWorkList)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEachSafe(&pWorker->WorkList, pCurEntry, pNextEntry, CR_SERVER_RPW_ENTRY, WorkEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListAppend(pWorkList, &pCurEntry->WorkerWorkEntry);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_PROMOTE(pCurEntry, Submitted, Worker);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsyncstatic DECLCALLBACK(int) crServerRpwWorkerThread(RTTHREAD ThreadSelf, void *pvUser)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_CTL_TYPE enmCtlType = CR_SERVER_RPW_CTL_TYPE_UNDEFINED;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CRMuralInfo *pDummyMural = crServerGetDummyMural(pWorker->ctxVisBits);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync bool fExit = false;
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync cr_server.head_spu->dispatch_table.MakeCurrent(pDummyMural->spuWindow, 0, pWorker->ctxId);
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync /* the crit sect is locked here */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (pWorker->Ctl.enmType != CR_SERVER_RPW_CTL_TYPE_UNDEFINED)
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync pWorker->Ctl.enmType = CR_SERVER_RPW_CTL_TYPE_UNDEFINED;
1f1f533d5b88c35cf740dca55c6f1937d1035a36vboxsync crServerRpwWorkerGetWorkLocked(pWorker, &WorkList);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (enmCtlType != CR_SERVER_RPW_CTL_TYPE_UNDEFINED)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync bool fCompleted = false;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /* fNewGpuItems means new entries arrived. WorkList contains new GPU submitted data
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * fCompleted means completion was performed, GpuSubmittedList contains old GPU submitted data,
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * which is now completed and should be released */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crServerRpwWorkerGpuMarkGpuCompletedSubmitedLocked(&GpuSubmittedList, &WorkList);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = RTSemEventWait(pWorker->hSubmitEvent, cWaitMillis);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.MakeCurrent(0, 0, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic int crServerRpwCtlNotify(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = RTSemEventWait(pWorker->Ctl.hCompleteEvent, RT_INDEFINITE_WAIT);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync pWorker->Ctl.enmType = CR_SERVER_RPW_CTL_TYPE_UNDEFINED;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("RTSemEventSignal failed tmpRc %d", tmpRc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic int crServerRpwCtl(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_CTL_TYPE enmType, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwCtlNotify failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = RTSemEventCreate(&pWorker->Ctl.hCompleteEvent);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CRASSERT(cr_server.MainContextInfo.CreateInfo.visualBits);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync pWorker->ctxId = cr_server.head_spu->dispatch_table.CreateContext("", cr_server.MainContextInfo.CreateInfo.visualBits, cr_server.MainContextInfo.SpuContext);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync pWorker->ctxVisBits = cr_server.MainContextInfo.CreateInfo.visualBits;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync pDummyMural = crServerGetDummyMural(pWorker->ctxVisBits);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /* since CreateContext does not actually create it on some platforms, e.g. on win,
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * we need to do MakeCurrent to ensure it is created.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * There is some black magic in doing that to work around ogl driver bugs
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * (i.e. we need to switch offscreen rendering off before doing make current) */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.MakeCurrent(pDummyMural->spuWindow, 0, pWorker->ctxId);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.MakeCurrent(cr_server.currentMural->spuWindow, 0,
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.currentCtxInfo->SpuContext > 0 ? cr_server.currentCtxInfo->SpuContext : cr_server.MainContextInfo.SpuContext);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.MakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = RTThreadCreate(&pWorker->hThread, crServerRpwWorkerThread, pWorker, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "CrServerDw");
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = RTSemEventWait(pWorker->hSubmitEvent, RT_INDEFINITE_WAIT);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.DestroyContext(pWorker->ctxId);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryResizeCleaned(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crServerPerformMakeCurrent(pDummy, &cr_server.MainContextInfo);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync for (int i = 0; i < 4; ++i)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.GenTextures(1, &pEntry->aidWorkerTexs[i]);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindTexture(GL_TEXTURE_2D, pEntry->aidWorkerTexs[i]);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pContext->bufferobject.unpackBuffer->hwid);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync for (int i = 0; i < 2; ++i)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.GenBuffersARB(1, &pEntry->aidPBOs[i]);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pEntry->aidPBOs[i]);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width*height*4, 0, GL_STREAM_READ_ARB);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (crStateIsBufferBound(GL_PIXEL_PACK_BUFFER_ARB))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pContext->bufferobject.packBuffer->hwid);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync GLuint uid = pContext->texture.unit[pContext->texture.curTextureUnit].currentTexture2D->hwid;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.BindTexture(GL_TEXTURE_2D, uid);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryCleanup(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwEntryCancel failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CRMuralInfo *pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crServerPerformMakeCurrent(pDummy, &cr_server.MainContextInfo);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.DeleteTextures(4, pEntry->aidWorkerTexs);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync cr_server.head_spu->dispatch_table.DeleteBuffersARB(2, pEntry->aidPBOs);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync memset(pEntry->aidPBOs, 0, sizeof (pEntry->aidPBOs));
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync memset(pEntry->aidWorkerTexs, 0, sizeof (pEntry->aidWorkerTexs));
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryResize(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (width == pEntry->Size.cx && width == pEntry->Size.cy)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwEntryCleanup failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync rc = crServerRpwEntryResizeCleaned(pWorker, pEntry, width, height);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwEntryResizeCleaned failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryInit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, uint32_t width, uint32_t height, PFNCR_SERVER_RPW_DATA pfnData)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync int rc = crServerRpwEntryResizeCleaned(pWorker, pEntry, width, height);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwEntryResizeCleaned failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntrySubmit(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Draw))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync Assert(pWorker->Ctl.enmType == CR_SERVER_RPW_CTL_TYPE_UNDEFINED);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Submitted))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_PROMOTE_KEEPVALID(pEntry, Draw, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListAppend(&pWorker->WorkList, &pEntry->WorkEntry);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_XCHG_VALID(pEntry, Draw, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic int crServerRpwEntryCancelCtl(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry, CR_SERVER_RPW_CTL_TYPE enmType)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (CR_SERVER_RPW_CTL_TYPE_TERM == enmType && pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("Entry should be null for term request");
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Submitted))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(pEntry, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync if (!CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Worker) && !CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pEntry, Gpu))
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /* can cancel it wight away */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync RTListForEachSafe(&pWorker->WorkList, pCurEntry, pNextEntry, CR_SERVER_RPW_ENTRY, WorkEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_IS_VALID(pCurEntry, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync CR_SERVER_RPW_ENTRY_TEX_INVALIDATE(pEntry, Submitted);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync crWarning("crServerRpwCtlNotify failed rc %d", rc);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryWaitComplete(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync int rc = crServerRpwCtl(pWorker, CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE, pEntry);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncint crServerRpwEntryCancel(CR_SERVER_RPW *pWorker, CR_SERVER_RPW_ENTRY *pEntry)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync return crServerRpwEntryCancelCtl(pWorker, pEntry, CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE);
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncstatic int crServerRpwCtlTerm(CR_SERVER_RPW *pWorker)
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync int rc = crServerRpwEntryCancelCtl(pWorker, NULL, CR_SERVER_RPW_CTL_TYPE_TERM);