VirtualBox

Changeset 51551 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 5, 2014 12:09:12 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94201
Message:

Main: removed obsolete RequestResize, ResizeCompleted methods.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r51527 r51551  
    1532015320    </method>
    1532115321
    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 virtual
    15328         machine. The <i>indirect</i> mode implies that the IFramebuffer
    15329         implementation allocates a memory buffer for the requested display mode
    15330         and provides it to the virtual machine. In <i>direct</i> mode, the
    15331         IFramebuffer implementation uses the memory buffer allocated and owned
    15332         by the virtual machine. This buffer represents the video memory of the
    15333         emulated video adapter (so called <i>guest VRAM</i>). The direct mode is
    15334         usually faster because the implementation gets a raw pointer to the
    15335         guest VRAM buffer which it can directly use for visualizing the contents
    15336         of the virtual display, as opposed to the indirect mode where the
    15337         contents of guest VRAM are copied to the memory buffer provided by
    15338         the implementation every time a display update occurs.
    15339 
    15340         It is important to note that the direct mode is really fast only when
    15341         the implementation uses the given guest VRAM buffer directly, for
    15342         example, by blitting it to the window representing the virtual machine's
    15343         display, which saves at least one copy operation comparing to the
    15344         indirect mode. However, using the guest VRAM buffer directly is not
    15345         always possible: the format and the color depth of this buffer may be
    15346         not supported by the target window, or it may be unknown (opaque) as in
    15347         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 a
    15349         fallback: when the guest VRAM contents are copied to the
    15350         implementation-provided memory buffer, color and format conversion is
    15351         done automatically by the underlying code.
    15352 
    15353         The @a pixelFormat parameter defines whether the direct mode is
    15354         available or not. If @a pixelFormat is <link
    15355         to="FramebufferPixelFormat_Opaque"/> then direct access to the guest
    15356         VRAM buffer is not available - the @a VRAM, @a bitsPerPixel and
    15357         @a bytesPerLine parameters must be ignored and the implementation must use
    15358         the indirect mode (where it provides its own buffer in one of the
    15359         supported formats). In all other cases, @a pixelFormat together with
    15360         @a bitsPerPixel and @a bytesPerLine define the format of the video memory
    15361         buffer pointed to by the @a VRAM parameter and the implementation is
    15362         free to choose which mode to use. To indicate that this frame buffer uses
    15363         the direct mode, the implementation of the <link to="#usesGuestVRAM"/>
    15364         attribute must return @c true and <link to="#address"/> must
    15365         return exactly the same address that is passed in the @a VRAM parameter
    15366         of this method; otherwise it is assumed that the indirect strategy is
    15367         chosen.
    15368 
    15369         The @a width and @a height parameters represent the size of the
    15370         requested display mode in both modes. In case of indirect mode, the
    15371         provided memory buffer should be big enough to store data of the given
    15372         display mode. In case of direct mode, it is guaranteed that the given
    15373         @a VRAM buffer contains enough space to represent the display mode of the
    15374         given size. Note that this frame buffer's <link to="#width"/> and <link
    15375         to="#height"/> attributes must return exactly the same values as
    15376         passed to this method after the resize is completed (see below).
    15377 
    15378         The @a finished output parameter determines if the implementation has
    15379         finished resizing the frame buffer or not. If, for some reason, the
    15380         resize cannot be finished immediately during this call, @a finished
    15381         must be set to @c false, and the implementation must call
    15382         <link to="IDisplay::resizeCompleted"/> after it has returned from
    15383         this method as soon as possible. If @a finished is @c false, the
    15384         machine will not call any frame buffer methods until
    15385         <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 of
    15389         this frame buffer must return exactly the same values as specified in the
    15390         parameters of this method, after the resize is completed. If the
    15391         indirect mode is chosen, these attributes must return values describing
    15392         the format of the implementation's own memory buffer <link
    15393         to="#address"/> points to. Note also that the <link to="#bitsPerPixel"/>
    15394         value must always correlate with <link to="#pixelFormat"/>. Note that
    15395         the <link to="#pixelFormat"/> attribute must never return <link
    15396         to="FramebufferPixelFormat_Opaque"/> regardless of the selected mode.
    15397 
    15398         <note>
    15399           This method is called by the IDisplay object under the
    15400           <link to="#lock"/> provided by this IFramebuffer
    15401           implementation. If this method returns @c false in @a finished, then
    15402           this lock is not released until
    15403           <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 to
    15409           <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 immediately
    15436           after this method returns or it should wait for
    15437           <link to="IDisplay::resizeCompleted"/>.
    15438         </desc>
    15439       </param>
    15440     </method>
    15441   -->
    15442 
    1544315322    <method name="notifyChange">
    1544415323      <desc>
     
    1590215781      </desc>
    1590315782    </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   -->
    1591815783
    1591915784    <method name="completeVHWACommand">
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r51525 r51551  
    236236    STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
    237237    STDMETHOD(InvalidateAndUpdate)();
    238     STDMETHOD(ResizeCompleted)(ULONG aScreenId);
    239238    STDMETHOD(SetSeamlessMode)(BOOL enabled);
    240239
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r51545 r51551  
    924924/**
    925925 *  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.
    930926 *
    931927 *  @param w New display width
     
    10251021    if (!maFramebuffers[uScreenId].pFramebuffer.isNull())
    10261022    {
    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);
    10381025    }
    10391026
     
    36493636    LogRelFlowFunc(("rc=%Rhrc\n", rc));
    36503637    return rc;
    3651 }
    3652 
    3653 /**
    3654  * Notification that the framebuffer has completed the
    3655  * asynchronous resize processing
    3656  *
    3657  * @returns COM status code
    3658  */
    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 for
    3666     //  this notification, etc. It might be also good to obey the caller to make
    3667     //  sure this method is not called from more than one thread at a time
    3668     //  (and therefore don't use Display lock at all here to save some
    3669     //  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 display
    3679      * 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;
    36853638}
    36863639
Note: See TracChangeset for help on using the changeset viewer.

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