VirtualBox

Changeset 83156 in vbox for trunk


Ignore:
Timestamp:
Feb 25, 2020 6:19:56 PM (5 years ago)
Author:
vboxsync
Message:

bugref:9637 Some PDMIDISPLAYPORT::pfnReportMonitorPositions nits.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmifs.h

    r83142 r83156  
    712712
    713713    /**
    714      * Notify the graphics device about the monitor positions since the ones we get from vmwgfx FIFO are not correct. In an ideal
    715      * universe this method should not be here.
    716      *
    717      * @param   pInterface   Pointer to this interface.
    718      * @param   cPositions   Number of monitor positions
    719      * @param   pPosition    Monitor positions (offsets/origins) array
     714     * Notify the graphics device about the monitor positions since the ones we get
     715     * from vmwgfx FIFO are not correct.
     716     *
     717     * In an ideal universe this method should not be here.
     718     *
     719     * @param   pInterface      Pointer to this interface.
     720     * @param   cPositions      Number of monitor positions.
     721     * @param   paPositions     Monitor positions (offsets/origins) array.
    720722     * @thread  Any.
    721723     */
    722     DECLR3CALLBACKMEMBER(void, pfnReportMonitorPositions, (PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition));
     724    DECLR3CALLBACKMEMBER(void, pfnReportMonitorPositions, (PPDMIDISPLAYPORT pInterface, uint32_t cPositions,
     725                                                           PCRTPOINT paPositions));
    723726
    724727} PDMIDISPLAYPORT;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r83154 r83156  
    712712
    713713#endif /* LOG_ENABLED */
    714 
    715714#ifdef IN_RING3
     715
    716716/**
    717717 * @interface_method_impl{PDMIDISPLAYPORT,pfnSetViewport}
     
    767767# endif
    768768}
     769
    769770
    770771/**
     
    832833}
    833834
     835
    834836/**
    835  * Used to update screen offsets (positions) since appearently vmwgfx fails to pass correct offsets thru FIFO.
     837 * @interface_method_impl{PDMIDISPLAYPORT,pfnReportMonitorPositions}
    836838 *
    837  * @param   pInterface  The device instance.
    838  * @param   cPositions  The size of the pPosition array
    839  * @param   pPosition   Monitor positions. We assume for the disable monitors the positions is (-1, -1)
    840  */
    841 DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition)
     839 * Used to update screen offsets (positions) since appearently vmwgfx fails to
     840 * pass correct offsets thru FIFO.
     841 */
     842DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PCRTPOINT paPositions)
    842843{
    843     PVGASTATECC pThisCC = RT_FROM_MEMBER(pInterface, VGASTATECC, IPort);
    844     PVGASTATE   pThis   = PDMDEVINS_2_DATA(pThisCC->pDevIns, PVGASTATE);
    845 
    846 
    847     PVMSVGAR3STATE  pSVGAState = pThisCC->svga.pSvgaR3State;
    848     size_t cScreenCount = RT_ELEMENTS(pSVGAState->aScreens);
    849 
    850     VMSVGASCREENOBJECT *pScreens = pSVGAState->aScreens;
    851     /* We assume cPositions is the # of outputs Xserver reports and pPosition is (-1, -1) for disabled monitors. */
    852     for (unsigned i = 0; i < cPositions; ++i)
    853     {
    854         /* Stop walking the array once we go thru all the monitors. */
    855         if (i >= cScreenCount)
    856             break;
    857         if ( pScreens[i].xOrigin == -1
    858           || pScreens[i].yOrigin == -1)
     844    PVGASTATECC         pThisCC    = RT_FROM_MEMBER(pInterface, VGASTATECC, IPort);
     845    PVGASTATE           pThis      = PDMDEVINS_2_DATA(pThisCC->pDevIns, PVGASTATE);
     846    PVMSVGAR3STATE      pSVGAState = pThisCC->svga.pSvgaR3State;
     847
     848    /* We assume cPositions is the # of outputs Xserver reports and paPositions is (-1, -1) for disabled monitors. */
     849    cPositions = RT_MIN(cPositions, RT_ELEMENTS(pSVGAState->aScreens));
     850    for (uint32_t i = 0; i < cPositions; ++i)
     851    {
     852        if (   pSVGAState->aScreens[i].xOrigin == paPositions[i].x
     853            && pSVGAState->aScreens[i].yOrigin == paPositions[i].y)
    859854            continue;
    860         if (   pScreens[i].xOrigin == pPosition[i].x
    861             && pScreens[i].yOrigin == pPosition[i].y)
     855
     856        if (pSVGAState->aScreens[i].xOrigin == -1)
    862857            continue;
    863         pScreens[i].xOrigin = pPosition[i].x;
    864         pScreens[i].yOrigin = pPosition[i].y;
    865         pScreens[i].fModified = true;
    866     }
     858        if (pSVGAState->aScreens[i].yOrigin == -1)
     859            continue;
     860
     861        pSVGAState->aScreens[i].xOrigin = paPositions[i].x;
     862        pSVGAState->aScreens[i].yOrigin = paPositions[i].y;
     863        pSVGAState->aScreens[i].fModified = true;
     864    }
     865
    867866    vmsvgaR3VBVAResize(pThis, pThisCC);
    868867}
     868
    869869#endif /* IN_RING3 */
    870870
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r83142 r83156  
    393393DECLCALLBACK(void) vmsvgaR3PortSetViewport(PPDMIDISPLAYPORT pInterface, uint32_t uScreenId,
    394394                                         uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
    395 DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition);
     395DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PCRTPOINT paPositions);
    396396
    397397int vmsvgaR3Init(PPDMDEVINS pDevIns);
Note: See TracChangeset for help on using the changeset viewer.

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