- Timestamp:
- Jan 21, 2014 6:18:36 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
r50095 r50149 66 66 #define SHCRGL_CPARMS_SET_VERSION (2) 67 67 #define SHCRGL_CPARMS_SCREEN_CHANGED (1) 68 #define SHCRGL_CPARMS_DEV_RESIZE ( 2)68 #define SHCRGL_CPARMS_DEV_RESIZE (1) 69 69 #define SHCRGL_CPARMS_INJECT (2) 70 70 #define SHCRGL_CPARMS_SET_PID (1) -
trunk/include/VBox/VBoxVideo3D.h
r49474 r50149 159 159 typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_CLT_CMDGET)(HVBOXCRCMDCLT hClt, PVBOXCMDVBVA_HDR *ppNextCmd, uint32_t *pcbNextCmd); 160 160 161 struct VBVAINFOSCREEN; 162 /* server queries for display mode.*/ 163 typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_CLT_DMGET)(HVBOXCRCMDCLT hClt, uint32_t idScreen, struct VBVAINFOSCREEN *pScreen, void **ppvVram); 164 161 165 /* Client callbacks (i.e. those client exposes to the server) */ 162 166 typedef struct VBOXCRCMD_CLTINFO … … 164 168 HVBOXCRCMDCLT hClient; 165 169 PFNVBOXCRCMD_CLT_CMDGET pfnCmdGet; 170 PFNVBOXCRCMD_CLT_DMGET pfnDmGet; 166 171 } VBOXCRCMD_CLTINFO; 167 172 -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r50126 r50149 593 593 int VBVAUpdateDisplay (PVGASTATE pVGAState); 594 594 void VBVAReset (PVGASTATE pVGAState); 595 int VBVAGetScreenInfo(PVGASTATE pVGAState, unsigned uScreenId, struct VBVAINFOSCREEN *pScreen, void **ppvVram); 595 596 596 597 bool VBVAIsEnabled(PVGASTATE pVGAState); 597 598 598 599 void VBVARaiseIrq (PVGASTATE pVGAState, uint32_t fFlags); 600 void VBVARaiseIrqNoWait(PVGASTATE pVGAState, uint32_t fFlags); 599 601 600 602 /* @return host-guest flags that were set on reset -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r49507 r50149 1918 1918 #if defined(VBOX_WITH_HGSMI) && (defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_WITH_VDMA) || defined(VBOX_WITH_WDDM)) 1919 1919 PVGASTATE pVGAState = (PVGASTATE)pvCallback; 1920 VBVARaiseIrq (pVGAState, 0);1920 VBVARaiseIrqNoWait (pVGAState, 0); 1921 1921 #else 1922 1922 NOREF(pvCallback); … … 2436 2436 pVGAState->pHGSMI = NULL; 2437 2437 } 2438 2439 int VBVAGetScreenInfo(PVGASTATE pVGAState, unsigned uScreenId, struct VBVAINFOSCREEN *pScreen, void **ppvVram) 2440 { 2441 PPDMDEVINS pDevIns = pVGAState->pDevInsR3; 2442 PHGSMIINSTANCE pIns = pVGAState->pHGSMI; 2443 VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext (pIns); 2444 int rc = PDMCritSectEnter(&pVGAState->CritSect, VERR_SEM_BUSY); 2445 if (RT_SUCCESS(rc)) 2446 { 2447 if (uScreenId < pCtx->cViews) 2448 { 2449 VBVAVIEW *pView = &pCtx->aViews[uScreenId]; 2450 if (pView->pVBVA) 2451 { 2452 uint8_t *pu8VRAM = pVGAState->vram_ptrR3 + pView->view.u32ViewOffset; 2453 *pScreen = pView->screen; 2454 *ppvVram = (void*)pu8VRAM; 2455 rc = VINF_SUCCESS; 2456 } 2457 else 2458 { 2459 /* pretend disabled */ 2460 memset(pScreen, 0, sizeof (*pScreen)); 2461 pScreen->u16Flags = VBVA_SCREEN_F_DISABLED; 2462 pScreen->u32ViewIndex = uScreenId; 2463 *ppvVram = NULL; 2464 rc = VINF_SUCCESS; 2465 } 2466 } 2467 else 2468 rc = VERR_INVALID_PARAMETER; 2469 2470 PDMCritSectLeave(&pVGAState->CritSect); 2471 } 2472 return rc; 2473 } -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r49519 r50149 356 356 } 357 357 358 static DECLCALLBACK(int) vboxVDMACrCmdCltDmGet(HVBOXCRCMDCLT hClt, uint32_t idScreen, struct VBVAINFOSCREEN *pScreen, void **ppvVram) 359 { 360 struct VBOXVDMAHOST *pVdma = hClt; 361 PVGASTATE pVGAState = pVdma->pVGAState; 362 363 return VBVAGetScreenInfo(pVGAState, idScreen, pScreen, ppvVram); 364 } 365 358 366 static int vboxVDMACrCtlHgsmiSetup(struct VBOXVDMAHOST *pVdma) 359 367 { … … 366 374 CltInfo.hClient = pVdma; 367 375 CltInfo.pfnCmdGet = vboxVDMACrCmdCltCmdGet; 376 CltInfo.pfnDmGet = vboxVDMACrCmdCltDmGet; 368 377 PVGASTATE pVGAState = pVdma->pVGAState; 369 378 pCmd->pvVRamBase = pVGAState->vram_ptrR3; -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r50095 r50149 531 531 extern DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable); 532 532 struct VBVAINFOSCREEN; 533 extern DECLEXPORT(int) crVBoxServerNotifyResize( const struct VBVAINFOSCREEN *pScreen, void *pvVRAM);533 extern DECLEXPORT(int) crVBoxServerNotifyResize(uint32_t idScreen); 534 534 extern DECLEXPORT(int32_t) crVBoxServerSetRootVisibleRegion(GLint cRects, const RTRECT *pRects); 535 535 -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r50095 r50149 1188 1188 for (int i = 0; i < SHCRGL_CPARMS_DEV_RESIZE; ++i) 1189 1189 { 1190 if (paParms[i].type != VBOX_HGCM_SVC_PARM_PTR 1191 || !paParms[i].u.pointer.addr) 1190 if (paParms[i].type != VBOX_HGCM_SVC_PARM_32BIT) 1192 1191 { 1193 1192 AssertMsgFailed(("invalid param\n")); … … 1196 1195 } 1197 1196 1198 rc = crVBoxServerNotifyResize( (const VBVAINFOSCREEN *)paParms[0].u.pointer.addr, paParms[1].u.pointer.addr);1197 rc = crVBoxServerNotifyResize(paParms[0].u.uint32); 1199 1198 break; 1200 1199 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.cpp
r50123 r50149 395 395 } 396 396 397 DECLEXPORT(int) crVBoxServerNotifyResize(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM) 397 398 static int crVBoxServerResizeScreen(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM) 398 399 { 399 400 int rc; … … 427 428 428 429 return rc; 430 } 431 432 DECLEXPORT(int) crVBoxServerNotifyResize(uint32_t idScreen) 433 { 434 struct VBVAINFOSCREEN Screen; 435 void *pvVRAM; 436 437 int rc = cr_server.CltInfo.pfnDmGet(cr_server.CltInfo.hClient, idScreen, &Screen, &pvVRAM); 438 if (!RT_SUCCESS(rc)) 439 { 440 WARN(("err")); 441 return rc; 442 } 443 444 rc = crVBoxServerResizeScreen(&Screen, pvVRAM); 445 if (!RT_SUCCESS(rc)) 446 { 447 WARN(("err")); 448 return rc; 449 } 450 451 return VINF_SUCCESS; 429 452 } 430 453 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50137 r50149 670 670 Assert(!pReplacedScrEntry); 671 671 } 672 673 if (hEntry) 674 { 675 if (CrVrScrCompositorEntryIsUsed(&hEntry->Entry)) 676 { 677 if (pFb->pDisplay) 678 pFb->pDisplay->EntryTexChanged(pFb, hEntry); 679 } 680 } 672 681 } 673 682 else … … 727 736 pFb->pDisplay->RegionsChanged(pFb); 728 737 } 738 739 if (hEntry) 740 { 741 if (CrVrScrCompositorEntryIsUsed(&hEntry->Entry)) 742 { 743 if (pFb->pDisplay) 744 pFb->pDisplay->EntryTexChanged(pFb, hEntry); 745 } 746 } 729 747 } 730 748 else … … 763 781 return CrHTableGet(&hEntry->HTable, hSlot); 764 782 } 783 784 typedef union CR_FBDISPBASE_FLAGS 785 { 786 struct { 787 uint32_t fRegionsShanged : 1; 788 uint32_t Reserved : 31; 789 }; 790 uint32_t u32Value; 791 } CR_FBDISPBASE_FLAGS; 765 792 766 793 class CrFbDisplayBase : public ICrFbDisplay … … 772 799 mcUpdates(0), 773 800 mhSlot(CRHTABLE_HANDLE_INVALID) 774 {} 801 { 802 mFlags.u32Value = 0; 803 } 775 804 776 805 virtual bool isComposite() … … 792 821 { 793 822 return !!mcUpdates; 823 } 824 825 int setRegionsChanged() 826 { 827 if (!mcUpdates) 828 { 829 WARN(("err")); 830 return VERR_INVALID_STATE; 831 } 832 833 mFlags.fRegionsShanged = 1; 834 return VINF_SUCCESS; 794 835 } 795 836 … … 848 889 { 849 890 ++mcUpdates; 891 Assert(!mFlags.fRegionsShanged || mcUpdates > 1); 850 892 return VINF_SUCCESS; 851 893 } … … 855 897 --mcUpdates; 856 898 Assert(mcUpdates < UINT32_MAX/2); 899 if (!mcUpdates) 900 onUpdateEnd(); 857 901 } 858 902 … … 874 918 return VERR_INVALID_STATE; 875 919 } 920 mFlags.fRegionsShanged = 1; 876 921 return VINF_SUCCESS; 877 922 } … … 904 949 return VERR_INVALID_STATE; 905 950 } 951 mFlags.fRegionsShanged = 1; 906 952 return VINF_SUCCESS; 907 953 } … … 919 965 return VERR_INVALID_STATE; 920 966 } 967 mFlags.fRegionsShanged = 1; 921 968 return VINF_SUCCESS; 922 969 } … … 929 976 return VERR_INVALID_STATE; 930 977 } 978 mFlags.fRegionsShanged = 1; 931 979 return VINF_SUCCESS; 932 980 } … … 948 996 class CrFbDisplayComposite* mpContainer; 949 997 protected: 998 virtual void onUpdateEnd() 999 { 1000 if (mFlags.fRegionsShanged) 1001 { 1002 mFlags.fRegionsShanged = 0; 1003 ueRegions(); 1004 } 1005 } 1006 1007 virtual void ueRegions() 1008 { 1009 } 1010 950 1011 int fbSynchAddAllEntries() 951 1012 { … … 1052 1113 uint32_t mcUpdates; 1053 1114 CRHTABLE_HANDLE mhSlot; 1115 CR_FBDISPBASE_FLAGS mFlags; 1054 1116 }; 1055 1117 … … 1687 1749 virtual int UpdateBegin(struct CR_FRAMEBUFFER *pFb) 1688 1750 { 1689 int rc = CrFbDisplayBase::UpdateBegin(pFb); 1690 if (!RT_SUCCESS(rc)) 1691 { 1692 WARN(("err")); 1693 return rc; 1694 } 1695 1696 return mpWindow->UpdateBegin(); 1751 int rc = mpWindow->UpdateBegin(); 1752 if (RT_SUCCESS(rc)) 1753 { 1754 rc = CrFbDisplayBase::UpdateBegin(pFb); 1755 if (RT_SUCCESS(rc)) 1756 return VINF_SUCCESS; 1757 else 1758 WARN(("err")); 1759 } 1760 else 1761 WARN(("err")); 1762 1763 return rc; 1697 1764 } 1698 1765 1699 1766 virtual void UpdateEnd(struct CR_FRAMEBUFFER *pFb) 1700 1767 { 1768 CrFbDisplayBase::UpdateEnd(pFb); 1769 1701 1770 mpWindow->UpdateEnd(); 1702 1703 CrFbDisplayBase::UpdateEnd(pFb);1704 1771 } 1705 1772 … … 1768 1835 1769 1836 return VINF_SUCCESS; 1770 }1771 1772 virtual int EntryRemoved(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry)1773 {1774 int rc = CrFbDisplayBase::EntryRemoved(pFb, hEntry);1775 if (!RT_SUCCESS(rc))1776 {1777 WARN(("err"));1778 return rc;1779 }1780 1781 return mpWindow->SetVisibleRegionsChanged();1782 }1783 1784 virtual int EntryPosChanged(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hEntry)1785 {1786 int rc = CrFbDisplayBase::EntryPosChanged(pFb, hEntry);1787 if (!RT_SUCCESS(rc))1788 {1789 WARN(("err"));1790 return rc;1791 }1792 1793 return mpWindow->SetVisibleRegionsChanged();1794 }1795 1796 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb)1797 {1798 int rc = CrFbDisplayBase::RegionsChanged(pFb);1799 if (!RT_SUCCESS(rc))1800 {1801 WARN(("err"));1802 return rc;1803 }1804 1805 return mpWindow->SetVisibleRegionsChanged();1806 1837 } 1807 1838 … … 1894 1925 1895 1926 protected: 1927 virtual void ueRegions() 1928 { 1929 mpWindow->SetVisibleRegionsChanged(); 1930 } 1931 1896 1932 virtual int screenChanged() 1897 1933 { … … 1910 1946 } 1911 1947 1912 mpWindow->SetVisibleRegionsChanged();1948 setRegionsChanged(); 1913 1949 1914 1950 return mpWindow->SetSize((uint32_t)(pRect->xRight - pRect->xLeft), (uint32_t)(pRect->yBottom - pRect->yTop)); … … 2122 2158 } 2123 2159 2160 VBOXVR_SCR_COMPOSITOR_ENTRY *pMyEntry = (VBOXVR_SCR_COMPOSITOR_ENTRY*)CrFbDDataEntryGet(hEntry, slotGet()); 2161 rc = CrVrScrCompositorEntryRegionsSet(&mCompositor, pMyEntry, NULL, 0, NULL, false, NULL); 2162 if (!RT_SUCCESS(rc)) 2163 { 2164 WARN(("err")); 2165 return rc; 2166 } 2167 2124 2168 return VINF_SUCCESS; 2125 2169 } … … 2142 2186 } 2143 2187 2144 virtual int RegionsChanged(struct CR_FRAMEBUFFER *pFb)2145 {2146 int rc = CrFbDisplayWindow::RegionsChanged(pFb);2147 if (!RT_SUCCESS(rc))2148 {2149 WARN(("err"));2150 return rc;2151 }2152 2153 rc = synchCompositorRegions();2154 if (!RT_SUCCESS(rc))2155 {2156 WARN(("err"));2157 return rc;2158 }2159 2160 return VINF_SUCCESS;2161 }2162 2163 2188 virtual int setViewportRect(const RTRECT *pViewportRect) 2164 2189 { … … 2181 2206 2182 2207 protected: 2208 virtual void ueRegions() 2209 { 2210 synchCompositorRegions(); 2211 } 2212 2183 2213 virtual int screenChanged() 2184 2214 { … … 2198 2228 2199 2229 return VINF_SUCCESS; 2230 } 2231 2232 virtual const struct VBOXVR_SCR_COMPOSITOR* getCompositor() 2233 { 2234 return &mCompositor; 2200 2235 } 2201 2236 … … 2630 2665 vrdpGeometry(hEntry); 2631 2666 vrdpRegions(hFb, hEntry); 2632 vrdpFrame(hEntry);2667 //vrdpFrame(hEntry); 2633 2668 return VINF_SUCCESS; 2634 2669 } -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r50095 r50149 664 664 if (is3denabled) 665 665 { 666 VBOXHGCMSVCPARM parm[SHCRGL_CPARMS_DEV_RESIZE]; 667 668 parm[0].type = VBOX_HGCM_SVC_PARM_PTR; 669 parm[0].u.pointer.addr = (void*)pScreen; 670 parm[0].u.pointer.size = sizeof (*pScreen); 671 parm[1].type = VBOX_HGCM_SVC_PARM_PTR; 672 parm[1].u.pointer.addr = (void*)pvVRAM; 673 parm[1].u.pointer.size = 0; 674 675 VMMDev *pVMMDev = mParent->getVMMDev(); 676 677 if (pVMMDev) 678 return pVMMDev->hgcmHostCall("VBoxSharedCrOpenGL", SHCRGL_HOST_FN_DEV_RESIZE, SHCRGL_CPARMS_DEV_RESIZE, parm); 679 return VERR_INVALID_STATE; 666 int rc = VERR_INVALID_STATE; 667 if (mhCrOglSvc) 668 { 669 VMMDev *pVMMDev = mParent->getVMMDev(); 670 if (pVMMDev) 671 { 672 VBOXHGCMSVCPARM parm[SHCRGL_CPARMS_DEV_RESIZE]; 673 674 parm[0].type = VBOX_HGCM_SVC_PARM_32BIT; 675 parm[0].u.uint32 = pScreen->u32ViewIndex; 676 677 /* no completion callback is specified with this call, 678 * the CrOgl code will complete the CrHgsmi command once it processes it */ 679 rc = pVMMDev->hgcmHostFastCallAsync(mhCrOglSvc, SHCRGL_HOST_FN_DEV_RESIZE, parm, NULL, NULL); 680 AssertRC(rc); 681 } 682 } 683 684 return rc; 680 685 } 681 686 #endif /* #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) */
Note:
See TracChangeset
for help on using the changeset viewer.