VirtualBox

Ignore:
Timestamp:
Apr 13, 2010 4:01:51 PM (15 years ago)
Author:
vboxsync
Message:

VideoModeSupported for multimonitor. (xTracker 4655)

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.cpp

    r27286 r28264  
    115115}
    116116
    117 BOOLEAN vboxLikesVideoMode(uint32_t width, uint32_t height, uint32_t bpp)
     117BOOLEAN vboxLikesVideoMode(uint32_t display, uint32_t width, uint32_t height, uint32_t bpp)
    118118{
    119119    BOOLEAN bRC = FALSE;
    120120
    121     VMMDevVideoModeSupportedRequest *req = NULL;
    122 
    123     int rc = VbglGRAlloc((VMMDevRequestHeader**)&req, sizeof(VMMDevVideoModeSupportedRequest), VMMDevReq_VideoModeSupported);
     121    VMMDevVideoModeSupportedRequest2 *req2 = NULL;
     122
     123    int rc = VbglGRAlloc((VMMDevRequestHeader**)&req2, sizeof(VMMDevVideoModeSupportedRequest2), VMMDevReq_VideoModeSupported2);
    124124    if (RT_FAILURE(rc))
    125125    {
     
    132132    else
    133133    {
    134         req->width  = width;
    135         req->height = height;
    136         req->bpp    = bpp;
    137         rc = VbglGRPerform(&req->header);
    138         if (RT_SUCCESS(rc))
    139         {
    140             bRC = req->fSupported;
     134        req2->display = display;
     135        req2->width  = width;
     136        req2->height = height;
     137        req2->bpp    = bpp;
     138        rc = VbglGRPerform(&req2->header);
     139        if (RT_SUCCESS(rc) && RT_SUCCESS(req2->header.rc))
     140        {
     141            bRC = req2->fSupported;
    141142        }
    142143        else
    143144        {
    144             dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR querying video mode supported status from VMMDev."
    145                      "rc = %Rrc\n", rc));
    146         }
    147         VbglGRFree(&req->header);
     145            /* Retry using old inteface. */
     146            AssertCompile(sizeof(VMMDevVideoModeSupportedRequest2) >= sizeof(VMMDevVideoModeSupportedRequest));
     147            VMMDevVideoModeSupportedRequest *req = (VMMDevVideoModeSupportedRequest *)req2;
     148            req->header.size        = sizeof(VMMDevVideoModeSupportedRequest);
     149            req->header.version     = VMMDEV_REQUEST_HEADER_VERSION;
     150            req->header.requestType = VMMDevReq_VideoModeSupported;
     151            req->header.rc          = VERR_GENERAL_FAILURE;
     152            req->header.reserved1   = 0;
     153            req->header.reserved2   = 0;
     154            req->width  = width;
     155            req->height = height;
     156            req->bpp    = bpp;
     157
     158            rc = VbglGRPerform(&req->header);
     159            if (RT_SUCCESS(rc) && RT_SUCCESS(req->header.rc))
     160            {
     161                bRC = req->fSupported;
     162            }
     163            else
     164            {
     165                dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR querying video mode supported status from VMMDev."
     166                         "rc = %Rrc\n", rc));
     167            }
     168        }
     169        VbglGRFree(&req2->header);
    148170    }
    149171
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.h

    r27205 r28264  
    3636{
    3737BOOLEAN vboxQueryDisplayRequest(uint32_t *xres, uint32_t *yres, uint32_t *bpp, uint32_t *pDisplayId);
    38 BOOLEAN vboxLikesVideoMode(uint32_t width, uint32_t height, uint32_t bpp);
     38BOOLEAN vboxLikesVideoMode(uint32_t display, uint32_t width, uint32_t height, uint32_t bpp);
    3939ULONG vboxGetHeightReduction();
    4040BOOLEAN vboxQueryPointerPos(uint16_t *pointerXPos, uint16_t *pointerYPos);
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r28228 r28264  
    483483
    484484        /* does the host like that mode? */
    485         if (!vboxLikesVideoMode(resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 8))
     485        if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 8))
    486486        {
    487487            ++matrixIndex;
     
    545545
    546546        /* does the host like that mode? */
    547         if (!vboxLikesVideoMode(resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 16))
     547        if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 16))
    548548        {
    549549            ++matrixIndex;
     
    605605
    606606        /* does the host like that mode? */
    607         if (!vboxLikesVideoMode(resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 24))
     607        if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 24))
    608608        {
    609609            ++matrixIndex;
     
    665665
    666666        /* does the host like that mode? */
    667         if (!vboxLikesVideoMode(resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 32))
     667        if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 32))
    668668        {
    669669            ++matrixIndex;
     
    749749
    750750        /* third test: does the host like the video mode? */
    751         if (!vboxLikesVideoMode(xres, yres, bpp))
     751        if (!vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp))
    752752            break;
    753753
     
    981981
    982982        /* does the host like that mode? */
    983         if (vboxLikesVideoMode(xres, yres, bpp))
     983        if (vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp))
    984984        {
    985985            /* we must have a valid video mode by now and it must fit within the VRAM */
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