Changeset 50921 in vbox for trunk/src/VBox
- Timestamp:
- Mar 28, 2014 3:47:50 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiDisp.cpp
r49591 r50921 131 131 pBuf->BasePrivate.Base.cbBuffer = cbBuf; 132 132 133 pBuf->BasePrivate.pHgsmi = &pPrivate->BasePrivate; 134 133 135 pBuf->hAllocation = DdiAllocInfo.hAllocation; 134 136 … … 199 201 } 200 202 201 void vboxUhgsmiD3DInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, PVBOXWDDMDISP_DEVICE pDevice)202 {203 pHgsmi->BasePrivate.Base.pfnBufferCreate = vboxUhgsmiD3DBufferCreate;204 pHgsmi->BasePrivate.Base.pfnBufferSubmit = vboxUhgsmiD3DBufferSubmit;205 /* no escapes (for now) */206 pHgsmi->BasePrivate.pfnEscape = NULL;207 pHgsmi->pDevice = pDevice;208 }209 210 203 static DECLCALLBACK(int) vboxCrHhgsmiDispEscape(struct VBOXUHGSMI_PRIVATE_BASE *pHgsmi, void *pvData, uint32_t cbData, BOOL fHwAccess) 211 204 { … … 228 221 } 229 222 223 void vboxUhgsmiD3DInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, PVBOXWDDMDISP_DEVICE pDevice) 224 { 225 pHgsmi->BasePrivate.Base.pfnBufferCreate = vboxUhgsmiD3DBufferCreate; 226 pHgsmi->BasePrivate.Base.pfnBufferSubmit = vboxUhgsmiD3DBufferSubmit; 227 /* escape is still needed, since Ugfsmi uses it e.g. to query connection id */ 228 pHgsmi->BasePrivate.pfnEscape = vboxCrHhgsmiDispEscape; 229 pHgsmi->pDevice = pDevice; 230 } 230 231 231 232 void vboxUhgsmiD3DEscInit(PVBOXUHGSMI_PRIVATE_D3D pHgsmi, struct VBOXWDDMDISP_DEVICE *pDevice) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiKmt.cpp
r49591 r50921 149 149 pBuf->BasePrivate.Base.cbBuffer = cbBuf; 150 150 151 pBuf->BasePrivate.pHgsmi = &pPrivate->BasePrivate; 152 151 153 pBuf->hAllocation = DdiAllocInfo.hAllocation; 154 152 155 153 156 *ppBuf = &pBuf->BasePrivate.Base; … … 279 282 pHgsmi->BasePrivate.Base.pfnBufferCreate = vboxUhgsmiKmtBufferCreate; 280 283 pHgsmi->BasePrivate.Base.pfnBufferSubmit = vboxUhgsmiKmtBufferSubmit; 281 /* no escapes (for now)*/282 pHgsmi->BasePrivate.pfnEscape = NULL;284 /* escape is still needed, since Ugfsmi uses it e.g. to query connection id */ 285 pHgsmi->BasePrivate.pfnEscape = vboxCrHhgsmiKmtEscape; 283 286 } 284 287 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r50913 r50921 587 587 pCtx->indexRecordFirstUncompleted = (pCtx->indexRecordFirstUncompleted + 1) % VBVA_MAX_RECORDS; 588 588 pCtx->off32DataUncompleted = (pCtx->off32DataUncompleted + cbBuffer) % pVBVA->cbData; 589 #ifdef DEBUG590 vboxHwBufferVerifyCompleted(pCtx);591 #endif592 589 } 593 590 … … 1076 1073 } 1077 1074 1075 #ifdef DEBUG 1076 vboxHwBufferVerifyCompleted(&pVbva->Vbva); 1077 #endif 1078 1078 1079 return fHasCommandsCompletedPreempted; 1079 1080 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r50913 r50921 33 33 #include <stdio.h> 34 34 35 #define VBOXWDDM_DUMMY_DMABUFFER_SIZE sizeof (RECT)35 #define VBOXWDDM_DUMMY_DMABUFFER_SIZE (sizeof (VBOXCMDVBVA_HDR) / 2) 36 36 37 37 DWORD g_VBoxLogUm = 0; … … 2863 2863 Assert(!pAllocationList->PhysicalAddress.HighPart); 2864 2864 Assert(!(pAllocationList->PhysicalAddress.QuadPart & 0xfffUL)); /* <- just a check to ensure allocation offset does not go here */ 2865 *poffVram = pAllocationList->PhysicalAddress.LowPart + pPatchList->AllocationOffset; ;2865 *poffVram = pAllocationList->PhysicalAddress.LowPart + pPatchList->AllocationOffset; 2866 2866 } 2867 2867 … … 5761 5761 { 5762 5762 // LOGF(("ENTER, hContext(0x%x)", hContext)); 5763 vboxVDbgBreakF(); 5763 5764 5764 5765 if (pRender->DmaBufferPrivateDataSize < sizeof (VBOXCMDVBVA_HDR)) … … 5781 5782 5782 5783 uint32_t cbBuffer = 0; 5783 uint32_t cb CmdDma = 0;5784 uint32_t cbPrivateData = 0; 5784 5785 VBOXCMDVBVA_HDR* pCmd = (VBOXCMDVBVA_HDR*)pRender->pDmaBufferPrivateData; 5785 5786 … … 5807 5808 } 5808 5809 5809 cbBuffer = RT_OFFSETOF(VBOXCMDVBVA_CRCMD, Cmd.aBuffers[pRender->AllocationListSize]); 5810 if (cbBuffer > 4096) 5811 { 5812 /* this should not be bigger actually */ 5813 WARN(("too big command buffer %d", cbBuffer)); 5810 cbBuffer = VBOXWDDM_DUMMY_DMABUFFER_SIZE; 5811 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_CRCMD, Cmd.aBuffers[pRender->AllocationListSize]); 5812 5813 if (pRender->DmaBufferPrivateDataSize < cbPrivateData) 5814 { 5815 WARN(("pRender->DmaBufferPrivateDataSize too small %d, requested %d", pRender->DmaBufferPrivateDataSize, cbPrivateData)); 5814 5816 return STATUS_INVALID_PARAMETER; 5815 5817 } 5816 5818 5817 cbCmdDma = VBOXWDDM_DUMMY_DMABUFFER_SIZE; 5818 5819 if (pRender->DmaBufferPrivateDataSize < cbBuffer) 5820 { 5821 WARN(("pRender->DmaBufferPrivateDataSize too small %d, requested %d", pRender->DmaBufferPrivateDataSize, cbBuffer)); 5822 return STATUS_INVALID_PARAMETER; 5823 } 5824 5825 if (pRender->DmaSize < cbCmdDma) 5819 if (pRender->DmaSize < cbBuffer) 5826 5820 { 5827 5821 WARN(("dma buffer %d too small", pRender->DmaSize)); … … 5829 5823 } 5830 5824 5831 Assert(pRender->PatchLocationListOutSize == pRender->AllocationListSize);5825 // Assert(pRender->PatchLocationListOutSize == pRender->AllocationListSize); 5832 5826 5833 5827 if (pRender->PatchLocationListOutSize < pRender->AllocationListSize) … … 5880 5874 case VBOXVDMACMD_TYPE_DMA_NOP: 5881 5875 { 5882 cb Buffer= sizeof (VBOXCMDVBVA_HDR);5883 cb CmdDma= VBOXWDDM_DUMMY_DMABUFFER_SIZE;5884 5885 if (pRender->DmaBufferPrivateDataSize < cb Buffer)5886 { 5887 WARN(("pRender->DmaBufferPrivateDataSize too small %d, requested %d", pRender->DmaBufferPrivateDataSize, cb Buffer));5876 cbPrivateData = sizeof (VBOXCMDVBVA_HDR); 5877 cbBuffer = VBOXWDDM_DUMMY_DMABUFFER_SIZE; 5878 5879 if (pRender->DmaBufferPrivateDataSize < cbPrivateData) 5880 { 5881 WARN(("pRender->DmaBufferPrivateDataSize too small %d, requested %d", pRender->DmaBufferPrivateDataSize, cbPrivateData)); 5888 5882 return STATUS_INVALID_PARAMETER; 5889 5883 } 5890 5884 5891 if (pRender->DmaSize < cb CmdDma)5885 if (pRender->DmaSize < cbBuffer) 5892 5886 { 5893 5887 WARN(("dma buffer %d too small", pRender->DmaSize)); … … 5916 5910 } 5917 5911 5918 pRender->pDmaBufferPrivateData = ((uint8_t*)pRender->pDmaBufferPrivateData) + cb Buffer;5919 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + cb CmdDma;5912 pRender->pDmaBufferPrivateData = ((uint8_t*)pRender->pDmaBufferPrivateData) + cbPrivateData; 5913 pRender->pDmaBuffer = ((uint8_t*)pRender->pDmaBuffer) + cbBuffer; 5920 5914 5921 5915 pCmd->u8State = VBOXCMDVBVA_STATE_SUBMITTED; … … 6091 6085 // LOGF(("ENTER, hContext(0x%x)", hContext)); 6092 6086 6093 vboxVDbgBreakF ();6087 vboxVDbgBreakFv(); 6094 6088 6095 6089 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)hContext; … … 6172 6166 { 6173 6167 pBlt->Hdr.u8Flags |= VBOXCMDVBVA_OPF_ALLOC_SRCPRIMARY; 6168 Assert((UINT)pSrcAlloc->AllocData.SurfDesc.VidPnSourceId < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays); 6174 6169 pBlt->Hdr.u.u8PrimaryID = pSrcAlloc->AllocData.SurfDesc.VidPnSourceId; 6175 6170 … … 6186 6181 Assert(fDstPrimary); 6187 6182 pBlt->Hdr.u8Flags |= VBOXCMDVBVA_OPF_ALLOC_DSTPRIMARY; 6183 Assert((UINT)pDstAlloc->AllocData.SurfDesc.VidPnSourceId < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays); 6188 6184 pBlt->Hdr.u.u8PrimaryID = pDstAlloc->AllocData.SurfDesc.VidPnSourceId; 6189 6185 … … 6252 6248 pHdr->u8OpCode = VBOXCMDVBVA_OPTYPE_FLIP; 6253 6249 pHdr->u8Flags = 0; 6250 Assert((UINT)pSrcAlloc->AllocData.SurfDesc.VidPnSourceId < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays); 6251 pHdr->u.u8PrimaryID = pSrcAlloc->AllocData.SurfDesc.VidPnSourceId; 6254 6252 VBOXCMDVBVA_FLIP *pFlip = (VBOXCMDVBVA_FLIP*)pHdr; 6255 6253 6256 6254 if (VBoxCVDdiFillAllocInfo(pHdr, &pFlip->src, pSrcAlloc, pSrc, false)) 6255 { 6256 WARN(("VBoxCVDdiFillAllocInfo reported no host id for flip!")); 6257 6257 u32SrcPatch = RT_OFFSETOF(VBOXCMDVBVA_FLIP, src.u.offVRAM); 6258 } 6258 6259 6259 6260 cbBuffer = VBOXWDDM_DUMMY_DMABUFFER_SIZE; … … 6693 6694 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D: 6694 6695 { 6695 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 6696 Assert(Status == STATUS_SUCCESS); 6696 if (!pDevExt->fCmdVbvaEnabled) 6697 { 6698 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 6699 if (!NT_SUCCESS(Status)) 6700 WARN(("vboxVideoAMgrCtxCreate failed %#x", Status)); 6701 } 6702 else 6703 Status = STATUS_SUCCESS; 6704 6697 6705 if (Status == STATUS_SUCCESS) 6698 6706 { … … 6747 6755 { 6748 6756 pContext->enmType = pInfo->enmType; 6749 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 6750 Assert(Status == STATUS_SUCCESS); 6757 if (!pDevExt->fCmdVbvaEnabled) 6758 { 6759 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 6760 if (!NT_SUCCESS(Status)) 6761 WARN(("vboxVideoAMgrCtxCreate failed %#x", Status)); 6762 } 6763 else 6764 Status = STATUS_SUCCESS; 6765 6751 6766 if (Status == STATUS_SUCCESS) 6752 6767 { … … 6981 6996 { 6982 6997 LOGF(("ENTER, hAdapter(0x%x)", hAdapter)); 6983 vboxVDbgBreakF ();6998 vboxVDbgBreakFv(); 6984 6999 6985 7000 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter; -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r50913 r50921 1212 1212 static int vboxVDMACrCmdVbvaProcessPagingEl(PPDMDEVINS pDevIns, VBOXCMDVBVAPAGEIDX iPage, uint8_t *pu8Vram, bool fIn) 1213 1213 { 1214 RTGCPHYS phPage = (RTGCPHYS)(iPage >>PAGE_SHIFT);1214 RTGCPHYS phPage = (RTGCPHYS)(iPage << PAGE_SHIFT); 1215 1215 PGMPAGEMAPLOCK Lock; 1216 1216 int rc; … … 1250 1250 static int vboxVDMACrCmdVbvaProcessPagingEls(PPDMDEVINS pDevIns, const VBOXCMDVBVAPAGEIDX *piPages, uint32_t cPages, uint8_t *pu8Vram, bool fIn) 1251 1251 { 1252 for (uint32_t i = 0; i < cPages; ++i )1252 for (uint32_t i = 0; i < cPages; ++i, pu8Vram += PAGE_SIZE) 1253 1253 { 1254 1254 int rc = vboxVDMACrCmdVbvaProcessPagingEl(pDevIns, piPages[i], pu8Vram, fIn); -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r50913 r50921 1465 1465 } 1466 1466 1467 rc = crServerVBoxWindowsShow( paParms[0].u.uint32);1467 rc = crServerVBoxWindowsShow(!!paParms[0].u.uint32); 1468 1468 if (!RT_SUCCESS(rc)) 1469 1469 WARN(("crServerVBoxWindowsShow failed rc %d", rc)); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50913 r50921 465 465 466 466 int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd); 467 int8_t crVBoxServerCrCmdFlipProcess(const VBOXCMDVBVA_FLIP *pFlip); 467 468 468 469 //#define VBOX_WITH_CRSERVER_DUMPER -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r50913 r50921 3073 3073 if (cbHdr < sizeof (*pFnCmd)) 3074 3074 { 3075 crWarning("invalid write cmd buffer size!");3075 WARN(("invalid write cmd buffer size!")); 3076 3076 rc = VERR_INVALID_PARAMETER; 3077 3077 break; … … 3081 3081 if (!pBuffer) 3082 3082 { 3083 crWarning("invalid buffer data received from guest!");3083 WARN(("invalid buffer data received from guest!")); 3084 3084 rc = VERR_INVALID_PARAMETER; 3085 3085 break; … … 3089 3089 if (RT_FAILURE(rc)) 3090 3090 { 3091 WARN(("crVBoxServerClientGet failed %d", rc)); 3091 3092 break; 3092 3093 } … … 3101 3102 rc = crVBoxServerInternalClientWriteRead(pClient); 3102 3103 CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(&pClient->conn->CmdData); 3103 return rc; 3104 } 3105 else 3106 { 3107 crWarning("invalid number of args"); 3108 rc = VERR_INVALID_PARAMETER; 3104 if (RT_FAILURE(rc)) 3105 { 3106 WARN(("crVBoxServerInternalClientWriteRead failed %d", rc)); 3107 break; 3108 } 3109 3109 break; 3110 3110 } 3111 3112 WARN(("invalid number of args")); 3113 rc = VERR_INVALID_PARAMETER; 3111 3114 break; 3112 3115 } … … 3128 3131 if (cbHdr < sizeof (*pFnCmd)) 3129 3132 { 3130 crWarning("invalid inject cmd buffer size!");3133 WARN(("invalid inject cmd buffer size!")); 3131 3134 rc = VERR_INVALID_PARAMETER; 3132 3135 break; … … 3136 3139 if (!pBuffer) 3137 3140 { 3138 crWarning("invalid buffer data received from guest!");3141 WARN(("invalid buffer data received from guest!")); 3139 3142 rc = VERR_INVALID_PARAMETER; 3140 3143 break; … … 3144 3147 if (RT_FAILURE(rc)) 3145 3148 { 3149 WARN(("crVBoxServerClientGet failed %d", rc)); 3146 3150 break; 3147 3151 } … … 3156 3160 rc = crVBoxServerInternalClientWriteRead(pClient); 3157 3161 CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(&pClient->conn->CmdData); 3158 return rc; 3162 if (RT_FAILURE(rc)) 3163 { 3164 WARN(("crVBoxServerInternalClientWriteRead failed %d", rc)); 3165 break; 3166 } 3167 3168 break; 3159 3169 } 3160 3170 3161 crWarning("invalid number of args");3171 WARN(("invalid number of args")); 3162 3172 rc = VERR_INVALID_PARAMETER; 3163 3173 break; … … 3179 3189 if (cbHdr < sizeof (*pFnCmd)) 3180 3190 { 3181 crWarning("invalid read cmd buffer size!");3191 WARN(("invalid read cmd buffer size!")); 3182 3192 rc = VERR_INVALID_PARAMETER; 3183 3193 break; 3184 3194 } 3185 3195 3186 3187 3196 if (!pBuffer) 3188 3197 { 3189 crWarning("invalid buffer data received from guest!");3198 WARN(("invalid buffer data received from guest!")); 3190 3199 rc = VERR_INVALID_PARAMETER; 3191 3200 break; … … 3195 3204 if (RT_FAILURE(rc)) 3196 3205 { 3206 WARN(("crVBoxServerClientGet failed %d", rc)); 3197 3207 break; 3198 3208 } … … 3208 3218 3209 3219 /* the read command is never pended, complete it right away */ 3210 pHdr->result = rc; 3211 3212 return VINF_SUCCESS; 3220 if (RT_FAILURE(rc)) 3221 { 3222 WARN(("crVBoxServerInternalClientRead failed %d", rc)); 3223 break; 3224 } 3225 3226 break; 3213 3227 } 3214 3228 … … 3238 3252 if (cbHdr < sizeof (*pFnCmd)) 3239 3253 { 3240 crWarning("invalid write_read cmd buffer size!");3254 WARN(("invalid write_read cmd buffer size!")); 3241 3255 rc = VERR_INVALID_PARAMETER; 3242 3256 break; 3243 3257 } 3244 3258 3245 3246 3259 CRASSERT(cbBuffer); 3247 3260 if (!pBuffer) 3248 3261 { 3249 crWarning("invalid write buffer data received from guest!");3262 WARN(("invalid write buffer data received from guest!")); 3250 3263 rc = VERR_INVALID_PARAMETER; 3251 3264 break; … … 3255 3268 if (!pWriteback) 3256 3269 { 3257 crWarning("invalid writeback buffer data received from guest!");3270 WARN(("invalid writeback buffer data received from guest!")); 3258 3271 rc = VERR_INVALID_PARAMETER; 3259 3272 break; 3260 3273 } 3274 3261 3275 rc = crVBoxServerClientGet(u32ClientID, &pClient); 3262 3276 if (RT_FAILURE(rc)) 3263 3277 { 3264 pHdr->result = rc;3265 return VINF_SUCCESS;3278 WARN(("crVBoxServerClientGet failed %d", rc)); 3279 break; 3266 3280 } 3267 3281 … … 3275 3289 rc = crVBoxServerInternalClientWriteRead(pClient); 3276 3290 CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(&pClient->conn->CmdData); 3277 return rc; 3291 3292 if (RT_FAILURE(rc)) 3293 { 3294 WARN(("crVBoxServerInternalClientWriteRead failed %d", rc)); 3295 break; 3296 } 3297 3298 break; 3278 3299 } 3279 3300 … … 3306 3327 } 3307 3328 3308 /* we can be on fail only here */3309 CRASSERT(RT_FAILURE(rc));3310 3329 pHdr->result = rc; 3311 3330 3312 return rc;3331 return VINF_SUCCESS; 3313 3332 } 3314 3333 … … 3500 3519 return -1; 3501 3520 } 3521 case VBOXCMDVBVA_OPTYPE_FLIP: 3522 { 3523 const VBOXCMDVBVA_FLIP *pFlip; 3524 3525 if (cbCmd < sizeof (VBOXCMDVBVA_FLIP)) 3526 { 3527 WARN(("invalid buffer size")); 3528 return -1; 3529 } 3530 3531 pFlip = (const VBOXCMDVBVA_FLIP*)pCmd; 3532 return crVBoxServerCrCmdFlipProcess(pFlip); 3533 } 3502 3534 case VBOXCMDVBVA_OPTYPE_BLT_OFFPRIMSZFMT_OR_ID: 3503 3535 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50913 r50921 4825 4825 return 0; 4826 4826 } 4827 4828 int8_t crVBoxServerCrCmdFlipProcess(const VBOXCMDVBVA_FLIP *pFlip) 4829 { 4830 uint32_t hostId; 4831 if (pFlip->Hdr.u8Flags & VBOXCMDVBVA_OPF_ALLOC_SRCID) 4832 hostId = pFlip->src.u.id; 4833 else 4834 { 4835 WARN(("VBOXCMDVBVA_OPF_ALLOC_SRCID not specified")); 4836 hostId = 0; 4837 } 4838 4839 uint32_t idScreen = pFlip->Hdr.u.u8PrimaryID; 4840 HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idScreen); 4841 if (!hFb) 4842 { 4843 WARN(("request to present on disabled framebuffer, ignore")); 4844 return 0; 4845 } 4846 4847 const RTRECT *pRect = CrVrScrCompositorRectGet(&hFb->Compositor); 4848 crServerDispatchVBoxTexPresent(hostId, idScreen, 0, 0, 1, (const GLint*)pRect); 4849 return 0; 4850 }
Note:
See TracChangeset
for help on using the changeset viewer.