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

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

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

commit 02617ab4248846e42e04ee2c7b7ea410d99e3308
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-05-13 17:51:09 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-05-13 18:40:24 +0000

    emulators/virtualbox-ose{,-nox11}-70: 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 031b8f8fae05eb84510c1686e8126959216c2426)
---
 emulators/virtualbox-ose-70/Makefile                 |  2 +-
 .../patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp  | 20 ++++++++++++++++++++
 ...c_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp | 11 +++++++++++
 ...src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp |  8 ++++----
 ...h-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h |  4 ++--
 emulators/virtualbox-ose-nox11-70/Makefile           |  2 +-
 6 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/emulators/virtualbox-ose-70/Makefile b/emulators/virtualbox-ose-70/Makefile
index 26c32ab3d9e4..c679edeef066 100644
--- a/emulators/virtualbox-ose-70/Makefile
+++ b/emulators/virtualbox-ose-70/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	virtualbox-ose
 DISTVERSION=	7.0.26
-PORTREVISION?=	1
+PORTREVISION?=	2
 CATEGORIES=	emulators
 MASTER_SITES=	https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \
 		LOCAL/vvd:docs
diff --git a/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp
new file mode 100644
index 000000000000..aa74b95e2303
--- /dev/null
+++ b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp
@@ -0,0 +1,20 @@
+--- src/VBox/Devices/Graphics/DevVGA-SVGA.cpp.orig	2025-04-11 12:09:20 UTC
++++ src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
+@@ -178,7 +178,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
+@@ -7153,7 +7153,7 @@ static void vmsvgaR3PowerOnDevice(PPDMDEVINS pDevIns, 
+     }
+ # endif
+ 
+-# 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-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp
new file mode 100644
index 000000000000..8592bccdc8fc
--- /dev/null
+++ b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp
@@ -0,0 +1,11 @@
+--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp.orig	2025-04-11 12:09:20 UTC
++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp
+@@ -3111,7 +3111,7 @@ static DECLCALLBACK(int) vmsvga3dBackInit(PPDMDEVINS p
+     RT_NOREF(pDevIns, pThis);
+ 
+     int rc;
+-#ifdef RT_OS_LINUX /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */
++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */
+     rc = glLdrInit(pDevIns);
+     if (RT_FAILURE(rc))
+     {
diff --git a/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
index c9574654562d..caa97030f41c 100644
--- a/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
+++ b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp
@@ -1,6 +1,6 @@
---- 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	2025-04-11 12:09:20 UTC
 +++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
-@@ -186,7 +186,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
+@@ -196,7 +196,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
      pfn_wglDeleteContext = 0;
      pfn_wglMakeCurrent = 0;
      pfn_wglShareLists = 0;
@@ -9,7 +9,7 @@
      pfn_XConfigureWindow = 0;
      pfn_XCloseDisplay = 0;
      pfn_XCreateColormap = 0;
-@@ -296,7 +296,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
+@@ -306,7 +306,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
      GLGETPROC_(wglDeleteContext, "");
      GLGETPROC_(wglMakeCurrent, "");
      GLGETPROC_(wglShareLists, "");
@@ -18,7 +18,7 @@
      X11GETPROC_(XConfigureWindow);
      X11GETPROC_(XCloseDisplay);
      X11GETPROC_(XCreateColormap);
-@@ -397,7 +397,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
+@@ -407,7 +407,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
      GLGETPROC_(glVertexPointer, "");
      GLGETPROC_(glViewport, "");
  
diff --git a/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h b/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h
index 3069950947cd..ea1c170e8f17 100644
--- a/emulators/virtualbox-ose-70/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h
+++ b/emulators/virtualbox-ose-70/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	2025-04-11 12:09:20 UTC
 +++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
-@@ -338,7 +338,7 @@ GLPFN BOOL (WINAPI *pfn_wglMakeCurrent)(HDC, HGLRC);
+@@ -346,7 +346,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-nox11-70/Makefile b/emulators/virtualbox-ose-nox11-70/Makefile
index ae6cac9a31c3..278eadfa1f23 100644
--- a/emulators/virtualbox-ose-nox11-70/Makefile
+++ b/emulators/virtualbox-ose-nox11-70/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	1
+PORTREVISION=	2
 PKGNAMESUFFIX=	-nox11-70
 
 MASTERDIR=	${.CURDIR}/../virtualbox-ose-70