Changeset 27839 in vbox for trunk/src/VBox
- Timestamp:
- Mar 30, 2010 8:31:42 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r26562 r27839 108 108 { 109 109 #ifdef VBOX_WITH_VIDEOHWACCEL 110 vboxVHWAInit();111 112 110 memset(pHalInfo, 0, sizeof(DD_HALINFO)); 113 111 pHalInfo->dwSize = sizeof(DD_HALINFO); … … 659 657 if (lpSurfaceLocal->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) 660 658 { 661 pBody->SurfInfo.offSurface = 0;659 pBody->SurfInfo.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, 0); 662 660 } 663 661 else … … 1082 1080 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_LOCK)); 1083 1081 1084 pBody->u.in.offSurface = (uint64_t)lpSurfaceGlobal->fpVidMem;1082 pBody->u.in.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSurfaceGlobal->fpVidMem); 1085 1083 1086 1084 // if (lpLock->bHasRect) … … 1465 1463 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_COLORKEY_SET)); 1466 1464 1467 pBody->u.in.offSurface = (uint64_t)lpSurfaceGlobal->fpVidMem;1465 pBody->u.in.offSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSurfaceGlobal->fpVidMem); 1468 1466 pBody->u.in.hSurf = pDesc->hHostHandle; 1469 1467 pBody->u.in.flags = vboxVHWAFromDDCKEYs(lpSetColorKey->dwFlags); … … 1508 1506 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_BLT)); 1509 1507 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); 1512 1510 1513 1511 pBody->u.in.hDstSurf = pDestDesc->hHostHandle; … … 1601 1599 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_FLIP)); 1602 1600 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); 1605 1603 1606 1604 pBody->u.in.hTargSurf = pTargDesc->hHostHandle; … … 1770 1768 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_SETPOSITION)); 1771 1769 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); 1774 1772 1775 1773 pBody->u.in.hDstSurf = pDestDesc->hHostHandle; … … 1811 1809 memset(pBody, 0, sizeof(VBOXVHWACMD_SURF_OVERLAY_UPDATE)); 1812 1810 1813 pBody->u.in.offSrcSurface = (uint64_t)lpSrcSurfaceGlobal->fpVidMem;1811 pBody->u.in.offSrcSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpSrcSurfaceGlobal->fpVidMem); 1814 1812 1815 1813 pBody->u.in.hSrcSurf = pSrcDesc->hHostHandle; … … 1841 1839 PVBOXVHWASURFDESC pDestDesc = (PVBOXVHWASURFDESC)lpDestSurfaceGlobal->dwReserved1; 1842 1840 pBody->u.in.hDstSurf = pDestDesc->hHostHandle; 1843 pBody->u.in.offDstSurface = (uint64_t)lpDestSurfaceGlobal->fpVidMem;1841 pBody->u.in.offDstSurface = vboxVHWAVramOffsetFromPDEV(pDev, lpDestSurfaceGlobal->fpVidMem); 1844 1842 } 1845 1843 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r25528 r27839 131 131 uint32_t numFourCC; 132 132 HGSMIOFFSET FourCC; 133 ULONG_PTR offVramBase; 133 134 BOOLEAN bVHWAEnabled; 135 BOOLEAN bVHWAInited; 134 136 } VBOXVHWAINFO; 135 137 #endif … … 297 299 298 300 #ifdef VBOX_WITH_VIDEOHWACCEL 301 302 DECLINLINE(uint64_t) vboxVHWAVramOffsetFromPDEV(PPDEV pDev, ULONG_PTR offPdev) 303 { 304 return (uint64_t)(pDev->vhwaInfo.offVramBase + offPdev); 305 } 299 306 300 307 #define VBOXDD_CHECKFLAG(_v, _f) ((_v) & (_f)) == (_f) -
trunk/src/VBox/Additions/WINNT/Graphics/Display/screen.c
r25062 r27839 154 154 Assert(!err); 155 155 #endif 156 157 #ifdef VBOX_WITH_VIDEOHWACCEL 158 if (!err) 159 vboxVHWAInit(ppdev); 160 #endif 161 156 162 /* this is not fatal, just means Video 2D acceleration will not be supported */ 157 163 err = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r26505 r27839 1065 1065 } 1066 1066 1067 void 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 1067 1092 # endif 1068 1093 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vhwa.c
r26667 r27839 139 139 ) 140 140 141 void vboxVHWAInit()142 {143 }144 145 void vboxVHWATerm()146 {147 }148 149 141 uint32_t vboxVHWAUnsupportedDDCAPS(uint32_t caps) 150 142 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27286 r27839 2687 2687 break; 2688 2688 } 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 2689 2713 #endif /* VBOX_WITH_HGSMI */ 2690 2691 2714 default: 2692 2715 dprintf(("VBoxVideo::VBoxVideoStartIO: Unsupported %p, fn %d(0x%x)\n", -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/vboxioctl.h
r22548 r27839 63 63 #define IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS \ 64 64 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) 65 68 66 69 #endif /* VBOX_WITH_HGSMI */ … … 167 170 } HGSMIHANDLERDISABLE; 168 171 172 # ifdef VBOX_WITH_VIDEOHWACCEL 173 typedef struct _VHWAQUERYINFO 174 { 175 ULONG_PTR offVramBase; 176 } VHWAQUERYINFO; 177 # endif 178 169 179 #endif /* VBOX_WITH_HGSMI */ 170 180 #pragma pack() -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r27682 r27839 1001 1001 1002 1002 #ifdef VBOX_WITH_VIDEOHWACCEL 1003 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd) 1003 static 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 1013 static VBOXVHWACMD* vbvaVHWAHHCommandCreate (PVGASTATE pVGAState, VBOXVHWACMD_TYPE enmCmd, int32_t iDisplay, VBOXVHWACMD_LENGTH cbCmd) 1004 1014 { 1005 1015 VBOXVHWACMD* pHdr = (VBOXVHWACMD*)RTMemAlloc(cbCmd + VBOXVHWACMD_HEADSIZE()); 1006 1016 Assert(pHdr); 1007 1017 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); 1015 1019 1016 1020 return pHdr; … … 1079 1083 int vbvaVHWAConstruct (PVGASTATE pVGAState) 1080 1084 { 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)); 1082 1086 Assert(pCmd); 1083 1087 if(pCmd) 1084 1088 { 1089 uint32_t iDisplay = 0; 1090 int rc = VINF_SUCCESS; 1085 1091 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); 1108 1128 1109 1129 vbvaVHWAHHCommandRelease(pCmd); … … 1117 1137 { 1118 1138 /* 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); 1120 1140 Assert(pCmd); 1121 1141 if(pCmd) 1122 1142 { 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); 1132 1167 1133 1168 vbvaVHWAHHCommandRelease(pCmd); … … 1141 1176 int vbvaVHWADisable (PVGASTATE pVGAState) 1142 1177 { 1143 VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0 );1178 VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(pVGAState, VBOXVHWACMD_TYPE_DISABLE, 0, 0); 1144 1179 Assert(pCmd); 1145 1180 if(pCmd) 1146 1181 { 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); 1158 1208 1159 1209 vbvaVHWAHHCommandRelease(pCmd); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r27762 r27839 820 820 /* these two additional template args is a workaround to this [VBox|UI] duplication 821 821 * @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) : 823 823 #endif 824 824 new VBoxQImageFrameBuffer (this); … … 839 839 /* these two additional template args is a workaround to this [VBox|UI] duplication 840 840 * @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) : 842 842 #endif 843 843 new VBoxSDLFrameBuffer (this); … … 864 864 /* these two additional template args is a workaround to this [VBox|UI] duplication 865 865 * @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) : 867 867 #endif 868 868 new VBoxQuartz2DFrameBuffer (this); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r27785 r27839 2204 2204 2205 2205 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()); 2207 2211 bool bNoPBO = false; 2208 2212 bool bPrimary = false; … … 2233 2237 } 2234 2238 2235 if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)2239 if (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE) 2236 2240 { 2237 2241 bNoPBO = true; … … 2240 2244 2241 2245 Assert((pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0); 2242 if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID2246 if (pVga->handle() == VBOXVHWA_SURFHANDLE_INVALID 2243 2247 && (pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OFFSCREENPLAIN) == 0) 2244 2248 { … … 2251 2255 // && pCmd->SurfInfo.height == pVga->height()) 2252 2256 { 2253 VBoxVHWAColorFormat format(pCmd->SurfInfo.PixelFormat.c.rgbBitCount,2257 reportedFormat = VBoxVHWAColorFormat(pCmd->SurfInfo.PixelFormat.c.rgbBitCount, 2254 2258 pCmd->SurfInfo.PixelFormat.m1.rgbRBitMask, 2255 2259 pCmd->SurfInfo.PixelFormat.m2.rgbGBitMask, 2256 2260 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)); 2258 2263 // if(pVga->pixelFormat().equals(format)) 2259 2264 { 2260 existingSurf = pVga;2261 2265 surf = pVga; 2262 2266 … … 2282 2286 if(!surf) 2283 2287 { 2288 Assert(!(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE)); 2284 2289 VBOXVHWAIMG_TYPE fFlags = 0; 2285 2290 if(!bNoPBO) … … 2336 2341 2337 2342 uchar * addr = vboxVRAMAddressFromOffset(pCmd->SurfInfo.offSurface); 2338 if (!existingSurf) 2339 surf->init(mDisplay.getPrimary(), addr); 2343 surf->init(mDisplay.getPrimary(), addr); 2340 2344 2341 2345 if(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_OVERLAY) … … 2376 2380 } 2377 2381 } 2382 else 2383 { 2384 Assert(pCmd->SurfInfo.surfCaps & VBOXVHWA_SCAPS_PRIMARYSURFACE); 2385 } 2378 2386 2379 2387 Assert(mDisplay.getVGA() == mDisplay.getPrimary()); … … 2382 2390 VBOXQGLLOG(("bps: %d\n", surf->bitsPerPixel())); 2383 2391 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 } 2387 2409 2388 2410 if(handle != VBOXVHWA_SURFHANDLE_INVALID) … … 2495 2517 VBOXQGLLOG_ENTER(("pSurf (0x%x)\n",pSurf)); 2496 2518 vboxCheckUpdateAddress (pSurf, pCmd->u.in.offSurface); 2497 if (pCmd->u.in.rectValid)2519 if (pCmd->u.in.rectValid) 2498 2520 { 2499 2521 QRect r = VBOXVHWA_CONSTRUCT_QRECT_FROM_RECTL_WH(&pCmd->u.in.rect); … … 3665 3687 Assert ((size.bytesPerLine() & 3) == 0); 3666 3688 fallback = ((size.bytesPerLine() & 3) != 0); 3689 Assert(!fallback); 3667 3690 } 3668 3691 if (!fallback) … … 3671 3694 Assert ((bitsPerLine & (size.bitsPerPixel() - 1)) == 0); 3672 3695 fallback = ((bitsPerLine & (size.bitsPerPixel() - 1)) != 0); 3696 Assert(!fallback); 3673 3697 } 3674 3698 if (!fallback) … … 3681 3705 else 3682 3706 { 3707 AssertBreakpoint(); 3683 3708 fallback = true; 3684 3709 } … … 3686 3711 if (fallback) 3687 3712 { 3713 /* we should never come to fallback more now */ 3714 AssertBreakpoint(); 3688 3715 /* we don't support either the pixel format or the color depth, 3689 3716 * fallback to a self-provided 32bpp RGB buffer */ … … 3998 4025 } 3999 4026 4000 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject, CSession * aSession )4027 VBoxQGLOverlay::VBoxQGLOverlay (QWidget *pViewport,QObject *pPostEventObject, CSession * aSession, uint32_t id) 4001 4028 : mpOverlayWgt (NULL), 4002 4029 mpViewport (pViewport), … … 4010 4037 mCmdPipe (pPostEventObject), 4011 4038 mSettings (*aSession), 4012 mpSession(aSession) 4039 mpSession(aSession), 4040 m_id(id) 4013 4041 { 4014 4042 /* postpone the gl widget initialization to avoid conflict with 3D on Mac */ … … 4062 4090 if (mOverlayImage.hasSurfaces()) 4063 4091 { 4064 Assert(!mOverlayVisible);4092 // Assert(!mOverlayVisible); 4065 4093 if (pViewport) 4066 4094 { … … 4068 4096 // vboxDoCheckUpdateViewport(); 4069 4097 } 4070 Assert(!mOverlayVisible);4098 // Assert(!mOverlayVisible); 4071 4099 } 4072 4100 mGlCurrent = false; … … 4604 4632 { 4605 4633 PVM pVM = (PVM)pCmd->pVM; 4606 uint32_t intsId = 0; /* @todo: set the proper id */4634 uint32_t intsId = m_id; 4607 4635 4608 4636 char nameFuf[sizeof(VBOXQGL_STATE_NAMEBASE) + 8]; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27777 r27839 226 226 VBoxVHWAColorFormat(uint32_t bitsPerPixel, uint32_t r, uint32_t g, uint32_t b); 227 227 VBoxVHWAColorFormat(uint32_t fourcc); 228 VBoxVHWAColorFormat(){} 228 VBoxVHWAColorFormat() : 229 mBitsPerPixel(0) /* needed for isValid() to work */ 230 {} 229 231 GLint internalFormat() const {return mInternalFormat; } 230 232 GLenum format() const {return mFormat; } … … 1575 1577 #ifdef VBOX_WITH_VIDEOHWACCEL 1576 1578 1577 void vboxCheckUpdateAddress 1579 void vboxCheckUpdateAddress(VBoxVHWASurfaceBase * pSurface, uint64_t offset) 1578 1580 { 1579 1581 if (pSurface->addressAlocated()) 1580 1582 { 1583 Assert(!mDisplay.isPrimary(pSurface)); 1581 1584 uchar * addr = vboxVRAMAddressFromOffset(offset); 1582 if (addr)1585 if (addr) 1583 1586 { 1584 1587 pSurface->setAddress(addr); … … 1761 1764 { 1762 1765 public: 1763 VBoxQGLOverlay (QWidget *pViewport, QObject *pPostEventObject, CSession * aSession);1766 VBoxQGLOverlay(QWidget *pViewport, QObject *pPostEventObject, CSession * aSession, uint32_t id); 1764 1767 ~VBoxQGLOverlay() 1765 1768 { … … 1912 1915 1913 1916 QGLWidget *mpShareWgt; 1917 1918 uint32_t m_id; 1914 1919 }; 1915 1920 … … 1920 1925 { 1921 1926 public: 1922 VBoxOverlayFrameBuffer (V *pView, CSession * aSession )1927 VBoxOverlayFrameBuffer (V *pView, CSession * aSession, uint32_t id) 1923 1928 : T (pView), 1924 mOverlay(pView->viewport(), pView, aSession ),1929 mOverlay(pView->viewport(), pView, aSession, id), 1925 1930 mpView (pView) 1926 1931 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r27769 r27839 497 497 /* these two additional template args is a workaround to this [VBox|UI] duplication 498 498 * @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()); 500 500 uisession()->setFrameBuffer(screenId(), pFramebuffer); 501 501 } … … 536 536 /* these two additional template args is a workaround to this [VBox|UI] duplication 537 537 * @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()); 539 539 uisession()->setFrameBuffer(screenId(), pFramebuffer); 540 540 } … … 579 579 /* these two additional template args is a workaround to this [VBox|UI] duplication 580 580 * @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()); 582 582 uisession()->setFrameBuffer(screenId(), pFramebuffer); 583 583 }
Note:
See TracChangeset
for help on using the changeset viewer.