VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm/VBoxDispDDraw.cpp@ 69500

Last change on this file since 69500 was 69500, checked in by vboxsync, 7 years ago

*: scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.2 KB
Line 
1/* $Id: VBoxDispDDraw.cpp 69500 2017-10-28 15:14:05Z vboxsync $ */
2/** @file
3 * VBox XPDM Display driver, DirectDraw callbacks
4 */
5
6/*
7 * Copyright (C) 2011-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#include "VBoxDisp.h"
19#include "VBoxDispDDraw.h"
20#include "VBoxDispMini.h"
21#include <iprt/asm.h>
22
23/* Called to check if our driver can create surface with requested attributes */
24DWORD APIENTRY VBoxDispDDCanCreateSurface(PDD_CANCREATESURFACEDATA lpCanCreateSurface)
25{
26 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpCanCreateSurface->lpDD->dhpdev;
27 LOGF_ENTER();
28
29 PDD_SURFACEDESC lpDDS = lpCanCreateSurface->lpDDSurfaceDesc;
30
31#ifdef VBOX_WITH_VIDEOHWACCEL
32 if(pDev->vhwa.bEnabled)
33 {
34 VBOXVHWACMD* pCmd;
35
36 uint32_t unsupportedSCaps = VBoxDispVHWAUnsupportedDDSCAPS(lpDDS->ddsCaps.dwCaps);
37 if(unsupportedSCaps)
38 {
39 WARN(("unsupported ddscaps: %#x", unsupportedSCaps));
40 lpCanCreateSurface->ddRVal = DDERR_INVALIDCAPS;
41 return DDHAL_DRIVER_HANDLED;
42 }
43
44 unsupportedSCaps = VBoxDispVHWAUnsupportedDDPFS(lpDDS->ddpfPixelFormat.dwFlags);
45 if(unsupportedSCaps)
46 {
47 WARN(("unsupported pixel format: %#x", unsupportedSCaps));
48 lpCanCreateSurface->ddRVal = DDERR_INVALIDPIXELFORMAT;
49 return DDHAL_DRIVER_HANDLED;
50 }
51
52 pCmd = VBoxDispVHWACommandCreate(pDev, VBOXVHWACMD_TYPE_SURF_CANCREATE, sizeof(VBOXVHWACMD_SURF_CANCREATE));
53 if(pCmd)
54 {
55 int rc;
56 VBOXVHWACMD_SURF_CANCREATE *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CANCREATE);
57 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_CANCREATE));
58
59 rc = VBoxDispVHWAFromDDSURFACEDESC(&pBody->SurfInfo, lpDDS);
60 pBody->u.in.bIsDifferentPixelFormat = lpCanCreateSurface->bIsDifferentPixelFormat;
61
62 VBoxDispVHWACommandSubmit(pDev, pCmd);
63
64 if (RT_SUCCESS(pCmd->rc))
65 {
66 if(pBody->u.out.ErrInfo)
67 {
68 WARN(("pBody->u.out.ErrInfo = %#x", pBody->u.out.ErrInfo));
69 lpCanCreateSurface->ddRVal = DDERR_GENERIC;
70 }
71 else
72 {
73 lpCanCreateSurface->ddRVal = DD_OK;
74 }
75 }
76 else
77 {
78 WARN(("VBoxDispVHWACommandSubmit failed with rc=%#x", rc));
79 lpCanCreateSurface->ddRVal = DDERR_GENERIC;
80 }
81 VBoxDispVHWACommandRelease(pDev, pCmd);
82 }
83 else
84 {
85 WARN(("VBoxDispVHWACommandCreate failed!"));
86 lpCanCreateSurface->ddRVal = DDERR_GENERIC;
87 }
88 return DDHAL_DRIVER_HANDLED;
89 }
90#endif /*VBOX_WITH_VIDEOHWACCEL*/
91
92 if (lpDDS->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
93 {
94 LOG(("No Z-Bufer support"));
95 lpCanCreateSurface->ddRVal = DDERR_UNSUPPORTED;
96 return DDHAL_DRIVER_HANDLED;
97 }
98 if (lpDDS->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
99 {
100 LOG(("No texture support"));
101 lpCanCreateSurface->ddRVal = DDERR_UNSUPPORTED;
102 return DDHAL_DRIVER_HANDLED;
103 }
104 if (lpCanCreateSurface->bIsDifferentPixelFormat && (lpDDS->ddpfPixelFormat.dwFlags & DDPF_FOURCC))
105 {
106 LOG(("FOURCC not supported"));
107 lpCanCreateSurface->ddRVal = DDERR_UNSUPPORTED;
108 return DDHAL_DRIVER_HANDLED;
109 }
110
111 lpCanCreateSurface->ddRVal = DD_OK;
112 LOGF_LEAVE();
113 return DDHAL_DRIVER_HANDLED;
114}
115
116/* Called to create DirectDraw surface.
117 * Note: we always return DDHAL_DRIVER_NOTHANDLED, which asks DirectDraw memory manager
118 * to perform actual memory allocation in our DDraw heap.
119 */
120DWORD APIENTRY VBoxDispDDCreateSurface(PDD_CREATESURFACEDATA lpCreateSurface)
121{
122 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpCreateSurface->lpDD->dhpdev;
123 LOGF_ENTER();
124
125 PDD_SURFACE_LOCAL pSurf = lpCreateSurface->lplpSList[0];
126
127 if (pSurf->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
128 {
129 LOG(("primary surface"));
130 pSurf->lpGbl->fpVidMem = 0;
131 }
132 else
133 {
134 LOG(("non primary surface"));
135 pSurf->lpGbl->fpVidMem = DDHAL_PLEASEALLOC_BLOCKSIZE;
136 }
137 pSurf->lpGbl->dwReserved1 = 0;
138
139#ifdef VBOX_WITH_VIDEOHWACCEL
140 if(pDev->vhwa.bEnabled)
141 {
142 VBOXVHWACMD* pCmd;
143
144 pCmd = VBoxDispVHWACommandCreate(pDev, VBOXVHWACMD_TYPE_SURF_CREATE, sizeof(VBOXVHWACMD_SURF_CREATE));
145 if (pCmd)
146 {
147 VBOXVHWACMD_SURF_CREATE *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CREATE);
148 PVBOXVHWASURFDESC pDesc;
149 int rc;
150
151 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_CREATE));
152 rc = VBoxDispVHWAFromDDSURFACEDESC(&pBody->SurfInfo, lpCreateSurface->lpDDSurfaceDesc);
153 VBOX_WARNRC(rc);
154
155 pBody->SurfInfo.surfCaps = VBoxDispVHWAFromDDSCAPS(pSurf->ddsCaps.dwCaps);
156 pBody->SurfInfo.flags |= DDSD_CAPS;
157
158 pBody->SurfInfo.height = pSurf->lpGbl->wHeight;
159 pBody->SurfInfo.width = pSurf->lpGbl->wWidth;
160 pBody->SurfInfo.flags |= DDSD_HEIGHT | DDSD_WIDTH;
161
162 VBoxDispVHWAFromDDPIXELFORMAT(&pBody->SurfInfo.PixelFormat, &pSurf->lpGbl->ddpfSurface);
163 pBody->SurfInfo.flags |= VBOXVHWA_SD_PIXELFORMAT;
164
165 if (pSurf->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
166 {
167 pBody->SurfInfo.offSurface = VBoxDispVHWAVramOffsetFromPDEV(pDev, 0);
168 }
169 else
170 {
171 pBody->SurfInfo.offSurface = VBOXVHWA_OFFSET64_VOID;
172 }
173
174 pDesc = VBoxDispVHWASurfDescAlloc();
175 if (pDesc)
176 {
177 VBoxDispVHWACommandSubmit(pDev, pCmd);
178 if (RT_SUCCESS(pCmd->rc))
179 {
180 pDesc->hHostHandle = pBody->SurfInfo.hSurf;
181
182 if(!!(pSurf->ddsCaps.dwCaps & DDSCAPS_OVERLAY)
183 && !!(pSurf->ddsCaps.dwCaps & DDSCAPS_VISIBLE))
184 {
185 pDesc->bVisible = true;
186 }
187
188 pSurf->lpGbl->dwBlockSizeX = pBody->SurfInfo.sizeX;
189 pSurf->lpGbl->dwBlockSizeY = pBody->SurfInfo.sizeY;
190 pSurf->lpGbl->lPitch = pBody->SurfInfo.pitch;
191
192 lpCreateSurface->lpDDSurfaceDesc->lPitch = pSurf->lpGbl->lPitch;
193 lpCreateSurface->lpDDSurfaceDesc->dwFlags |= DDSD_PITCH;
194
195
196 /** @todo it's probably a memory leak, because DDDestroySurface wouldn't be called for
197 * primary surfaces.
198 */
199 pSurf->lpGbl->dwReserved1 = (ULONG_PTR)pDesc;
200 }
201 else
202 {
203 WARN(("VBoxDispVHWACommandSubmit failed with rc=%#x", rc));
204 VBoxDispVHWASurfDescFree(pDesc);
205 }
206 }
207 else
208 {
209 WARN(("VBoxDispVHWASurfDescAlloc failed"));
210 }
211 VBoxDispVHWACommandRelease(pDev, pCmd);
212 }
213 else
214 {
215 WARN(("VBoxDispVHWACommandCreate failed"));
216 }
217 return DDHAL_DRIVER_NOTHANDLED;
218 }
219#endif /*VBOX_WITH_VIDEOHWACCEL*/
220
221 LPDDSURFACEDESC pDesc = lpCreateSurface->lpDDSurfaceDesc;
222
223 if (pDesc->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED4)
224 {
225 pSurf->lpGbl->lPitch = RT_ALIGN_T(pSurf->lpGbl->wWidth/2, 32, LONG);
226 }
227 else
228 if (pDesc->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8)
229 {
230 pSurf->lpGbl->lPitch = RT_ALIGN_T(pSurf->lpGbl->wWidth, 32, LONG);
231 }
232 else
233 {
234 pSurf->lpGbl->lPitch = pSurf->lpGbl->wWidth*(pDesc->ddpfPixelFormat.dwRGBBitCount/8);
235 }
236
237 pSurf->lpGbl->dwBlockSizeX = pSurf->lpGbl->lPitch;
238 pSurf->lpGbl->dwBlockSizeY = pSurf->lpGbl->wHeight;
239
240 pDesc->lPitch = pSurf->lpGbl->lPitch;
241 pDesc->dwFlags |= DDSD_PITCH;
242
243 LOGF_LEAVE();
244 return DDHAL_DRIVER_NOTHANDLED;
245}
246
247/* Called to destroy DirectDraw surface,
248 * in particular we should free vhwa resources allocated on VBoxDispDDCreateSurface.
249 * Note: we're always returning DDHAL_DRIVER_NOTHANDLED because we rely on DirectDraw memory manager.
250 */
251DWORD APIENTRY VBoxDispDDDestroySurface(PDD_DESTROYSURFACEDATA lpDestroySurface)
252{
253 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpDestroySurface->lpDD->dhpdev;
254 LOGF_ENTER();
255
256 lpDestroySurface->ddRVal = DD_OK;
257
258#ifdef VBOX_WITH_VIDEOHWACCEL
259 if (pDev->vhwa.bEnabled)
260 {
261 VBOXVHWACMD* pCmd;
262
263 pCmd = VBoxDispVHWACommandCreate(pDev, VBOXVHWACMD_TYPE_SURF_DESTROY, sizeof(VBOXVHWACMD_SURF_DESTROY));
264 if (pCmd)
265 {
266 VBOXVHWACMD_SURF_DESTROY *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_DESTROY);
267 PVBOXVHWASURFDESC pDesc = (PVBOXVHWASURFDESC)lpDestroySurface->lpDDSurface->lpGbl->dwReserved1;
268
269 if (pDesc)
270 {
271 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_DESTROY));
272 pBody->u.in.hSurf = pDesc->hHostHandle;
273
274 VBoxDispVHWACommandSubmit(pDev, pCmd);
275
276 VBoxDispVHWACommandRelease(pDev, pCmd);
277
278 VBoxDispVHWASurfDescFree(pDesc);
279
280 lpDestroySurface->lpDDSurface->lpGbl->dwReserved1 = (ULONG_PTR)NULL;
281 }
282 else
283 {
284 WARN(("!pDesc, memory overwrite somewhere?"));
285 lpDestroySurface->ddRVal = DDERR_GENERIC;
286 }
287 }
288 else
289 {
290 WARN(("VBoxDispVHWACommandCreate failed!"));
291 lpDestroySurface->ddRVal = DDERR_GENERIC;
292 }
293 }
294 else
295#endif /*VBOX_WITH_VIDEOHWACCEL*/
296
297 LOGF_LEAVE();
298 return DDHAL_DRIVER_NOTHANDLED;
299}
300
301/* Called before first DDLock/after last DDUnlock to map/unmap surface memory from given process address space
302 * We go easy way and map whole framebuffer and offscreen DirectDraw heap every time.
303 */
304DWORD APIENTRY VBoxDispDDMapMemory(PDD_MAPMEMORYDATA lpMapMemory)
305{
306 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpMapMemory->lpDD->dhpdev;
307 VIDEO_SHARE_MEMORY smem;
308 int rc;
309 LOGF_ENTER();
310
311 lpMapMemory->ddRVal = DDERR_GENERIC;
312
313 memset(&smem, 0, sizeof(smem));
314 smem.ProcessHandle = lpMapMemory->hProcess;
315
316 if (lpMapMemory->bMap)
317 {
318 VIDEO_SHARE_MEMORY_INFORMATION smemInfo;
319
320 smem.ViewSize = pDev->layout.offDDrawHeap + pDev->layout.cbDDrawHeap;
321
322 rc = VBoxDispMPShareVideoMemory(pDev->hDriver, &smem, &smemInfo);
323 VBOX_WARNRC_RETV(rc, DDHAL_DRIVER_HANDLED);
324
325 lpMapMemory->fpProcess = (FLATPTR) smemInfo.VirtualAddress;
326 }
327 else
328 {
329 smem.RequestedVirtualAddress = (PVOID) lpMapMemory->fpProcess;
330
331 rc = VBoxDispMPUnshareVideoMemory(pDev->hDriver, &smem);
332 VBOX_WARNRC_RETV(rc, DDHAL_DRIVER_HANDLED);
333 }
334
335
336 lpMapMemory->ddRVal = DD_OK;
337 LOGF_LEAVE();
338 return DDHAL_DRIVER_HANDLED;
339}
340
341/* Lock specified area of surface */
342DWORD APIENTRY VBoxDispDDLock(PDD_LOCKDATA lpLock)
343{
344 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpLock->lpDD->dhpdev;
345 LOGF_ENTER();
346
347 DD_SURFACE_LOCAL* pSurf = lpLock->lpDDSurface;
348
349 lpLock->ddRVal = DD_OK;
350
351#ifdef VBOX_WITH_VIDEOHWACCEL
352 if(pDev->vhwa.bEnabled)
353 {
354 PVBOXVHWASURFDESC pDesc = (PVBOXVHWASURFDESC) pSurf->lpGbl->dwReserved1;
355 RECTL tmpRect, *pRect;
356
357 if (!pDesc)
358 {
359 WARN(("!pDesc, memory overwrite somewhere?"));
360 lpLock->ddRVal = DDERR_GENERIC;
361 return DDHAL_DRIVER_HANDLED;
362 }
363
364 /* Check if host is still processing drawing commands */
365 if (ASMAtomicUoReadU32(&pDesc->cPendingBltsSrc)
366 || ASMAtomicUoReadU32(&pDesc->cPendingFlipsCurr)
367 || ASMAtomicUoReadU32(&pDesc->cPendingBltsDst)
368 || ASMAtomicUoReadU32(&pDesc->cPendingFlipsTarg))
369 {
370 VBoxDispVHWACommandCheckHostCmds(pDev);
371 if(ASMAtomicUoReadU32(&pDesc->cPendingBltsSrc)
372 || ASMAtomicUoReadU32(&pDesc->cPendingFlipsCurr)
373 || ASMAtomicUoReadU32(&pDesc->cPendingBltsDst)
374 || ASMAtomicUoReadU32(&pDesc->cPendingFlipsTarg))
375 {
376 lpLock->ddRVal = DDERR_WASSTILLDRAWING;
377 return DDHAL_DRIVER_HANDLED;
378 }
379 }
380
381 if (lpLock->bHasRect)
382 {
383 pRect = &lpLock->rArea;
384 }
385 else
386 {
387 tmpRect.left = 0;
388 tmpRect.top = 0;
389 tmpRect.right = pSurf->lpGbl->wWidth-1;
390 tmpRect.bottom = pSurf->lpGbl->wHeight-1;
391 pRect = &tmpRect;
392 }
393
394 if (lpLock->dwFlags & DDLOCK_DISCARDCONTENTS)
395 {
396 VBoxDispVHWARegionTrySubstitute(&pDesc->NonupdatedMemRegion, pRect);
397 VBoxDispVHWARegionAdd(&pDesc->UpdatedMemRegion, pRect);
398 }
399 else if (!VBoxDispVHWARegionIntersects(&pDesc->NonupdatedMemRegion, pRect))
400 {
401 VBoxDispVHWARegionAdd(&pDesc->UpdatedMemRegion, pRect);
402 }
403 else
404 {
405 VBOXVHWACMD *pCmd;
406 pCmd = VBoxDispVHWACommandCreate(pDev, VBOXVHWACMD_TYPE_SURF_LOCK, sizeof(VBOXVHWACMD_SURF_LOCK));
407
408 if (pCmd)
409 {
410 VBOXVHWACMD_SURF_LOCK *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_LOCK);
411 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_LOCK));
412
413 pBody->u.in.offSurface = VBoxDispVHWAVramOffsetFromPDEV(pDev, pSurf->lpGbl->fpVidMem);
414
415 VBoxDispVHWAFromRECTL(&pBody->u.in.rect, &pDesc->NonupdatedMemRegion.Rect);
416 pBody->u.in.rectValid = 1;
417
418 pBody->u.in.hSurf = pDesc->hHostHandle;
419
420 /* wait for the surface to be locked and memory buffer updated */
421 VBoxDispVHWACommandSubmit(pDev, pCmd);
422 VBOX_WARNRC(pCmd->rc);
423 VBoxDispVHWACommandRelease(pDev, pCmd);
424 VBoxDispVHWARegionClear(&pDesc->NonupdatedMemRegion);
425 }
426 else
427 {
428 WARN(("VBoxDispVHWACommandCreate failed!"));
429 lpLock->ddRVal = DDERR_GENERIC;
430 }
431 }
432
433 return DDHAL_DRIVER_NOTHANDLED;
434 }
435#endif /*VBOX_WITH_VIDEOHWACCEL*/
436
437 /* We only care about primary surface as we'd have to report dirty rectangles to the host in the DDUnlock*/
438 if (pSurf->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
439 {
440 pDev->ddpsLock.bLocked = TRUE;
441
442 if (lpLock->bHasRect)
443 {
444 pDev->ddpsLock.rect = lpLock->rArea;
445 }
446 else
447 {
448 pDev->ddpsLock.rect.left = 0;
449 pDev->ddpsLock.rect.top = 0;
450 pDev->ddpsLock.rect.right = pDev->mode.ulWidth;
451 pDev->ddpsLock.rect.bottom = pDev->mode.ulHeight;
452 }
453 }
454
455 LOGF_LEAVE();
456 return DDHAL_DRIVER_NOTHANDLED;
457}
458
459/* Unlock previously locked surface */
460DWORD APIENTRY VBoxDispDDUnlock(PDD_UNLOCKDATA lpUnlock)
461{
462 PVBOXDISPDEV pDev = (PVBOXDISPDEV) lpUnlock->lpDD->dhpdev;
463 LOGF_ENTER();
464
465 DD_SURFACE_LOCAL *pSurf = lpUnlock->lpDDSurface;
466
467 lpUnlock->ddRVal = DD_OK;
468
469#ifdef VBOX_WITH_VIDEOHWACCEL
470 if(pDev->vhwa.bEnabled)
471 {
472 PVBOXVHWASURFDESC pDesc = (PVBOXVHWASURFDESC) pSurf->lpGbl->dwReserved1;
473
474 if (!pDesc)
475 {
476 WARN(("!pDesc, memory overwrite somewhere?"));
477 lpUnlock->ddRVal = DDERR_GENERIC;
478 return DDHAL_DRIVER_HANDLED;
479 }
480
481 if((pSurf->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && pDesc->UpdatedMemRegion.bValid
482 && VBoxVBVABufferBeginUpdate(&pDev->vbvaCtx, &pDev->hgsmi.ctx))
483 {
484 vbvaReportDirtyRect(pDev, &pDesc->UpdatedMemRegion.Rect);
485
486 if (pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents & VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET)
487 {
488 vrdpReset(pDev);
489 pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents &= ~VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET;
490 }
491
492 if (pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents & VBVA_F_MODE_VRDP)
493 {
494 vrdpReportDirtyRect(pDev, &pDesc->UpdatedMemRegion.Rect);
495 }
496
497 VBoxVBVABufferEndUpdate(&pDev->vbvaCtx);
498 }
499 else if ((pSurf->ddsCaps.dwCaps & DDSCAPS_VISIBLE)
500 || ((pSurf->ddsCaps.dwCaps & DDSCAPS_OVERLAY) && pDesc->bVisible))
501 {
502 VBOXVHWACMD *pCmd;
503 pCmd = VBoxDispVHWACommandCreate (pDev, VBOXVHWACMD_TYPE_SURF_UNLOCK, sizeof(VBOXVHWACMD_SURF_UNLOCK));
504
505 if(pCmd)
506 {
507 VBOXVHWACMD_SURF_UNLOCK *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_UNLOCK);
508 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_UNLOCK));
509
510 pBody->u.in.hSurf = pDesc->hHostHandle;
511 if(pDesc->UpdatedMemRegion.bValid)
512 {
513 pBody->u.in.xUpdatedMemValid = 1;
514 VBoxDispVHWAFromRECTL(&pBody->u.in.xUpdatedMemRect, &pDesc->UpdatedMemRegion.Rect);
515 VBoxDispVHWARegionClear(&pDesc->UpdatedMemRegion);
516 }
517
518 VBoxDispVHWACommandSubmitAsynchAndComplete(pDev, pCmd);
519 }
520 else
521 {
522 WARN(("VBoxDispVHWACommandCreate failed!"));
523 lpUnlock->ddRVal = DDERR_GENERIC;
524 }
525
526 }
527
528 return DDHAL_DRIVER_NOTHANDLED;
529 }
530#endif /*VBOX_WITH_VIDEOHWACCEL*/
531
532 if (pDev->ddpsLock.bLocked)
533 {
534 pDev->ddpsLock.bLocked = FALSE;
535
536 if (pDev->hgsmi.bSupported && VBoxVBVABufferBeginUpdate(&pDev->vbvaCtx, &pDev->hgsmi.ctx))
537 {
538 vbvaReportDirtyRect(pDev, &pDev->ddpsLock.rect);
539
540 if (pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents & VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET)
541 {
542 vrdpReset(pDev);
543 pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents &= ~VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET;
544 }
545
546 if (pDev->vbvaCtx.pVBVA->hostFlags.u32HostEvents & VBVA_F_MODE_VRDP)
547 {
548 vrdpReportDirtyRect(pDev, &pDev->ddpsLock.rect);
549 }
550
551 VBoxVBVABufferEndUpdate(&pDev->vbvaCtx);
552 }
553 }
554
555 LOGF_LEAVE();
556 return DDHAL_DRIVER_NOTHANDLED;
557}
Note: See TracBrowser for help on using the repository browser.

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