Changeset 22215 in vbox
- Timestamp:
- Aug 13, 2009 12:41:04 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r22189 r22215 257 257 #define VBOXVHWA_VERSION_MAJ 0 258 258 #define VBOXVHWA_VERSION_MIN 0 259 #define VBOXVHWA_VERSION_BLD 1259 #define VBOXVHWA_VERSION_BLD 2 260 260 #define VBOXVHWA_VERSION_RSV 0 261 261 … … 275 275 VBOXVHWACMD_TYPE_QUERY_INFO2, 276 276 VBOXVHWACMD_TYPE_ENABLE, 277 VBOXVHWACMD_TYPE_DISABLE 277 VBOXVHWACMD_TYPE_DISABLE, 278 VBOXVHWACMD_TYPE_HH_CONSTRUCT 278 279 } VBOXVHWACMD_TYPE; 279 280 … … 291 292 /* the host has copied the VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION command and returned it to the guest */ 292 293 #define VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED 0x00020000 294 /* this is the host->host cmd, i.e. a configuration command posted by the host to the framebuffer */ 295 #define VBOXVHWACMD_FLAG_HH_CMD 0x10000000 293 296 294 297 typedef struct _VBOXVHWACMD … … 300 303 uint64_t GuestVBVAReserved1; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */ 301 304 uint64_t GuestVBVAReserved2; /* field internally used by the guest VBVA cmd handling, must NOT be modified by clients */ 305 volatile uint32_t cRefs; 306 int32_t Reserved; 302 307 union 303 308 { … … 729 734 } u; 730 735 } VBOXVHWACMD_SURF_OVERLAY_SETPOSITION; 736 737 typedef struct _VBOXVHWACMD_HH_CONSTRUCT 738 { 739 void * pVM; 740 } VBOXVHWACMD_HH_CONSTRUCT; 731 741 732 742 #pragma pack() -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r21957 r22215 5291 5291 { 5292 5292 vga_save(pSSMHandle, PDMINS_2_DATA(pDevIns, PVGASTATE)); 5293 #ifdef VBOX_WITH_VIDEOHWACCEL 5294 return vbvaVHWASaveStateExec(pDevIns, pSSMHandle); 5295 #else 5293 5296 return VINF_SUCCESS; 5294 } 5295 5297 #endif 5298 } 5299 5300 #ifdef VBOX_WITH_VIDEOHWACCEL 5301 static DECLCALLBACK(int) vgaR3SavePrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 5302 { 5303 return vbvaVHWASaveStatePrep(pDevIns, pSSM); 5304 } 5305 #endif 5296 5306 5297 5307 /** … … 5303 5313 * @param u32Version The data unit version number. 5304 5314 */ 5305 static DECLCALLBACK(int) vgaR3 LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version)5315 static DECLCALLBACK(int) vgaR3xec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version) 5306 5316 { 5307 5317 if (vga_load(pSSMHandle, PDMINS_2_DATA(pDevIns, PVGASTATE), u32Version)) 5308 5318 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 5319 #ifdef VBOX_WITH_VIDEOHWACCEL 5320 return vbvaVHWALoadStateExec(pDevIns, pSSMHandle); 5321 #else 5309 5322 return VINF_SUCCESS; 5323 #endif 5310 5324 } 5311 5325 … … 5546 5560 rc = VERR_INTERNAL_ERROR; 5547 5561 } 5562 #ifdef VBOX_WITH_VIDEOHWACCEL 5563 if(rc == VINF_SUCCESS) 5564 { 5565 rc = vbvaVHWAConstruct(pThis); 5566 Assert(RT_SUCCESS(rc)); 5567 } 5568 #endif 5548 5569 } 5549 5570 else … … 5922 5943 /* save */ 5923 5944 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, VGA_SAVEDSTATE_VERSION, 5924 sizeof(*pThis), NULL, vgaR3SaveExec, NULL, NULL, vgaR3LoadExec, NULL); 5945 sizeof(*pThis), 5946 #ifdef VBOX_WITH_VIDEOHWACCEL 5947 NULL, vgaR3SaveExec, NULL, 5948 #else 5949 NULL, vgaR3SaveExec, NULL, 5950 #endif 5951 NULL, vgaR3xec, NULL); 5925 5952 if (RT_FAILURE(rc)) 5926 5953 return rc; -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r20444 r22215 453 453 # ifdef VBOX_WITH_VIDEOHWACCEL 454 454 int vbvaVHWACommandCompleteAsynch(PPDMDDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd); 455 456 int vbvaVHWAConstruct (PVGASTATE pVGAState); 457 int vbvaVHWADisable (PVGASTATE pVGAState); 458 int vbvaVHWASaveStatePrep (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 459 int vbvaVHWASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 460 int vbvaVHWALoadStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 455 461 # endif 456 462 #endif /* VBOX_WITH_HGSMI */ -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r22099 r22215 203 203 VirtualBox_LIBS = $(LIB_DDU) 204 204 205 ifdef VBOX_WITH_VIDEOHWACCEL 206 # Necessary for save state support 207 VirtualBox_LIBS += $(LIB_VMM) 208 endif 205 209 ifeq ($(KBUILD_TYPE),release) 206 210 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r22189 r22215 640 640 uint32_t widthCompression() const {return mWidthCompression;} 641 641 uint32_t heightCompression() const {return mHeightCompression;} 642 // uint32_t r(uint32_t pix); 643 // uint32_t g(uint32_t pix); 644 // uint32_t b(uint32_t pix); 642 const VBoxVHWAColorComponent& r() const {return mR;} 643 const VBoxVHWAColorComponent& g() const {return mG;} 644 const VBoxVHWAColorComponent& b() const {return mB;} 645 const VBoxVHWAColorComponent& a() const {return mA;} 645 646 646 647 private: … … 1033 1034 VBoxVHWAColorKey mDefaultSrcOverlayCKey; 1034 1035 1035 1036 // GLenum mFormat;1037 // GLint mInternalFormat;1038 // GLenum mType;1039 // ulong mDisplayWidth;1040 // ulong mDisplayHeight;1041 // ulong mBytesPerPixel;1042 // ulong mBytesPerLine;1043 1044 1036 int mLockCount; 1045 1037 /* memory buffer not reflected in fm and texture, e.g if memory buffer is replaced or in case of lock/unlock */ … … 1078 1070 1079 1071 typedef std::list <VBoxVHWASurfaceBase*> SurfList; 1072 typedef std::list <VBoxVHWASurfList*> OverlayList; 1080 1073 1081 1074 class VBoxVHWASurfList … … 1198 1191 } 1199 1192 1200 1201 1193 void performDisplay() 1202 1194 { … … 1211 1203 { 1212 1204 pOverlay->performDisplay(pPrimary); 1213 // pPrimary->overlay(pOverlay);1214 1205 } 1215 1206 } 1216 1207 } 1208 1209 const OverlayList & overlays() const {return mOverlays;} 1217 1210 1218 1211 private: … … 1220 1213 VBoxVHWASurfList mPrimary; 1221 1214 1222 typedef std::list <VBoxVHWASurfList*> OverlayList;1223 1224 1215 OverlayList mOverlays; 1225 1216 }; … … 1235 1226 1236 1227 uchar *vboxAddress() { return mDisplay.getVGA() ? mDisplay.getVGA()->address() : NULL; } 1228 1237 1229 #ifdef VBOX_WITH_VIDEOHWACCEL 1238 1230 uchar *vboxVRAMAddressFromOffset(uint64_t offset); 1239 #endif 1231 1232 void vhwaSaveExec(struct SSMHANDLE * pSSM); 1233 int vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version); 1234 #endif 1235 1240 1236 ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); } 1241 1237 ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : NULL; } 1242 1238 1243 1239 typedef void (VBoxGLWidget::*PFNVBOXQGLOP)(void* ); 1244 //typedef FNVBOXQGLOP *PFNVBOXQGLOP;1245 1240 1246 1241 void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe);} 1247 1242 void vboxResizeEvent (VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re);} 1248 //#ifdef VBOXQGL_DBG_SURF 1249 // void vboxTestSurfaces () {vboxPerformGLOp(&VBoxGLWidget::vboxDoTestSurfaces, NULL);} 1250 //#endif 1243 1251 1244 void vboxProcessVHWACommands(VBoxVHWACommandProcessEvent * pEvent) {vboxPerformGLOp(&VBoxGLWidget::vboxDoProcessVHWACommands, pEvent);} 1252 1245 #ifdef VBOX_WITH_VIDEOHWACCEL … … 1259 1252 void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData); 1260 1253 protected: 1261 // void resizeGL (int height, int width);1262 1254 1263 1255 void paintGL() 1264 1256 { 1265 // Assert(mState.getCurrent() == NULL);1266 // /* we are called with QGLWidget context */1267 // mState.assertCurrent(mDisplay.getVGA(), false);1268 1257 if(mpfnOp) 1269 1258 { … … 1275 1264 mDisplay.performDisplay(); 1276 1265 } 1277 // /* restore the context */1278 // mState.makeCurrent(mDisplay.getVGA());1279 // /* clear*/1280 // mState.assertCurrent(NULL, false);1281 1266 } 1282 1267 1283 1268 void initializeGL(); 1284 1269 private: 1285 // void vboxDoInitDisplay();1286 // void vboxDoDeleteDisplay();1287 // void vboxDoPerformDisplay() { Assert(mDisplayInitialized); glCallList(mDisplay); }1288 1270 void vboxDoResize(void *re); 1289 1271 void vboxDoPaint(void *rec); … … 1324 1306 int vhwaQueryInfo1(struct _VBOXVHWACMD_QUERYINFO1 *pCmd); 1325 1307 int vhwaQueryInfo2(struct _VBOXVHWACMD_QUERYINFO2 *pCmd); 1308 int vhwaConstruct(struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd); 1309 1310 int vhwaSaveSurface(struct SSMHANDLE * pSSM, VBoxVHWASurfaceBase *pSurf, uint32_t surfCaps); 1311 int vhwaLoadSurface(struct SSMHANDLE * pSSM, uint32_t u32Version); 1312 int vhwaSaveOverlayData(struct SSMHANDLE * pSSM, VBoxVHWASurfaceBase *pSurf); 1313 int vhwaLoadOverlayData(struct SSMHANDLE * pSSM, uint32_t u32Version); 1326 1314 1327 1315 void vhwaDoSurfaceOverlayUpdate(VBoxVHWASurfaceBase *pDstSurf, VBoxVHWASurfaceBase *pSrcSurf, struct _VBOXVHWACMD_SURF_OVERLAY_UPDATE *pCmd); … … 1329 1317 static const QGLFormat & vboxGLFormat(); 1330 1318 1331 // VBoxVHWASurfaceQGL * pDisplay;1332 1319 VBoxVHWADisplay mDisplay; 1333 1320 1334 1321 1335 /* we need to do all opengl stuff in the paintGL context, 1336 * submit the operation to be performed */ 1322 /* we do all opengl stuff in the paintGL context, 1323 * submit the operation to be performed 1324 * @todo: could be moved outside the updateGL */ 1337 1325 void vboxPerformGLOp(PFNVBOXQGLOP pfn, void* pContext) {mpfnOp = pfn; mOpContext = pContext; updateGL();} 1338 1326 … … 1347 1335 void *mOpContext; 1348 1336 1349 // ulong mBitsPerPixel;1350 1337 ulong mPixelFormat; 1351 1338 bool mUsesGuestVRAM; 1352 #if 0 1353 VBoxVHWAGlContextState mState; 1354 #endif 1339 bool mVGASurfCreated; 1355 1340 1356 1341 RTCRITSECT mCritSect; -
trunk/src/VBox/Main/DisplayImpl.cpp
r21878 r22215 2349 2349 if(FAILED(hr)) 2350 2350 { 2351 rc = VERR_GENERAL_FAILURE;2351 rc = (hr == E_NOTIMPL) ? VERR_NOT_IMPLEMENTED : VERR_GENERAL_FAILURE; 2352 2352 } 2353 2353 … … 2363 2363 { 2364 2364 /* tell the guest the command is complete */ 2365 pCommand->Flags &= (~VBOXVHWACMD_FLAG_HG_ASYNCH); 2365 2366 pCommand->rc = rc; 2366 2367 }
Note:
See TracChangeset
for help on using the changeset viewer.