Changeset 81594 in vbox
- Timestamp:
- Oct 30, 2019 6:47:23 PM (5 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r80876 r81594 50 50 #define VBOXWDDM_C_PATH_LOCATION_LIST_SIZE 0xc00 51 51 52 #ifndef VBOX_WITH_MESA3D 52 53 #define VBOXWDDM_C_POINTER_MAX_WIDTH 64 53 54 #define VBOXWDDM_C_POINTER_MAX_HEIGHT 64 55 #else 56 #define VBOXWDDM_C_POINTER_MAX_WIDTH 256 57 #define VBOXWDDM_C_POINTER_MAX_HEIGHT 256 58 #define VBOXWDDM_C_POINTER_MAX_WIDTH_LEGACY 64 59 #define VBOXWDDM_C_POINTER_MAX_HEIGHT_LEGACY 64 60 #endif 54 61 55 62 #define VBOXWDDM_POINTER_ATTRIBUTES_SIZE VBOXWDDM_ROUNDBOUND( \ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r80876 r81594 1868 1868 pCaps->MaxPointerWidth = VBOXWDDM_C_POINTER_MAX_WIDTH; 1869 1869 pCaps->MaxPointerHeight = VBOXWDDM_C_POINTER_MAX_HEIGHT; 1870 #ifdef VBOX_WITH_MESA3D 1871 if (pDevExt->enmHwType == VBOXVIDEO_HWTYPE_VBOX) 1872 { 1873 pCaps->MaxPointerWidth = VBOXWDDM_C_POINTER_MAX_WIDTH_LEGACY; 1874 pCaps->MaxPointerHeight = VBOXWDDM_C_POINTER_MAX_HEIGHT_LEGACY; 1875 } 1876 #endif 1870 1877 pCaps->PointerCaps.Value = 3; /* Monochrome , Color*/ /* MaskedColor == Value | 4, disable for now */ 1871 1878 if (!g_VBoxDisplayOnly) … … 2932 2939 } 2933 2940 2941 bool vboxWddmUpdatePointerShape(PVBOXMP_DEVEXT pDevExt, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength) 2942 { 2943 #ifdef VBOX_WITH_MESA3D 2944 if (pDevExt->enmHwType != VBOXVIDEO_HWTYPE_VBOX) 2945 { 2946 NTSTATUS Status = STATUS_SUCCESS; 2947 2948 /** @todo Get rid of the unnecesary en-/decode procedure (XPDM legacy). */ 2949 uint32_t fFlags = pAttrs->Enable & 0x0000FFFF; 2950 uint32_t xHot = (pAttrs->Enable >> 16) & 0xFF; 2951 uint32_t yHot = (pAttrs->Enable >> 24) & 0xFF; 2952 uint32_t cWidth = pAttrs->Width; 2953 uint32_t cHeight = pAttrs->Height; 2954 uint32_t cbAndMask = 0; 2955 uint32_t cbXorMask = 0; 2956 2957 if (fFlags & VBOX_MOUSE_POINTER_SHAPE) 2958 { 2959 /* Size of the pointer data: sizeof(AND mask) + sizeof(XOR mask) */ 2960 cbAndMask = ((((cWidth + 7) / 8) * cHeight + 3) & ~3); 2961 cbXorMask = cWidth * 4 * cHeight; 2962 2963 /* Send the shape to the host. */ 2964 if (fFlags & VBOX_MOUSE_POINTER_ALPHA) 2965 { 2966 void const *pvImage = &pAttrs->Pixels[cbAndMask]; 2967 Status = GaDefineAlphaCursor(pDevExt->pGa, 2968 xHot, 2969 yHot, 2970 cWidth, 2971 cHeight, 2972 pvImage, 2973 cbXorMask); 2974 } 2975 else 2976 { 2977 uint32_t u32AndMaskDepth = 1; 2978 uint32_t u32XorMaskDepth = 32; 2979 2980 void const *pvAndMask = &pAttrs->Pixels[0]; 2981 void const *pvXorMask = &pAttrs->Pixels[cbAndMask]; 2982 Status = GaDefineCursor(pDevExt->pGa, 2983 xHot, 2984 yHot, 2985 cWidth, 2986 cHeight, 2987 u32AndMaskDepth, 2988 u32XorMaskDepth, 2989 pvAndMask, 2990 cbAndMask, 2991 pvXorMask, 2992 cbXorMask); 2993 } 2994 } 2995 2996 /** @todo Hack: Use the legacy interface to handle visibility. 2997 * Eventually the VMSVGA WDDM driver should use the SVGA_FIFO_CURSOR_* interface. 2998 */ 2999 VIDEO_POINTER_ATTRIBUTES attrs; 3000 RT_ZERO(attrs); 3001 attrs.Enable = pAttrs->Enable & VBOX_MOUSE_POINTER_VISIBLE; 3002 if (!VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &attrs, sizeof(attrs))) 3003 { 3004 Status = STATUS_INVALID_PARAMETER; 3005 } 3006 3007 return Status == STATUS_SUCCESS; 3008 } 3009 #endif 3010 3011 /* VBOXVIDEO_HWTYPE_VBOX */ 3012 return VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), pAttrs, cbLength); 3013 } 3014 2934 3015 static void vboxWddmHostPointerEnable(PVBOXMP_DEVEXT pDevExt, BOOLEAN fEnable) 2935 3016 { … … 2940 3021 PointerAttributes.Enable = VBOX_MOUSE_POINTER_VISIBLE; 2941 3022 } 2942 VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &PointerAttributes, sizeof(PointerAttributes));3023 vboxWddmUpdatePointerShape(pDevExt, &PointerAttributes, sizeof(PointerAttributes)); 2943 3024 } 2944 3025 … … 2985 3066 if (fScreenChanged) 2986 3067 { 2987 BOOLEAN bResult = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE);3068 BOOLEAN bResult = vboxWddmUpdatePointerShape(pDevExt, &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE); 2988 3069 if (!bResult) 2989 3070 { … … 3023 3104 { 3024 3105 pDevExt->PointerInfo.iLastReportedScreen = pSetPointerShape->VidPnSourceId; 3025 if ( VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pDevExt), &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE))3106 if (vboxWddmUpdatePointerShape(pDevExt, &pPointerInfo->Attributes.data, VBOXWDDM_POINTER_ATTRIBUTES_SIZE)) 3026 3107 Status = STATUS_SUCCESS; 3027 3108 else -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.cpp
r76790 r81594 1014 1014 } 1015 1015 1016 NTSTATUS SvgaGenDefineCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 1017 uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 1018 uint32_t u32AndMaskDepth, uint32_t u32XorMaskDepth, 1019 void const *pvAndMask, uint32_t cbAndMask, void const *pvXorMask, uint32_t cbXorMask, 1020 void *pvDst, 1021 uint32_t cbDst, 1022 uint32_t *pcbOut) 1023 { 1024 RT_NOREF(pSvga); 1025 1026 const uint32_t cbCmd = sizeof(uint32_t) 1027 + sizeof(SVGAFifoCmdDefineCursor) 1028 + cbAndMask 1029 + cbXorMask; 1030 1031 const uint32_t cbRequired = cbCmd; 1032 if (pcbOut) 1033 { 1034 *pcbOut = cbRequired; 1035 } 1036 1037 if (cbDst < cbRequired) 1038 { 1039 return STATUS_BUFFER_OVERFLOW; 1040 } 1041 1042 SvgaCmdDefineCursor(pvDst, u32HotspotX, u32HotspotY, u32Width, u32Height, 1043 u32AndMaskDepth, u32XorMaskDepth, 1044 pvAndMask, cbAndMask, pvXorMask, cbXorMask); 1045 1046 return STATUS_SUCCESS; 1047 } 1048 1049 NTSTATUS SvgaDefineCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 1050 uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 1051 uint32_t u32AndMaskDepth, uint32_t u32XorMaskDepth, 1052 void const *pvAndMask, uint32_t cbAndMask, void const *pvXorMask, uint32_t cbXorMask) 1053 { 1054 NTSTATUS Status = STATUS_SUCCESS; 1055 1056 uint32_t cbSubmit = 0; 1057 SvgaGenDefineCursor(pSvga, 1058 u32HotspotX, u32HotspotY, u32Width, u32Height, 1059 u32AndMaskDepth, u32XorMaskDepth, 1060 pvAndMask, cbAndMask, pvXorMask, cbXorMask, 1061 NULL, 0, &cbSubmit); 1062 1063 void *pvCmd = SvgaFifoReserve(pSvga, cbSubmit); 1064 if (pvCmd) 1065 { 1066 Status = SvgaGenDefineCursor(pSvga, 1067 u32HotspotX, u32HotspotY, u32Width, u32Height, 1068 u32AndMaskDepth, u32XorMaskDepth, 1069 pvAndMask, cbAndMask, pvXorMask, cbXorMask, 1070 pvCmd, cbSubmit, NULL); 1071 Assert(Status == STATUS_SUCCESS); 1072 SvgaFifoCommit(pSvga, cbSubmit); 1073 } 1074 else 1075 { 1076 Status = STATUS_INSUFFICIENT_RESOURCES; 1077 } 1078 1079 return Status; 1080 } 1081 1082 NTSTATUS SvgaGenDefineAlphaCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 1083 uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 1084 void const *pvImage, uint32_t cbImage, 1085 void *pvDst, 1086 uint32_t cbDst, 1087 uint32_t *pcbOut) 1088 { 1089 RT_NOREF(pSvga); 1090 1091 const uint32_t cbCmd = sizeof(uint32_t) 1092 + sizeof(SVGAFifoCmdDefineAlphaCursor) 1093 + cbImage; 1094 1095 const uint32_t cbRequired = cbCmd; 1096 if (pcbOut) 1097 { 1098 *pcbOut = cbRequired; 1099 } 1100 1101 if (cbDst < cbRequired) 1102 { 1103 return STATUS_BUFFER_OVERFLOW; 1104 } 1105 1106 SvgaCmdDefineAlphaCursor(pvDst, u32HotspotX, u32HotspotY, u32Width, u32Height, 1107 pvImage, cbImage); 1108 1109 return STATUS_SUCCESS; 1110 } 1111 1112 NTSTATUS SvgaDefineAlphaCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 1113 uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 1114 void const *pvImage, uint32_t cbImage) 1115 { 1116 NTSTATUS Status = STATUS_SUCCESS; 1117 1118 uint32_t cbSubmit = 0; 1119 SvgaGenDefineAlphaCursor(pSvga, 1120 u32HotspotX, u32HotspotY, u32Width, u32Height, 1121 pvImage, cbImage, 1122 NULL, 0, &cbSubmit); 1123 1124 void *pvCmd = SvgaFifoReserve(pSvga, cbSubmit); 1125 if (pvCmd) 1126 { 1127 Status = SvgaGenDefineAlphaCursor(pSvga, 1128 u32HotspotX, u32HotspotY, u32Width, u32Height, 1129 pvImage, cbImage, 1130 pvCmd, cbSubmit, NULL); 1131 Assert(Status == STATUS_SUCCESS); 1132 SvgaFifoCommit(pSvga, cbSubmit); 1133 } 1134 else 1135 { 1136 Status = STATUS_INSUFFICIENT_RESOURCES; 1137 } 1138 1139 return Status; 1140 } 1141 1142 1016 1143 NTSTATUS SvgaGenDefineGMRFB(PVBOXWDDM_EXT_VMSVGA pSvga, 1017 1144 uint32_t u32Offset, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/Svga.h
r76790 r81594 269 269 uint32_t u32Height); 270 270 271 NTSTATUS SvgaDefineCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 272 uint32_t u32HotspotX, 273 uint32_t u32HotspotY, 274 uint32_t u32Width, 275 uint32_t u32Height, 276 uint32_t u32AndMaskDepth, 277 uint32_t u32XorMaskDepth, 278 void const *pvAndMask, 279 uint32_t cbAndMask, 280 void const *pvXorMask, 281 uint32_t cbXorMask); 282 283 NTSTATUS SvgaDefineAlphaCursor(PVBOXWDDM_EXT_VMSVGA pSvga, 284 uint32_t u32HotspotX, 285 uint32_t u32HotspotY, 286 uint32_t u32Width, 287 uint32_t u32Height, 288 void const *pvImage, 289 uint32_t cbImage); 290 271 291 NTSTATUS SvgaGenDefineGMRFB(PVBOXWDDM_EXT_VMSVGA pSvga, 272 292 uint32_t u32Offset, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/SvgaCmd.cpp
r76553 r81594 73 73 } 74 74 75 void SvgaCmdDefineCursor(void *pvCmd, uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 76 uint32_t u32AndMaskDepth, uint32_t u32XorMaskDepth, 77 void const *pvAndMask, uint32_t cbAndMask, void const *pvXorMask, uint32_t cbXorMask) 78 { 79 uint32_t *pu32Id = (uint32_t *)pvCmd; 80 SVGAFifoCmdDefineCursor *pCommand = (SVGAFifoCmdDefineCursor *)&pu32Id[1]; 81 82 *pu32Id = SVGA_CMD_DEFINE_CURSOR; 83 84 pCommand->id = 0; 85 pCommand->hotspotX = u32HotspotX; 86 pCommand->hotspotY = u32HotspotY; 87 pCommand->width = u32Width; 88 pCommand->height = u32Height; 89 pCommand->andMaskDepth = u32AndMaskDepth; 90 pCommand->xorMaskDepth = u32XorMaskDepth; 91 92 uint8_t *pu8AndMask = (uint8_t *)&pCommand[1]; 93 memcpy(pu8AndMask, pvAndMask, cbAndMask); 94 95 uint8_t *pu8XorMask = pu8AndMask + cbAndMask; 96 memcpy(pu8XorMask, pvXorMask, cbXorMask); 97 } 98 99 void SvgaCmdDefineAlphaCursor(void *pvCmd, uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 100 void const *pvImage, uint32_t cbImage) 101 { 102 uint32_t *pu32Id = (uint32_t *)pvCmd; 103 SVGAFifoCmdDefineAlphaCursor *pCommand = (SVGAFifoCmdDefineAlphaCursor *)&pu32Id[1]; 104 105 *pu32Id = SVGA_CMD_DEFINE_ALPHA_CURSOR; 106 107 pCommand->id = 0; 108 pCommand->hotspotX = u32HotspotX; 109 pCommand->hotspotY = u32HotspotY; 110 pCommand->width = u32Width; 111 pCommand->height = u32Height; 112 113 uint8_t *pu8Image = (uint8_t *)&pCommand[1]; 114 memcpy(pu8Image, pvImage, cbImage); 115 } 116 75 117 void SvgaCmdFence(void *pvCmd, uint32_t u32Fence) 76 118 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/SvgaCmd.h
r76563 r81594 29 29 void SvgaCmdDestroyScreen(void *pvCmd, uint32_t u32Id); 30 30 void SvgaCmdUpdate(void *pvCmd, uint32_t u32X, uint32_t u32Y, uint32_t u32Width, uint32_t u32Height); 31 void SvgaCmdDefineCursor(void *pvCmd, uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 32 uint32_t u32AndMaskDepth, uint32_t u32XorMaskDepth, 33 void const *pvAndMask, uint32_t cbAndMask, void const *pvXorMask, uint32_t cbXorMask); 34 void SvgaCmdDefineAlphaCursor(void *pvCmd, uint32_t u32HotspotX, uint32_t u32HotspotY, uint32_t u32Width, uint32_t u32Height, 35 void const *pvImage, uint32_t cbImage); 31 36 void SvgaCmdFence(void *pvCmd, uint32_t u32Fence); 32 37 void SvgaCmdDefineGMRFB(void *pvCmd, uint32_t u32Offset, uint32_t u32BytesPerLine); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp
r80422 r81594 193 193 VBOXWDDM_EXT_VMSVGA *pSvga = pGaDevExt->hw.pSvga; 194 194 return SvgaUpdate(pSvga, u32X, u32Y, u32Width, u32Height); 195 } 196 197 NTSTATUS GaDefineCursor(PVBOXWDDM_EXT_GA pGaDevExt, 198 uint32_t u32HotspotX, 199 uint32_t u32HotspotY, 200 uint32_t u32Width, 201 uint32_t u32Height, 202 uint32_t u32AndMaskDepth, 203 uint32_t u32XorMaskDepth, 204 void const *pvAndMask, 205 uint32_t cbAndMask, 206 void const *pvXorMask, 207 uint32_t cbXorMask) 208 { 209 VBOXWDDM_EXT_VMSVGA *pSvga = pGaDevExt->hw.pSvga; 210 return SvgaDefineCursor(pSvga, u32HotspotX, u32HotspotY, u32Width, u32Height, 211 u32AndMaskDepth, u32XorMaskDepth, 212 pvAndMask, cbAndMask, pvXorMask, cbXorMask); 213 } 214 215 NTSTATUS GaDefineAlphaCursor(PVBOXWDDM_EXT_GA pGaDevExt, 216 uint32_t u32HotspotX, 217 uint32_t u32HotspotY, 218 uint32_t u32Width, 219 uint32_t u32Height, 220 void const *pvImage, 221 uint32_t cbImage) 222 { 223 VBOXWDDM_EXT_VMSVGA *pSvga = pGaDevExt->hw.pSvga; 224 return SvgaDefineAlphaCursor(pSvga, u32HotspotX, u32HotspotY, u32Width, u32Height, 225 pvImage, cbImage); 195 226 } 196 227 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.h
r76790 r81594 58 58 uint32_t u32Height); 59 59 60 NTSTATUS GaDefineCursor(PVBOXWDDM_EXT_GA pGaDevExt, 61 uint32_t u32HotspotX, 62 uint32_t u32HotspotY, 63 uint32_t u32Width, 64 uint32_t u32Height, 65 uint32_t u32AndMaskDepth, 66 uint32_t u32XorMaskDepth, 67 void const *pvAndMask, 68 uint32_t cbAndMask, 69 void const *pvXorMask, 70 uint32_t cbXorMask); 71 72 NTSTATUS GaDefineAlphaCursor(PVBOXWDDM_EXT_GA pGaDevExt, 73 uint32_t u32HotspotX, 74 uint32_t u32HotspotY, 75 uint32_t u32Width, 76 uint32_t u32Height, 77 void const *pvImage, 78 uint32_t cbImage); 79 60 80 NTSTATUS APIENTRY GaDxgkDdiBuildPagingBuffer(const HANDLE hAdapter, 61 81 DXGKARG_BUILDPAGINGBUFFER *pBuildPagingBuffer);
Note:
See TracChangeset
for help on using the changeset viewer.