Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Oct 2020 09:10:56 +0000 (UTC)
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r553427 - in head/emulators: virtualbox-ose-additions virtualbox-ose/files
Message-ID:  <202010270910.09R9AuDd095307@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: madpilot
Date: Tue Oct 27 09:10:56 2020
New Revision: 553427
URL: https://svnweb.freebsd.org/changeset/ports/553427

Log:
  Fix patch to virtualbox-ose-additions OpenGL ssupport to actually
  work at runtime as much as possible.
  
  The OpenGL bits in VirtualBox 5 are an old implementation that does
  not play too well with what wee have in the tree now. Thesse patches
  simply change the funzionn prototypess in VirtualBox to match the
  ones from mesa so it caan compile and interface as much as possible
  with it.
  
  Thanks to Ronald Klop <ronald-lists@klop.ws> for testing.
  
  PR:		250315
  Submitted by:	rozhuk.im@gmail.com
  Approved by:	portmgr (fixit blanket)

Added:
  head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h   (contents, props changed)
Modified:
  head/emulators/virtualbox-ose-additions/Makefile

Modified: head/emulators/virtualbox-ose-additions/Makefile
==============================================================================
--- head/emulators/virtualbox-ose-additions/Makefile	Tue Oct 27 08:40:21 2020	(r553426)
+++ head/emulators/virtualbox-ose-additions/Makefile	Tue Oct 27 09:10:56 2020	(r553427)
@@ -3,7 +3,7 @@
 
 PORTNAME=	virtualbox-ose
 PORTVERSION=	5.2.44
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	emulators
 MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
 PKGNAMESUFFIX?=	-additions
@@ -141,10 +141,6 @@ post-patch:
 	    ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
 	@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
 .endif
-	@${REINPLACE_CMD} \
-	    -e 's|#define GLX_EXTRAS 1||g' \
-	    ${WRKSRC}/src/VBox/Additions/common/crOpenGL/dri_glx.h \
-	    ${WRKSRC}/src/VBox/Additions/common/crOpenGL/glx_proto.h
 
 post-patch-OPENGL-on:
 	@${ECHO_CMD} 'VBOX_USE_SYSTEM_GL_HEADERS = 1' >> ${WRKSRC}/LocalConfig.kmk

Added: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h	Tue Oct 27 09:10:56 2020	(r553427)
@@ -0,0 +1,33 @@
+--- src/VBox/Additions/common/crOpenGL/dri_glx.h.orig	2020-07-09 16:50:09 UTC
++++ src/VBox/Additions/common/crOpenGL/dri_glx.h
+@@ -111,23 +111,23 @@ extern DECLEXPORT(const char *) VBOXGLXTAG(glXQueryExt
+ extern DECLEXPORT(GLXPbufferSGIX) VBOXGLXTAG(glXCreateGLXPbufferSGIX)
+ (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+ 
+-extern DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)
+-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
++extern DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX)
++(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+ 
+ extern DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXTAG(glXChooseFBConfigSGIX)
+ (Display *dpy, int screen, int *attrib_list, int *nelements);
+ 
+-extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf);
++extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf);
+ extern DECLEXPORT(void) VBOXGLXTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask);
+ extern DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
+ 
+ extern DECLEXPORT(GLXFBConfigSGIX) VBOXGLXTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis);
+-extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config);
++extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config);
+ extern DECLEXPORT(GLXContext) VBOXGLXTAG(glXCreateContextWithConfigSGIX)
+-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
++(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+ 
+-extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
+-extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
++extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
++extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+ 
+ /*
+  * GLX 1.3 functions

Added: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h	Tue Oct 27 09:10:56 2020	(r553427)
@@ -0,0 +1,25 @@
+--- src/VBox/Additions/common/crOpenGL/fakedri_drv.h.orig	2020-07-09 16:50:09 UTC
++++ src/VBox/Additions/common/crOpenGL/fakedri_drv.h
+@@ -80,16 +80,16 @@ extern Bool VBOXGLXENTRYTAG(glXQueryVersion)(Display *
+ extern XVisualInfo * VBOXGLXENTRYTAG(glXChooseVisual)(Display *dpy, int screen, int *attribList) ;
+ extern const char * VBOXGLXENTRYTAG(glXQueryExtensionsString)(Display *dpy, int screen) ;
+ extern GLXPbufferSGIX VBOXGLXENTRYTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+-extern int VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
++extern void VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+ extern GLXFBConfigSGIX * VBOXGLXENTRYTAG(glXChooseFBConfigSGIX)(Display *dpy, int screen, int *attrib_list, int *nelements);
+-extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf) ;
++extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf) ;
+ extern void VBOXGLXENTRYTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask) ;
+ extern void VBOXGLXENTRYTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask) ;
+ extern GLXFBConfigSGIX VBOXGLXENTRYTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis) ;
+-extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config) ;
+-extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
+-extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap) ;
+-extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value) ;
++extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config) ;
++extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
++extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap) ;
++extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value) ;
+ extern GLXFBConfig * VBOXGLXENTRYTAG(glXChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements) ;
+ extern GLXPbuffer VBOXGLXENTRYTAG(glXCreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list) ;
+ extern GLXPixmap VBOXGLXENTRYTAG(glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list) ;

Added: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c	Tue Oct 27 09:10:56 2020	(r553427)
@@ -0,0 +1,58 @@
+--- src/VBox/Additions/common/crOpenGL/glx.c.orig	2020-07-09 16:50:09 UTC
++++ src/VBox/Additions/common/crOpenGL/glx.c
+@@ -742,7 +742,7 @@ VBOXGLXTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXF
+     return 0;
+ }
+ 
+-DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf)
++DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf)
+ {
+     (void) dpy;
+     (void) pbuf;
+@@ -763,7 +763,7 @@ DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(D
+     (void) mask;
+ }
+ 
+-DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf,
++DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf,
+                                                    int attribute, unsigned int *value)
+ {
+     (void) dpy;
+@@ -771,10 +771,9 @@ DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Dis
+     (void) attribute;
+     (void) value;
+     crWarning("glXQueryGLXPbufferSGIX not implemented by Chromium");
+-    return 0;
+ }
+ 
+-DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config,
++DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config,
+                                                      int attribute, int *value)
+ {
+     return VBOXGLXTAG(glXGetFBConfigAttrib)(dpy, config, attribute, value);
+@@ -789,14 +788,14 @@ VBOXGLXTAG(glXChooseFBConfigSGIX)(Display *dpy, int sc
+ 
+ DECLEXPORT(GLXPixmap)
+ VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy,
+-                                             GLXFBConfig config,
++                                             GLXFBConfigSGIX config,
+                                              Pixmap pixmap)
+ {
+     return VBOXGLXTAG(glXCreatePixmap)(dpy, config, pixmap, NULL);
+ }
+ 
+ DECLEXPORT(GLXContext)
+-VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config,
++VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config,
+                                            int render_type,
+                                            GLXContext share_list,
+                                            Bool direct)
+@@ -812,7 +811,7 @@ VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dp
+ 
+ DECLEXPORT(XVisualInfo *)
+ VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy,
+-                                         GLXFBConfig config)
++                                         GLXFBConfigSGIX config)
+ {
+     return visualInfoFromFBConfig(dpy, config);
+ }

Added: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c	Tue Oct 27 09:10:56 2020	(r553427)
@@ -0,0 +1,50 @@
+--- src/VBox/Additions/common/crOpenGL/glx_c_exports.c.orig	2020-10-25 11:52:00 UTC
++++ src/VBox/Additions/common/crOpenGL/glx_c_exports.c
+@@ -213,8 +213,8 @@ DECLEXPORT(GLXPbufferSGIX) VBOXGLXENTRYTAG(glXCreateGL
+     return glxim.CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
+ }
+ 
+-DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)
+-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value)
++DECLEXPORT(void) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)
++(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
+ {
+     return glxim.QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
+ }
+@@ -225,7 +225,7 @@ DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXENTRYTAG(glXChoos
+     return glxim.ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
+ }
+ 
+-DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf)
++DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf)
+ {
+     return glxim.DestroyGLXPbufferSGIX(dpy, pbuf);
+ }
+@@ -245,23 +245,23 @@ DECLEXPORT(GLXFBConfigSGIX) VBOXGLXENTRYTAG(glXGetFBCo
+     return glxim.GetFBConfigFromVisualSGIX(dpy, vis);
+ }
+ 
+-DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config)
++DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config)
+ {
+     return glxim.GetVisualFromFBConfigSGIX(dpy, config);
+ }
+ 
+ DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)
+-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
++(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
+ {
+     return glxim.CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
+ }
+ 
+-DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap)
++DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap)
+ {
+     return glxim.CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
+ }
+ 
+-DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value)
++DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
+ {
+     return glxim.GetFBConfigAttribSGIX(dpy, config, attribute, value);
+ }

Added: head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h	Tue Oct 27 09:10:56 2020	(r553427)
@@ -0,0 +1,33 @@
+--- src/VBox/Additions/common/crOpenGL/glx_proto.h.orig	2020-07-09 16:50:09 UTC
++++ src/VBox/Additions/common/crOpenGL/glx_proto.h
+@@ -95,23 +95,23 @@ typedef const char * (*PGLXFUNC_QueryExtensionsString)
+ typedef GLXPbufferSGIX (*PGLXFUNC_CreateGLXPbufferSGIX)
+ (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+ 
+-typedef int (*PGLXFUNC_QueryGLXPbufferSGIX)
+-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
++typedef void (*PGLXFUNC_QueryGLXPbufferSGIX)
++(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+ 
+ typedef GLXFBConfigSGIX * (*PGLXFUNC_ChooseFBConfigSGIX)
+ (Display *dpy, int screen, int *attrib_list, int *nelements);
+ 
+-typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf);
++typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf);
+ typedef void (*PGLXFUNC_SelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask);
+ typedef void (*PGLXFUNC_GetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
+ 
+ typedef GLXFBConfigSGIX (*PGLXFUNC_GetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis);
+-typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config);
++typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config);
+ typedef GLXContext (*PGLXFUNC_CreateContextWithConfigSGIX)
+-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
++(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+ 
+-typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
+-typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
++typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
++typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+ 
+ /*
+  * GLX 1.3 functions



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010270910.09R9AuDd095307>