Changeset 22247 in vbox
- Timestamp:
- Aug 13, 2009 9:04:28 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r22215 r22247 257 257 #define VBOXVHWA_VERSION_MAJ 0 258 258 #define VBOXVHWA_VERSION_MIN 0 259 #define VBOXVHWA_VERSION_BLD 2259 #define VBOXVHWA_VERSION_BLD 3 260 260 #define VBOXVHWA_VERSION_RSV 0 261 261 … … 318 318 typedef unsigned int VBOXVHWACMD_LENGTH; 319 319 typedef uint64_t VBOXVHWA_SURFHANDLE; 320 #define VBOXVHWA CMD_SURFHANDLE_INVALID 0320 #define VBOXVHWA_SURFHANDLE_INVALID 0 321 321 #define VBOXVHWACMD_BODY(_p, _t) ((_t*)(_p)->body) 322 322 #define VBOXVHWACMD_HEAD(_pb) ((VBOXVHWACMD*)((uint8_t *)(_pb) - RT_OFFSETOF(VBOXVHWACMD, body))) … … 387 387 uint32_t surfCaps; 388 388 uint32_t Reserved2; 389 VBOXVHWA_SURFHANDLE hSurf; 390 uint64_t offSurface; 389 391 } VBOXVHWA_SURFACEDESC; 390 392 … … 564 566 } VBOXVHWACMD_QUERYINFO2; 565 567 566 #define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWA INFO2, FourCC[_cFourCC])568 #define VBOXVHWAINFO2_SIZE(_cFourCC) RT_OFFSETOF(VBOXVHWACMD_QUERYINFO2, FourCC[_cFourCC]) 567 569 568 570 typedef struct _VBOXVHWACMD_SURF_CANCREATE … … 587 589 { 588 590 VBOXVHWA_SURFACEDESC SurfInfo; 589 union590 {591 struct592 {593 uint64_t offSurface;594 } in;595 596 struct597 {598 VBOXVHWA_SURFHANDLE hSurf;599 } out;600 } u;601 591 } VBOXVHWACMD_SURF_CREATE; 602 592 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r22136 r22247 657 657 if (lpSurfaceLocal->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) 658 658 { 659 pBody-> u.in.offSurface = 0;659 pBody->SurfInfo.offSurface = 0; 660 660 } 661 661 else 662 662 { 663 pBody-> u.in.offSurface = VBOXVHWA_OFFSET64_VOID;663 pBody->SurfInfo.offSurface = VBOXVHWA_OFFSET64_VOID; 664 664 } 665 665 … … 674 674 uint32_t surfSizeX = pBody->SurfInfo.sizeX; 675 675 uint32_t surfSizeY = pBody->SurfInfo.sizeY; 676 pDesc->hHostHandle = pBody-> u.out.hSurf;676 pDesc->hHostHandle = pBody->SurfInfo.hSurf; 677 677 lpSurfaceGlobal->dwReserved1 = (ULONG_PTR)pDesc; 678 678 lPitch = pBody->SurfInfo.pitch; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r22136 r22247 109 109 volatile uint32_t cPendingFlipsTarg; 110 110 #ifdef DEBUG 111 volatile uint 64_t cFlipsCurr;112 volatile uint 64_t cFlipsTarg;111 volatile uint32_t cFlipsCurr; 112 volatile uint32_t cFlipsTarg; 113 113 #endif 114 114 // uint32_t cBitsPerPixel; -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r22189 r22247 911 911 VBOXVHWACMD_QUERYINFO2* vboxVHWAQueryHostInfo2(PPDEV ppdev, uint32_t numFourCC) 912 912 { 913 VBOXVHWACMD* pCmd = vboxVHWACommandCreate (ppdev, VBOXVHWACMD_TYPE_QUERY_INFO2, sizeof(VBOXVHWACMD_QUERYINFO2));913 VBOXVHWACMD* pCmd = vboxVHWACommandCreate (ppdev, VBOXVHWACMD_TYPE_QUERY_INFO2, VBOXVHWAINFO2_SIZE(numFourCC)); 914 914 VBOXVHWACMD_QUERYINFO2 *pInfo2; 915 915 if (!pCmd) -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r22215 r22247 123 123 VBOXVHWA_PIPECMD_PAINT = 1, 124 124 VBOXVHWA_PIPECMD_VHWA, 125 125 VBOXVHWA_PIPECMD_OP, 126 126 }VBOXVHWA_PIPECMD_TYPE; 127 128 typedef DECLCALLBACK(void) FNVBOXVHWACALLBACK(void * pContext); 129 typedef FNVBOXVHWACALLBACK *PFNVBOXVHWACALLBACK; 130 131 typedef struct VBOXVHWACALLBACKINFO 132 { 133 PFNVBOXVHWACALLBACK pfnCallback; 134 void * pContext; 135 }VBOXVHWACALLBACKINFO; 127 136 class VBoxVHWACommandElement 128 137 { … … 131 140 { 132 141 mType = VBOXVHWA_PIPECMD_VHWA; 133 mpCmd = pCmd;142 u.mpCmd = pCmd; 134 143 } 135 144 … … 138 147 mType = VBOXVHWA_PIPECMD_PAINT; 139 148 mRect = aRect; 149 } 150 151 void setOp(const VBOXVHWACALLBACKINFO & aOp) 152 { 153 mType = VBOXVHWA_PIPECMD_OP; 154 u.mCallback = aOp; 140 155 } 141 156 … … 150 165 setVHWACmd((struct _VBOXVHWACMD *)pvData); 151 166 break; 167 case VBOXVHWA_PIPECMD_OP: 168 setOp(*((VBOXVHWACALLBACKINFO *)pvData)); 169 break; 170 default: 171 Assert(0); 172 break; 152 173 } 153 174 } … … 155 176 VBOXVHWA_PIPECMD_TYPE type() const {return mType;} 156 177 const QRect & rect() const {return mRect;} 157 struct _VBOXVHWACMD * vhwaCmd() const {return mpCmd;}178 struct _VBOXVHWACMD * vhwaCmd() const {return u.mpCmd;} 158 179 159 180 private: 160 181 VBoxVHWACommandElement * mpNext; 161 182 VBOXVHWA_PIPECMD_TYPE mType; 162 struct _VBOXVHWACMD * mpCmd; 183 union 184 { 185 struct _VBOXVHWACMD * mpCmd; 186 VBOXVHWACALLBACKINFO mCallback; 187 }u; 163 188 QRect mRect; 164 189 … … 756 781 }; 757 782 783 class VBoxVHWAHandleTable 784 { 785 public: 786 VBoxVHWAHandleTable(uint32_t initialSize); 787 ~VBoxVHWAHandleTable(); 788 uint32_t put(void * data); 789 bool mapPut(uint32_t h, void * data); 790 void* get(uint32_t h); 791 void* remove(uint32_t h); 792 private: 793 void doPut(uint32_t h, void * data); 794 void doRemove(uint32_t h); 795 void** mTable; 796 uint32_t mcSize; 797 uint32_t mcUsage; 798 uint32_t mCursor; 799 }; 800 758 801 /* data flow: 759 802 * I. NON-Yinverted surface: … … 935 978 const VBoxVHWAColorFormat & colorFormat() {return mColorFormat; } 936 979 937 /* clients should treat the returned texture as read-only */938 // GLuint textureSynched(const QRect * aRect) { /*synchTex(aRect); */synchTexMem(aRect); return mTexture; }939 940 980 void setAddress(uchar * addr); 941 981 942 982 const QRect& rect() {return mRect;} 943 // const QRect& texRect() {return mTexRect;}944 945 // /* surface currently being displayed in a flip chain */946 // virtual bool isPrimary() = 0;947 // /* surface representing the main framebuffer. */948 // virtual bool isMainFramebuffer() = 0;949 #if 0950 virtual void makeCurrent() = 0;951 virtual void makeYInvertedCurrent() = 0;952 bool isYInverted() {return mIsYInverted; }953 954 bool isHidden() {return mIsYInverted; }955 void setHidden(bool hidden)956 {957 if(hidden == mIsYInverted)958 return;959 960 invert();961 }962 int invert();963 964 bool isFrontBuffer() {return !mIsYInverted; }965 #endif966 983 967 984 class VBoxVHWASurfList * getComplexList() {return mComplexList; } … … 969 986 class VBoxVHWAGlProgramMngr * getGlProgramMngr(); 970 987 static int setCKey(class VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst); 988 989 uint64_t handle() {return mHGHandle;} 990 void setHandle(uint64_t h) {mHGHandle = h;} 971 991 private: 972 992 void setComplexList(VBoxVHWASurfList *aComplexList) { mComplexList = aComplexList; } 973 993 void initDisplay(VBoxVHWASurfaceBase *pPrimary); 974 994 void deleteDisplay(); 975 // void initDisplay(bool bInverted); 976 // void deleteDisplay(bool bInverted); 977 GLuint createDisplay(VBoxVHWASurfaceBase *pPrimary 978 #if 0 979 bool bInverted 980 #endif 981 ); 995 996 GLuint createDisplay(VBoxVHWASurfaceBase *pPrimary); 982 997 void doDisplay(VBoxVHWASurfaceBase *pPrimary, VBoxVHWAGlProgramVHWA * pProgram, bool bBindDst); 983 998 void synchTexMem(const QRect * aRect); 984 #if 0 985 void synchTex(const QRect * aRect); 986 void synchTexFB(const QRect * aRect); 987 void synchMem(const QRect * aRect); 988 void synchFB(const QRect * aRect); 989 void synch(const QRect * aRect); 990 #endif 999 991 1000 int performBlt(const QRect * pDstRect, VBoxVHWASurfaceBase * pSrcSurface, const QRect * pSrcRect, const VBoxVHWAColorKey * pDstCKey, const VBoxVHWAColorKey * pSrcCKey, bool blt); 992 1001 993 // void doTex2FB(const QRect * aRect);994 1002 void doTex2FB(const QRect * pDstRect, const QRect * pSrcRect); 995 1003 void doMultiTex2FB(const QRect * pDstRect, VBoxVHWATexture * pDstTex, const QRect * pSrcRect, int cSrcTex); 996 1004 void doMultiTex2FB(const QRect * pDstRect, const QRect * pSrcRect, int cSrcTex); 997 // void doMultiTex2FB(GLenum tex, const QRect * pDstRect, const QRect * pSrcRect);998 1005 999 1006 void doSetupMatrix(const QSize * pSize , bool bInverted); 1000 1007 1001 1008 QRect mRect; /* == Inv FB size */ 1002 // QRect mTexRect; /* texture size */1003 1009 1004 1010 QRect mSrcRect; 1005 1011 QRect mTargRect; /* == Vis FB size */ 1006 1012 QRect mTargSize; 1007 #if 0 1008 GLuint mYInvertedDisplay; 1009 #endif 1013 1010 1014 GLuint mVisibleDisplay; 1011 #if 0 1012 bool mYInvertedDisplayInitialized; 1013 #endif 1015 1014 1016 bool mVisibleDisplayInitialized; 1015 1017 … … 1037 1039 /* memory buffer not reflected in fm and texture, e.g if memory buffer is replaced or in case of lock/unlock */ 1038 1040 VBoxVHWADirtyRect mUpdateMem2TexRect; 1039 #if 01040 /* memory buffer not reflected in fm and texture, e.g if memory buffer is replaced or in case of lock/unlock */1041 VBoxVHWADirtyRect mUpdateTex2FBRect;1042 /*in case of blit we blit from another surface's texture, so our current texture gets durty */1043 VBoxVHWADirtyRect mUpdateFB2TexRect;1044 /*in case of blit the memory buffer does not get updated until we need it, e.g. for paint or lock operations */1045 VBoxVHWADirtyRect mUpdateFB2MemRect;1046 #endif1047 1041 1048 1042 bool mFreeAddress; 1049 #if 01050 bool mIsYInverted;1051 #endif1052 1043 1053 1044 class VBoxVHWASurfList *mComplexList; … … 1055 1046 class VBoxGLWidget *mWidget; 1056 1047 1048 uint64_t mHGHandle; 1057 1049 protected: 1058 #if 01059 virtual void init(uchar *pvMem, bool bInverted);1060 class VBoxVHWAGlContextState *mState;1061 #endif1062 1050 1063 1051 friend class VBoxVHWASurfList; … … 1216 1204 }; 1217 1205 1206 typedef void (VBoxGLWidget::*PFNVBOXQGLOP)(void* ); 1207 1218 1208 class VBoxGLWidget : public QGLWidget 1219 1209 { … … 1236 1226 ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); } 1237 1227 ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : NULL; } 1238 1239 typedef void (VBoxGLWidget::*PFNVBOXQGLOP)(void* );1240 1228 1241 1229 void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe);} … … 1276 1264 #endif 1277 1265 #ifdef VBOX_WITH_VIDEOHWACCEL 1266 void vboxDoVHWACmdExec(void *cmd); 1278 1267 void vboxDoVHWACmd(void *cmd); 1268 1279 1269 void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset) 1280 1270 { … … 1325 1315 void vboxPerformGLOp(PFNVBOXQGLOP pfn, void* pContext) {mpfnOp = pfn; mOpContext = pContext; updateGL();} 1326 1316 1317 /* posts op to UI thread */ 1318 int vboxExecOpSynch(PFNVBOXQGLOP pfn, void* pContext); 1319 1327 1320 void cmdPipeInit(); 1328 1321 void cmdPipeDelete(); … … 1331 1324 VBoxVHWACommandElement * detachCmdList(VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free); 1332 1325 VBoxVHWACommandElement * processCmdList(VBoxVHWACommandElement * pCmd); 1326 1327 VBoxVHWASurfaceBase* handle2Surface(uint32_t h) { return (VBoxVHWASurfaceBase*)mSurfHandleTable.get(h); } 1328 1329 VBoxVHWAHandleTable mSurfHandleTable; 1333 1330 1334 1331 PFNVBOXQGLOP mpfnOp;
Note:
See TracChangeset
for help on using the changeset viewer.