VirtualBox

Changeset 27839 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 30, 2010 8:31:42 PM (15 years ago)
Author:
vboxsync
Message:

2d: working multi-monitor + some fixing for working with not-using-VRAM mode

Location:
trunk/src/VBox
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c

    r26562 r27839  
    108108    {
    109109#ifdef VBOX_WITH_VIDEOHWACCEL
    110         vboxVHWAInit();
    111 
    112110        memset(pHalInfo, 0, sizeof(DD_HALINFO));
    113111        pHalInfo->dwSize    = sizeof(DD_HALINFO);
     
    659657            if (lpSurfaceLocal->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
    660658            {
    661                 pBody->SurfInfo.offSurface = 0;
     659                pBody->SurfInfo.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, 0);
    662660            }
    663661            else
     
    10821080                memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_LOCK));
    10831081
    1084                 pBody->u.in.offSurface = (uint64_t)lpSurfaceGlobal->fpVidMem;
     1082                pBody->u.in.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSurfaceGlobal->fpVidMem);
    10851083
    10861084//            if (lpLock->bHasRect)
     
    14651463        memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_COLORKEY_SET));
    14661464
    1467         pBody->u.in.offSurface = (uint64_t)lpSurfaceGlobal->fpVidMem;
     1465        pBody->u.in.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSurfaceGlobal->fpVidMem);
    14681466        pBody->u.in.hSurf = pDesc->hHostHandle;
    14691467        pBody->u.in.flags = vboxVHWAFromDDCKEYs(lpSetColorKey->dwFlags);
     
    15081506            memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_BLT));
    15091507
    1510             pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem;
    1511             pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem;
     1508            pBody->u.in.offSrcSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSrcSurfaceGlobal->fpVidMem);
     1509            pBody->u.in.offDstSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpDestSurfaceGlobal->fpVidMem);
    15121510
    15131511            pBody->u.in.hDstSurf = pDestDesc->hHostHandle;
     
    16011599        memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_FLIP));
    16021600
    1603         pBody->u.in.offCurrSurface = (uint64_t)lpCurrSurfaceGlobal->fpVidMem;
    1604         pBody->u.in.offTargSurface = (uint64_t)lpTargSurfaceGlobal->fpVidMem;
     1601        pBody->u.in.offCurrSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpCurrSurfaceGlobal->fpVidMem);
     1602        pBody->u.in.offTargSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpTargSurfaceGlobal->fpVidMem);
    16051603
    16061604        pBody->u.in.hTargSurf = pTargDesc->hHostHandle;
     
    17701768        memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_SETPOSITION));
    17711769
    1772         pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem;
    1773         pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem;
     1770        pBody->u.in.offSrcSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSrcSurfaceGlobal->fpVidMem);
     1771        pBody->u.in.offDstSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpDestSurfaceGlobal->fpVidMem);
    17741772
    17751773        pBody->u.in.hDstSurf = pDestDesc->hHostHandle;
     
    18111809        memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_UPDATE));
    18121810
    1813         pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem;
     1811        pBody->u.in.offSrcSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSrcSurfaceGlobal->fpVidMem);
    18141812
    18151813        pBody->u.in.hSrcSurf = pSrcDesc->hHostHandle;
     
    18411839            PVBOXVHWASURFDESC pDestDesc = (PVBOXVHWASURFDESC)lpDestSurfaceGlobal->dwReserved1;
    18421840            pBody->u.in.hDstSurf = pDestDesc->hHostHandle;
    1843             pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem;
     1841            pBody->u.in.offDstSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpDestSurfaceGlobal->fpVidMem);
    18441842        }
    18451843
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h

    r25528 r27839  
    131131    uint32_t numFourCC;
    132132    HGSMIOFFSET FourCC;
     133    ULONG_PTR offVramBase;
    133134    BOOLEAN bVHWAEnabled;
     135    BOOLEAN bVHWAInited;
    134136} VBOXVHWAINFO;
    135137#endif
     
    297299
    298300 #ifdef VBOX_WITH_VIDEOHWACCEL
     301
     302DECLINLINE(uint64_t) vboxVHWAVramOffsetFromPDEV(PPDEV pDev, ULONG_PTR offPdev)
     303{
     304    return (uint64_t)(pDev->vhwaInfo.offVramBase + offPdev);
     305}
    299306
    300307#define VBOXDD_CHECKFLAG(_v, _f) ((_v) & (_f)) == (_f)
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/screen.c

    r25062 r27839  
    154154                Assert(!err);
    155155#endif
     156
     157#ifdef VBOX_WITH_VIDEOHWACCEL
     158                if (!err)
     159                    vboxVHWAInit(ppdev);
     160#endif
     161
    156162                /* this is not fatal, just means Video 2D acceleration will not be supported */
    157163                err = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c

    r26505 r27839  
    10651065}
    10661066
     1067void vboxVHWAInit(PPDEV ppdev)
     1068{
     1069    VHWAQUERYINFO info;
     1070    DWORD returnedDataLength;
     1071    DWORD err;
     1072
     1073    memset(&info, 0, sizeof (info));
     1074
     1075    err = EngDeviceIoControl(ppdev->hDriver,
     1076            IOCTL_VIDEO_VHWA_QUERY_INFO,
     1077            NULL,
     1078            0,
     1079            &info,
     1080            sizeof(info),
     1081            &returnedDataLength);
     1082    Assert(!err);
     1083    if(!err)
     1084    {
     1085        ppdev->vhwaInfo.offVramBase = info.offVramBase;
     1086        ppdev->vhwaInfo.bVHWAInited = TRUE;
     1087    }
     1088    else
     1089        ppdev->vhwaInfo.bVHWAInited = FALSE;
     1090}
     1091
    10671092# endif
    10681093
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/vhwa.c

    r26667 r27839  
    139139        )
    140140
    141 void vboxVHWAInit()
    142 {
    143 }
    144 
    145 void vboxVHWATerm()
    146 {
    147 }
    148 
    149141uint32_t vboxVHWAUnsupportedDDCAPS(uint32_t caps)
    150142{
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r27286 r27839  
    26872687            break;
    26882688        }
     2689# ifdef VBOX_WITH_VIDEOHWACCEL
     2690        case IOCTL_VIDEO_VHWA_QUERY_INFO:
     2691        {
     2692            if (RequestPacket->OutputBufferLength < sizeof (VHWAQUERYINFO))
     2693            {
     2694                dprintf(("VBoxVideo::VBoxVideoStartIO: Output buffer too small: %d needed: %d!!!\n",
     2695                         RequestPacket->OutputBufferLength, sizeof(VHWAQUERYINFO)));
     2696                RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
     2697                return FALSE;
     2698            }
     2699
     2700            if (!pDevExt->pPrimary->u.primary.bHGSMI)
     2701            {
     2702                RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
     2703                return FALSE;
     2704            }
     2705
     2706            VHWAQUERYINFO *pInfo = (VHWAQUERYINFO *)RequestPacket->OutputBuffer;
     2707            pInfo->offVramBase = (ULONG_PTR)pDevExt->ulFrameBufferOffset;
     2708            RequestPacket->StatusBlock->Information = sizeof (VHWAQUERYINFO);
     2709            Result = TRUE;
     2710            break;
     2711        }
     2712# endif
    26892713#endif /* VBOX_WITH_HGSMI */
    2690 
    26912714        default:
    26922715            dprintf(("VBoxVideo::VBoxVideoStartIO: Unsupported %p, fn %d(0x%x)\n",
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/vboxioctl.h

    r22548 r27839  
    6363#define IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS \
    6464    CTL_CODE(FILE_DEVICE_VIDEO, 0x434, METHOD_BUFFERED, FILE_ANY_ACCESS)
     65
     66#define IOCTL_VIDEO_VHWA_QUERY_INFO \
     67    CTL_CODE(FILE_DEVICE_VIDEO, 0x435, METHOD_BUFFERED, FILE_ANY_ACCESS)
    6568
    6669#endif /* VBOX_WITH_HGSMI */
     
    167170} HGSMIHANDLERDISABLE;
    168171
     172# ifdef VBOX_WITH_VIDEOHWACCEL
     173typedef struct _VHWAQUERYINFO
     174{
     175    ULONG_PTR offVramBase;
     176} VHWAQUERYINFO;
     177# endif
     178
    169179#endif /* VBOX_WITH_HGSMI */
    170180#pragma pack()
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r27682 r27839  
    10011001
    10021002#ifdef VBOX_WITH_VIDEOHWACCEL
    1003 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd)
     1003static void vbvaVHWAHHCommandReinit(VBOXVHWACMD* pHdr, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay)
     1004{
     1005    memset(pHdr, 0, VBOXVHWACMD_HEADSIZE());
     1006    pHdr->cRefs = 1;
     1007    pHdr->iDisplay = iDisplay;
     1008    pHdr->rc = VERR_NOT_IMPLEMENTED;
     1009    pHdr->enmCmd = enmCmd;
     1010    pHdr->Flags = VBOXVHWACMD_FLAG_HH_CMD;
     1011}
     1012
     1013static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay, VBOXVHWACMD_LENGTH cbCmd)
    10041014{
    10051015    VBOXVHWACMD* pHdr = (VBOXVHWACMD*)RTMemAlloc(cbCmd + VBOXVHWACMD_HEADSIZE());
    10061016    Assert(pHdr);
    10071017    if (pHdr)
    1008     {
    1009         memset(pHdr, 0, VBOXVHWACMD_HEADSIZE());
    1010         pHdr->cRefs = 1;
    1011         pHdr->rc = VERR_NOT_IMPLEMENTED;
    1012         pHdr->enmCmd = enmCmd;
    1013         pHdr->Flags = VBOXVHWACMD_FLAG_HH_CMD;
    1014     }
     1018        vbvaVHWAHHCommandReinit(pHdr, enmCmd, iDisplay);
    10151019
    10161020    return pHdr;
     
    10791083int vbvaVHWAConstruct (PVGASTATE pVGAState)
    10801084{
    1081     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_CONSTRUCT, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
     1085    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_CONSTRUCT, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
    10821086    Assert(pCmd);
    10831087    if(pCmd)
    10841088    {
     1089        uint32_t iDisplay = 0;
     1090        int rc = VINF_SUCCESS;
    10851091        VBOXVHWACMD_HH_CONSTRUCT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_HH_CONSTRUCT);
    1086         memset(pBody, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
    1087 
    1088         PPDMDEVINS pDevIns = pVGAState->pDevInsR3;
    1089         PVM pVM = PDMDevHlpGetVM(pDevIns);
    1090 
    1091         pBody->pVM = pVM;
    1092         pBody->pvVRAM = pVGAState->vram_ptrR3;
    1093         pBody->cbVRAM = pVGAState->vram_size;
    1094 
    1095         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1096         AssertRC(rc);
    1097         if(RT_SUCCESS(rc))
    1098         {
    1099             rc = pCmd->rc;
    1100             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1101             if(rc == VERR_NOT_IMPLEMENTED)
    1102             {
    1103                 /* @todo: set some flag in pVGAState indicating VHWA is not supported */
    1104                 /* VERR_NOT_IMPLEMENTED is not a failure, we just do not support it */
    1105                 rc = VINF_SUCCESS;
    1106             }
    1107         }
     1092
     1093        do
     1094        {
     1095            memset(pBody, 0, sizeof(VBOXVHWACMD_HH_CONSTRUCT));
     1096
     1097            PPDMDEVINS pDevIns = pVGAState->pDevInsR3;
     1098            PVM pVM = PDMDevHlpGetVM(pDevIns);
     1099
     1100            pBody->pVM = pVM;
     1101            pBody->pvVRAM = pVGAState->vram_ptrR3;
     1102            pBody->cbVRAM = pVGAState->vram_size;
     1103
     1104            rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1105            AssertRC(rc);
     1106            if(RT_SUCCESS(rc))
     1107            {
     1108                rc = pCmd->rc;
     1109                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1110                if(rc == VERR_NOT_IMPLEMENTED)
     1111                {
     1112                    /* @todo: set some flag in pVGAState indicating VHWA is not supported */
     1113                    /* VERR_NOT_IMPLEMENTED is not a failure, we just do not support it */
     1114                    rc = VINF_SUCCESS;
     1115                }
     1116
     1117                if (!RT_SUCCESS(rc))
     1118                    break;
     1119            }
     1120            else
     1121                break;
     1122
     1123            ++iDisplay;
     1124            if (iDisplay >= pVGAState->cMonitors)
     1125                break;
     1126            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_HH_CONSTRUCT, (int32_t)iDisplay);
     1127        } while (true);
    11081128
    11091129        vbvaVHWAHHCommandRelease(pCmd);
     
    11171137{
    11181138    /* ensure we have all pending cmds processed and h->g cmds disabled */
    1119     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_RESET, 0);
     1139    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_HH_RESET, 0, 0);
    11201140    Assert(pCmd);
    11211141    if(pCmd)
    11221142    {
    1123         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1124         AssertRC(rc);
    1125         if(RT_SUCCESS(rc))
    1126         {
    1127             rc = pCmd->rc;
    1128             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1129             if (rc == VERR_NOT_IMPLEMENTED)
    1130                 rc = VINF_SUCCESS;
    1131         }
     1143        int rc = VINF_SUCCESS;
     1144        uint32_t iDisplay = 0;
     1145
     1146        do
     1147        {
     1148            rc =vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1149            AssertRC(rc);
     1150            if(RT_SUCCESS(rc))
     1151            {
     1152                rc = pCmd->rc;
     1153                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1154                if (rc == VERR_NOT_IMPLEMENTED)
     1155                    rc = VINF_SUCCESS;
     1156            }
     1157
     1158            if (!RT_SUCCESS(rc))
     1159                break;
     1160
     1161            ++iDisplay;
     1162            if (iDisplay >= pVGAState->cMonitors)
     1163                break;
     1164            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_HH_RESET, (int32_t)iDisplay);
     1165
     1166        } while (true);
    11321167
    11331168        vbvaVHWAHHCommandRelease(pCmd);
     
    11411176int vbvaVHWADisable (PVGASTATE pVGAState)
    11421177{
    1143     VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0);
     1178    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0, 0);
    11441179    Assert(pCmd);
    11451180    if(pCmd)
    11461181    {
    1147         int rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    1148         AssertRC(rc);
    1149         if(RT_SUCCESS(rc))
    1150         {
    1151             rc = pCmd->rc;
    1152             AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
    1153             if(rc == VERR_NOT_IMPLEMENTED)
    1154             {
    1155                 rc = VINF_SUCCESS;
    1156             }
    1157         }
     1182        int rc = VINF_SUCCESS;
     1183        uint32_t iDisplay = 0;
     1184
     1185        do
     1186        {
     1187            rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1188            AssertRC(rc);
     1189            if(RT_SUCCESS(rc))
     1190            {
     1191                rc = pCmd->rc;
     1192                AssertMsg(RT_SUCCESS(rc) || rc == VERR_NOT_IMPLEMENTED, ("%Rrc\n", rc));
     1193                if(rc == VERR_NOT_IMPLEMENTED)
     1194                {
     1195                    rc = VINF_SUCCESS;
     1196                }
     1197            }
     1198
     1199            if (!RT_SUCCESS(rc))
     1200                break;
     1201
     1202            ++iDisplay;
     1203            if (iDisplay >= pVGAState->cMonitors)
     1204                break;
     1205            vbvaVHWAHHCommandReinit(pCmd, VBOXVHWACMD_TYPE_DISABLE, (int32_t)iDisplay);
     1206
     1207        } while (true);
    11581208
    11591209        vbvaVHWAHHCommandRelease(pCmd);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r27762 r27839  
    820820                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    821821                     * @todo: they are to be removed once VBox stuff is gone */
    822                     mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session()) :
     822                    mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) :
    823823#endif
    824824                    new VBoxQImageFrameBuffer (this);
     
    839839                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    840840                     * @todo: they are to be removed once VBox stuff is gone */
    841                     mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session()) :
     841                    mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) :
    842842#endif
    843843                    new VBoxSDLFrameBuffer (this);
     
    864864                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    865865                     * @todo: they are to be removed once VBox stuff is gone */
    866                     mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session()) :
     866                    mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQuartz2DFrameBuffer, VBoxConsoleView, VBoxResizeEvent> (this, &mainWnd->session(), 0) :
    867867#endif
    868868                    new VBoxQuartz2DFrameBuffer (this);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r27785 r27839  
    22042204
    22052205    VBoxVHWASurfaceBase *surf = NULL;
    2206     const VBoxVHWASurfaceBase *existingSurf = NULL;
     2206    /* in case the Framebuffer is working in "not using VRAM" mode,
     2207     * we need to report the pitch, etc. info of the form guest expects from us*/
     2208    VBoxVHWAColorFormat reportedFormat;
     2209    /* paranoya to ensure the VBoxVHWAColorFormat API works properly */
     2210    Assert(!reportedFormat.isValid());
    22072211    bool bNoPBO = false;
    22082212    bool bPrimary = false;
     
    22332237    }
    22342238
    2235     if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
     2239    if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)
    22362240    {
    22372241        bNoPBO = true;
     
    22402244
    22412245        Assert((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0);
    2242         if(pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID
     2246        if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID
    22432247                && (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0)
    22442248        {
     
    22512255//                        && pCmd->SurfInfo.height == pVga->height())
    22522256                {
    2253                     VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,
     2257                    reportedFormat = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,
    22542258                                                pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask,
    22552259                                                pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask,
    22562260                                                pCmd->SurfInfo.PixelFormat.m3.rgbBBitMask);
    2257                     Assert(pVga->pixelFormat().equals(format));
     2261                    // the assert below is incorrect in case the Framebuffer is working in "not using VRAM" mode
     2262//                    Assert(pVga->pixelFormat().equals(format));
    22582263//                    if(pVga->pixelFormat().equals(format))
    22592264                    {
    2260                         existingSurf = pVga;
    22612265                        surf = pVga;
    22622266
     
    22822286    if(!surf)
    22832287    {
     2288        Assert(!(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE));
    22842289        VBOXVHWAIMG_TYPE fFlags = 0;
    22852290        if(!bNoPBO)
     
    23362341
    23372342        uchar * addr = vboxVRAMAddressFromOffset(pCmd->SurfInfo.offSurface);
    2338         if (!existingSurf)
    2339             surf->init(mDisplay.getPrimary(), addr);
     2343        surf->init(mDisplay.getPrimary(), addr);
    23402344
    23412345        if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY)
     
    23762380        }
    23772381    }
     2382    else
     2383    {
     2384        Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE);
     2385    }
    23782386
    23792387    Assert(mDisplay.getVGA() == mDisplay.getPrimary());
     
    23822390    VBOXQGLLOG(("bps: %d\n", surf->bitsPerPixel()));
    23832391
    2384     pCmd->SurfInfo.pitch        = surf->bitsPerPixel() * surf->width() / 8;
    2385     pCmd->SurfInfo.sizeX = surf->memSize();
    2386     pCmd->SurfInfo.sizeY = 1;
     2392    if (!reportedFormat.isValid())
     2393    {
     2394        pCmd->SurfInfo.pitch = surf->bitsPerPixel() * surf->width() / 8;
     2395        pCmd->SurfInfo.sizeX = surf->memSize();
     2396        pCmd->SurfInfo.sizeY = 1;
     2397    }
     2398    else
     2399    {
     2400        /* this is the case of Framebuffer not using Gueat VRAM */
     2401        /* can happen for primary surface creation only */
     2402        Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE);
     2403        pCmd->SurfInfo.pitch = (reportedFormat.bitsPerPixel() * surf->width() + 7) / 8;
     2404        /* we support only RGB case now, otherwise we would need more complicated mechanism of memsize calculation */
     2405        Assert(!reportedFormat.fourcc());
     2406        pCmd->SurfInfo.sizeX = (reportedFormat.bitsPerPixel() * surf->width() + 7) / 8 * surf->height();
     2407        pCmd->SurfInfo.sizeY = 1;
     2408    }
    23872409
    23882410    if(handle != VBOXVHWA_SURFHANDLE_INVALID)
     
    24952517    VBOXQGLLOG_ENTER(("pSurf (0x%x)\n",pSurf));
    24962518    vboxCheckUpdateAddress (pSurf, pCmd->u.in.offSurface);
    2497     if(pCmd->u.in.rectValid)
     2519    if (pCmd->u.in.rectValid)
    24982520    {
    24992521        QRect r = VBOXVHWA_CONSTRUCT_QRECT_FROM_RECTL_WH(&pCmd->u.in.rect);
     
    36653687            Assert ((size.bytesPerLine() & 3) == 0);
    36663688            fallback = ((size.bytesPerLine() & 3) != 0);
     3689            Assert(!fallback);
    36673690        }
    36683691        if (!fallback)
     
    36713694            Assert ((bitsPerLine & (size.bitsPerPixel() - 1)) == 0);
    36723695            fallback = ((bitsPerLine & (size.bitsPerPixel() - 1)) != 0);
     3696            Assert(!fallback);
    36733697        }
    36743698        if (!fallback)
     
    36813705    else
    36823706    {
     3707        AssertBreakpoint();
    36833708        fallback = true;
    36843709    }
     
    36863711    if (fallback)
    36873712    {
     3713        /* we should never come to fallback more now */
     3714        AssertBreakpoint();
    36883715        /* we don't support either the pixel format or the color depth,
    36893716         * fallback to a self-provided 32bpp RGB buffer */
     
    39984025}
    39994026
    4000 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject,  CSession * aSession)
     4027VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject,  CSession * aSession, uint32_t id)
    40014028    : mpOverlayWgt (NULL),
    40024029      mpViewport (pViewport),
     
    40104037      mCmdPipe (pPostEventObject),
    40114038      mSettings (*aSession),
    4012       mpSession(aSession)
     4039      mpSession(aSession),
     4040      m_id(id)
    40134041{
    40144042    /* postpone the gl widget initialization to avoid conflict with 3D on Mac */
     
    40624090        if (mOverlayImage.hasSurfaces())
    40634091        {
    4064             Assert(!mOverlayVisible);
     4092//            Assert(!mOverlayVisible);
    40654093            if (pViewport)
    40664094            {
     
    40684096//            vboxDoCheckUpdateViewport();
    40694097            }
    4070             Assert(!mOverlayVisible);
     4098//            Assert(!mOverlayVisible);
    40714099        }
    40724100        mGlCurrent = false;
     
    46044632{
    46054633    PVM pVM = (PVM)pCmd->pVM;
    4606     uint32_t intsId = 0; /* @todo: set the proper id */
     4634    uint32_t intsId = m_id;
    46074635
    46084636    char nameFuf[sizeof(VBOXQGL_STATE_NAMEBASE) + 8];
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r27777 r27839  
    226226    VBoxVHWAColorFormat(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b);
    227227    VBoxVHWAColorFormat(uint32_t fourcc);
    228     VBoxVHWAColorFormat(){}
     228    VBoxVHWAColorFormat() :
     229        mBitsPerPixel(0) /* needed for isValid() to work */
     230    {}
    229231    GLint internalFormat() const {return mInternalFormat; }
    230232    GLenum format() const {return mFormat; }
     
    15751577#ifdef VBOX_WITH_VIDEOHWACCEL
    15761578
    1577     void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset)
     1579    void vboxCheckUpdateAddress(VBoxVHWASurfaceBase * pSurface, uint64_t offset)
    15781580    {
    15791581        if (pSurface->addressAlocated())
    15801582        {
     1583            Assert(!mDisplay.isPrimary(pSurface));
    15811584            uchar * addr = vboxVRAMAddressFromOffset(offset);
    1582             if(addr)
     1585            if (addr)
    15831586            {
    15841587                pSurface->setAddress(addr);
     
    17611764{
    17621765public:
    1763     VBoxQGLOverlay (QWidget *pViewport, QObject *pPostEventObject, CSession * aSession);
     1766    VBoxQGLOverlay(QWidget *pViewport, QObject *pPostEventObject, CSession * aSession, uint32_t id);
    17641767    ~VBoxQGLOverlay()
    17651768    {
     
    19121915
    19131916    QGLWidget *mpShareWgt;
     1917
     1918    uint32_t m_id;
    19141919};
    19151920
     
    19201925{
    19211926public:
    1922     VBoxOverlayFrameBuffer (V *pView, CSession * aSession)
     1927    VBoxOverlayFrameBuffer (V *pView, CSession * aSession, uint32_t id)
    19231928        : T (pView),
    1924           mOverlay(pView->viewport(), pView, aSession),
     1929          mOverlay(pView->viewport(), pView, aSession, id),
    19251930          mpView (pView)
    19261931    {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r27769 r27839  
    497497                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    498498                     * @todo: they are to be removed once VBox stuff is gone */
    499                     pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session());
     499                    pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQImage, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
    500500                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    501501                }
     
    536536                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    537537                     * @todo: they are to be removed once VBox stuff is gone */
    538                     pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session());
     538                    pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
    539539                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    540540                }
     
    579579                    /* these two additional template args is a workaround to this [VBox|UI] duplication
    580580                     * @todo: they are to be removed once VBox stuff is gone */
    581                     pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session());
     581                    pFramebuffer = new VBoxOverlayFrameBuffer<UIFrameBufferQuartz2D, UIMachineView, UIResizeEvent>(this, &machineWindowWrapper()->session(), (uint32_t)screenId());
    582582                    uisession()->setFrameBuffer(screenId(), pFramebuffer);
    583583                }
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