VirtualBox

Changeset 55968 in vbox


Ignore:
Timestamp:
May 20, 2015 2:31:37 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11: on RandR 1.1 X servers really only do mode-hint mode changes through VBoxClient.

Location:
trunk/src/VBox/Additions/x11
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/display.cpp

    r55385 r55968  
    271271        if (!pState->fHaveRandR12)
    272272            notifyXServerRandR11(pState);
    273         do
    274             rc = VbglR3WaitEvent(  VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST
    275                                  | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED,
    276                                  RT_INDEFINITE_WAIT, &fEvents);
    277         while(rc == VERR_INTERRUPTED);
     273        rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED, RT_INDEFINITE_WAIT,
     274                             &fEvents);
     275        /* Interrupted is used to re-set the mode without changing it. */
     276        if (rc == VERR_INTERRUPTED)
     277            rc = VINF_SUCCESS;
    278278        if (RT_FAILURE(rc))  /* VERR_NO_MEMORY? */
    279279            VBClFatalError(("event wait failed, rc=%Rrc\n", rc));
     
    367367{
    368368    struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface);
     369    int rc;
    369370
    370371    if (!pSelf->mfInit)
    371372        return VERR_WRONG_ORDER;
    372     return enableEventsAndCaps();
     373    rc = enableEventsAndCaps();
     374    /* RandR 1.1-based drivers only let us change mode when we are not switched
     375     * out, so interrupt the wait when we switch in and re-set it. */
     376    VbglR3InterruptEventWaits();
     377    return rc;
    373378}
    374379
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r55875 r55968  
    301301/** Set a video mode to the hardware, RandR 1.1 version.  Since we no longer do
    302302 * virtual frame buffers, adjust the screen pixmap dimensions to match. */
    303 static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fLimitedContext)
     303static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime)
    304304{
    305305    VBOXPtr pVBox = VBOXGetRec(pScrn);
     
    308308    pVBox->pScreens[0].aScreenLocation.cx = pMode->HDisplay;
    309309    pVBox->pScreens[0].aScreenLocation.cy = pMode->VDisplay;
    310     if (fLimitedContext)
    311     {
     310    if (fScreenInitTime)
     311    {
     312        /* The screen structure is not fully set up yet, so do not touch it. */
    312313        pScrn->displayWidth = pScrn->virtualX = pMode->HDisplay;
    313314        pScrn->virtualY = pMode->VDisplay;
     
    10431044#ifdef VBOXVIDEO_13
    10441045
    1045 static void setVirtualSizeRandR12(ScrnInfoPtr pScrn, bool fLimitedContext)
     1046static void setVirtualSizeRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
    10461047{
    10471048    VBOXPtr pVBox = VBOXGetRec(pScrn);
     
    10701071         * cause problems setting up RandR 1.2 which needs it set to the
    10711072         * maximum size at this point. */
    1072         if (!fLimitedContext)
     1073        if (!fScreenInitTime)
    10731074        {
    10741075            TRACE_LOG("cx=%u, cy=%u\n", cx, cy);
     
    10811082}
    10821083
    1083 static void setScreenSizesRandR12(ScrnInfoPtr pScrn, bool fLimitedContext)
     1084static void setScreenSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
    10841085{
    10851086    VBOXPtr pVBox = VBOXGetRec(pScrn);
     
    10961097        xf86CrtcSetMode(pVBox->pScreens[i].paCrtcs, pVBox->pScreens[i].paOutputs->probed_modes, RR_Rotate_0,
    10971098                        pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y);
    1098         if (!fLimitedContext)
     1099        if (!fScreenInitTime)
    10991100            RRCrtcNotify(pVBox->pScreens[i].paCrtcs->randr_crtc, pVBox->pScreens[i].paOutputs->randr_output->modes[0],
    11001101                         pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y, RR_Rotate_0,
     
    11061107}
    11071108
    1108 static void setSizesRandR12(ScrnInfoPtr pScrn, bool fLimitedContext)
    1109 {
    1110     VBOXPtr pVBox = VBOXGetRec(pScrn);
    1111 
    1112     if (!fLimitedContext)
     1109static void setSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
     1110{
     1111    VBOXPtr pVBox = VBOXGetRec(pScrn);
     1112
     1113    if (!fScreenInitTime)
    11131114    {
    11141115# if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5
     
    11181119# endif
    11191120    }
    1120     setVirtualSizeRandR12(pScrn, fLimitedContext);
    1121     setScreenSizesRandR12(pScrn, fLimitedContext);
    1122     if (!fLimitedContext)
     1121    setVirtualSizeRandR12(pScrn, fScreenInitTime);
     1122    setScreenSizesRandR12(pScrn, fScreenInitTime);
     1123    if (!fScreenInitTime)
    11231124    {
    11241125        /* We use RRScreenSizeSet() here and not RRScreenSizeNotify() because
     
    11351136#else
    11361137
    1137 static void setSizesRandR11(ScrnInfoPtr pScrn, bool fLimitedContext)
     1138static void setSizesRandR11(ScrnInfoPtr pScrn)
    11381139{
    11391140    VBOXPtr pVBox = VBOXGetRec(pScrn);
     
    11431144    pNewMode->HDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL);
    11441145    pNewMode->VDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL);
    1145     setModeRandR11(pScrn, pNewMode, fLimitedContext);
    11461146}
    11471147
     
    11561156    setSizesRandR12(pScrn, fScreenInitTime);
    11571157#else
    1158     setSizesRandR11(pScrn, fScreenInitTime);
     1158    setSizesRandR11(pScrn);
    11591159#endif
    11601160    if (pScrn->vtSema)
     
    13271327    }
    13281328
    1329 #endif
    13301329    /* set first video mode */
    13311330    setSizesAndCursorIntegration(pScrn, true);
     1331#else
     1332    /* set first video mode */
     1333    setModeRandR11(pScrn, pScrn->currentMode, true);
     1334#endif
    13321335
    13331336    /* Register block and wake-up handlers for getting new screen size hints. */
     
    13961399    vboxEnableVbva(pScrn);
    13971400    /* Re-set video mode */
     1401#ifdef VBOXVIDEO_13
    13981402    vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL);
    13991403    vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, NULL);
     1404    setSizesAndCursorIntegration(pScrn, false);
     1405#else
    14001406    /* This prevents a crash in CentOS 3.  I was unable to debug it to
    14011407     * satisfaction, partly due to the lack of symbols.  My guess is that
     
    14041410     * point of the VT switch. */
    14051411    pScrn->vtSema = FALSE;
    1406     setSizesAndCursorIntegration(pScrn, false);
     1412    setModeRandR11(pScrn, pScrn->currentMode, false);
    14071413    pScrn->vtSema = TRUE;
     1414#endif
    14081415#ifdef SET_HAVE_VT_PROPERTY
    14091416    updateHasVTProperty(pScrn, TRUE);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette