VirtualBox

Changeset 28264 in vbox for trunk/src/VBox


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

VideoModeSupported for multimonitor. (xTracker 4655)

Location:
trunk/src/VBox
Files:
8 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 */
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r28099 r28264  
    10231023                /* forward the call */
    10241024                pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv,
     1025                                                                       0, /* primary screen. */
    10251026                                                                       videoModeSupportedRequest->width,
    10261027                                                                       videoModeSupportedRequest->height,
    10271028                                                                       videoModeSupportedRequest->bpp,
    10281029                                                                       &videoModeSupportedRequest->fSupported);
     1030            }
     1031            break;
     1032        }
     1033
     1034        /*
     1035         * Query whether the given video mode is supported for a specific display
     1036         */
     1037        case VMMDevReq_VideoModeSupported2:
     1038        {
     1039            if (pRequestHeader->size != sizeof(VMMDevVideoModeSupportedRequest2))
     1040            {
     1041                AssertMsgFailed(("VMMDev video mode supported request 2 structure has invalid size!\n"));
     1042                pRequestHeader->rc = VERR_INVALID_PARAMETER;
     1043            }
     1044            else
     1045            {
     1046                VMMDevVideoModeSupportedRequest2 *videoModeSupportedRequest2 = (VMMDevVideoModeSupportedRequest2*)pRequestHeader;
     1047                /* forward the call */
     1048                pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv,
     1049                                                                       videoModeSupportedRequest2->display,
     1050                                                                       videoModeSupportedRequest2->width,
     1051                                                                       videoModeSupportedRequest2->height,
     1052                                                                       videoModeSupportedRequest2->bpp,
     1053                                                                       &videoModeSupportedRequest2->fSupported);
    10291054            }
    10301055            break;
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDev.h

    r27315 r28264  
    5555                                                   uint32_t width, uint32_t height,
    5656                                                   void *pShape);
    57     static DECLCALLBACK(int)    VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,
     57    static DECLCALLBACK(int)    VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height,
    5858                                                   uint32_t bpp, bool *fSupported);
    5959    static DECLCALLBACK(int)    GetHeightReduction(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *heightReduction);
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp

    r27315 r28264  
    217217}
    218218
    219 DECLCALLBACK(int) VMMDev::VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,
     219DECLCALLBACK(int) VMMDev::VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height,
    220220                                             uint32_t bpp, bool *fSupported)
    221221{
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r28256 r28264  
    20992099
    21002100    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     2101
     2102    if (aScreenId != 0 && aScreenId >= mcMonitors)
     2103        return E_INVALIDARG;
    21012104
    21022105    /* @todo this should be actually done on EMT. */
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r28051 r28264  
    319319}
    320320
    321 DECLCALLBACK(int) vmmdevVideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,
     321DECLCALLBACK(int) vmmdevVideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height,
    322322                                           uint32_t bpp, bool *fSupported)
    323323{
     
    326326    if (!fSupported)
    327327        return VERR_INVALID_PARAMETER;
    328     IFramebuffer *framebuffer = pDrv->pVMMDev->getParent()->getDisplay()->getFramebuffer();
    329     if (framebuffer)
     328#ifdef DEBUG_sunlover
     329    Log(("vmmdevVideoModeSupported: [%d]: %dx%dx%d\n", display, width, height, bpp));
     330#endif
     331    IFramebuffer *framebuffer = NULL;
     332    LONG xOrigin = 0;
     333    LONG yOrigin = 0;
     334    HRESULT hrc = pDrv->pVMMDev->getParent()->getDisplay()->GetFramebuffer(display, &framebuffer, &xOrigin, &yOrigin);
     335    if (SUCCEEDED(hrc) && framebuffer)
     336    {
    330337        framebuffer->VideoModeSupported(width, height, bpp, (BOOL*)fSupported);
     338        framebuffer->Release();
     339    }
    331340    else
     341    {
     342#ifdef DEBUG_sunlover
     343        Log(("vmmdevVideoModeSupported: hrc %x, framebuffer %p!!!\n", hrc, framebuffer));
     344#endif
    332345        *fSupported = true;
     346    }
    333347    return VINF_SUCCESS;
    334348}
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