git: b0f425fe9650 - 2025Q2 - emulators/virtualbox-ose{,-nox11}: Add patches for better graphics devices support

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Tue, 13 May 2025 18:40:57 UTC
The branch 2025Q2 has been updated by vvd:

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

commit b0f425fe96500cdb49ed9e39ac875e40a8fcd9fc
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-05-13 17:45:42 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-05-13 18:40:20 +0000

    emulators/virtualbox-ose{,-nox11}: Add patches for better graphics devices support
    
    While here refresh patches for graphics devices
    
    PR:             286748
    Tested by:      Martin Birgmeier <d8zNeCFG@aon.at>, rkoberman@gmail.com
    MFH:            2025Q2
    
    (cherry picked from commit 47d943f3cfad86764803a0c1a99a4a65d33ddf17)
---
 emulators/virtualbox-ose-nox11/Makefile              |  2 +-
 emulators/virtualbox-ose/Makefile                    |  2 +-
 .../patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp  | 20 ++++++++++++++++++++
 ...src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp |  2 +-
 ...h-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h |  4 ++--
 ...rc_VBox_Devices_Graphics_DevVGA-SVGA3d-internal.h | 11 +++++++++++
 6 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/emulators/virtualbox-ose-nox11/Makefile b/emulators/virtualbox-ose-nox11/Makefile
index c9a9c1f951e3..27bd5629cbb9 100644
--- a/emulators/virtualbox-ose-nox11/Makefile
+++ b/emulators/virtualbox-ose-nox11/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	12
+PORTREVISION=	14
 PKGNAMESUFFIX=	-nox11
 
 MASTERDIR=	${.CURDIR}/../virtualbox-ose
diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile
index e79e170b28a5..d868733954cb 100644
--- a/emulators/virtualbox-ose/Makefile
+++ b/emulators/virtualbox-ose/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	virtualbox-ose
 DISTVERSION=	6.1.50
-PORTREVISION?=	13
+PORTREVISION?=	14
 CATEGORIES=	emulators
 MASTER_SITES=	https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \
 		LOCAL/bofh/emulators/virtualbox-ose:docs
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp
new file mode 100644
index 000000000000..949c413d4ba3
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp
@@ -0,0 +1,20 @@
+--- src/VBox/Devices/Graphics/DevVGA-SVGA.cpp.orig	2024-01-11 12:18:20 UTC
++++ src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
+@@ -169,7 +169,7 @@
+ # ifdef RT_OS_DARWIN
+ #  include "DevVGA-SVGA3d-cocoa.h"
+ # endif
+-# ifdef RT_OS_LINUX
++# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+ #  ifdef IN_RING3
+ #include "DevVGA-SVGA3d-glLdr.h"
+ #  endif
+@@ -3520,7 +3520,7 @@ static DECLCALLBACK(int) vmsvgaR3FifoLoop(PPDMDEVINS p
+     PVMSVGAR3STATE  pSVGAState = pThisCC->svga.pSvgaR3State;
+     int             rc;
+ 
+-# if defined(VBOX_WITH_VMSVGA3D) && defined(RT_OS_LINUX)
++# if defined(VBOX_WITH_VMSVGA3D) && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX))
+     if (pThis->svga.f3DEnabled)
+     {
+         /* The FIFO thread may use X API for accelerated screen output. */
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
index c9574654562d..4bee4df8ce47 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
@@ -1,4 +1,4 @@
---- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig	2021-01-07 15:39:16 UTC
+--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig	2024-01-11 12:18:21 UTC
 +++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
 @@ -186,7 +186,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
      pfn_wglDeleteContext = 0;
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h
index 3069950947cd..34edb2b49799 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h
@@ -1,6 +1,6 @@
---- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig	2021-01-07 15:39:17 UTC
+--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig	2024-01-11 12:18:21 UTC
 +++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
-@@ -338,7 +338,7 @@ GLPFN BOOL (WINAPI *pfn_wglMakeCurrent)(HDC, HGLRC);
+@@ -338,7 +338,7 @@ GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC);
  GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC);
  #define wglShareLists pfn_wglShareLists
  
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-internal.h b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-internal.h
new file mode 100644
index 000000000000..1378f39b6a59
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-internal.h
@@ -0,0 +1,11 @@
+--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h.orig	2024-01-11 12:18:21 UTC
++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
+@@ -1175,7 +1175,7 @@ typedef struct VMSVGAHWSCREEN
+ typedef struct VMSVGAHWSCREEN
+ {
+     uint32_t u32Reserved0;
+-#if defined(RT_OS_LINUX)
++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
+     /* OpenGL context, which is used for the screen updates. */
+     GLXContext glxctx;
+