Changeset 27720 in vbox for trunk/src/VBox
- Timestamp:
- Mar 25, 2010 7:06:26 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r27697 r27720 206 206 { 207 207 public: 208 VBoxVHWACommandProcessEvent ( VBoxVHWACommandElement *pEl)208 VBoxVHWACommandProcessEvent () 209 209 : QEvent ((QEvent::Type) VBoxDefs::VHWACommandProcessType) 210 { 211 mCmdPipe.put(pEl); 212 } 213 VBoxVHWACommandElementPipe & pipe() { return mCmdPipe; } 214 215 VBoxVHWACommandProcessEvent *mpNext; 216 private: 217 VBoxVHWACommandElementPipe mCmdPipe; 210 {} 218 211 }; 219 212 … … 2027 2020 } 2028 2021 2029 //VBoxVHWACommandElement * VBoxVHWAImage::processCmdList(VBoxVHWACommandElement * pCmd)2030 //{2031 // VBoxVHWACommandElement * pCur;2032 // do2033 // {2034 // pCur = pCmd;2035 // switch(pCmd->type())2036 // {2037 // case VBOXVHWA_PIPECMD_PAINT:2038 // vboxDoUpdateRect(&pCmd->rect());2039 // break;2040 //#ifdef VBOX_WITH_VIDEOHWACCEL2041 // case VBOXVHWA_PIPECMD_VHWA:2042 // vboxDoVHWACmd(pCmd->vhwaCmd());2043 // break;2044 // case VBOXVHWA_PIPECMD_FUNC:2045 // {2046 // const VBOXVHWAFUNCCALLBACKINFO & info = pCmd->func();2047 // info.pfnCallback(info.pContext1, info.pContext2);2048 // break;2049 // }2050 //#endif2051 // default:2052 // Assert(0);2053 // }2054 // pCmd = pCmd->mpNext;2055 // } while(pCmd);2056 //2057 // return pCur;2058 //}2059 //2060 //void VBoxVHWAImage::vboxDoProcessVHWACommands(void *pContext)2061 //{2062 // VBoxVHWACommandElementProcessor * pPipe = (VBoxVHWACommandElementProcessor*)pContext;2063 // VBoxVHWACommandElement * pFirst = pPipe->detachCmdList(NULL, NULL);2064 // do2065 // {2066 // VBoxVHWACommandElement * pLast = processCmdList(pFirst);2067 //2068 // pFirst = pPipe->detachCmdList(pFirst, pLast);2069 // } while(pFirst);2070 //}2071 2072 2022 int VBoxVHWAImage::reset(VHWACommandList * pCmdList) 2073 2023 { … … 2124 2074 2125 2075 #ifdef VBOX_WITH_VIDEOHWACCEL 2126 //void VBoxVHWAImage::vboxDoVHWACmd(void *cmd)2127 //{2128 // vboxDoVHWACmdExec(cmd);2129 //2130 // CDisplay display = m_console.GetDisplay();2131 // Assert (!display.isNull());2132 //2133 // display.CompleteVHWACommand((BYTE*)cmd);2134 //}2135 //2136 //void VBoxVHWAImage::vboxDoVHWACmdAndFree(void *cmd)2137 //{2138 // vboxDoVHWACmdExec(cmd);2139 //2140 // free(cmd);2141 //}2142 //2143 //void VBoxVHWAImage::vboxDoVHWACmdExec(void *cmd)2144 //{2145 // struct _VBOXVHWACMD * pCmd = (struct _VBOXVHWACMD *)cmd;2146 // switch(pCmd->enmCmd)2147 // {2148 // case VBOXVHWACMD_TYPE_SURF_CANCREATE:2149 // {2150 // VBOXVHWACMD_SURF_CANCREATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CANCREATE);2151 // pCmd->rc = vhwaSurfaceCanCreate(pBody);2152 // } break;2153 // case VBOXVHWACMD_TYPE_SURF_CREATE:2154 // {2155 // VBOXVHWACMD_SURF_CREATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CREATE);2156 // pCmd->rc = vhwaSurfaceCreate(pBody);2157 // } break;2158 // case VBOXVHWACMD_TYPE_SURF_DESTROY:2159 // {2160 // VBOXVHWACMD_SURF_DESTROY * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_DESTROY);2161 // pCmd->rc = vhwaSurfaceDestroy(pBody);2162 // } break;2163 // case VBOXVHWACMD_TYPE_SURF_LOCK:2164 // {2165 // VBOXVHWACMD_SURF_LOCK * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_LOCK);2166 // pCmd->rc = vhwaSurfaceLock(pBody);2167 // } break;2168 // case VBOXVHWACMD_TYPE_SURF_UNLOCK:2169 // {2170 // VBOXVHWACMD_SURF_UNLOCK * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_UNLOCK);2171 // pCmd->rc = vhwaSurfaceUnlock(pBody);2172 // } break;2173 // case VBOXVHWACMD_TYPE_SURF_BLT:2174 // {2175 // VBOXVHWACMD_SURF_BLT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_BLT);2176 // pCmd->rc = vhwaSurfaceBlt(pBody);2177 // } break;2178 // case VBOXVHWACMD_TYPE_SURF_FLIP:2179 // {2180 // VBOXVHWACMD_SURF_FLIP * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_FLIP);2181 // pCmd->rc = vhwaSurfaceFlip(pBody);2182 // } break;2183 // case VBOXVHWACMD_TYPE_SURF_OVERLAY_UPDATE:2184 // {2185 // VBOXVHWACMD_SURF_OVERLAY_UPDATE * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_UPDATE);2186 // pCmd->rc = vhwaSurfaceOverlayUpdate(pBody);2187 // } break;2188 // case VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION:2189 // {2190 // VBOXVHWACMD_SURF_OVERLAY_SETPOSITION * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_OVERLAY_SETPOSITION);2191 // pCmd->rc = vhwaSurfaceOverlaySetPosition(pBody);2192 // } break;2193 // case VBOXVHWACMD_TYPE_SURF_COLORKEY_SET:2194 // {2195 // VBOXVHWACMD_SURF_COLORKEY_SET * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_COLORKEY_SET);2196 // pCmd->rc = vhwaSurfaceColorkeySet(pBody);2197 // } break;2198 // case VBOXVHWACMD_TYPE_QUERY_INFO1:2199 // {2200 // VBOXVHWACMD_QUERYINFO1 * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_QUERYINFO1);2201 // pCmd->rc = vhwaQueryInfo1(pBody);2202 // } break;2203 // case VBOXVHWACMD_TYPE_QUERY_INFO2:2204 // {2205 // VBOXVHWACMD_QUERYINFO2 * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_QUERYINFO2);2206 // pCmd->rc = vhwaQueryInfo2(pBody);2207 // } break;2208 // case VBOXVHWACMD_TYPE_ENABLE:2209 // case VBOXVHWACMD_TYPE_DISABLE:2210 // pCmd->rc = VINF_SUCCESS;2211 // break;2212 // case VBOXVHWACMD_TYPE_HH_CONSTRUCT:2213 // {2214 // VBOXVHWACMD_HH_CONSTRUCT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_HH_CONSTRUCT);2215 // pCmd->rc = vhwaConstruct(pBody);2216 // } break;2217 // default:2218 // Assert(0);2219 // pCmd->rc = VERR_NOT_IMPLEMENTED;2220 // break;2221 // }2222 //}2223 2224 2076 int VBoxVHWAImage::vhwaSurfaceCanCreate(struct _VBOXVHWACMD_SURF_CANCREATE *pCmd) 2225 2077 { … … 4186 4038 void VBoxQGLOverlay::updateAttachment(QWidget *pViewport, QObject *pPostEventObject) 4187 4039 { 4040 if (mpViewport != pViewport) 4041 { 4042 mpViewport = pViewport; 4043 if (mpOverlayWgt) 4044 { 4045 mpOverlayWgt = NULL; 4046 mOverlayWidgetVisible = false; 4047 initGl(); 4048 Assert(!mOverlayVisible); 4049 // vboxDoCheckUpdateViewport(); 4050 } 4051 mGlCurrent = false; 4052 } 4188 4053 mCmdPipe.updatePostEventObject(pPostEventObject); 4189 if (mpViewport != pViewport)4190 {4191 mpViewport = pViewport;4192 mpOverlayWgt = NULL;4193 mOverlayWidgetVisible = false;4194 initGl();4195 vboxDoCheckUpdateViewport();4196 mGlCurrent = false;4197 }4198 4054 } 4199 4055 … … 4234 4090 } 4235 4091 4236 VBoxVHWACommandElement *pTest = mCmdPipe.detachCmdList( pHead, pTail);4092 VBoxVHWACommandElement *pTest = mCmdPipe.detachCmdList(NULL, pHead, pTail); 4237 4093 Assert(!pTest); 4238 4094 NOREF(pTest); … … 4303 4159 Assert(!mGlCurrent); 4304 4160 mGlCurrent = false; /* just a fall-back */ 4305 VBoxVHWACommandElement * pFirst = mCmdPipe.detachCmdList(NULL, NULL); 4161 bool bFirstCmd = true; 4162 VBoxVHWACommandElement *pLast; 4163 VBoxVHWACommandElement * pFirst = mCmdPipe.detachCmdList(&pLast, NULL, NULL); 4306 4164 while(pFirst) /* pFirst can be zero right after reset when all pending commands are flushed, 4307 4165 * while events for those commands may still come along */ 4308 4166 { 4309 VBoxVHWACommandElement * pLast = processCmdList(pFirst); 4310 4311 pFirst = mCmdPipe.detachCmdList(pFirst, pLast); 4167 VBoxVHWACommandElement * pLastProcessed = processCmdList(pFirst, bFirstCmd); 4168 4169 if (pLastProcessed == pLast) 4170 { 4171 pFirst = mCmdPipe.detachCmdList(&pLast, pFirst, pLastProcessed); 4172 bFirstCmd = false; 4173 } 4174 else 4175 { 4176 mCmdPipe.putBack(pLastProcessed->mpNext, pLast, pFirst, pLastProcessed); 4177 break; 4178 } 4312 4179 } 4313 4180 … … 4773 4640 } 4774 4641 4775 VBoxVHWACommandElement * VBoxQGLOverlay::processCmdList(VBoxVHWACommandElement * pCmd )4642 VBoxVHWACommandElement * VBoxQGLOverlay::processCmdList(VBoxVHWACommandElement * pCmd, bool bFirst) 4776 4643 { 4777 4644 VBoxVHWACommandElement * pCur; … … 4798 4665 Assert(0); 4799 4666 } 4667 4800 4668 pCmd = pCmd->mpNext; 4801 } while(pCmd); 4669 if (!pCmd) 4670 break; 4671 4672 if (!bFirst) 4673 { 4674 if (pCmd->isNewEvent()) 4675 break; 4676 } 4677 else 4678 bFirst = false; 4679 } while(1); 4802 4680 4803 4681 return pCur; … … 4806 4684 4807 4685 VBoxVHWACommandElementProcessor::VBoxVHWACommandElementProcessor(QObject *pParent) : 4808 mpFirstEvent (NULL),4809 mpLastEvent (NULL),4810 4686 m_pParent(pParent), 4811 4687 mbNewEvent (false), … … 4835 4711 void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags) 4836 4712 { 4713 bool bNeedNewEvent = false; 4837 4714 /* 1. lock*/ 4838 4715 RTCritSectEnter(&mCritSect); … … 4851 4728 4852 4729 if((flags & VBOXVHWACMDPIPEC_NEWEVENT) != 0) 4853 {4854 4730 mbNewEvent = true; 4855 }4856 4731 4857 4732 /* 2. if can add to current*/ 4858 if(!mbNewEvent) 4859 { 4860 /* 3. if event is being processed (event != 0) */ 4861 if(mpLastEvent) 4862 { 4863 /* 3.a add cmd to event */ 4864 mpLastEvent->pipe().put(pCmd); 4865 /* 3.b unlock and return */ 4866 if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0) 4867 { 4868 mbNewEvent = true; 4869 } 4870 RTCritSectLeave(&mCritSect); 4871 return; 4872 } 4873 } 4874 4875 /* we're here because the cmd was NOT be added to the current event queue */ 4876 /* 4. unlock*/ 4733 if(mbNewEvent || (!mbProcessingList && m_CmdPipe.isEmpty())) 4734 { 4735 pCmd->setNewEventFlag(); 4736 bNeedNewEvent = true; 4737 mbNewEvent = false; 4738 } 4739 4740 m_CmdPipe.put(pCmd); 4741 4742 if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0) 4743 mbNewEvent = true; 4744 4877 4745 RTCritSectLeave(&mCritSect); 4878 /* 5. create & initialize new Event */ 4879 VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent(pCmd); 4880 pCurrentEvent->mpNext = NULL; 4881 4882 /* 6. lock */ 4883 RTCritSectEnter(&mCritSect); 4884 /* 7. if no current event set event as current */ 4885 if(!mpLastEvent) 4886 { 4887 Assert(!mpFirstEvent); 4888 mpFirstEvent = pCurrentEvent; 4889 mpLastEvent = pCurrentEvent; 4890 } 4891 else 4892 { 4893 mpLastEvent->mpNext = pCurrentEvent; 4894 mpLastEvent = pCurrentEvent; 4895 } 4896 /* 8. reset blocking events counter */ 4897 mbNewEvent = ((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0); 4898 /* 9. unlock */ 4899 RTCritSectLeave(&mCritSect); 4900 /* 10. post event */ 4901 QApplication::postEvent (m_pParent, pCurrentEvent); 4902 } 4903 4904 VBoxVHWACommandElement * VBoxVHWACommandElementProcessor::detachCmdList(VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free) 4746 4747 if (bNeedNewEvent) 4748 { 4749 VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent(); 4750 QApplication::postEvent (m_pParent, pCurrentEvent); 4751 } 4752 } 4753 4754 void VBoxVHWACommandElementProcessor::putBack(class VBoxVHWACommandElement * pFirst2Put, VBoxVHWACommandElement * pLast2Put, 4755 class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free) 4905 4756 { 4906 4757 VBoxVHWACommandElement * pList = NULL; 4907 4758 RTCritSectEnter(&mCritSect); 4908 if(pFirst2Free) 4909 { 4759 if (pFirst2Free) 4910 4760 mFreeElements.pusha(pFirst2Free, pLast2Free); 4911 } 4912 if(mpFirstEvent) 4913 { 4914 pList = mpFirstEvent->pipe().detachList(); 4915 if(pList) 4916 { 4917 /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */ 4918 mbProcessingList = true; 4919 RTCritSectLeave(&mCritSect); 4920 return pList; 4921 } 4922 else 4923 { 4924 VBoxVHWACommandProcessEvent *pNext = mpFirstEvent->mpNext; 4925 if(pNext) 4926 { 4927 mpFirstEvent = pNext; 4928 } 4929 else 4930 { 4931 mpFirstEvent = NULL; 4932 mpLastEvent = NULL; 4933 } 4934 } 4935 } 4936 4937 /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */ 4761 m_CmdPipe.prepend(pFirst2Put, pLast2Put); 4938 4762 mbProcessingList = false; 4939 4763 RTCritSectLeave(&mCritSect); 4764 } 4765 4766 void VBoxVHWACommandElementProcessor::updatePostEventObject(QObject *m_pObject) 4767 { 4768 int cEventsNeeded = 0; 4769 const VBoxVHWACommandElement * pFirst; 4770 RTCritSectEnter(&mCritSect); 4771 m_pParent = m_pObject; 4772 4773 pFirst = m_CmdPipe.contentsRo(NULL); 4774 for (; pFirst; pFirst = pFirst->mpNext) 4775 { 4776 if (pFirst->isNewEvent()) 4777 ++cEventsNeeded; 4778 } 4779 RTCritSectLeave(&mCritSect); 4780 4781 for (int i = 0; i < cEventsNeeded; ++i) 4782 { 4783 VBoxVHWACommandProcessEvent *pCurrentEvent = new VBoxVHWACommandProcessEvent(); 4784 QApplication::postEvent (m_pParent, pCurrentEvent); 4785 } 4786 } 4787 4788 VBoxVHWACommandElement * VBoxVHWACommandElementProcessor::detachCmdList(VBoxVHWACommandElement **ppLast, 4789 VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free) 4790 { 4791 VBoxVHWACommandElement * pList = NULL; 4792 RTCritSectEnter(&mCritSect); 4793 if (pFirst2Free) 4794 { 4795 mFreeElements.pusha(pFirst2Free, pLast2Free); 4796 } 4797 pList = m_CmdPipe.detachList(ppLast); 4798 if (pList) 4799 { 4800 /* assume the caller atimically calls detachCmdList to free the elements obtained now those and reset the state */ 4801 mbProcessingList = true; 4802 RTCritSectLeave(&mCritSect); 4803 return pList; 4804 } 4805 else 4806 { 4807 mbProcessingList = false; 4808 } 4809 4810 RTCritSectLeave(&mCritSect); 4940 4811 return NULL; 4941 4812 } … … 4944 4815 void VBoxVHWACommandElementProcessor::reset(VBoxVHWACommandElement ** ppHead, VBoxVHWACommandElement ** ppTail) 4945 4816 { 4946 VBoxVHWACommandElement * pHead = NULL; 4947 VBoxVHWACommandElement * pTail = NULL; 4948 VBoxVHWACommandProcessEvent * pFirst; 4949 VBoxVHWACommandProcessEvent * pLast; 4817 VBoxVHWACommandElementPipe pipe; 4950 4818 RTCritSectEnter(&mCritSect); 4951 pFirst = mpFirstEvent; 4952 pLast = mpLastEvent; 4953 mpFirstEvent = NULL; 4954 mpLastEvent = NULL; 4819 4820 pipe.setFrom(&m_CmdPipe); 4955 4821 4956 4822 if(mbProcessingList) … … 4962 4828 RTCritSectEnter(&mCritSect); 4963 4829 /* it is assumed no one sends any new commands while reset is in progress */ 4964 Assert(!mpFirstEvent);4965 Assert(!mpLastEvent);4966 4830 if(!mbProcessingList) 4967 4831 { … … 4971 4835 } 4972 4836 4973 if(pFirst) 4974 { 4975 Assert(pLast); 4976 VBoxVHWACommandElement * pCurHead; 4977 for(VBoxVHWACommandProcessEvent * pCur = pFirst; pCur ; pCur = pCur->mpNext) 4978 { 4979 pCurHead = pCur->pipe().detachList(); 4980 if(!pCurHead) 4981 continue; 4982 if(!pHead) 4983 pHead = pCurHead; 4984 if(pTail) 4985 pTail->mpNext = pCurHead; 4986 4987 for(VBoxVHWACommandElement * pCurEl = pCurHead; pCurEl; pCurEl = pCurEl->mpNext) 4988 { 4989 pTail = pCurEl; 4990 } 4991 } 4992 4993 if(!pTail) 4994 pTail = pHead; 4995 } 4996 4997 if(pHead) 4837 pipe.prependFrom(&m_CmdPipe); 4838 4839 if(!pipe.isEmpty()) 4840 { 4998 4841 mbProcessingList = true; 4842 *ppHead = pipe.detachList(ppTail); 4843 } 4999 4844 5000 4845 RTCritSectLeave(&mCritSect); 5001 5002 *ppHead = pHead;5003 *ppTail = pTail;5004 }5005 5006 void VBoxVHWACommandsQueue::enqueue(PFNVBOXQGLFUNC pfn, void* pContext1, void* pContext2)5007 {5008 VBoxVHWACommandElement *pCmd = new VBoxVHWACommandElement();5009 VBOXVHWAFUNCCALLBACKINFO info;5010 info.pfnCallback = pfn;5011 info.pContext1 = pContext1;5012 info.pContext2 = pContext2;5013 pCmd->setFunc(info);5014 mCmds.put(pCmd);5015 }5016 5017 VBoxVHWACommandElement * VBoxVHWACommandsQueue::detachList()5018 {5019 return mCmds.detachList();5020 }5021 5022 void VBoxVHWACommandsQueue::freeList(VBoxVHWACommandElement * pList)5023 {5024 while(pList)5025 {5026 VBoxVHWACommandElement * pCur = pList;5027 pList = pCur->mpNext;5028 delete pCur;5029 }5030 4846 } 5031 4847 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27697 r27720 1165 1165 { 1166 1166 public: 1167 VBoxVHWACommandElement() : 1168 bNewEvent(false) 1169 {} 1170 1167 1171 void setVHWACmd(struct _VBOXVHWACMD * pCmd) 1168 1172 { … … 1202 1206 } 1203 1207 1208 void setNewEventFlag() {bNewEvent = true;} 1209 bool isNewEvent() const { return bNewEvent; } 1210 1204 1211 VBOXVHWA_PIPECMD_TYPE type() const {return mType;} 1205 1212 const QRect & rect() const {return mRect;} … … 1216 1223 }u; 1217 1224 QRect mRect; 1225 bool bNewEvent; 1218 1226 }; 1219 1227 … … 1228 1236 void put(VBoxVHWACommandElement *pCmd) 1229 1237 { 1230 if (mpLast)1238 if (mpLast) 1231 1239 { 1232 1240 Assert(mpFirst); … … 1244 1252 } 1245 1253 1246 VBoxVHWACommandElement * detachList() 1247 { 1248 if(mpLast) 1254 void setFrom(VBoxVHWACommandElementPipe *pOther) 1255 { 1256 mpFirst = pOther->detachList(&mpLast); 1257 } 1258 1259 void set(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast) 1260 { 1261 mpFirst = pFirst; 1262 mpLast = pLast; 1263 mpLast->mpNext = NULL; 1264 } 1265 1266 void prepend(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast) 1267 { 1268 if (!mpFirst) 1269 set(pFirst, pLast); 1270 else if (pLast) 1271 { 1272 pLast->mpNext = mpFirst; 1273 mpFirst = pFirst; 1274 } 1275 } 1276 1277 void prependFrom(VBoxVHWACommandElementPipe *pOther) 1278 { 1279 VBoxVHWACommandElement *pFirst; 1280 VBoxVHWACommandElement *pLast; 1281 pFirst = pOther->detachList(&pLast); 1282 prepend(pFirst, pLast); 1283 } 1284 1285 void append(VBoxVHWACommandElement *pFirst, VBoxVHWACommandElement *pLast) 1286 { 1287 if (!mpLast) 1288 set(pFirst, pLast); 1289 else if (pLast) 1290 { 1291 mpLast->mpNext = pFirst; 1292 mpLast = pLast; 1293 } 1294 } 1295 1296 VBoxVHWACommandElement * detachList(VBoxVHWACommandElement **ppLast) 1297 { 1298 if (mpLast) 1249 1299 { 1250 1300 VBoxVHWACommandElement * pHead = mpFirst; 1301 if (ppLast) 1302 *ppLast = mpLast; 1251 1303 mpFirst = NULL; 1252 1304 mpLast = NULL; 1253 1305 return pHead; 1254 1306 } 1307 if (ppLast) 1308 *ppLast = NULL; 1255 1309 return NULL; 1256 1310 } 1311 1312 const VBoxVHWACommandElement * contentsRo (const VBoxVHWACommandElement **ppLast) const 1313 { 1314 if (ppLast) 1315 *ppLast = mpLast; 1316 return mpFirst; 1317 } 1318 1319 bool isEmpty() const { return !mpLast; } 1257 1320 private: 1258 1321 VBoxVHWACommandElement *mpFirst; … … 1301 1364 void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags); 1302 1365 void completeCurrentEvent(); 1303 class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free); 1366 class VBoxVHWACommandElement * detachCmdList(class VBoxVHWACommandElement ** ppLast, 1367 class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free); 1368 void putBack(class VBoxVHWACommandElement * pFirst2Put, VBoxVHWACommandElement * pLast2Put, 1369 class VBoxVHWACommandElement * pFirst2Free, VBoxVHWACommandElement * pLast2Free); 1304 1370 void reset(class VBoxVHWACommandElement ** ppHead, class VBoxVHWACommandElement ** ppTail); 1305 void updatePostEventObject(QObject *m_pObject) { m_pParent = m_pObject; }1371 void updatePostEventObject(QObject *m_pObject); 1306 1372 private: 1307 1373 RTCRITSECT mCritSect; 1308 class VBoxVHWACommandProcessEvent *mpFirstEvent; 1309 class VBoxVHWACommandProcessEvent *mpLastEvent; 1374 VBoxVHWACommandElementPipe m_CmdPipe; 1310 1375 QObject *m_pParent; 1311 1376 bool mbNewEvent; … … 1313 1378 VBoxVHWACommandElementStack mFreeElements; 1314 1379 VBoxVHWACommandElement mElementsBuffer[2048]; 1315 };1316 1317 class VBoxVHWACommandsQueue1318 {1319 public:1320 void enqueue(PFNVBOXQGLFUNC pfn, void* pContext1, void* pContext2);1321 1322 VBoxVHWACommandElement * detachList();1323 1324 void freeList(VBoxVHWACommandElement * pList);1325 1326 private:1327 VBoxVHWACommandElementPipe mCmds;1328 1380 }; 1329 1381 … … 1401 1453 int reset(VHWACommandList * pCmdList); 1402 1454 1403 // ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); }1404 // ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : 0; }1405 1455 int vboxFbWidth() {return mDisplay.getVGA()->width(); } 1406 1456 int vboxFbHeight() {return mDisplay.getVGA()->height(); } … … 1445 1495 } 1446 1496 1447 // VHWACommandList &onResizeCmdList() { return mOnResizeCmdList; }1448 1449 1497 static void pushSettingsAndSetupViewport(const QSize &display, const QRect &viewport) 1450 1498 { … … 1473 1521 #endif 1474 1522 #ifdef VBOX_WITH_VIDEOHWACCEL 1475 // void vboxDoVHWACmdExec(void *cmd);1476 // void vboxDoVHWACmdAndFree(void *cmd);1477 // void vboxDoVHWACmd(void *cmd);1478 1523 1479 1524 void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset) … … 1500 1545 VBoxVHWADisplay mDisplay; 1501 1546 1502 // void vboxDoProcessVHWACommands(void *pContext);1503 1504 // class VBoxVHWACommandElement * processCmdList(class VBoxVHWACommandElement * pCmd);1505 1506 1547 VBoxVHWASurfaceBase* handle2Surface(uint32_t h) 1507 1548 { … … 1519 1560 VBoxVHWASurfList *mConstructingList; 1520 1561 int32_t mcRemaining2Contruct; 1521 1522 /* this is used in saved state restore to postpone surface restoration1523 * till the framebuffer size is restored */1524 // VHWACommandList mOnResizeCmdList;1525 1562 1526 1563 class VBoxVHWAGlProgramMngr *mpMngr; … … 1779 1816 void addMainDirtyRect (const QRect & aRect); 1780 1817 void vboxCheckUpdateOverlay (const QRect & rect); 1781 VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd );1818 VBoxVHWACommandElement * processCmdList (VBoxVHWACommandElement * pCmd, bool bFirst); 1782 1819 1783 1820 int vhwaConstruct (struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd);
Note:
See TracChangeset
for help on using the changeset viewer.