Changeset 51330 in vbox
- Timestamp:
- May 21, 2014 7:46:25 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
r50754 r51330 60 60 #define SHCRGL_GUEST_FN_WRITE_BUFFER (13) 61 61 #define SHCRGL_GUEST_FN_WRITE_READ_BUFFERED (14) 62 #define SHCRGL_GUEST_FN_GET_CAPS (15) 62 #define SHCRGL_GUEST_FN_GET_CAPS_LEGACY (15) 63 #define SHCRGL_GUEST_FN_GET_CAPS_NEW (16) 63 64 64 65 /* Parameters count */ … … 80 81 #define SHCRGL_CPARMS_VIEWPORT_CHANGED (5) 81 82 #define SHCRGL_CPARMS_VIEWPORT_CHANGED2 (1) 82 #define SHCRGL_CPARMS_GET_CAPS (1) 83 #define SHCRGL_CPARMS_GET_CAPS_LEGACY (1) 84 #define SHCRGL_CPARMS_GET_CAPS_NEW (1) 83 85 84 86 /* @todo Move to H3DOR.h begin */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
r51080 r51330 25 25 #include <cr_protocol.h> 26 26 27 static uint32_t g_VBoxMpCrHostCaps = 0;27 CR_CAPS_INFO g_VBoxMpCrHostCapsInfo; 28 28 static uint32_t g_VBoxMpCr3DSupported = 0; 29 29 30 30 uint32_t VBoxMpCrGetHostCaps() 31 31 { 32 return g_VBoxMpCrHostCaps ;32 return g_VBoxMpCrHostCapsInfo.u32Caps; 33 33 } 34 34 … … 815 815 } 816 816 817 static int vboxMpCrCtlConGetCaps (PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t *pu32Caps)817 static int vboxMpCrCtlConGetCapsLegacy(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t *pu32Caps) 818 818 { 819 819 CRVBOXHGCMGETCAPS parms; … … 822 822 parms.hdr.result = VERR_WRONG_ORDER; 823 823 parms.hdr.u32ClientID = u32ClientID; 824 parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS ;825 parms.hdr.cParms = SHCRGL_CPARMS_GET_CAPS ;824 parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_LEGACY; 825 parms.hdr.cParms = SHCRGL_CPARMS_GET_CAPS_LEGACY; 826 826 827 827 parms.Caps.type = VMMDevHGCMParmType_32bit; … … 839 839 if (RT_FAILURE(parms.hdr.result)) 840 840 { 841 WARN(("SHCRGL_GUEST_FN_GET_CAPS failed, rc (%d)", parms.hdr.result));841 WARN(("SHCRGL_GUEST_FN_GET_CAPS_LEGACY failed, rc (%d)", parms.hdr.result)); 842 842 return parms.hdr.result; 843 843 } 844 844 845 /* if host reports it supports CR_VBOX_CAP_CMDVBVA, clean it up, 846 * we only support CR_VBOX_CAP_CMDVBVA of the proper version reported by SHCRGL_GUEST_FN_GET_CAPS_NEW */ 847 parms.Caps.u.value32 &= ~CR_VBOX_CAP_CMDVBVA; 848 845 849 *pu32Caps = parms.Caps.u.value32; 850 851 return VINF_SUCCESS; 852 } 853 854 static int vboxMpCrCtlConGetCapsNew(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, CR_CAPS_INFO *pCapsInfo) 855 { 856 pCapsInfo->u32Caps = CR_VBOX_CAPS_ALL; 857 pCapsInfo->u32CmdVbvaVersion = CR_CMDVBVA_VERSION; 858 859 CRVBOXHGCMGETCAPS parms; 860 int rc; 861 862 parms.hdr.result = VERR_WRONG_ORDER; 863 parms.hdr.u32ClientID = u32ClientID; 864 parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_NEW; 865 parms.hdr.cParms = SHCRGL_CPARMS_GET_CAPS_NEW; 866 867 parms.Caps.type = VMMDevHGCMParmType_LinAddr; 868 parms.Caps.u.Pointer.u.linearAddr = (uintptr_t)pCapsInfo; 869 parms.Caps.u.Pointer.size = sizeof (*pCapsInfo); 870 871 rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, &parms.hdr, sizeof (parms)); 872 if (RT_FAILURE(rc)) 873 { 874 WARN(("vboxCrCtlConCall failed, rc (%d)", rc)); 875 return rc; 876 } 877 878 if (RT_FAILURE(parms.hdr.result)) 879 { 880 WARN(("SHCRGL_GUEST_FN_GET_CAPS_NEW failed, rc (%d)", parms.hdr.result)); 881 return parms.hdr.result; 882 } 883 884 if (pCapsInfo->u32CmdVbvaVersion != CR_CMDVBVA_VERSION) 885 { 886 WARN(("CmdVbva version mismatch (%d), expected(%d)", pCapsInfo->u32CmdVbvaVersion, CR_CMDVBVA_VERSION)); 887 pCapsInfo->u32Caps &= ~CR_VBOX_CAP_CMDVBVA; 888 } 889 890 pCapsInfo->u32Caps &= CR_VBOX_CAPS_ALL; 846 891 847 892 return VINF_SUCCESS; … … 1008 1053 { 1009 1054 g_VBoxMpCr3DSupported = 0; 1010 g_VBoxMpCrHostCaps = 0;1055 memset(&g_VBoxMpCrHostCapsInfo, 0, sizeof (g_VBoxMpCrHostCapsInfo)); 1011 1056 1012 1057 VBOXMP_CRCTLCON CrCtlCon = {0}; … … 1021 1066 g_VBoxMpCr3DSupported = 1; 1022 1067 1023 rc = vboxMpCrCtlConGetCaps (&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCaps);1068 rc = vboxMpCrCtlConGetCapsNew(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCapsInfo); 1024 1069 if (RT_FAILURE(rc)) 1025 1070 { 1026 WARN(("vboxMpCrCtlConGetCaps failed rc (%d), ignoring..", rc)); 1027 g_VBoxMpCrHostCaps = 0; 1071 WARN(("vboxMpCrCtlConGetCapsNew failed rc (%d), ignoring..", rc)); 1072 g_VBoxMpCrHostCapsInfo.u32CmdVbvaVersion = 0; 1073 rc = vboxMpCrCtlConGetCapsLegacy(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCapsInfo.u32Caps); 1074 if (RT_FAILURE(rc)) 1075 { 1076 WARN(("vboxMpCrCtlConGetCapsLegacy failed rc (%d), ignoring..", rc)); 1077 g_VBoxMpCrHostCapsInfo.u32Caps = 0; 1078 } 1028 1079 } 1029 1080 1030 1081 #if 0 //ndef DEBUG_misha 1031 g_VBoxMpCrHostCaps &= ~CR_VBOX_CAP_CMDVBVA; 1082 g_VBoxMpCrHostCapsInfo.u32Caps &= ~CR_VBOX_CAP_CMDVBVA; 1083 g_VBoxMpCrHostCapsInfo.u32CmdVbvaVersion = 0; 1032 1084 #endif 1033 1085 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r51260 r51330 1161 1161 } 1162 1162 1163 NTSTATUS Status = STATUS_ UNSUCCESSFUL;1163 NTSTATUS Status = STATUS_SUCCESS; 1164 1164 uint32_t hostID = pSrcAllocData->hostID; 1165 1165 int rc; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r51328 r51330 1893 1893 NTSTATUS VBoxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, BOOLEAN *pfSupported) 1894 1894 { 1895 UINT i;1896 1895 VBOXVIDPNGETPATHSINFO CbContext = {0}; 1897 1896 CbContext.pDevExt = pDevExt; -
trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h
r51200 r51330 17 17 extern "C" { 18 18 #endif 19 20 #define CR_CMDVBVA_VERSION 1 21 22 #pragma pack(1) 23 typedef struct CR_CAPS_INFO 24 { 25 uint32_t u32Caps; 26 uint32_t u32CmdVbvaVersion; 27 } CR_CAPS_INFO; 28 #pragma pack() 29 19 30 20 31 /*For now guest is allowed to connect host opengl service if protocol version matches exactly*/ -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r50913 r51330 520 520 extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer); 521 521 extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor); 522 extern DECLEXPORT(int32_t) crVBoxServerClientGetCaps(uint32_t u32ClientID, uint32_t *pu32Caps); 522 extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsLegacy(uint32_t u32ClientID, uint32_t *pu32Caps); 523 extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsNew(uint32_t u32ClientID, CR_CAPS_INFO *pInfo); 523 524 extern DECLEXPORT(int32_t) crVBoxServerClientSetPID(uint32_t u32ClientID, uint64_t pid); 524 525 -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r51160 r51330 1287 1287 } 1288 1288 1289 static int crVBoxHGCMGetHostCaps (CRConnection *conn, uint32_t *pu32HostCaps)1289 static int crVBoxHGCMGetHostCapsLegacy(CRConnection *conn, uint32_t *pu32HostCaps) 1290 1290 { 1291 1291 CRVBOXHGCMGETCAPS caps; … … 1294 1294 caps.hdr.result = VERR_WRONG_ORDER; 1295 1295 caps.hdr.u32ClientID = conn->u32ClientID; 1296 caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS ;1297 caps.hdr.cParms = SHCRGL_CPARMS_GET_CAPS ;1296 caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_LEGACY; 1297 caps.hdr.cParms = SHCRGL_CPARMS_GET_CAPS_LEGACY; 1298 1298 1299 1299 caps.Caps.type = VMMDevHGCMParmType_32bit; … … 1321 1321 return rc; 1322 1322 } 1323 1324 1323 1325 1324 static int crVBoxHGCMSetPID(CRConnection *conn, unsigned long long pid) … … 1445 1444 if (!g_crvboxhgcm.fHostCapsInitialized) 1446 1445 { 1447 rc = crVBoxHGCMGetHostCaps (conn, &g_crvboxhgcm.u32HostCaps);1446 rc = crVBoxHGCMGetHostCapsLegacy(conn, &g_crvboxhgcm.u32HostCaps); 1448 1447 if (RT_FAILURE(rc)) 1449 1448 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r50921 r51330 904 904 } 905 905 906 case SHCRGL_GUEST_FN_GET_CAPS: 907 { 908 Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS\n")); 909 910 /* Verify parameter count and types. */ 911 if (cParms != SHCRGL_CPARMS_GET_CAPS) 912 { 913 rc = VERR_INVALID_PARAMETER; 914 } 915 else 916 if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT) 906 case SHCRGL_GUEST_FN_GET_CAPS_NEW: 907 { 908 Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS_NEW\n")); 909 910 /* Verify parameter count and types. */ 911 if (cParms != SHCRGL_CPARMS_GET_CAPS_NEW) 912 { 913 WARN(("invalid parameter count")); 914 rc = VERR_INVALID_PARAMETER; 915 break; 916 } 917 918 if (paParms[0].type != VBOX_HGCM_SVC_PARM_PTR) 919 { 920 WARN(("invalid parameter")); 921 rc = VERR_INVALID_PARAMETER; 922 break; 923 } 924 925 if (paParms[0].u.pointer.size < sizeof (CR_CAPS_INFO)) 926 { 927 WARN(("invalid buffer size")); 928 rc = VERR_INVALID_PARAMETER; 929 break; 930 } 931 932 CR_CAPS_INFO *pInfo = (CR_CAPS_INFO*)paParms[0].u.pointer.addr; 933 rc = crVBoxServerClientGetCapsNew(u32ClientID, pInfo); 934 AssertRC(rc); 935 936 break; 937 } 938 939 case SHCRGL_GUEST_FN_GET_CAPS_LEGACY: 940 { 941 Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS_LEGACY\n")); 942 943 /* Verify parameter count and types. */ 944 if (cParms != SHCRGL_CPARMS_GET_CAPS_LEGACY) 945 { 946 rc = VERR_INVALID_PARAMETER; 947 } 948 else if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT) 917 949 { 918 950 rc = VERR_INVALID_PARAMETER; … … 921 953 { 922 954 /* Execute the function. */ 923 rc = crVBoxServerClientGetCaps (u32ClientID, &paParms[0].u.uint32);955 rc = crVBoxServerClientGetCapsLegacy(u32ClientID, &paParms[0].u.uint32); 924 956 AssertRC(rc); 925 957 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r51320 r51330 840 840 } 841 841 842 extern DECLEXPORT(int32_t) crVBoxServerClientGetCaps(uint32_t u32ClientID, uint32_t *pu32Caps) 843 { 844 *pu32Caps = cr_server.u32Caps; 842 extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsLegacy(uint32_t u32ClientID, uint32_t *pu32Caps) 843 { 844 uint32_t u32Caps = cr_server.u32Caps; 845 u32Caps &= ~CR_VBOX_CAP_CMDVBVA; 846 *pu32Caps = u32Caps; 847 return VINF_SUCCESS; 848 } 849 850 extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsNew(uint32_t u32ClientID, CR_CAPS_INFO *pInfo) 851 { 852 pInfo->u32Caps = cr_server.u32Caps; 853 pInfo->u32CmdVbvaVersion = CR_CMDVBVA_VERSION; 845 854 return VINF_SUCCESS; 846 855 }
Note:
See TracChangeset
for help on using the changeset viewer.