VirtualBox

Changeset 6849 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 7, 2008 2:35:49 PM (17 years ago)
Author:
vboxsync
Message:

Additions/common: fixed the guest R3 library display change query function - display is an out parameter, not an in parameter

Location:
trunk/src/VBox/Additions
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r6842 r6849  
    119119 * @param   pcy         Where to store the vertical pixel resolution (0 = do not change).
    120120 * @param   pcBits      Where to store the bits per pixel (0 = do not change).
    121  * @param   fEventAck   Flag that the request is an acknowlegement for the
    122  *                      VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
    123  *                      Values:
    124  *                          0                                   - just querying,
    125  *                          VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
    126  * @param   iDisplay    0 for primary display, 1 for the first secondary, etc.
    127  */
    128 VBGLR3DECL(int) VbglR3GetDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits,
    129                                               uint32_t fEventAck, uint32_t iDisplay)
    130 {
    131     VMMDevDisplayChangeRequest2 Req;
    132     vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2);
    133     Req.xres = 0;
    134     Req.yres = 0;
    135     Req.bpp = 0;
    136     Req.eventAck = fEventAck;
    137     Req.display = iDisplay;
     121 * @param   iDisplay    Where to store the display number the request was for - 0 for the
     122 *                      primary display, 1 for the first secondary, etc.
     123 */
     124VBGLR3DECL(int) VbglR3GetLastDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits,
     125                                                 uint32_t *piDisplay)
     126{
     127    VMMDevDisplayChangeRequest2 Req = { { 0 } };
     128
     129#ifndef VBOX_VBGLR3_XFREE86
     130    AssertPtrReturn(pcx, VERR_INVALID_PARAMETER);
     131    AssertPtrReturn(pcy, VERR_INVALID_PARAMETER);
     132    AssertPtrReturn(pcBits, VERR_INVALID_PARAMETER);
     133    AssertPtrReturn(piDisplay, VERR_INVALID_PARAMETER);
     134#endif
     135vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2);
    138136    int rc = vbglR3GRPerform(&Req.header);
    139137    if (RT_SUCCESS(rc))
     
    144142        *pcy = Req.yres;
    145143        *pcBits = Req.bpp;
     144        *piDisplay = Req.display;
    146145    }
    147146    return rc;
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils-new.c

    r6588 r6849  
    823823 * @param   pcy         Where to store the vertical pixel resolution (0 = do not change).
    824824 * @param   pcBits      Where to store the bits per pixel (0 = do not change).
    825  * @param   fEventAck   Flag that the request is an acknowlegement for the
    826  *                      VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
    827  *                      Values:
    828  *                          0                                   - just querying,
    829  *                          VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
    830  * @param   iDisplay    0 for primary display, 1 for the first secondary, etc.
     825 * @param   iDisplay    Where to store the display number the request was for - 0 for the
     826 *                      primary display, 1 for the first secondary, etc.
    831827 */
    832828Bool
    833829vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy,
    834                             uint32_t *pcBits, uint32_t fEventAck, uint32_t iDisplay)
    835 {
    836     int rc = VbglR3GetDisplayChangeRequest(pcx, pcy, pcBits, fEventAck, iDisplay);
     830                            uint32_t *pcBits, uint32_t *piDisplay)
     831{
     832    int rc = VbglR3GetLastDisplayChangeRequest(pcx, pcy, pcBits, piDisplay);
    837833    if (RT_SUCCESS(rc))
    838834        return TRUE;
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c

    r6587 r6849  
    960960 *
    961961 * @returns iprt status value
    962  * @retval xres     horizontal pixel resolution (0 = do not change)
    963  * @retval yres     vertical pixel resolution (0 = do not change)
    964  * @retval bpp      bits per pixel (0 = do not change)
    965  * @param  eventAck Flag that the request is an acknowlegement for the
    966  *                  VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
    967  *                  Values:
    968  *                      0                                   - just querying,
    969  *                      VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
    970  * @param  display  0 for primary display, 1 for the first secondary, etc.
     962 * @param xres     where to store the horizontal pixel resolution requested
     963 *                 (0 = do not change)
     964 * @param yres     where to store the vertical pixel resolution requested
     965 *                 (0 = do not change)
     966 * @param bpp      where to store the bits per pixel requeste
     967 *                 (0 = do not change)
     968 * @param  display Where to store the display number the request was for -
     969 *                 0 for the primary display, 1 for the first secondary, etc.
    971970 */
    972971Bool
    973972vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *px, uint32_t *py,
    974                             uint32_t *pbpp, uint32_t eventAck, uint32_t display)
     973                            uint32_t *pbpp, uint32_t *display)
    975974{
    976975    int rc, scrnIndex = pScrn->scrnIndex;
    977976    VBOXPtr pVBox = pScrn->driverPrivate;
    978977
    979     VMMDevDisplayChangeRequest2 Req;
     978    VMMDevDisplayChangeRequest2 Req = { { 0 } };
    980979    vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2);
    981     Req.xres = 0;
    982     Req.yres = 0;
    983     Req.bpp = 0;
    984     Req.eventAck = eventAck;
    985     Req.display = display;
    986980    rc = vbox_vmmcall(pScrn, pVBox, &Req.header);
    987981    if (RT_SUCCESS(rc))
     
    990984        *py = Req.yres;
    991985        *pbpp = Req.bpp;
     986        *display = Req.display;
    992987        return TRUE;
    993988    }
  • trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h

    r6642 r6849  
    191191extern Bool vboxDisableVbva(ScrnInfoPtr pScrn);
    192192
    193 extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy,
    194                             uint32_t *pcBits, uint32_t fEventAck, uint32_t iDisplay);
     193extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx,
     194                                        uint32_t *pcy, uint32_t *pcBits,
     195                                        uint32_t *piDisplay);
    195196
    196197#endif /* _VBOXVIDEO_H_ */
  • trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c

    r6642 r6849  
    398398vbox_output_get_modes (xf86OutputPtr output)
    399399{
    400     uint32_t x, y, bpp;
     400    uint32_t x, y, bpp, display;
    401401    bool rc;
    402402    DisplayModePtr pModes = NULL;
     
    404404
    405405    TRACE;
    406     rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, 0, 0);
     406    rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &display);
     407    /* @todo - check the display number once we support multiple displays. */
    407408    if (rc && (0 != x) && (0 != y)) {
    408409        vbox_output_add_mode(&pModes, NULL, x, y, TRUE);
    409         vbox_output_add_mode(&pModes, "1024x768", 1024, 768, FALSE);
    410         vbox_output_add_mode(&pModes, "800x600", 800, 600, FALSE);
    411         vbox_output_add_mode(&pModes, "640x480", 640, 480, FALSE);
    412     } else {
    413         vbox_output_add_mode(&pModes, "1024x768", 1024, 768, FALSE);
    414         vbox_output_add_mode(&pModes, "800x600", 800, 600, FALSE);
    415         vbox_output_add_mode(&pModes, "640x480", 640, 480, FALSE);
    416     }
     410    }
     411    vbox_output_add_mode(&pModes, "1024x768", 1024, 768, FALSE);
     412    vbox_output_add_mode(&pModes, "800x600", 800, 600, FALSE);
     413    vbox_output_add_mode(&pModes, "640x480", 640, 480, FALSE);
    417414    TRACE2;
    418415    return pModes;
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