1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

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)
This commit is contained in:
Guido Falsi 2020-10-27 09:10:56 +00:00
parent 1102271f2f
commit 4296c3e1e4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=553427
6 changed files with 200 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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) ;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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