[Pkg-virtualbox-commits] [virtualbox] 01/01: Uploading to unstable with 3d fix for nvidia

Gianfranco Costamagna locutusofborg at moszumanska.debian.org
Fri Feb 2 08:28:50 UTC 2018


This is an automated email from the git hooks/post-receive script.

locutusofborg pushed a commit to branch master
in repository virtualbox.

commit 44501b8f665e2db263cd40dde97ab6405264b637
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Fri Feb 2 09:26:16 2018 +0100

    Uploading to unstable with 3d fix for nvidia
---
 debian/changelog                   |  9 +++++
 debian/patches/nvidia-3d-fix.patch | 74 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series              |  1 +
 3 files changed, 84 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 67d7199..5e45c70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+virtualbox (5.2.6-dfsg-3) unstable; urgency=medium
+
+  * Patch for 3D runtime flickering with NVIDIA cards
+    (this needs a new environment variable) Closes: #889030
+    CR_RENDER_FORCE_PRESENT_MAIN_THREAD=0 VirtualBox
+    Thanks Marius Mikucionis <mmikucionis at gmail.com> for the report!
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Thu, 01 Feb 2018 13:37:11 +0100
+
 virtualbox (5.2.6-dfsg-2) unstable; urgency=high
 
   * Add kernel 4.15 patch, from mail list (LP: #1737759
diff --git a/debian/patches/nvidia-3d-fix.patch b/debian/patches/nvidia-3d-fix.patch
new file mode 100644
index 0000000..4588624
--- /dev/null
+++ b/debian/patches/nvidia-3d-fix.patch
@@ -0,0 +1,74 @@
+--- virtualbox-5.2.6-dfsg.orig/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
++++ virtualbox-5.2.6-dfsg/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c
+@@ -44,6 +44,7 @@ typedef struct
+ #define WINDOW_NAME window->title
+ 
+ static Bool WindowExistsFlag;
++static Bool CrRenderForcePresentMainThread = True;
+ 
+ static int
+ WindowExistsErrorHandler( Display *dpy, XErrorEvent *xerr )
+@@ -1114,6 +1115,15 @@ createWindow( VisualInfo *visual, GLbool
+         AssertRC(rc);
+     }
+ 
++    /*
++     * Runtime CR_RENDER_FORCE_PRESENT_MAIN_THREAD flag
++     */
++    const char *pEnvCrRenderForcePresentMainThread = crGetenv("CR_RENDER_FORCE_PRESENT_MAIN_THREAD");
++    if (pEnvCrRenderForcePresentMainThread != NULL)
++    {
++        CrRenderForcePresentMainThread = crStrToInt(pEnvCrRenderForcePresentMainThread) != 0 ? True : False;
++    }
++
+     return GL_TRUE;
+ }
+ 
+@@ -1924,25 +1934,25 @@ renderspu_SystemShowWindow( WindowInfo *
+     }
+ }
+ 
+-#define CR_RENDER_FORCE_PRESENT_MAIN_THREAD
+-
+ void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
+ {
+     /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl,
+      * here it forces rendering in WinCmd thread rather than a Main thread.
+      * it is used for debugging only in any way actually.
+      * @todo: change to some more generic macro name */
+-#ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD
++    int rc = VERR_SEM_BUSY;
+     const struct VBOXVR_SCR_COMPOSITOR *pCompositor;
+-    /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */
+-    int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
++    if (!CrRenderForcePresentMainThread)
++    {
++        /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */
++        rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
++    }
+     if (RT_SUCCESS(rc))
+     {
+-        renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false);
+-        renderspuVBoxCompositorRelease(window);
++            renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false);
++            renderspuVBoxCompositorRelease(window);
+     }
+     else if (rc == VERR_SEM_BUSY)
+-#endif
+     {
+         Status status;
+         XEvent event;
+@@ -1961,13 +1971,11 @@ void renderspu_SystemVBoxPresentComposit
+         }
+         XFlush(render_spu.pCommunicationDisplay);
+     }
+-#ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD
+     else
+     {
+         /* this is somewhat we do not expect */
+         WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc));
+     }
+-#endif
+ }
+ 
+ static void
diff --git a/debian/patches/series b/debian/patches/series
index 8062ea3..a84d829 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,3 +17,4 @@
 37-python-3.6-support.patch
 fix-build.patch
 kernel-4.15.patch
+nvidia-3d-fix.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git



More information about the Pkg-virtualbox-commits mailing list