Changeset 51551 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 5, 2014 12:09:12 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94201
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r51527 r51551 15320 15320 </method> 15321 15321 15322 <!--15323 <method name="requestResize" wsmap="suppress">15324 <desc>15325 Requests a size and pixel format change.15326 15327 There are two modes of working with the video buffer of the virtual15328 machine. The <i>indirect</i> mode implies that the IFramebuffer15329 implementation allocates a memory buffer for the requested display mode15330 and provides it to the virtual machine. In <i>direct</i> mode, the15331 IFramebuffer implementation uses the memory buffer allocated and owned15332 by the virtual machine. This buffer represents the video memory of the15333 emulated video adapter (so called <i>guest VRAM</i>). The direct mode is15334 usually faster because the implementation gets a raw pointer to the15335 guest VRAM buffer which it can directly use for visualizing the contents15336 of the virtual display, as opposed to the indirect mode where the15337 contents of guest VRAM are copied to the memory buffer provided by15338 the implementation every time a display update occurs.15339 15340 It is important to note that the direct mode is really fast only when15341 the implementation uses the given guest VRAM buffer directly, for15342 example, by blitting it to the window representing the virtual machine's15343 display, which saves at least one copy operation comparing to the15344 indirect mode. However, using the guest VRAM buffer directly is not15345 always possible: the format and the color depth of this buffer may be15346 not supported by the target window, or it may be unknown (opaque) as in15347 case of text or non-linear multi-plane VGA video modes. In this case,15348 the indirect mode (that is always available) should be used as a15349 fallback: when the guest VRAM contents are copied to the15350 implementation-provided memory buffer, color and format conversion is15351 done automatically by the underlying code.15352 15353 The @a pixelFormat parameter defines whether the direct mode is15354 available or not. If @a pixelFormat is <link15355 to="FramebufferPixelFormat_Opaque"/> then direct access to the guest15356 VRAM buffer is not available - the @a VRAM, @a bitsPerPixel and15357 @a bytesPerLine parameters must be ignored and the implementation must use15358 the indirect mode (where it provides its own buffer in one of the15359 supported formats). In all other cases, @a pixelFormat together with15360 @a bitsPerPixel and @a bytesPerLine define the format of the video memory15361 buffer pointed to by the @a VRAM parameter and the implementation is15362 free to choose which mode to use. To indicate that this frame buffer uses15363 the direct mode, the implementation of the <link to="#usesGuestVRAM"/>15364 attribute must return @c true and <link to="#address"/> must15365 return exactly the same address that is passed in the @a VRAM parameter15366 of this method; otherwise it is assumed that the indirect strategy is15367 chosen.15368 15369 The @a width and @a height parameters represent the size of the15370 requested display mode in both modes. In case of indirect mode, the15371 provided memory buffer should be big enough to store data of the given15372 display mode. In case of direct mode, it is guaranteed that the given15373 @a VRAM buffer contains enough space to represent the display mode of the15374 given size. Note that this frame buffer's <link to="#width"/> and <link15375 to="#height"/> attributes must return exactly the same values as15376 passed to this method after the resize is completed (see below).15377 15378 The @a finished output parameter determines if the implementation has15379 finished resizing the frame buffer or not. If, for some reason, the15380 resize cannot be finished immediately during this call, @a finished15381 must be set to @c false, and the implementation must call15382 <link to="IDisplay::resizeCompleted"/> after it has returned from15383 this method as soon as possible. If @a finished is @c false, the15384 machine will not call any frame buffer methods until15385 <link to="IDisplay::resizeCompleted"/> is called.15386 15387 Note that if the direct mode is chosen, the <link to="#bitsPerPixel"/>,15388 <link to="#bytesPerLine"/> and <link to="#pixelFormat"/> attributes of15389 this frame buffer must return exactly the same values as specified in the15390 parameters of this method, after the resize is completed. If the15391 indirect mode is chosen, these attributes must return values describing15392 the format of the implementation's own memory buffer <link15393 to="#address"/> points to. Note also that the <link to="#bitsPerPixel"/>15394 value must always correlate with <link to="#pixelFormat"/>. Note that15395 the <link to="#pixelFormat"/> attribute must never return <link15396 to="FramebufferPixelFormat_Opaque"/> regardless of the selected mode.15397 15398 <note>15399 This method is called by the IDisplay object under the15400 <link to="#lock"/> provided by this IFramebuffer15401 implementation. If this method returns @c false in @a finished, then15402 this lock is not released until15403 <link to="IDisplay::resizeCompleted"/> is called.15404 </note>15405 </desc>15406 <param name="screenId" type="unsigned long" dir="in">15407 <desc>15408 Logical screen number. Must be used in the corresponding call to15409 <link to="IDisplay::resizeCompleted"/> if this call is made.15410 </desc>15411 </param>15412 <param name="pixelFormat" type="unsigned long" dir="in">15413 <desc>15414 Pixel format of the memory buffer pointed to by @a VRAM.15415 See also <link to="FramebufferPixelFormat"/>.15416 </desc>15417 </param>15418 <param name="VRAM" type="octet" mod="ptr" dir="in">15419 <desc>Pointer to the virtual video card's VRAM (may be @c null).</desc>15420 </param>15421 <param name="bitsPerPixel" type="unsigned long" dir="in">15422 <desc>Color depth, bits per pixel.</desc>15423 </param>15424 <param name="bytesPerLine" type="unsigned long" dir="in">15425 <desc>Size of one scan line, in bytes.</desc>15426 </param>15427 <param name="width" type="unsigned long" dir="in">15428 <desc>Width of the guest display, in pixels.</desc>15429 </param>15430 <param name="height" type="unsigned long" dir="in">15431 <desc>Height of the guest display, in pixels.</desc>15432 </param>15433 <param name="finished" type="boolean" dir="return">15434 <desc>15435 Can the VM start using the new frame buffer immediately15436 after this method returns or it should wait for15437 <link to="IDisplay::resizeCompleted"/>.15438 </desc>15439 </param>15440 </method>15441 -->15442 15443 15322 <method name="notifyChange"> 15444 15323 <desc> … … 15902 15781 </desc> 15903 15782 </method> 15904 15905 <!--15906 <method name="resizeCompleted">15907 <desc>15908 Signals that a framebuffer has completed the resize operation.15909 15910 <result name="VBOX_E_NOT_SUPPORTED">15911 Operation only valid for external frame buffers.15912 </result>15913 15914 </desc>15915 <param name="screenId" type="unsigned long" dir="in"/>15916 </method>15917 -->15918 15783 15919 15784 <method name="completeVHWACommand"> -
trunk/src/VBox/Main/include/DisplayImpl.h
r51525 r51551 236 236 STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height); 237 237 STDMETHOD(InvalidateAndUpdate)(); 238 STDMETHOD(ResizeCompleted)(ULONG aScreenId);239 238 STDMETHOD(SetSeamlessMode)(BOOL enabled); 240 239 -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51545 r51551 924 924 /** 925 925 * Handles display resize event. 926 * Disables access to VGA device;927 * calls the framebuffer RequestResize method;928 * if framebuffer resizes synchronously,929 * updates the display connector data and enables access to the VGA device.930 926 * 931 927 * @param w New display width … … 1025 1021 if (!maFramebuffers[uScreenId].pFramebuffer.isNull()) 1026 1022 { 1027 int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId, 1028 pixelFormat, pvVRAM, bpp, cbLine, w, h); 1029 if (rc == VINF_VGA_RESIZE_IN_PROGRESS) 1030 { 1031 /* Immediately return to the caller. ResizeCompleted will be called back by the 1032 * GUI thread. The ResizeCompleted callback will change the resize status from 1033 * InProgress to UpdateDisplayData. The latter status will be checked by the 1034 * display timer callback on EMT and all required adjustments will be done there. 1035 */ 1036 return rc; 1037 } 1023 callFramebufferResize(maFramebuffers[uScreenId].pFramebuffer, uScreenId, 1024 pixelFormat, pvVRAM, bpp, cbLine, w, h); 1038 1025 } 1039 1026 … … 3649 3636 LogRelFlowFunc(("rc=%Rhrc\n", rc)); 3650 3637 return rc; 3651 }3652 3653 /**3654 * Notification that the framebuffer has completed the3655 * asynchronous resize processing3656 *3657 * @returns COM status code3658 */3659 STDMETHODIMP Display::ResizeCompleted(ULONG aScreenId)3660 {3661 LogRelFlowFunc(("\n"));3662 3663 /// @todo (dmik) can we AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); here?3664 // This will require general code review and may add some details.3665 // In particular, we may want to check whether EMT is really waiting for3666 // this notification, etc. It might be also good to obey the caller to make3667 // sure this method is not called from more than one thread at a time3668 // (and therefore don't use Display lock at all here to save some3669 // milliseconds).3670 AutoCaller autoCaller(this);3671 if (FAILED(autoCaller.rc())) return autoCaller.rc();3672 3673 /* this is only valid for external framebuffers */3674 if (maFramebuffers[aScreenId].pFramebuffer == NULL)3675 return setError(VBOX_E_NOT_SUPPORTED,3676 tr("Resize completed notification is valid only for external framebuffers"));3677 3678 /* Set the flag indicating that the resize has completed and display3679 * data need to be updated. */3680 bool f = ASMAtomicCmpXchgU32 (&maFramebuffers[aScreenId].u32ResizeStatus,3681 ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress);3682 AssertRelease(f);NOREF(f);3683 3684 return S_OK;3685 3638 } 3686 3639
Note:
See TracChangeset
for help on using the changeset viewer.