Changeset 60083 in vbox for trunk/src/VBox/Additions/x11/vboxvideo
- Timestamp:
- Mar 17, 2016 6:40:28 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106078
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r56228 r60083 181 181 } 182 182 183 #define SIZE_HINTS_PROPERTY "VBOX_SIZE_HINTS"184 #define SIZE_HINTS_MISMATCH_PROPERTY "VBOX_SIZE_HINTS_MISMATCH"185 #define MOUSE_CAPABILITIES_PROPERTY "VBOX_MOUSE_CAPABILITIES"186 187 183 #define COMPARE_AND_MAYBE_SET(pDest, src, pfChanged, fSet) \ 188 184 do { \ … … 194 190 } \ 195 191 } while(0) 196 197 /** Read in information about the most recent size hints and cursor198 * capabilities requested for the guest screens from a root window property set199 * by an X11 client. Information obtained via HGSMI takes priority. */200 void vbvxReadSizesAndCursorIntegrationFromProperties(ScrnInfoPtr pScrn, bool *pfNeedUpdate)201 {202 VBOXPtr pVBox = VBOXGetRec(pScrn);203 size_t cPropertyElements, cDummy;204 int32_t *paModeHints, *pfCursorCapabilities;205 unsigned i;206 bool fChanged;207 bool fNeedUpdate = false;208 int32_t fSizeMismatch = false;209 210 if (vbvxGetIntegerPropery(pScrn, SIZE_HINTS_PROPERTY, &cPropertyElements, &paModeHints) != VINF_SUCCESS)211 paModeHints = NULL;212 if (paModeHints != NULL)213 for (i = 0; i < cPropertyElements / 2 && i < pVBox->cScreens; ++i)214 {215 VBVAMODEHINT *pVBVAModeHint = &pVBox->paVBVAModeHints[i];216 int32_t iSizeHint = paModeHints[i * 2];217 int32_t iLocation = paModeHints[i * 2 + 1];218 bool fNoHGSMI = !pVBox->fHaveHGSMIModeHints || pVBVAModeHint->magic != VBVAMODEHINT_MAGIC;219 220 fChanged = false;221 if (iSizeHint != 0)222 {223 if (iSizeHint == -1)224 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].afConnected, false, &fChanged, fNoHGSMI);225 else226 {227 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].aPreferredSize.cx, (iSizeHint >> 16) & 0x8fff, &fChanged, fNoHGSMI);228 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].aPreferredSize.cy, iSizeHint & 0x8fff, &fChanged, fNoHGSMI);229 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].afConnected, true, &fChanged, fNoHGSMI);230 }231 if (iLocation == -1)232 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].afHaveLocation, false, &fChanged, fNoHGSMI);233 else234 {235 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].aPreferredLocation.x, (iLocation >> 16) & 0x8fff, &fChanged,236 fNoHGSMI);237 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].aPreferredLocation.y, iLocation & 0x8fff, &fChanged, fNoHGSMI);238 COMPARE_AND_MAYBE_SET(&pVBox->pScreens[i].afHaveLocation, true, &fChanged, fNoHGSMI);239 }240 if (fChanged && fNoHGSMI)241 fNeedUpdate = true;242 if (fChanged && !fNoHGSMI)243 fSizeMismatch = true;244 }245 }246 fChanged = false;247 if ( vbvxGetIntegerPropery(pScrn, MOUSE_CAPABILITIES_PROPERTY, &cDummy, &pfCursorCapabilities) == VINF_SUCCESS248 && cDummy == 1)249 compareAndMaybeSetUseHardwareCursor(pVBox, *pfCursorCapabilities, &fChanged, !pVBox->fHaveHGSMIModeHints);250 if (fChanged && !pVBox->fHaveHGSMIModeHints)251 fNeedUpdate = true;252 if (fChanged && pVBox->fHaveHGSMIModeHints)253 fSizeMismatch = true;254 vbvxSetIntegerPropery(pScrn, SIZE_HINTS_MISMATCH_PROPERTY, 1, &fSizeMismatch, false);255 if (pfNeedUpdate != NULL && fNeedUpdate)256 *pfNeedUpdate = true;257 }258 192 259 193 /** Read in information about the most recent size hints and cursor -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r59943 r60083 989 989 } 990 990 991 #ifndef VBOXVIDEO_13 991 992 /** Set the graphics and guest cursor support capabilities to the host if 992 993 * the user-space helper is running. */ … … 998 999 int rc; 999 1000 1000 if ( pVBox->fHaveHGSMIModeHints)1001 if (!pVBox->fHaveHGSMIModeHints) 1001 1002 return; 1002 rc = vbvxGetIntegerPropery(pScrn, "VBOX _HAS_GRAPHICS", &cData, &paData);1003 rc = vbvxGetIntegerPropery(pScrn, "VBOXCLIENT_STARTED", &cData, &paData); 1003 1004 if (rc != VINF_SUCCESS || cData != 1) 1004 1005 return; 1005 if (RT_BOOL(*paData) != hasVT) 1006 { 1007 uint32_t fFeatures; 1008 VbglR3SetGuestCaps(hasVT ? VMMDEV_GUEST_SUPPORTS_GRAPHICS : 0, hasVT ? 0 : VMMDEV_GUEST_SUPPORTS_GRAPHICS); 1009 rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL); 1010 fFeatures &= VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_NEW_PROTOCOL; 1011 if (RT_SUCCESS(rc)) 1012 VbglR3SetMouseStatus(hasVT ? fFeatures : fFeatures | VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR); 1013 } 1014 *paData = hasVT; 1015 } 1006 pVBox->fHaveVBoxClient = TRUE; 1007 VBoxHGSMISendCapsInfo(&pVBox->guestCtx, hasVT 1008 ? VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION 1009 : VBVACAPS_DISABLE_CURSOR_INTEGRATION); 1010 } 1011 #endif 1016 1012 1017 1013 #ifdef VBOXVIDEO_13 … … 1111 1107 #else 1112 1108 1109 #define PREFERRED_MODE_ATOM_NAME "VBOXVIDEO_PREFERRED_MODE" 1110 1113 1111 static void setSizesRandR11(ScrnInfoPtr pScrn) 1114 1112 { 1115 1113 VBOXPtr pVBox = VBOXGetRec(pScrn); 1116 1114 DisplayModePtr pNewMode; 1115 int32_t propertyValue; 1117 1116 1118 1117 pNewMode = pScrn->modes != pScrn->currentMode ? pScrn->modes : pScrn->modes->next; 1119 1118 pNewMode->HDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL); 1120 1119 pNewMode->VDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL); 1120 propertyValue = (pNewMode->HDisplay << 16) + pNewMode->VDisplay; 1121 ChangeWindowProperty(ROOT_WINDOW(pScrn), MakeAtom(PREFERRED_MODE_ATOM_NAME, 1122 sizeof(PREFERRED_MODE_ATOM_NAME) - 1, TRUE), XA_INTEGER, 32, 1123 PropModeReplace, 1, &propertyValue, TRUE); 1121 1124 } 1122 1125 … … 1150 1153 (void)pTimeout; 1151 1154 (void)pReadmask; 1152 updateGraphicsCapability(pScrn, pScrn->vtSema); 1155 #ifndef VBOXVIDEO_13 1156 if (!pVBox->fHaveVBoxClient) 1157 updateGraphicsCapability(pScrn, pScrn->vtSema); 1158 #endif 1153 1159 if (pScrn->vtSema) 1154 1160 vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, &fNeedUpdate); 1155 /* This has to be done even when we are switched out so that VBoxClient can1156 * set a mode using RandR without having to know the virtual terminal state.1157 */1158 if (ROOT_WINDOW(pScrn) != NULL)1159 vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, &fNeedUpdate);1160 1161 if (fNeedUpdate) 1161 1162 setSizesAndCursorIntegration(pScrn, false); … … 1246 1247 return FALSE; 1247 1248 VBoxInitialiseSizeHints(pScrn); 1248 /* Get any screen size hints from HGSMI. Do not yet try to access X11 1249 * properties, as they are not yet set up, and nor are the clients that 1250 * might have set them. */ 1249 /* Get any screen size hints from HGSMI. */ 1251 1250 vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL); 1252 1251 … … 1366 1365 1367 1366 TRACE_ENTRY(); 1368 updateGraphicsCapability(pScrn, TRUE);1369 1367 vbvxSetUpHGSMIHeapInGuest(pVBox, pScrn->videoRam * 1024); 1370 1368 vboxEnableVbva(pScrn); … … 1374 1372 setSizesAndCursorIntegration(pScrn, false); 1375 1373 #else 1374 updateGraphicsCapability(pScrn, TRUE); 1376 1375 setModeRandR11(pScrn, pScrn->currentMode, false, true, cXOverRide, cYOverRide); 1377 1376 DeleteProperty(ROOT_WINDOW(pScrn), MakeAtom(NO_VT_ATOM_NAME, sizeof(NO_VT_ATOM_NAME) - 1, TRUE)); … … 1390 1389 1391 1390 TRACE_ENTRY(); 1392 updateGraphicsCapability(pScrn, FALSE);1393 1391 #ifdef VBOXVIDEO_13 1394 1392 for (i = 0; i < pVBox->cScreens; ++i) 1395 1393 vbox_crtc_dpms(pVBox->pScreens[i].paCrtcs, DPMSModeOff); 1396 1394 #else 1395 updateGraphicsCapability(pScrn, FALSE); 1397 1396 ChangeWindowProperty(ROOT_WINDOW(pScrn), MakeAtom(NO_VT_ATOM_NAME, sizeof(NO_VT_ATOM_NAME) - 1, FALSE), XA_INTEGER, 32, 1398 1397 PropModeReplace, 1, &propertyValue, TRUE); -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r59194 r60083 201 201 void *hACPIEventHandler; 202 202 # endif 203 #else 204 /** Has VBoxClient registered with us for setting video modes? */ 205 bool fHaveVBoxClient; 203 206 #endif 204 207 /** HGSMI guest heap context */ -
trunk/src/VBox/Additions/x11/vboxvideo/vbva.c
r57426 r60083 222 222 #ifdef VBOXVIDEO_13 223 223 VBoxHGSMISendCapsInfo(&pVBox->guestCtx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION); 224 #else 225 VBoxHGSMISendCapsInfo(&pVBox->guestCtx, VBVACAPS_DISABLE_CURSOR_INTEGRATION); 226 #endif 224 227 pVBox->fHaveHGSMIModeHints = haveHGSMIModeHintAndCursorReportingInterface(pVBox); 225 228 pVBox->fHostHasScreenBlankingFlag = hostHasScreenBlankingFlag(pVBox); 226 #endif227 229 return rc; 228 230 }
Note:
See TracChangeset
for help on using the changeset viewer.