VirtualBox

儲存庫 vbox 的更動 34747


忽略:
時間撮記:
2010-12-6 下午01:44:49 (14 年 以前)
作者:
vboxsync
訊息:

Additions/x11/vboxvideo: main code for multi-monitor X11 and various small fixes

位置:
trunk/src/VBox/Additions/x11/vboxvideo
檔案:
刪除 1 筆資料
修改 5 筆資料

圖例:

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

    r34722 r34747  
    131131vboxvideo_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD
    132132vboxvideo_drv_13_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
    133 vboxvideo_drv_13_DEFS := $(vboxvideo_drv_70_DEFS) vboxvideo
     133vboxvideo_drv_13_DEFS := $(vboxvideo_drv_70_DEFS) VBOXVIDEO_13
    134134vboxvideo_drv_13_INCS = \
    135135        $(VBOX_PATH_X11_XORG_1_3) \
  • trunk/src/VBox/Additions/x11/vboxvideo/undefined_13

    r34721 r34747  
    112112sigfillset
    113113sprintf
     114snprintf
    114115sscanf
    115116sscanf
     
    191192xf86UnMapVidMem
    192193xf86sprintf
     194xf86snprintf
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxutils.c

    r34715 r34747  
    215215                || aRects[i].y2 <   pVBox->aScreenLocation[j].y)
    216216                continue;
    217             cmdHdr.x = (int16_t)aRects[i].x1 - pVBox->aScreenLocation[j].x;
    218             cmdHdr.y = (int16_t)aRects[i].y1 - pVBox->aScreenLocation[j].y;
     217            cmdHdr.x =   (int16_t)aRects[i].x1
     218                       - pVBox->aScreenLocation[j].x * 2
     219                       + pVBox->aScreenLocation[0].x;
     220            cmdHdr.y =   (int16_t)aRects[i].y1
     221                       - pVBox->aScreenLocation[j].y * 2
     222                       + pVBox->aScreenLocation[0].y;
    219223            cmdHdr.w = (uint16_t)(aRects[i].x2 - aRects[i].x1);
    220224            cmdHdr.h = (uint16_t)(aRects[i].y2 - aRects[i].y1);
    221225
    222             TRACE_LOG("x=%d, y=%d, w=%d, z=%d\n", cmdHdr.x, cmdHdr.y,
    223                       cmdHdr.w, cmdHdr.h);
     226            TRACE_LOG("display=%u, x=%d, y=%d, w=%d, h=%d\n",
     227                      j, cmdHdr.x, cmdHdr.y, cmdHdr.w, cmdHdr.h);
    224228           
    225229            VBoxVBVABufferBeginUpdate(&pVBox->aVbvaCtx[j], &pVBox->guestCtx);
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r34722 r34747  
    301301    TRACE_LOG("name=%s, HDisplay=%d, VDisplay=%d, x=%d, y=%d\n", adjusted_mode->name,
    302302           adjusted_mode->HDisplay, adjusted_mode->VDisplay, x, y);
    303     VBOXSetMode(crtc->scrn, 0, adjusted_mode->HDisplay, adjusted_mode->VDisplay,
    304                 x, y);
     303    VBOXSetMode(crtc->scrn, (uint32_t)crtc->driver_private,
     304                adjusted_mode->HDisplay, adjusted_mode->VDisplay, x, y);
    305305    /* Don't remember any modes set while we are seamless, as they are
    306306     * just temporary. */
     
    713713    Gamma gzeros = {0.0, 0.0, 0.0};
    714714    rgb rzeros = {0, 0, 0};
    715 #ifdef VBOXVIDEO_13
    716     xf86OutputPtr output;
    717 #endif
    718715    unsigned DispiId;
    719716
     
    822819        if (!xf86SetDepthBpp(pScrn, cBits, 0, 0, Support32bppFb))
    823820            return FALSE;
    824 #ifndef VBOXVIDEO_13
    825821        vboxAddModes(pScrn, cx, cy);
    826 #endif
    827822    }
    828823    if (pScrn->bitsPerPixel != 32 && pScrn->bitsPerPixel != 16)
     
    840835    pScrn->virtualX = 32000;
    841836    pScrn->virtualY = 32000;
    842 
    843     /* Initialise CRTC and output configuration for use with randr1.2. */
    844     xf86CrtcConfigInit(pScrn, &VBOXCrtcConfigFuncs);
    845 
    846     /* Setup our single virtual CRTC. */
    847     xf86CrtcCreate(pScrn, &VBOXCrtcFuncs);
    848 
    849     /* Set up our single virtual output. */
    850     output = xf86OutputCreate(pScrn, &VBOXOutputFuncs, "VBOX1");
    851 
    852     /* Set a sane minimum and maximum mode size */
    853     xf86CrtcSetSizeRange(pScrn, 64, 64, 32000, 32000);
    854 
    855     /* We are not interested in the monitor section in the configuration file. */
    856     xf86OutputUseScreenMonitor(output, FALSE);
    857     output->possible_crtcs = 1;
    858     output->possible_clones = 0;
    859 
    860     /* Now create our initial CRTC/output configuration. */
    861     if (!xf86InitialConfiguration(pScrn, TRUE)) {
    862         xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initial CRTC configuration failed!\n");
    863         return (FALSE);
    864     }
    865 #else /* !VBOXVIDEO_13 */
     837#else
    866838    /* We don't validate with xf86ValidateModes and xf86PruneModes as we
    867839     * already know what we like and what we don't. */
     
    873845    pScrn->virtualY = pScrn->currentMode->VDisplay;
    874846
     847#endif /* !VBOXVIDEO_13 */
     848
     849    /* Needed before we initialise DRI. */
    875850    pScrn->displayWidth = pScrn->virtualX;
    876851
    877852    xf86PrintModes(pScrn);
    878 
    879 #endif /* !VBOXVIDEO_13 */
    880853
    881854    /* Colour weight - we always call this, since we are always in
     
    970943    if (!miSetPixmapDepths())
    971944        return (FALSE);
    972 
    973     /* Needed before we initialise DRI. */
    974     pScrn->displayWidth = pScrn->virtualX;
    975945
    976946#ifdef VBOX_DRI
     
    1017987
    1018988#ifdef VBOXVIDEO_13
     989    /* Initialise CRTC and output configuration for use with randr1.2. */
     990    xf86CrtcConfigInit(pScrn, &VBOXCrtcConfigFuncs);
     991
     992    {
     993        uint32_t i;
     994
     995        for (i = 0; i < pVBox->cScreens; ++i)
     996        {
     997            char szOutput[256];
     998
     999            /* Setup our virtual CRTCs. */
     1000            pVBox->paCrtcs[i] = xf86CrtcCreate(pScrn, &VBOXCrtcFuncs);
     1001            pVBox->paCrtcs[i]->driver_private = (void *)i;
     1002
     1003            /* Set up our virtual outputs. */
     1004            snprintf(szOutput, sizeof(szOutput), "VBOX%u", i);
     1005            pVBox->paOutputs[i] = xf86OutputCreate(pScrn, &VBOXOutputFuncs,
     1006                                                   szOutput);
     1007
     1008            /* We are not interested in the monitor section in the
     1009             * configuration file. */
     1010            xf86OutputUseScreenMonitor(pVBox->paOutputs[i], FALSE);
     1011            pVBox->paOutputs[i]->possible_crtcs = 1 << i;
     1012            pVBox->paOutputs[i]->possible_clones = 0;
     1013            TRACE_LOG("Created crtc (%p) and output %s (%p)\n",
     1014                      (void *)pVBox->paCrtcs[i], szOutput,
     1015                      (void *)pVBox->paOutputs[i]);
     1016        }
     1017    }
     1018
     1019    /* Set a sane minimum and maximum mode size */
     1020    xf86CrtcSetSizeRange(pScrn, 64, 64, 32000, 32000);
     1021
     1022    /* Now create our initial CRTC/output configuration. */
     1023    if (!xf86InitialConfiguration(pScrn, TRUE)) {
     1024        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initial CRTC configuration failed!\n");
     1025        return (FALSE);
     1026    }
     1027   
    10191028    /* Initialise randr 1.2 mode-setting functions and set first mode.
    10201029     * Note that the mode won't be usable until the server has resized the
     
    11801189        xf86PrintModes(pScrn);
    11811190    }
    1182 #endif
    11831191    if (rc && !vboxGuestIsSeamless(pScrn))
    11841192        vboxSaveVideoMode(pScrn, pMode->HDisplay, pMode->VDisplay,
    11851193                          pScrn->bitsPerPixel);
     1194#endif
    11861195    if (pVBox->accessEnabled)
    11871196        pVBox->EnableDisableFBAccess(scrnIndex, TRUE);
     
    11971206            unsigned cHeight, int x, int y)
    11981207{
    1199     VBOXPtr pVBox;
     1208    VBOXPtr pVBox = VBOXGetRec(pScrn);
    12001209    Bool rc = TRUE;
     1210    uint32_t xRel = cDisplay ? x - pVBox->aScreenLocation[0].x : 0;
     1211    uint32_t yRel = cDisplay ? y - pVBox->aScreenLocation[0].y : 0;
    12011212
    12021213    int bpp = pScrn->depth == 24 ? 32 : 16;
    12031214    TRACE_LOG("cDisplay=%u, cWidth=%u, cHeight=%u, x=%d, y=%d, displayWidth=%d\n",
    12041215              cDisplay, cWidth, cHeight, x, y, pScrn->displayWidth);
    1205     pVBox = VBOXGetRec(pScrn);
    12061216    /* Don't fiddle with the hardware if we are switched
    12071217     * to a virtual terminal. */
     
    12181228        && (pVBox->fHaveHGSMI)
    12191229        && !pVBox->vtSwitch)
    1220         VBoxHGSMIProcessDisplayInfo(&pVBox->guestCtx, cDisplay, x, y,
     1230        VBoxHGSMIProcessDisplayInfo(&pVBox->guestCtx, cDisplay, xRel, yRel,
    12211231                                    (y * pScrn->displayWidth + x) * bpp / 8,
    12221232                                    pScrn->displayWidth * bpp / 8,
    12231233                                    cWidth, cHeight, bpp);
    1224     pVBox->aScreenLocation[0].cx = cWidth;
    1225     pVBox->aScreenLocation[0].cy = cHeight;
    1226     pVBox->aScreenLocation[0].x = x;
    1227     pVBox->aScreenLocation[0].y = y;
     1234    pVBox->aScreenLocation[cDisplay].cx = cWidth;
     1235    pVBox->aScreenLocation[cDisplay].cy = cHeight;
     1236    pVBox->aScreenLocation[cDisplay].x = x;
     1237    pVBox->aScreenLocation[cDisplay].y = y;
    12281238    TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
    12291239    return rc;
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h

    r34715 r34747  
    212212     * sending dirty rectangle information to the right one. */
    213213    RTRECT2 aScreenLocation[VBOX_VIDEO_MAX_SCREENS];
     214#ifdef VBOXVIDEO_13
     215    /** The virtual crtcs */
     216    struct _xf86Crtc *paCrtcs[VBOX_VIDEO_MAX_SCREENS];
     217    struct _xf86Output *paOutputs[VBOX_VIDEO_MAX_SCREENS];
     218#endif
    214219    /** Offsets of VBVA buffers in video RAM */
    215220    uint32_t aoffVBVABuffer[VBOX_VIDEO_MAX_SCREENS];
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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