- Timestamp:
- Apr 23, 2014 11:39:21 AM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r50940 r51121 118 118 #define VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS 0x01 119 119 #define VBOXWDDM_HGSYNC_F_SYNCED_LOCATION 0x02 120 #define VBOXWDDM_HGSYNC_F_SYNCED_ALL (VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS | VBOXWDDM_HGSYNC_F_SYNCED_LOCATION) 120 #define VBOXWDDM_HGSYNC_F_SYNCED_VISIBILITY 0x04 121 #define VBOXWDDM_HGSYNC_F_SYNCED_ALL (VBOXWDDM_HGSYNC_F_SYNCED_DIMENSIONS | VBOXWDDM_HGSYNC_F_SYNCED_LOCATION | VBOXWDDM_HGSYNC_F_SYNCED_VISIBILITY) 121 122 #define VBOXWDDM_HGSYNC_F_CHANGED_LOCATION_ONLY (VBOXWDDM_HGSYNC_F_SYNCED_ALL & ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION) 122 123 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r51081 r51121 1341 1341 return pCmd->Hdr.i32Result; 1342 1342 } 1343 1344 int VBoxCmdVbvaConCmdResize(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags) 1345 { 1346 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 1347 1348 VBOXCMDVBVA_CTL_RESIZE *pResize = (VBOXCMDVBVA_CTL_RESIZE*)vboxCmdVbvaCtlCreate(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, sizeof (VBOXCMDVBVA_CTL_RESIZE)); 1349 if (!pResize) 1350 { 1351 WARN(("vboxCmdVbvaCtlCreate failed")); 1352 return VERR_OUT_OF_RESOURCES; 1353 } 1354 1355 pResize->Hdr.u32Type = VBOXCMDVBVACTL_TYPE_RESIZE; 1356 pResize->Hdr.i32Result = VERR_NOT_IMPLEMENTED; 1357 1358 int rc = vboxWddmScreenInfoInit(&pResize->Resize.aEntries[0].Screen, pAllocData, pVScreenPos, fFlags); 1359 if (RT_SUCCESS(rc)) 1360 { 1361 rc = vboxCmdVbvaCtlSubmitSync(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, &pResize->Hdr); 1362 if (RT_SUCCESS(rc)) 1363 { 1364 rc = pResize->Hdr.i32Result; 1365 if (RT_FAILURE(rc)) 1366 WARN(("VBOXCMDVBVACTL_TYPE_RESIZE failed %d", rc)); 1367 } 1368 else 1369 WARN(("vboxCmdVbvaCtlSubmitSync failed %d", rc)); 1370 } 1371 else 1372 WARN(("vboxWddmScreenInfoInit failed %d", rc)); 1373 1374 vboxCmdVbvaCtlFree(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, &pResize->Hdr); 1375 1376 return rc; 1377 } 1343 1378 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h
r51042 r51121 247 247 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD* pCmd, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion); 248 248 int VBoxCmdVbvaConCmdCompletionData(void *pvCmd, VBOXCMDVBVA_CRCMD_CMD **ppCmd); 249 int VBoxCmdVbvaConCmdResize(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags); 249 250 #endif /* #ifdef VBOX_WITH_CROGL */ 250 251 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r51111 r51121 202 202 } 203 203 204 NTSTATUS vboxWddmGhDisplayPostInfoScreenBySDesc (PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_SURFACE_DESC *pDesc, const POINT * pVScreenPos, uint16_t fFlags)204 int vboxWddmGhDisplayPostInfoScreen(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags) 205 205 { 206 206 void *p = VBoxHGSMIBufferAlloc (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, … … 208 208 HGSMI_CH_VBVA, 209 209 VBVA_INFO_SCREEN); 210 Assert(p); 211 if (p) 212 { 213 VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)p; 214 215 pScreen->u32ViewIndex = pDesc->VidPnSourceId; 216 pScreen->i32OriginX = pVScreenPos->x; 217 pScreen->i32OriginY = pVScreenPos->y; 210 if (!p) 211 { 212 WARN(("VBoxHGSMIBufferAlloc failed")); 213 214 return VERR_OUT_OF_RESOURCES; 215 } 216 217 VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)p; 218 219 int rc = vboxWddmScreenInfoInit(pScreen, pAllocData, pVScreenPos, fFlags); 220 if (RT_SUCCESS(rc)) 221 { 218 222 pScreen->u32StartOffset = 0; //(uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 219 pScreen->u32LineSize = pDesc->pitch; 220 pScreen->u32Width = pDesc->width; 221 pScreen->u32Height = pDesc->height; 222 pScreen->u16BitsPerPixel = (uint16_t)pDesc->bpp; 223 pScreen->u16Flags = fFlags; 224 225 VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 226 227 VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 228 } 229 230 return STATUS_SUCCESS; 231 232 } 233 234 NTSTATUS vboxWddmGhDisplayPostInfoScreen(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos) 235 { 236 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreenBySDesc(pDevExt, &pAllocData->SurfDesc, pVScreenPos, VBVA_SCREEN_F_ACTIVE); 237 if (!NT_SUCCESS(Status)) 238 WARN(("vboxWddmGhDisplayPostInfoScreenBySDesc failed Status 0x%x", Status)); 239 return Status; 240 } 241 242 NTSTATUS vboxWddmGhDisplayHideScreen(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 243 { 244 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[VidPnTargetId]; 245 /* this will force update on re-activation */ 246 pSource->AllocData.SurfDesc.width = 0; 247 pSource->AllocData.SurfDesc.height = 0; 248 POINT VScreenPos = {0}; 249 250 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreenBySDesc(pDevExt, &pSource->AllocData.SurfDesc, &VScreenPos, VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED); 251 if (!NT_SUCCESS(Status)) 252 WARN(("vboxWddmGhDisplayPostInfoScreenBySDesc failed Status 0x%x", Status)); 253 return Status; 254 } 255 256 BOOL vboxWddmGhDisplayCheckCompletePeningScreenInfo(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 257 { 258 if (!ASMAtomicCmpXchgBool(&pDevExt->aTargets[VidPnTargetId].fStateSyncPening, false, true)) 259 return FALSE; 260 return vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, &pDevExt->aSources[VidPnTargetId]); 261 } 262 263 NTSTATUS vboxWddmGhDisplayPostInfoView(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData) 223 224 rc = VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 225 if (RT_FAILURE(rc)) 226 WARN(("VBoxHGSMIBufferSubmit failed %d", rc)); 227 } 228 else 229 WARN(("VBoxHGSMIBufferSubmit failed %d", rc)); 230 231 VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 232 233 return rc; 234 } 235 236 int vboxWddmGhDisplayPostInfoView(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData) 264 237 { 265 238 VBOXVIDEOOFFSET offVram = vboxWddmAddrFramOffset(&pAllocData->Addr); … … 267 240 { 268 241 WARN(("offVram == VBOXVIDEOOFFSET_VOID")); 269 return STATUS_INVALID_PARAMETER;242 return VERR_INVALID_PARAMETER; 270 243 } 271 244 … … 275 248 HGSMI_CH_VBVA, 276 249 VBVA_INFO_VIEW); 277 Assert(p); 278 if (p) 279 { 280 VBVAINFOVIEW *pView = (VBVAINFOVIEW *)p; 281 282 pView->u32ViewIndex = pAllocData->SurfDesc.VidPnSourceId; 283 pView->u32ViewOffset = (uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 284 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/VBoxCommonFromDeviceExt(pDevExt)->cDisplays; 285 286 pView->u32MaxScreenSize = pView->u32ViewSize; 287 288 VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 289 290 VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 250 if (!p) 251 { 252 WARN(("VBoxHGSMIBufferAlloc failed")); 253 return VERR_OUT_OF_RESOURCES; 254 } 255 256 VBVAINFOVIEW *pView = (VBVAINFOVIEW *)p; 257 258 pView->u32ViewIndex = pAllocData->SurfDesc.VidPnSourceId; 259 pView->u32ViewOffset = (uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 260 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/VBoxCommonFromDeviceExt(pDevExt)->cDisplays; 261 262 pView->u32MaxScreenSize = pView->u32ViewSize; 263 264 int rc = VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 265 if (RT_FAILURE(rc)) 266 WARN(("VBoxHGSMIBufferSubmit failed %d", rc)); 267 268 VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p); 269 270 return rc; 271 } 272 273 NTSTATUS vboxWddmGhDisplayPostResize(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags) 274 { 275 int rc; 276 #ifdef VBOX_WITH_CROGL 277 if (pDevExt->fCmdVbvaEnabled) 278 { 279 rc = VBoxCmdVbvaConCmdResize(pDevExt, pAllocData, pVScreenPos, fFlags); 280 if (RT_SUCCESS(rc)) 281 return STATUS_SUCCESS; 282 283 WARN(("VBoxCmdVbvaConCmdResize failed %d", rc)); 284 285 if (rc != VERR_NOT_IMPLEMENTED) 286 { 287 WARN(("VBoxCmdVbvaConCmdResize unexpected error occured %d", rc)); 288 return STATUS_UNSUCCESSFUL; 289 } 290 } 291 #endif 292 293 if (!(fFlags & VBVA_SCREEN_F_DISABLED)) 294 { 295 rc = vboxWddmGhDisplayPostInfoView(pDevExt, pAllocData); 296 if (RT_FAILURE(rc)) 297 { 298 WARN(("vboxWddmGhDisplayPostInfoView failed %d", rc)); 299 return STATUS_UNSUCCESSFUL; 300 } 301 } 302 303 rc = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocData, pVScreenPos, fFlags); 304 if (RT_FAILURE(rc)) 305 { 306 WARN(("vboxWddmGhDisplayPostInfoScreen failed %d", rc)); 307 return STATUS_UNSUCCESSFUL; 291 308 } 292 309 293 310 return STATUS_SUCCESS; 311 } 312 313 NTSTATUS vboxWddmGhDisplayHideScreen(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 314 { 315 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[VidPnTargetId]; 316 317 NTSTATUS Status = vboxWddmGhDisplayPostResize(pDevExt, &pSource->AllocData, &pSource->VScreenPos, VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED); 318 if (!NT_SUCCESS(Status)) 319 WARN(("vboxWddmGhDisplayPostResize failed Status 0x%x", Status)); 320 return Status; 321 } 322 323 BOOL vboxWddmGhDisplayCheckCompletePeningScreenInfo(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 324 { 325 if (!ASMAtomicCmpXchgBool(&pDevExt->aTargets[VidPnTargetId].fStateSyncPening, false, true)) 326 return FALSE; 327 return vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, &pDevExt->aSources[VidPnTargetId]); 294 328 } 295 329 … … 340 374 pSource->VScreenPos = *pVScreenPos; 341 375 342 NTSTATUS Status = vboxWddmGhDisplayPost InfoScreen(pDevExt, &pSource->AllocData, &pSource->VScreenPos);376 NTSTATUS Status = vboxWddmGhDisplayPostResize(pDevExt, &pSource->AllocData, &pSource->VScreenPos, VBVA_SCREEN_F_ACTIVE); 343 377 Assert(Status == STATUS_SUCCESS); 344 378 return Status; … … 361 395 if (NT_SUCCESS(Status)) 362 396 { 363 Status = vboxWddmGhDisplayPost InfoView(pDevExt, pAllocData);397 Status = vboxWddmGhDisplayPostResize(pDevExt, pAllocData, pVScreenPos, VBVA_SCREEN_F_ACTIVE); 364 398 if (NT_SUCCESS(Status)) 365 399 { 366 Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocData, pVScreenPos);367 if (NT_SUCCESS(Status))368 {369 400 #ifdef VBOX_WITH_CROGL 370 371 372 373 374 375 376 377 401 if (pDevExt->f3DEnabled) 402 { 403 Status = vboxVdmaTexPresentSetAlloc(pDevExt, pRealFbAlloc); 404 if (NT_SUCCESS(Status)) 405 return STATUS_SUCCESS; 406 else 407 WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status)); 408 } 378 409 #else 379 return STATUS_SUCCESS; 380 #endif 381 } 382 else 383 WARN(("vboxWddmGhDisplayPostInfoScreen failed, Status 0x%x", Status)); 410 return STATUS_SUCCESS; 411 #endif 384 412 } 385 413 else 386 WARN(("vboxWddmGhDisplayPost InfoViewfailed, Status 0x%x", Status));414 WARN(("vboxWddmGhDisplayPostResize failed, Status 0x%x", Status)); 387 415 } 388 416 else … … 5334 5362 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_LOCATION; 5335 5363 5336 if (p Source->bVisible)5364 if (pDevExt->fCmdVbvaEnabled || pSource->bVisible) 5337 5365 { 5338 5366 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); … … 5384 5412 PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation; 5385 5413 if (pAllocation) 5414 { 5415 Assert(pAllocation->bVisible == pSource->bVisible); 5386 5416 pAllocation->bVisible = pSetVidPnSourceVisibility->Visible; 5417 } 5387 5418 5388 5419 if (pSource->bVisible != pSetVidPnSourceVisibility->Visible) 5389 5420 { 5390 5421 pSource->bVisible = pSetVidPnSourceVisibility->Visible; 5391 if (pSource->bVisible) 5422 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_VISIBILITY; 5423 if (pDevExt->fCmdVbvaEnabled || pSource->bVisible) 5392 5424 { 5393 5425 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); … … 5538 5570 { 5539 5571 if (pSource->bVisible || !pTarget->HeightVisible) 5572 { 5573 pSource->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_VISIBILITY; 5574 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); 5575 } 5576 else if (pDevExt->fCmdVbvaEnabled) 5540 5577 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); 5541 5578 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r50987 r51121 243 243 (pAddr->SegmentId == 1 ? pAddr->offVram : 0) 244 244 : VBOXVIDEOOFFSET_VOID; 245 } 246 247 DECLINLINE(int) vboxWddmScreenInfoInit(VBVAINFOSCREEN *pScreen, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags) 248 { 249 VBOXVIDEOOFFSET offVram = vboxWddmAddrFramOffset(&pAllocData->Addr); 250 if (offVram == VBOXVIDEOOFFSET_VOID && !(fFlags & VBVA_SCREEN_F_DISABLED)) 251 { 252 WARN(("offVram == VBOXVIDEOOFFSET_VOID")); 253 return VERR_INVALID_PARAMETER; 254 } 255 256 pScreen->u32ViewIndex = pAllocData->SurfDesc.VidPnSourceId; 257 pScreen->i32OriginX = pVScreenPos->x; 258 pScreen->i32OriginY = pVScreenPos->y; 259 pScreen->u32StartOffset = (uint32_t)offVram; 260 pScreen->u32LineSize = pAllocData->SurfDesc.pitch; 261 pScreen->u32Width = pAllocData->SurfDesc.width; 262 pScreen->u32Height = pAllocData->SurfDesc.height; 263 pScreen->u16BitsPerPixel = (uint16_t)pAllocData->SurfDesc.bpp; 264 pScreen->u16Flags = fFlags; 265 266 return VINF_SUCCESS; 245 267 } 246 268 -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r51013 r51121 592 592 void VBVAReset (PVGASTATE pVGAState); 593 593 void VBVAPause (PVGASTATE pVGAState, bool fPause); 594 int VBVAGetScreenInfo(PVGASTATE pVGAState, unsigned uScreenId, struct VBVAINFOSCREEN *pScreen, void **ppvVram);595 594 596 595 bool VBVAIsEnabled(PVGASTATE pVGAState); … … 598 597 void VBVARaiseIrq (PVGASTATE pVGAState, uint32_t fFlags); 599 598 void VBVARaiseIrqNoWait(PVGASTATE pVGAState, uint32_t fFlags); 599 600 int VBVAInfoView(PVGASTATE pVGAState, VBVAINFOVIEW *pView); 601 int VBVAInfoScreen(PVGASTATE pVGAState, VBVAINFOSCREEN *pScreen); 600 602 601 603 /* @return host-guest flags that were set on reset -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r51013 r51121 496 496 pVBVA->hostFlags.u32SupportedOrders = 0; 497 497 498 rc = pVGAState->pDrv->pfnVBVAEnable (pVGAState->pDrv, uScreenId, &pVBVA->hostFlags );498 rc = pVGAState->pDrv->pfnVBVAEnable (pVGAState->pDrv, uScreenId, &pVBVA->hostFlags, false); 499 499 } 500 500 else … … 1903 1903 } 1904 1904 1905 int VBVAInfoView(PVGASTATE pVGAState, VBVAINFOVIEW *pView) 1906 { 1907 LogFlowFunc(("VBVA_INFO_VIEW: index %d, offset 0x%x, size 0x%x, max screen size 0x%x\n", 1908 pView->u32ViewIndex, pView->u32ViewOffset, pView->u32ViewSize, pView->u32MaxScreenSize)); 1909 1910 PHGSMIINSTANCE pIns = pVGAState->pHGSMI; 1911 VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext (pIns); 1912 1913 /* @todo verify view data. */ 1914 if (pView->u32ViewIndex >= pCtx->cViews) 1915 { 1916 Log(("View index too large %d!!!\n", 1917 pView->u32ViewIndex)); 1918 return VERR_INVALID_PARAMETER; 1919 } 1920 1921 pCtx->aViews[pView->u32ViewIndex].view = *pView; 1922 1923 return VINF_SUCCESS; 1924 } 1925 1926 int VBVAInfoScreen(PVGASTATE pVGAState, VBVAINFOSCREEN *pScreen) 1927 { 1928 PHGSMIINSTANCE pIns = pVGAState->pHGSMI; 1929 VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext (pIns); 1930 VBVAINFOVIEW *pView = &pCtx->aViews[pScreen->u32ViewIndex].view; 1931 /* Calculate the offset of the end of the screen so we can make 1932 * sure it is inside the view. I assume that screen rollover is not 1933 * implemented. */ 1934 int64_t offEnd = (int64_t)pScreen->u32Height * pScreen->u32LineSize 1935 + pScreen->u32Width + pScreen->u32StartOffset; 1936 LogRel(("VBVA_INFO_SCREEN: [%d] @%d,%d %dx%d, line 0x%x, BPP %d, flags 0x%x\n", 1937 pScreen->u32ViewIndex, pScreen->i32OriginX, pScreen->i32OriginY, 1938 pScreen->u32Width, pScreen->u32Height, 1939 pScreen->u32LineSize, pScreen->u16BitsPerPixel, pScreen->u16Flags)); 1940 1941 if ( pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews) 1942 && pScreen->u16BitsPerPixel <= 32 1943 && pScreen->u32Width <= UINT16_MAX 1944 && pScreen->u32Height <= UINT16_MAX 1945 && pScreen->u32LineSize <= UINT16_MAX * 4 1946 && offEnd < pView->u32MaxScreenSize) 1947 { 1948 vbvaResize (pVGAState, &pCtx->aViews[pScreen->u32ViewIndex], pScreen); 1949 return VINF_SUCCESS; 1950 } 1951 1952 LogRelFlow(("VBVA_INFO_SCREEN [%lu]: bad data: %lux%lu, line 0x%lx, BPP %u, start offset %lu, max screen size %lu\n", 1953 (unsigned long)pScreen->u32ViewIndex, 1954 (unsigned long)pScreen->u32Width, 1955 (unsigned long)pScreen->u32Height, 1956 (unsigned long)pScreen->u32LineSize, 1957 (unsigned long)pScreen->u16BitsPerPixel, 1958 (unsigned long)pScreen->u32StartOffset, 1959 (unsigned long)pView->u32MaxScreenSize)); 1960 return VERR_INVALID_PARAMETER; 1961 } 1962 1905 1963 1906 1964 /* … … 2069 2127 pView++, cbBuffer -= sizeof (VBVAINFOVIEW)) 2070 2128 { 2071 LogFlowFunc(("VBVA_INFO_VIEW: index %d, offset 0x%x, size 0x%x, max screen size 0x%x\n", 2072 pView->u32ViewIndex, pView->u32ViewOffset, pView->u32ViewSize, pView->u32MaxScreenSize)); 2073 2074 /* @todo verify view data. */ 2075 if (pView->u32ViewIndex >= pCtx->cViews) 2076 { 2077 Log(("View index too large %d!!!\n", 2078 pView->u32ViewIndex)); 2079 rc = VERR_INVALID_PARAMETER; 2129 VBVAINFOVIEW View = *pView; 2130 rc = VBVAInfoView(pVGAState, &View); 2131 if (RT_FAILURE(rc)) 2080 2132 break; 2081 }2082 2083 pCtx->aViews[pView->u32ViewIndex].view = *pView;2084 2133 } 2085 2134 } break; … … 2124 2173 2125 2174 VBVAINFOSCREEN *pScreen = (VBVAINFOSCREEN *)pvBuffer; 2126 VBVAINFOVIEW *pView = &pCtx->aViews[pScreen->u32ViewIndex].view; 2127 /* Calculate the offset of the end of the screen so we can make 2128 * sure it is inside the view. I assume that screen rollover is not 2129 * implemented. */ 2130 int64_t offEnd = (int64_t)pScreen->u32Height * pScreen->u32LineSize 2131 + pScreen->u32Width + pScreen->u32StartOffset; 2132 LogRel(("VBVA_INFO_SCREEN: [%d] @%d,%d %dx%d, line 0x%x, BPP %d, flags 0x%x\n", 2133 pScreen->u32ViewIndex, pScreen->i32OriginX, pScreen->i32OriginY, 2134 pScreen->u32Width, pScreen->u32Height, 2135 pScreen->u32LineSize, pScreen->u16BitsPerPixel, pScreen->u16Flags)); 2136 2137 if ( pScreen->u32ViewIndex < RT_ELEMENTS (pCtx->aViews) 2138 && pScreen->u16BitsPerPixel <= 32 2139 && pScreen->u32Width <= UINT16_MAX 2140 && pScreen->u32Height <= UINT16_MAX 2141 && pScreen->u32LineSize <= UINT16_MAX * 4 2142 && offEnd < pView->u32MaxScreenSize) 2143 { 2144 vbvaResize (pVGAState, &pCtx->aViews[pScreen->u32ViewIndex], pScreen); 2145 } 2146 else 2147 { 2148 LogRelFlow(("VBVA_INFO_SCREEN [%lu]: bad data: %lux%lu, line 0x%lx, BPP %u, start offset %lu, max screen size %lu\n", 2149 (unsigned long)pScreen->u32ViewIndex, 2150 (unsigned long)pScreen->u32Width, 2151 (unsigned long)pScreen->u32Height, 2152 (unsigned long)pScreen->u32LineSize, 2153 (unsigned long)pScreen->u16BitsPerPixel, 2154 (unsigned long)pScreen->u32StartOffset, 2155 (unsigned long)pView->u32MaxScreenSize)); 2156 rc = VERR_INVALID_PARAMETER; 2157 } 2175 VBVAINFOSCREEN Screen = *pScreen; 2176 rc = VBVAInfoScreen(pVGAState, &Screen); 2158 2177 } break; 2159 2178 … … 2442 2461 pVGAState->pHGSMI = NULL; 2443 2462 } 2444 2445 int VBVAGetScreenInfo(PVGASTATE pVGAState, unsigned uScreenId, struct VBVAINFOSCREEN *pScreen, void **ppvVram)2446 {2447 PPDMDEVINS pDevIns = pVGAState->pDevInsR3;2448 PHGSMIINSTANCE pIns = pVGAState->pHGSMI;2449 VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext (pIns);2450 int rc = PDMCritSectEnter(&pVGAState->CritSect, VERR_SEM_BUSY);2451 if (RT_SUCCESS(rc))2452 {2453 if (uScreenId < pCtx->cViews)2454 {2455 VBVAVIEW *pView = &pCtx->aViews[uScreenId];2456 if (pView->pVBVA)2457 {2458 uint8_t *pu8VRAM = pVGAState->vram_ptrR3 + pView->view.u32ViewOffset;2459 *pScreen = pView->screen;2460 *ppvVram = (void*)pu8VRAM;2461 rc = VINF_SUCCESS;2462 }2463 else2464 {2465 /* pretend disabled */2466 memset(pScreen, 0, sizeof (*pScreen));2467 pScreen->u16Flags = VBVA_SCREEN_F_DISABLED;2468 pScreen->u32ViewIndex = uScreenId;2469 *ppvVram = NULL;2470 rc = VINF_SUCCESS;2471 }2472 }2473 else2474 rc = VERR_INVALID_PARAMETER;2475 2476 PDMCritSectLeave(&pVGAState->CritSect);2477 }2478 return rc;2479 } -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r51111 r51121 109 109 VBVAEXHOSTCTL_TYPE_GHH_ENABLE_PAUSED, 110 110 VBVAEXHOSTCTL_TYPE_GHH_DISABLE, 111 VBVAEXHOSTCTL_TYPE_GH_MIN = VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE, 112 VBVAEXHOSTCTL_TYPE_GH_MAX = VBVAEXHOSTCTL_TYPE_GHH_DISABLE 111 VBVAEXHOSTCTL_TYPE_GHH_RESIZE 113 112 } VBVAEXHOSTCTL_TYPE; 114 113 … … 615 614 static int vboxVBVAExHSSaveGuestCtl(struct VBVAEXHOSTCONTEXT *pCmdVbva, VBVAEXHOSTCTL* pCtl, uint8_t* pu8VramBase, PSSMHANDLE pSSM) 616 615 { 617 if (VBVAEXHOSTCTL_TYPE_GH_MIN > pCtl->enmType || VBVAEXHOSTCTL_TYPE_GH_MAX < pCtl->enmType)618 {619 WARN(("unexpected command type!\n"));620 return VERR_INTERNAL_ERROR;621 }622 623 616 int rc = SSMR3PutU32(pSSM, pCtl->enmType); 624 617 AssertRCReturn(rc, rc); … … 681 674 if (!u32) 682 675 return VINF_EOF; 683 684 if (VBVAEXHOSTCTL_TYPE_GH_MIN > u32 || VBVAEXHOSTCTL_TYPE_GH_MAX < u32)685 {686 WARN(("unexpected command type!\n"));687 return VERR_INTERNAL_ERROR;688 }689 676 690 677 VBVAEXHOSTCTL* pHCtl = VBoxVBVAExHCtlCreate(pCmdVbva, (VBVAEXHOSTCTL_TYPE)u32); … … 1336 1323 } 1337 1324 case VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE: 1325 { 1338 1326 if (!VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva)) 1339 1327 { … … 1342 1330 } 1343 1331 return pVdma->CrSrvInfo.pfnHostCtl(pVdma->CrSrvInfo.hSvr, pCmd->u.cmd.pu8Cmd, pCmd->u.cmd.cbCmd); 1332 } 1344 1333 case VBVAEXHOSTCTL_TYPE_GHH_DISABLE: 1345 1334 { … … 1383 1372 switch (enmType) 1384 1373 { 1385 case VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE: 1386 if (!VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva)) 1387 { 1388 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for disabled vdma VBVA\n")); 1389 return VERR_INVALID_STATE; 1390 } 1391 return pVdma->CrSrvInfo.pfnGuestCtl(pVdma->CrSrvInfo.hSvr, pCmd->u.cmd.pu8Cmd, pCmd->u.cmd.cbCmd); 1374 case VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE: 1375 { 1376 if (!VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva)) 1377 { 1378 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for disabled vdma VBVA\n")); 1379 return VERR_INVALID_STATE; 1380 } 1381 return pVdma->CrSrvInfo.pfnGuestCtl(pVdma->CrSrvInfo.hSvr, pCmd->u.cmd.pu8Cmd, pCmd->u.cmd.cbCmd); 1382 } 1383 case VBVAEXHOSTCTL_TYPE_GHH_RESIZE: 1384 { 1385 if (!VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva)) 1386 { 1387 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for disabled vdma VBVA\n")); 1388 return VERR_INVALID_STATE; 1389 } 1390 1391 uint32_t cbCmd = pCmd->u.cmd.cbCmd; 1392 1393 if (cbCmd % sizeof (VBOXCMDVBVA_RESIZE_ENTRY)) 1394 { 1395 WARN(("invalid buffer size\n")); 1396 return VERR_INVALID_PARAMETER; 1397 } 1398 1399 uint32_t cElements = cbCmd / sizeof (VBOXCMDVBVA_RESIZE_ENTRY); 1400 if (!cElements) 1401 { 1402 WARN(("invalid buffer size\n")); 1403 return VERR_INVALID_PARAMETER; 1404 } 1405 1406 VBOXCMDVBVA_RESIZE *pResize = (VBOXCMDVBVA_RESIZE*)pCmd->u.cmd.pu8Cmd; 1407 PVGASTATE pVGAState = pVdma->pVGAState; 1408 int rc = VINF_SUCCESS; 1409 1410 for (uint32_t i = 0; i < cElements; ++i) 1411 { 1412 VBOXCMDVBVA_RESIZE_ENTRY *pEntry = &pResize->aEntries[i]; 1413 VBVAINFOSCREEN Screen = pEntry->Screen; 1414 VBVAINFOVIEW View; 1415 uint32_t u32StartOffsetPreserve = 0; 1416 if (Screen.u32StartOffset == ~0UL) 1417 { 1418 if (Screen.u16Flags & VBVA_SCREEN_F_DISABLED) 1419 { 1420 u32StartOffsetPreserve = ~0UL; 1421 Screen.u32StartOffset = 0; 1422 } 1423 else 1424 { 1425 WARN(("invalid parameter\n")); 1426 rc = VERR_INVALID_PARAMETER; 1427 break; 1428 } 1429 } 1430 1431 1432 View.u32ViewIndex = Screen.u32ViewIndex; 1433 View.u32ViewOffset = 0; 1434 View.u32ViewSize = Screen.u32LineSize * Screen.u32Height + Screen.u32StartOffset; 1435 View.u32MaxScreenSize = View.u32ViewSize + Screen.u32Width + 1; /* <- make VBVAInfoScreen logic (offEnd < pView->u32MaxScreenSize) happy */ 1436 1437 int rc = VBVAInfoView(pVGAState, &View); 1438 if (RT_SUCCESS(rc)) 1439 { 1440 1441 rc = VBVAInfoScreen(pVGAState, &Screen); 1442 if (RT_SUCCESS(rc)) 1443 { 1444 if (u32StartOffsetPreserve) 1445 Screen.u32StartOffset = u32StartOffsetPreserve; 1446 1447 rc = pVdma->CrSrvInfo.pfnResize(pVdma->CrSrvInfo.hSvr, &Screen, u32StartOffsetPreserve ? NULL : pVGAState->vram_ptrR3 + Screen.u32StartOffset); 1448 if (RT_SUCCESS(rc)) 1449 continue; 1450 else 1451 { 1452 WARN(("pfnResize failed %d\n", rc)); 1453 break; 1454 } 1455 } 1456 else 1457 { 1458 WARN(("VBVAInfoScreen failed %d\n", rc)); 1459 break; 1460 } 1461 } 1462 else 1463 { 1464 WARN(("VBVAInfoView failed %d\n", rc)); 1465 break; 1466 } 1467 } 1468 return rc; 1469 } 1392 1470 case VBVAEXHOSTCTL_TYPE_GHH_ENABLE: 1393 1471 case VBVAEXHOSTCTL_TYPE_GHH_ENABLE_PAUSED: … … 2645 2723 } 2646 2724 2647 static int vdmaVBVACtl OpaqueSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL_SOURCE enmSource, uint8_t* pu8Cmd, uint32_t cbCmd, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete)2648 { 2649 VBVAEXHOSTCTL* pHCtl = VBoxVBVAExHCtlCreate(&pVdma->CmdVbva, VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE);2725 static int vdmaVBVACtlGenericSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL_SOURCE enmSource, VBVAEXHOSTCTL_TYPE enmType, uint8_t* pu8Cmd, uint32_t cbCmd, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete) 2726 { 2727 VBVAEXHOSTCTL* pHCtl = VBoxVBVAExHCtlCreate(&pVdma->CmdVbva, enmType); 2650 2728 if (!pHCtl) 2651 2729 { … … 2666 2744 } 2667 2745 2668 static int vdmaVBVACtl OpaqueGuestSubmit(PVBOXVDMAHOST pVdma, VBOXCMDVBVA_CTL *pCtl, uint32_t cbCtl)2746 static int vdmaVBVACtlGenericGuestSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL_TYPE enmType, VBOXCMDVBVA_CTL *pCtl, uint32_t cbCtl) 2669 2747 { 2670 2748 Assert(cbCtl >= sizeof (VBOXCMDVBVA_CTL)); 2671 2749 VBoxSHGSMICommandMarkAsynchCompletion(pCtl); 2672 int rc = vdmaVBVACtl OpaqueSubmit(pVdma, VBVAEXHOSTCTL_SOURCE_GUEST, (uint8_t*)(pCtl+1), cbCtl - sizeof (VBOXCMDVBVA_CTL), vboxCmdVBVACmdCtlGuestCompletion, pVdma);2750 int rc = vdmaVBVACtlGenericSubmit(pVdma, VBVAEXHOSTCTL_SOURCE_GUEST, enmType, (uint8_t*)(pCtl+1), cbCtl - sizeof (VBOXCMDVBVA_CTL), vboxCmdVBVACmdCtlGuestCompletion, pVdma); 2673 2751 if (RT_SUCCESS(rc)) 2674 2752 return VINF_SUCCESS; 2675 2753 2676 WARN(("vdmaVBVACtl OpaqueSubmit failed %d\n", rc));2754 WARN(("vdmaVBVACtlGenericSubmit failed %d\n", rc)); 2677 2755 pCtl->i32Result = rc; 2678 2756 rc = VBoxSHGSMICommandComplete(pVdma->pHgsmi, pCtl); … … 2694 2772 { 2695 2773 pCmd->u.pfnInternal = (void(*)())pfnCompletion; 2696 int rc = vdmaVBVACtl OpaqueSubmit(pVdma, VBVAEXHOSTCTL_SOURCE_HOST, (uint8_t*)pCmd, cbCmd, vboxCmdVBVACmdCtlHostCompletion, pvCompletion);2774 int rc = vdmaVBVACtlGenericSubmit(pVdma, VBVAEXHOSTCTL_SOURCE_HOST, VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE, (uint8_t*)pCmd, cbCmd, vboxCmdVBVACmdCtlHostCompletion, pvCompletion); 2697 2775 if (RT_FAILURE(rc)) 2698 2776 { … … 2707 2785 return rc; 2708 2786 } 2709 WARN(("vdmaVBVACtl OpaqueSubmit failed %d\n", rc));2787 WARN(("vdmaVBVACtlGenericSubmit failed %d\n", rc)); 2710 2788 return rc; 2711 2789 } 2712 2790 2791 return VINF_SUCCESS; 2792 } 2793 2794 static DECLCALLBACK(int) vdmaVBVANotifyEnable(PVGASTATE pVGAState) 2795 { 2796 for (uint32_t i = 0; i < pVGAState->cMonitors; i++) 2797 { 2798 int rc = pVGAState->pDrv->pfnVBVAEnable (pVGAState->pDrv, i, NULL, true); 2799 if (!RT_SUCCESS(rc)) 2800 { 2801 WARN(("pfnVBVAEnable failed %d\n", rc)); 2802 for (uint32_t j = 0; j < i; j++) 2803 { 2804 pVGAState->pDrv->pfnVBVADisable (pVGAState->pDrv, j); 2805 } 2806 2807 return rc; 2808 } 2809 } 2810 return VINF_SUCCESS; 2811 } 2812 2813 static DECLCALLBACK(int) vdmaVBVANotifyDisable(PVGASTATE pVGAState) 2814 { 2815 for (uint32_t i = 0; i < pVGAState->cMonitors; i++) 2816 { 2817 pVGAState->pDrv->pfnVBVADisable (pVGAState->pDrv, i); 2818 } 2713 2819 return VINF_SUCCESS; 2714 2820 } … … 2722 2828 { 2723 2829 rc = vboxVDMACrGuestCtlProcess(pVdma, pHCtl); 2724 if (RT_FAILURE(rc)) 2830 /* rc == VINF_SUCCESS would mean the actual state change has occcured */ 2831 if (rc == VINF_SUCCESS) 2832 { 2833 /* we need to inform Main about VBVA enable/disable 2834 * main expects notifications to be done from the main thread 2835 * submit it there */ 2836 PVGASTATE pVGAState = pVdma->pVGAState; 2837 2838 if (VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva)) 2839 vdmaVBVANotifyEnable(pVGAState); 2840 else 2841 vdmaVBVANotifyDisable(pVGAState); 2842 } 2843 else if (RT_FAILURE(rc)) 2725 2844 WARN(("vboxVDMACrGuestCtlProcess failed %d\n", rc)); 2726 2845 } … … 2823 2942 } 2824 2943 2825 static DECLCALLBACK(int) vdmaVBVANotifyEnable(PVGASTATE pVGAState)2826 {2827 for (uint32_t i = 0; i < pVGAState->cMonitors; i++)2828 {2829 int rc = pVGAState->pDrv->pfnVBVAEnable (pVGAState->pDrv, i, NULL);2830 if (!RT_SUCCESS(rc))2831 {2832 WARN(("pfnVBVAEnable failed %d\n", rc));2833 for (uint32_t j = 0; j < i; j++)2834 {2835 pVGAState->pDrv->pfnVBVADisable (pVGAState->pDrv, j);2836 }2837 2838 return rc;2839 }2840 }2841 return VINF_SUCCESS;2842 }2843 2844 static DECLCALLBACK(int) vdmaVBVANotifyDisable(PVGASTATE pVGAState)2845 {2846 for (uint32_t i = 0; i < pVGAState->cMonitors; i++)2847 {2848 pVGAState->pDrv->pfnVBVADisable (pVGAState->pDrv, i);2849 }2850 return VINF_SUCCESS;2851 }2852 2853 static DECLCALLBACK(void) vboxCmdVBVACmdCtlGuestEnableDisableCompletion(VBVAEXHOSTCONTEXT *pVbva, struct VBVAEXHOSTCTL *pCtl, int rc, void *pvContext)2854 {2855 if (rc == VINF_SUCCESS)2856 {2857 /* we need to inform Main about VBVA enable/disable2858 * main expects notifications to be done from the main thread2859 * submit it there */2860 PVBOXVDMAHOST pVdma = RT_FROM_MEMBER(pVbva, VBOXVDMAHOST, CmdVbva);2861 PVGASTATE pVGAState = pVdma->pVGAState;2862 2863 if (VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva))2864 VMR3ReqCallNoWait(PDMDevHlpGetVM(pVGAState->pDevInsR3), VMCPUID_ANY, (PFNRT)vdmaVBVANotifyEnable, 1, pVGAState);2865 else2866 VMR3ReqCallNoWait(PDMDevHlpGetVM(pVGAState->pDevInsR3), VMCPUID_ANY, (PFNRT)vdmaVBVANotifyDisable, 1, pVGAState);2867 }2868 2869 vboxCmdVBVACmdCtlGuestCompletion(pVbva, pCtl, rc, pvContext);2870 }2871 2872 2944 static int vdmaVBVACtlEnableDisableSubmitInternal(PVBOXVDMAHOST pVdma, VBVAENABLE *pEnable, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete) 2873 2945 { … … 2881 2953 { 2882 2954 VBoxSHGSMICommandMarkAsynchCompletion(&pEnable->Hdr); 2883 int rc = vdmaVBVACtlEnableDisableSubmitInternal(pVdma, &pEnable->Enable, vboxCmdVBVACmdCtlGuest EnableDisableCompletion, pVdma);2955 int rc = vdmaVBVACtlEnableDisableSubmitInternal(pVdma, &pEnable->Enable, vboxCmdVBVACmdCtlGuestCompletion, pVdma); 2884 2956 if (RT_SUCCESS(rc)) 2885 2957 return VINF_SUCCESS; … … 3045 3117 { 3046 3118 case VBOXCMDVBVACTL_TYPE_3DCTL: 3047 return vdmaVBVACtlOpaqueGuestSubmit(pVdma, pCtl, cbCtl); 3119 return vdmaVBVACtlGenericGuestSubmit(pVdma, VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE, pCtl, cbCtl); 3120 case VBOXCMDVBVACTL_TYPE_RESIZE: 3121 return vdmaVBVACtlGenericGuestSubmit(pVdma, VBVAEXHOSTCTL_TYPE_GHH_RESIZE, pCtl, cbCtl); 3048 3122 case VBOXCMDVBVACTL_TYPE_ENABLE: 3049 3123 if (cbCtl != sizeof (VBOXCMDVBVA_CTL_ENABLE)) … … 3215 3289 Assert(pVdma->CmdVbva.i32State == VBVAEXHOSTCONTEXT_ESTATE_PAUSED); 3216 3290 3217 vdmaVBVANotifyEnable(pVdma->pVGAState);3218 3219 3291 VBVAEXHOSTCTL HCtl; 3220 3292 HCtl.enmType = VBVAEXHOSTCTL_TYPE_HH_LOADSTATE; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r51111 r51121 473 473 int8_t crVBoxServerCrCmdFlipProcess(const VBOXCMDVBVA_FLIP *pFlip); 474 474 475 int crVBoxServerResizeScreen(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM); 476 475 477 //#define VBOX_WITH_CRSERVER_DUMPER 476 478 #ifdef VBOX_WITH_CRSERVER_DUMPER -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r51111 r51121 3569 3569 } 3570 3570 3571 static DECLCALLBACK(int) crVBoxCrCmdResize(HVBOXCRCMDSVR hSvr, const struct VBVAINFOSCREEN *pScreen, void *pvVRAM) 3572 { 3573 CRASSERT(cr_server.fCrCmdEnabled); 3574 return crVBoxServerResizeScreen(pScreen, pvVRAM); 3575 } 3576 3571 3577 static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***"; 3572 3578 … … 4195 4201 pSetup->CrCmdServerInfo.pfnHostCtl = crVBoxCrCmdHostCtl; 4196 4202 pSetup->CrCmdServerInfo.pfnGuestCtl = crVBoxCrCmdGuestCtl; 4203 pSetup->CrCmdServerInfo.pfnResize = crVBoxCrCmdResize; 4197 4204 pSetup->CrCmdServerInfo.pfnSaveState = crVBoxCrCmdSaveState; 4198 4205 pSetup->CrCmdServerInfo.pfnLoadState = crVBoxCrCmdLoadState; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.cpp
r50754 r51121 395 395 396 396 397 staticint crVBoxServerResizeScreen(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM)397 int crVBoxServerResizeScreen(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM) 398 398 { 399 399 int rc; … … 431 431 DECLEXPORT(int) crVBoxServerNotifyResize(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM) 432 432 { 433 if (cr_server.fCrCmdEnabled) 434 { 435 WARN(("crVBoxServerNotifyResize for enabled CrCmd")); 436 return VERR_INVALID_STATE; 437 } 438 433 439 int rc = crVBoxServerResizeScreen(pScreen, pvVRAM); 434 440 if (!RT_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r51112 r51121 1242 1242 return pFbTex; 1243 1243 } 1244 1245 1244 1246 1245 CR_TEXDATA* CrFbTexDataCreate(const VBOXVR_TEXTURE *pTex) -
trunk/src/VBox/Main/include/DisplayImpl.h
r51013 r51121 98 98 bool fVBVAEnabled; 99 99 bool fVBVAForceResize; 100 bool fRenderThreadMode; 100 101 uint32_t cVBVASkipUpdate; 101 102 struct … … 280 281 #endif 281 282 #ifdef VBOX_WITH_HGSMI 282 static DECLCALLBACK(int) displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags );283 static DECLCALLBACK(int) displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags, bool fRenderThreadMode); 283 284 static DECLCALLBACK(void) displayVBVADisable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId); 284 285 static DECLCALLBACK(void) displayVBVAUpdateBegin(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId); -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51095 r51121 638 638 maFramebuffers[ul].fVBVAEnabled = false; 639 639 maFramebuffers[ul].fVBVAForceResize = false; 640 maFramebuffers[ul].fRenderThreadMode = false; 640 641 maFramebuffers[ul].cVBVASkipUpdate = 0; 641 642 RT_ZERO(maFramebuffers[ul].vbvaSkippedRect); … … 872 873 { 873 874 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 875 if (maFramebuffers[pScreen->u32ViewIndex].fRenderThreadMode) 876 return VINF_SUCCESS; /* nop it */ 877 874 878 BOOL is3denabled; 875 879 mParent->machine()->COMGETTER(Accelerate3DEnabled)(&is3denabled); … … 4587 4591 4588 4592 #ifdef VBOX_WITH_HGSMI 4589 DECLCALLBACK(int) Display::displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags )4593 DECLCALLBACK(int) Display::displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, PVBVAHOSTFLAGS pHostFlags, bool fRenderThreadMode) 4590 4594 { 4591 4595 LogRelFlowFunc(("uScreenId %d\n", uScreenId)); … … 4594 4598 Display *pThis = pDrv->pDisplay; 4595 4599 4600 if (pThis->maFramebuffers[uScreenId].fVBVAEnabled && pThis->maFramebuffers[uScreenId].fRenderThreadMode != fRenderThreadMode) 4601 { 4602 LogRel(("enabling different vbva mode")); 4603 #ifdef DEBUG_misha 4604 AssertMsgFailed(("enabling different vbva mode")); 4605 #endif 4606 return VERR_INVALID_STATE; 4607 } 4608 4596 4609 pThis->maFramebuffers[uScreenId].fVBVAEnabled = true; 4597 4610 pThis->maFramebuffers[uScreenId].pVBVAHostFlags = pHostFlags; 4611 pThis->maFramebuffers[uScreenId].fRenderThreadMode = fRenderThreadMode; 4598 4612 pThis->maFramebuffers[uScreenId].fVBVAForceResize = true; 4599 4613 … … 4630 4644 pFBInfo->fVBVAEnabled = false; 4631 4645 pFBInfo->fVBVAForceResize = false; 4646 pFBInfo->fRenderThreadMode = false; 4632 4647 4633 4648 vbvaSetMemoryFlagsHGSMI(uScreenId, 0, false, pFBInfo);
Note:
See TracChangeset
for help on using the changeset viewer.