forked from pool/virtualbox
fb04d2a68e
Fix problems with VB 5.0.17 OBS-URL: https://build.opensuse.org/request/show/382287 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=246
268 lines
10 KiB
Diff
268 lines
10 KiB
Diff
Index: src/VBox/Additions/linux/drm/vbox_drv.h
|
|
===================================================================
|
|
--- src/VBox/Additions/linux/drm/vbox_drv.h (revision 106108)
|
|
+++ src/VBox/Additions/linux/drm/vbox_drv.h (revision 106140)
|
|
@@ -118,6 +118,9 @@
|
|
|
|
struct mutex hw_mutex;
|
|
bool isr_installed;
|
|
+ /** Have we finished fbdev initialisation? We limit reported display
|
|
+ * modes to 800x600 until this point to get a sensible console size. */
|
|
+ bool fbdev_init;
|
|
struct work_struct hotplug_work;
|
|
};
|
|
|
|
Index: src/VBox/Additions/linux/drm/vbox_mode.c
|
|
===================================================================
|
|
--- src/VBox/Additions/linux/drm/vbox_mode.c (revision 106108)
|
|
+++ src/VBox/Additions/linux/drm/vbox_mode.c (revision 106140)
|
|
@@ -426,11 +426,15 @@
|
|
{
|
|
struct vbox_connector *vbox_connector = NULL;
|
|
struct drm_display_mode *mode = NULL;
|
|
+ struct vbox_private *vbox = NULL;
|
|
unsigned num_modes = 0;
|
|
int preferred_width, preferred_height;
|
|
|
|
LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector));
|
|
vbox_connector = to_vbox_connector(connector);
|
|
+ vbox = connector->dev->dev_private;
|
|
+ if (!vbox->fbdev_init)
|
|
+ return drm_add_modes_noedid(connector, 800, 600);
|
|
num_modes = drm_add_modes_noedid(connector, 2560, 1600);
|
|
preferred_width = vbox_connector->mode_hint.width ? vbox_connector->mode_hint.width : 1024;
|
|
preferred_height = vbox_connector->mode_hint.height ? vbox_connector->mode_hint.height : 768;
|
|
@@ -691,5 +695,8 @@
|
|
static int vbox_cursor_move(struct drm_crtc *crtc,
|
|
int x, int y)
|
|
{
|
|
+ struct vbox_private *vbox = crtc->dev->dev_private;
|
|
+
|
|
+ VBoxHGSMICursorPosition(&vbox->submit_info, true, x, y, NULL, NULL);
|
|
return 0;
|
|
}
|
|
Index: src/VBox/Additions/linux/drm/vbox_fb.c
|
|
===================================================================
|
|
--- src/VBox/Additions/linux/drm/vbox_fb.c (revision 106108)
|
|
+++ src/VBox/Additions/linux/drm/vbox_fb.c (revision 106140)
|
|
@@ -438,6 +438,7 @@
|
|
ret = drm_fb_helper_initial_config(&fbdev->helper, 32);
|
|
if (ret)
|
|
goto fini;
|
|
+ vbox->fbdev_init = true;
|
|
|
|
LogFunc(("vboxvideo: %d\n", __LINE__));
|
|
return 0;
|
|
Index: src/VBox/Additions/linux/drm/vbox_drv.c
|
|
===================================================================
|
|
--- src/VBox/Additions/linux/drm/vbox_drv.c (revision 106108)
|
|
+++ src/VBox/Additions/linux/drm/vbox_drv.c (revision 106140)
|
|
@@ -257,7 +257,7 @@
|
|
/* Do not load if any of the virtual consoles is in graphics mode to be
|
|
* sure that we do not pick a fight with a user-mode driver or VESA. */
|
|
for (i = 0; i < MAX_NR_CONSOLES - 1; ++i)
|
|
- if (vc_cons[i].d->vc_mode == KD_GRAPHICS)
|
|
+ if (vc_cons[i].d && vc_cons[i].d->vc_mode == KD_GRAPHICS)
|
|
return -EINVAL;
|
|
|
|
return drm_pci_init(&driver, &vbox_pci_driver);
|
|
Index: src/VBox/Additions/linux/installer/vboxadd-x11.sh
|
|
===================================================================
|
|
--- src/VBox/Additions/linux/installer/vboxadd-x11.sh (revision 106108)
|
|
+++ src/VBox/Additions/linux/installer/vboxadd-x11.sh (revision 106140)
|
|
@@ -424,7 +424,7 @@
|
|
}
|
|
# Do not install if we can use the kernel driver.
|
|
case `uname -r` in
|
|
- 1.* | 2.* | 3.[0-9].* | 3.11 ) ;;
|
|
+ 1.* | 2.* | 3.[0-9].* | 3.10.* ) ;;
|
|
* ) vboxvideo_src="" ;;
|
|
esac
|
|
;;
|
|
Index: src/VBox/Additions/common/crOpenGL/egl.c
|
|
===================================================================
|
|
--- src/VBox/Additions/common/crOpenGL/egl.c (revision 106108)
|
|
+++ src/VBox/Additions/common/crOpenGL/egl.c (revision 106140)
|
|
@@ -910,6 +910,13 @@
|
|
return setEGLError(EGL_BAD_MATCH);
|
|
}
|
|
|
|
+DECLEXPORT(EGLBoolean) eglSwapInterval (EGLDisplay dpy, EGLint interval)
|
|
+{
|
|
+ NOREF(dpy);
|
|
+ NOREF(interval);
|
|
+ return EGL_TRUE;
|
|
+}
|
|
+
|
|
typedef void (*VBEGLFuncPtr)(void);
|
|
DECLEXPORT(VBEGLFuncPtr)eglGetProcAddress(const char *pszName)
|
|
{
|
|
Index: src/VBox/Additions/x11/vboxvideo/vboxvideo.c
|
|
===================================================================
|
|
--- src/VBox/Additions/x11/vboxvideo/vboxvideo.c (revision 106108)
|
|
+++ src/VBox/Additions/x11/vboxvideo/vboxvideo.c (revision 106140)
|
|
@@ -1010,102 +1010,8 @@
|
|
}
|
|
#endif
|
|
|
|
-#ifdef VBOXVIDEO_13
|
|
+#ifndef VBOXVIDEO_13
|
|
|
|
-static void setVirtualSizeRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
|
|
-{
|
|
- VBOXPtr pVBox = VBOXGetRec(pScrn);
|
|
- unsigned i;
|
|
- unsigned cx = 0;
|
|
- unsigned cy = 0;
|
|
-
|
|
- for (i = 0; i < pVBox->cScreens; ++i)
|
|
- {
|
|
- if ( pVBox->fHaveHGSMIModeHints && pVBox->pScreens[i].afHaveLocation)
|
|
- {
|
|
- pVBox->pScreens[i].paCrtcs->x = pVBox->pScreens[i].aPreferredLocation.x;
|
|
- pVBox->pScreens[i].paCrtcs->y = pVBox->pScreens[i].aPreferredLocation.y;
|
|
- }
|
|
- if ( pVBox->pScreens[i].paOutputs->status == XF86OutputStatusConnected
|
|
- && pVBox->pScreens[i].paCrtcs->x + pVBox->pScreens[i].aPreferredSize.cx < VBOX_VIDEO_MAX_VIRTUAL
|
|
- && pVBox->pScreens[i].paCrtcs->y + pVBox->pScreens[i].aPreferredSize.cy < VBOX_VIDEO_MAX_VIRTUAL)
|
|
- {
|
|
- cx = max(cx, pVBox->pScreens[i].paCrtcs->x + pVBox->pScreens[i].aPreferredSize.cx);
|
|
- cy = max(cy, pVBox->pScreens[i].paCrtcs->y + pVBox->pScreens[i].aPreferredSize.cy);
|
|
- }
|
|
- }
|
|
- if (cx != 0 && cy != 0)
|
|
- {
|
|
- /* Do not set the virtual resolution in limited context as that can
|
|
- * cause problems setting up RandR 1.2 which needs it set to the
|
|
- * maximum size at this point. */
|
|
- if (!fScreenInitTime)
|
|
- {
|
|
- TRACE_LOG("cx=%u, cy=%u\n", cx, cy);
|
|
- xf86ScrnToScreen(pScrn)->width = cx;
|
|
- xf86ScrnToScreen(pScrn)->height = cy;
|
|
- xf86ScrnToScreen(pScrn)->mmWidth = cx * 254 / 960;
|
|
- xf86ScrnToScreen(pScrn)->mmHeight = cy * 254 / 960;
|
|
- adjustScreenPixmap(pScrn, cx, cy);
|
|
- vbvxSetSolarisMouseRange(cx, cy);
|
|
- }
|
|
- }
|
|
-}
|
|
-
|
|
-static void setScreenSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
|
|
-{
|
|
- VBOXPtr pVBox = VBOXGetRec(pScrn);
|
|
- unsigned i;
|
|
-
|
|
- for (i = 0; i < pVBox->cScreens; ++i)
|
|
- {
|
|
- if (!pVBox->pScreens[i].afConnected)
|
|
- continue;
|
|
- /* The Crtc can get "unset" if the screen was disconnected previously.
|
|
- * I couldn't find an API to re-set it which did not have side-effects.
|
|
- */
|
|
- pVBox->pScreens[i].paOutputs->crtc = pVBox->pScreens[i].paCrtcs;
|
|
- xf86CrtcSetMode(pVBox->pScreens[i].paCrtcs, pVBox->pScreens[i].paOutputs->probed_modes, RR_Rotate_0,
|
|
- pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y);
|
|
- if (!fScreenInitTime)
|
|
- RRCrtcNotify(pVBox->pScreens[i].paCrtcs->randr_crtc, pVBox->pScreens[i].paOutputs->randr_output->modes[0],
|
|
- pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y, RR_Rotate_0,
|
|
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5
|
|
- NULL,
|
|
-#endif
|
|
- 1, &pVBox->pScreens[i].paOutputs->randr_output);
|
|
- }
|
|
-}
|
|
-
|
|
-static void setSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime)
|
|
-{
|
|
- VBOXPtr pVBox = VBOXGetRec(pScrn);
|
|
-
|
|
- if (!fScreenInitTime)
|
|
- {
|
|
-# if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5
|
|
- RRGetInfo(xf86ScrnToScreen(pScrn), TRUE);
|
|
-# else
|
|
- RRGetInfo(xf86ScrnToScreen(pScrn));
|
|
-# endif
|
|
- }
|
|
- setVirtualSizeRandR12(pScrn, fScreenInitTime);
|
|
- setScreenSizesRandR12(pScrn, fScreenInitTime);
|
|
- if (!fScreenInitTime)
|
|
- {
|
|
- /* We use RRScreenSizeSet() here and not RRScreenSizeNotify() because
|
|
- * the first also pushes the virtual screen size to the input driver.
|
|
- * We were doing this manually by setting screenInfo.width and height
|
|
- * and calling xf86UpdateDesktopDimensions() where appropriate, but this
|
|
- * failed on Ubuntu 12.04.0 due to a problematic X server back-port. */
|
|
- RRScreenSizeSet(xf86ScrnToScreen(pScrn), xf86ScrnToScreen(pScrn)->width, xf86ScrnToScreen(pScrn)->height,
|
|
- xf86ScrnToScreen(pScrn)->mmWidth, xf86ScrnToScreen(pScrn)->mmHeight);
|
|
- RRTellChanged(xf86ScrnToScreen(pScrn));
|
|
- }
|
|
-}
|
|
-
|
|
-#else
|
|
-
|
|
#define PREFERRED_MODE_ATOM_NAME "VBOXVIDEO_PREFERRED_MODE"
|
|
|
|
static void setSizesRandR11(ScrnInfoPtr pScrn)
|
|
@@ -1131,7 +1037,11 @@
|
|
|
|
TRACE_LOG("fScreenInitTime=%d\n", (int)fScreenInitTime);
|
|
#ifdef VBOXVIDEO_13
|
|
- setSizesRandR12(pScrn, fScreenInitTime);
|
|
+# if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5
|
|
+ RRGetInfo(xf86ScrnToScreen(pScrn), TRUE);
|
|
+# else
|
|
+ RRGetInfo(xf86ScrnToScreen(pScrn));
|
|
+# endif
|
|
#else
|
|
setSizesRandR11(pScrn);
|
|
#endif
|
|
@@ -1246,8 +1156,6 @@
|
|
if (ShadowFBInit2(pScreen, NULL, vbvxHandleDirtyRect) != TRUE)
|
|
return FALSE;
|
|
VBoxInitialiseSizeHints(pScrn);
|
|
- /* Get any screen size hints from HGSMI. */
|
|
- vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL);
|
|
|
|
#ifdef VBOXVIDEO_13
|
|
/* Initialise CRTC and output configuration for use with randr1.2. */
|
|
@@ -1304,7 +1212,9 @@
|
|
}
|
|
|
|
/* set first video mode */
|
|
- setSizesAndCursorIntegration(pScrn, true);
|
|
+ if (!xf86SetDesiredModes(pScrn)) {
|
|
+ return FALSE;
|
|
+ }
|
|
#else
|
|
/* set first video mode */
|
|
setModeRandR11(pScrn, pScrn->currentMode, true, false, 0, 0);
|
|
@@ -1368,8 +1278,9 @@
|
|
vboxEnableVbva(pScrn);
|
|
/* Re-set video mode */
|
|
#ifdef VBOXVIDEO_13
|
|
- vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL);
|
|
- setSizesAndCursorIntegration(pScrn, false);
|
|
+ if (!xf86SetDesiredModes(pScrn)) {
|
|
+ return FALSE;
|
|
+ }
|
|
#else
|
|
updateGraphicsCapability(pScrn, TRUE);
|
|
setModeRandR11(pScrn, pScrn->currentMode, false, true, cXOverRide, cYOverRide);
|
|
Index: src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm
|
|
===================================================================
|
|
--- src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm (revision 106108)
|
|
+++ src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm (revision 106140)
|
|
@@ -88,6 +88,10 @@
|
|
if (self)
|
|
m_pCallbacks = [[NSMutableArray alloc] init];
|
|
|
|
+ /* Gently disable El Capitan tries to break everything with the Enter Full Screen action.
|
|
+ * S.a. https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ for reference. */
|
|
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
|
|
+
|
|
return self;
|
|
}
|
|
|