VirtualBox

vbox的更動 35048 路徑 trunk/src/VBox/Additions/x11


忽略:
時間撮記:
2010-12-14 上午12:21:15 (14 年 以前)
作者:
vboxsync
訊息:

Additions/x11/vboxvideo: do not force the origin of the first monitor to zero and only set valid video modes

位置:
trunk/src/VBox/Additions/x11/vboxvideo
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxutils.c

    r34871 r35048  
    215215                || aRects[i].y2 <   pVBox->aScreenLocation[j].y)
    216216                continue;
    217             cmdHdr.x =   (int16_t)aRects[i].x1
    218                        - pVBox->aScreenLocation[0].x;
    219             cmdHdr.y =   (int16_t)aRects[i].y1
    220                        - pVBox->aScreenLocation[0].y;
     217            cmdHdr.x = (int16_t)aRects[i].x1;
     218            cmdHdr.y = (int16_t)aRects[i].y1;
    221219            cmdHdr.w = (uint16_t)(aRects[i].x2 - aRects[i].x1);
    222220            cmdHdr.h = (uint16_t)(aRects[i].y2 - aRects[i].y1);
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r34922 r35048  
    13411341    Bool rc = TRUE;
    13421342    Bool fPrimaryMoved = FALSE;
    1343     uint32_t cPrimary, cIndex;
     1343    uint32_t cIndex;
    13441344    uint32_t cwReal, chReal;
    1345     int32_t cxRel, cyRel, cxReal, cyReal, cxOld, cyOld;
     1345    uint32_t offStart, offStartReal;
     1346    int32_t cxReal, cyReal, cxOld, cyOld;
    13461347
    13471348    TRACE_LOG("cDisplay=%u, cWidth=%u, cHeight=%u, x=%d, y=%d, displayWidth=%d\n",
     
    13531354    pVBox->aScreenLocation[cDisplay].x = x;
    13541355    pVBox->aScreenLocation[cDisplay].y = y;
    1355     cPrimary = vboxGetPrimaryIndex(pScrn);
    13561356    cIndex = vboxGetRealLocationIndex(pScrn, cDisplay);
    1357     if (cDisplay == cPrimary && (x != cxOld || y != cyOld))
    1358         fPrimaryMoved = TRUE;
    13591357    cwReal = pVBox->aScreenLocation[cIndex].cx;
    13601358    chReal = pVBox->aScreenLocation[cIndex].cy;
    13611359    cxReal = pVBox->aScreenLocation[cIndex].x;
    13621360    cyReal = pVBox->aScreenLocation[cIndex].y;
    1363     cxRel = cxReal - pVBox->aScreenLocation[cPrimary].x;
    1364     cyRel = cyReal - pVBox->aScreenLocation[cPrimary].y;
     1361    offStart = cyReal * pVBox->cbLine + cxReal * vboxBPP(pScrn) / 8;
     1362    /* Silently fail if the mode - specifically the virtual width - is too
     1363     * large for VRAM as we sometimes have to do this - see comments in
     1364     * VBOXPreInit. */
     1365    if (offStart + pVBox->cbLine * chReal > pVBox->cbFramebuffer)
     1366        return TRUE;
    13651367    /* Don't fiddle with the hardware if we are switched
    13661368     * to a virtual terminal. */
    13671369    if (!pVBox->vtSwitch)
    13681370    {
    1369         TRACE_LOG("setting mode.  cWidth=%u, cHeight=%u, cwReal=%u, chReal=%u, pScrn->virtualX=%d, pScrn->virtualY=%d, vboxBPP(pScrn)=%d, x=%d, y=%d, cDisplay=%u, cPrimary=%u, cIndex=%u, cxRel=%d, cyRel=%d, cxReal=%d, cyReal=%d, pVBox->cbLine=%d\n",
     1371        TRACE_LOG("setting mode.  cWidth=%u, cHeight=%u, cwReal=%u, chReal=%u, pScrn->virtualX=%d, pScrn->virtualY=%d, vboxBPP(pScrn)=%d, x=%d, y=%d, cDisplay=%u, cIndex=%u, cxReal=%d, cyReal=%d, pVBox->cbLine=%d\n",
    13701372                  cWidth, cHeight, cwReal, chReal, pScrn->virtualX,
    1371                   pScrn->virtualY, vboxBPP(pScrn), x, y, cDisplay, cPrimary,
    1372                   cIndex, cxRel, cyRel, cxReal, cyReal, pVBox->cbLine);
     1373                  pScrn->virtualY, vboxBPP(pScrn), x, y, cDisplay,
     1374                  cIndex, cxReal, cyReal, pVBox->cbLine);
    13731375        if (cDisplay == 0)
    13741376            VBoxVideoSetModeRegisters(cwReal, chReal, pScrn->displayWidth,
     
    13811383        && (pVBox->fHaveHGSMI)
    13821384        && !pVBox->vtSwitch)
    1383         VBoxHGSMIProcessDisplayInfo(&pVBox->guestCtx, cDisplay, cxRel, cyRel,
    1384                                       cyReal * pVBox->cbLine
    1385                                     + cxReal * vboxBPP(pScrn) / 8,
    1386                                     pVBox->cbLine,
    1387                                     cwReal, chReal, vboxBPP(pScrn));
    1388     /* The guest-host protocol says that first screen is always at offset
    1389      * (0,0).  Ergo, if the guest changes that offset we need to move all
    1390      * other screens in the host to keep the relative positions right. */
    1391     if (fPrimaryMoved)
    1392     {
    1393         unsigned i;
    1394         for (i = 1; i < pVBox->cScreens; ++i)
    1395             if (i != cPrimary)
    1396                 VBOXSetMode(pScrn, i, pVBox->aScreenLocation[i].cx,
    1397                             pVBox->aScreenLocation[i].cy,
    1398                             pVBox->aScreenLocation[i].x,
    1399                             pVBox->aScreenLocation[i].y);
    1400     }
     1385        VBoxHGSMIProcessDisplayInfo(&pVBox->guestCtx, cDisplay, cxReal, cyReal,
     1386                                    offStart, pVBox->cbLine, cwReal, chReal,
     1387                                    vboxBPP(pScrn));
    14011388    TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
    14021389    return rc;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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