git: 37964f0e32be - main - emulators/virtualbox-ose-legacy: Backported patch from emulators/virtualbox-ose improve VGA/SVGA emulation

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Sun, 11 May 2025 23:01:20 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=37964f0e32be377e10b03c9d93801daadd4de2c9

commit 37964f0e32be377e10b03c9d93801daadd4de2c9
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-05-11 22:54:48 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-05-11 22:54:48 +0000

    emulators/virtualbox-ose-legacy: Backported patch from emulators/virtualbox-ose improve VGA/SVGA emulation
    
    While here sort options.
    
    MFH:    2025Q2
---
 emulators/virtualbox-ose-legacy/Makefile           |  4 +-
 ...src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp | 47 ++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/emulators/virtualbox-ose-legacy/Makefile b/emulators/virtualbox-ose-legacy/Makefile
index 9635d1977766..e46c5f8b905b 100644
--- a/emulators/virtualbox-ose-legacy/Makefile
+++ b/emulators/virtualbox-ose-legacy/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	virtualbox-ose
 DISTVERSION=	5.2.44
-PORTREVISION?=	30
+PORTREVISION?=	31
 CATEGORIES=	emulators
 MASTER_SITES=	https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \
 		LOCAL/bofh/emulators/virtualbox-ose-legacy:docs
@@ -75,7 +75,7 @@ PLIST_SUB=	GUEST_VER=${DISTVERSION} \
 SLAVE_PORT?=	no
 
 OPTIONS_DEFINE=		ALSA DBUS DEBUG DOCS GUESTADDITIONS NLS PULSEAUDIO \
-			PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
+			PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC VPX WEBSERVICE X11
 OPTIONS_DEFAULT=	DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
 .if ${SLAVE_PORT} == no
 OPTIONS_DEFAULT+=	PYTHON
diff --git a/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp
new file mode 100644
index 000000000000..055a29c732a9
--- /dev/null
+++ b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp
@@ -0,0 +1,47 @@
+--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig	2020-07-09 16:55:07 UTC
++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
+@@ -1094,7 +1094,7 @@ int vmsvga3dTerminate(PVGASTATE pThis)
+     RTSemEventDestroy(pState->WndRequestSem);
+ #elif defined(RT_OS_DARWIN)
+ 
+-#elif defined(RT_OS_LINUX)
++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+     /* signal to the thread that it is supposed to exit */
+     pState->bTerminate = true;
+     /* wait for it to terminate */
+@@ -3200,7 +3200,7 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t s
+     return VINF_SUCCESS;
+ }
+ 
+-#ifdef RT_OS_LINUX
++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+ /**
+  * X11 event handling thread.
+  *
+@@ -3230,7 +3230,7 @@ DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD hThrea
+     }
+     return VINF_SUCCESS;
+ }
+-#endif // RT_OS_LINUX
++#endif // RT_OS_FREEBSD || RT_OS_LINUX
+ 
+ 
+ /**
+@@ -3590,7 +3590,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATE pThis, 
+     AssertRC(rc);
+ #elif defined(RT_OS_DARWIN)
+     vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext);
+-#elif defined(RT_OS_LINUX)
++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+     glXMakeCurrent(pState->display, None, NULL);
+     glXDestroyContext(pState->display, pContext->glxContext);
+     XDestroyWindow(pState->display, pContext->window);
+@@ -3648,7 +3648,7 @@ static void vmsvga3dChangeModeOneContext(PVGASTATE pTh
+     RT_NOREF(pState);
+     vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight);
+ 
+-#elif defined(RT_OS_LINUX)
++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+     XWindowChanges wc;
+     wc.width = pThis->svga.uWidth;
+     wc.height = pThis->svga.uHeight;