Changeset 56431 in vbox
- Timestamp:
- Jun 15, 2015 1:50:23 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideo.h
r56378 r56431 933 933 /** Returns the max size of VBVA record. */ 934 934 #define VBOX_VBVA_CONF32_MAX_RECORD_SIZE 6 935 /** The host mouse cursor capabilities: VBVA_MOUSE_CURSOR_*. */936 #define VBOX_VBVA_CONF32_MOUSE_CURSOR 7937 938 #define VBVA_MOUSE_CURSOR_NO_XOR 0x00000001939 935 940 936 typedef struct VBVACONF32 -
trunk/include/VBox/VBoxVideoGuest.h
r56378 r56431 292 292 RTDECL(bool) VBoxVideoAnyWidthAllowed(void); 293 293 RTDECL(uint16_t) VBoxHGSMIGetScreenFlags(PHGSMIGUESTCOMMANDCONTEXT pCtx); 294 RTDECL(uint32_t) VBoxHGSMIGetMouseCursorFlags(PHGSMIGUESTCOMMANDCONTEXT pCtx);295 294 296 295 struct VBVAINFOVIEW; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.cpp
r56378 r56431 19 19 #include "VBoxMPCommon.h" 20 20 #include <VBox/Hardware/VBoxVideoVBE.h> 21 #include <iprt/asm.h>22 21 23 22 int VBoxMPCmnMapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv, uint32_t ulOffset, uint32_t ulSize) … … 108 107 } 109 108 110 static bool vboxMPCmnIsXorPointer(uint32_t fFlags,111 uint32_t cWidth,112 uint32_t cHeight,113 const uint8_t *pu8Pixels,114 uint32_t cbLength)115 {116 if ( (fFlags & VBOX_MOUSE_POINTER_SHAPE) == 0117 || (fFlags & VBOX_MOUSE_POINTER_ALPHA) != 0)118 119 {120 return false;121 }122 123 if (cWidth > 8192 || cHeight > 8192)124 {125 /* Not supported cursor size. */126 return false;127 }128 129 /* Pointer data consists of AND mask and XOR_MASK */130 const uint32_t cbAndLine = (cWidth + 7) / 8;131 const uint32_t cbAndMask = ((cbAndLine * cHeight + 3) & ~3);132 const uint32_t cbXorMask = cWidth * 4 * cHeight;133 134 if (cbAndMask + cbXorMask > cbLength)135 {136 return false;137 }138 139 /* If AND mask contains only 1, then it is a XOR only cursor. */140 bool fXorOnly = true;141 const uint8_t *pu8AndLine = &pu8Pixels[0];142 uint32_t i;143 for (i = 0; i < cHeight; ++i)144 {145 if (ASMBitFirstClear(pu8AndLine, cWidth) != -1)146 {147 fXorOnly = false;148 break;149 }150 pu8AndLine += cbAndLine;151 }152 153 return fXorOnly;154 }155 156 109 bool VBoxMPCmnUpdatePointerShape(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength) 157 110 { … … 163 116 uint8_t *pPixels = &pAttrs->Pixels[0]; 164 117 165 if (pCommon->u32MouseCursorFlags & VBVA_MOUSE_CURSOR_NO_XOR)166 {167 if (vboxMPCmnIsXorPointer(fFlags,168 cWidth, cHeight, pPixels,169 cbLength - sizeof(VIDEO_POINTER_ATTRIBUTES)))170 {171 return false;172 }173 }174 175 118 int rc = VBoxHGSMIUpdatePointerShape(&pCommon->guestCtx, 176 119 fFlags, cHotX, cHotY, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r56378 r56431 67 67 68 68 BOOLEAN fAnyX; /* Unrestricted horizontal resolution flag. */ 69 70 uint32_t u32MouseCursorFlags; /* VBVA_MOUSE_CURSOR_* */71 69 } VBOXMP_COMMON, *PVBOXMP_COMMON; 72 70 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r56378 r56431 1135 1135 if (VBoxCommonFromDeviceExt(pDevExt)->bHGSMI) 1136 1136 { 1137 PVBOXMP_COMMON pCommon = VBoxCommonFromDeviceExt(pDevExt);1138 pCommon->u32MouseCursorFlags = VBoxHGSMIGetMouseCursorFlags(&pCommon->guestCtx);1139 1140 1137 vboxWddmSetupDisplays(pDevExt); 1141 1138 if (!VBoxCommonFromDeviceExt(pDevExt)->bHGSMI) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPDriver.cpp
r56378 r56431 149 149 VBoxSetupDisplaysHGSMI(&pExt->u.primary.commonInfo, phVRAM, ulApertureSize, cbVRAM, 0); 150 150 151 PVBOXMP_COMMON pCommon = &pExt->u.primary.commonInfo;152 if (pCommon->bHGSMI)153 {154 pCommon->u32MouseCursorFlags = VBoxHGSMIGetMouseCursorFlags(&pCommon->guestCtx);155 }156 157 151 /* Check if the chip restricts horizontal resolution or not. 158 152 * Must be done after VBoxSetupDisplaysHGSMI, because it initializes the common structure. -
trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
r56378 r56431 379 379 return (uint16_t)u32Flags; 380 380 } 381 382 383 /**384 * Query the mouse cursor flags VBVA_MOUSE_CURSOR_*.385 *386 * @returns The mask of VBVA_MOUSE_CURSOR_* flags or 0 if host does not support the request.387 * @param pCtx the context containing the heap to use388 */389 RTDECL(uint32_t) VBoxHGSMIGetMouseCursorFlags(PHGSMIGUESTCOMMANDCONTEXT pCtx)390 {391 uint32_t u32Flags = 0;392 int rc = VBoxQueryConfHGSMIDef(pCtx, VBOX_VBVA_CONF32_MOUSE_CURSOR, 0, &u32Flags);393 LogFunc(("u32Flags = 0x%x rc %Rrc\n", u32Flags, rc));394 if (RT_FAILURE(rc))395 u32Flags = 0;396 return u32Flags;397 } -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r56378 r56431 840 840 841 841 Log((" VBVA o 0x%x p %p\n", 842 pView-> u32VBVAOffset,842 pView->vbva.u32VBVAOffset, 843 843 pView->vbva.guest.pVBVA)); 844 844 845 845 Log((" PR cb 0x%x p %p\n", 846 pView-> partialRecord.cb,847 pView-> partialRecord.pu8));846 pView->vbva.partialRecord.cb, 847 pView->vbva.partialRecord.pu8)); 848 848 } 849 849 … … 2115 2115 pConf32->u32Value = VBVA_MAX_RECORD_SIZE; 2116 2116 } 2117 else if (u32Index == VBOX_VBVA_CONF32_MOUSE_CURSOR)2118 {2119 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)2120 pConf32->u32Value = 0;2121 #else2122 pConf32->u32Value = VBVA_MOUSE_CURSOR_NO_XOR;2123 #endif2124 }2125 2117 else 2126 2118 {
Note:
See TracChangeset
for help on using the changeset viewer.