Skip to content

Commit 3a5d1dc

Browse files
committed
add missing mesa patches
1 parent 094fbba commit 3a5d1dc

7 files changed

+284
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From 44518d07398d663448d79e4f546736b40752630c Mon Sep 17 00:00:00 2001
2+
From: Ulrich Sibiller <[email protected]>
3+
Date: Wed, 16 Mar 2016 14:40:08 +0100
4+
Subject: [PATCH] Fix non-working GLX in 64bit Xorg 7.0
5+
6+
Found the needed patch in debian bugtracker at
7+
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364233
8+
---
9+
src/glx/x11/indirect_vertex_array.c | 2 +-
10+
src/mesa/drivers/dri/common/glcontextmodes.c | 3 +++
11+
src/mesa/main/glheader.h | 3 +++
12+
3 files changed, 7 insertions(+), 1 deletion(-)
13+
14+
Index: Mesa/src/glx/x11/indirect_vertex_array.c
15+
===================================================================
16+
--- Mesa.orig/src/glx/x11/indirect_vertex_array.c
17+
+++ Mesa/src/glx/x11/indirect_vertex_array.c
18+
@@ -530,7 +530,7 @@ static GLubyte *
19+
emit_DrawArrays_header_old( __GLXcontext * gc,
20+
struct array_state_vector * arrays,
21+
size_t * elements_per_request,
22+
- size_t * total_requests,
23+
+ unsigned int * total_requests,
24+
GLenum mode, GLsizei count )
25+
{
26+
size_t command_size;
27+
Index: Mesa/src/mesa/main/glheader.h
28+
===================================================================
29+
--- Mesa.orig/src/mesa/main/glheader.h
30+
+++ Mesa/src/mesa/main/glheader.h
31+
@@ -46,6 +46,9 @@
32+
#ifndef GLHEADER_H
33+
#define GLHEADER_H
34+
35+
+#ifdef HAVE_DIX_CONFIG_H
36+
+#include "dix-config.h"
37+
+#endif
38+
39+
#if defined(XFree86LOADER) && defined(IN_MODULE)
40+
#include "xf86_ansic.h"
41+
Index: Mesa/src/mesa/drivers/dri/common/glcontextmodes.c
42+
===================================================================
43+
--- Mesa.orig/src/mesa/drivers/dri/common/glcontextmodes.c
44+
+++ Mesa/src/mesa/drivers/dri/common/glcontextmodes.c
45+
@@ -39,6 +39,9 @@
46+
# include "imports.h"
47+
# define __glXMemset memset
48+
#else
49+
+# if defined (HAVE_DIX_CONFIG_H)
50+
+# include <dix-config.h>
51+
+# endif
52+
# include <X11/X.h>
53+
# include <GL/glx.h>
54+
# include "GL/glxint.h"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Description: Turn glx_ansic.h into a no-op include. (by using memset, malloc, free directly)
2+
Author: Mike Gabriel <[email protected]>
3+
4+
Index: Mesa/src/glx/glcontextmodes.c
5+
===================================================================
6+
--- Mesa.orig/src/glx/x11/glcontextmodes.c
7+
+++ Mesa/src/glx/x11/glcontextmodes.c
8+
@@ -53,14 +53,14 @@
9+
# ifdef XFree86Server
10+
# include <os.h>
11+
# include <string.h>
12+
-# define _mesa_malloc(b) xalloc(b)
13+
-# define _mesa_free(m) xfree(m)
14+
+# define _mesa_malloc(b) malloc(b)
15+
+# define _mesa_free(m) free(m)
16+
# define _mesa_memset memset
17+
# else
18+
# include <X11/Xlibint.h>
19+
# define _mesa_memset memset
20+
-# define _mesa_malloc(b) Xmalloc(b)
21+
-# define _mesa_free(m) Xfree(m)
22+
+# define _mesa_malloc(b) malloc(b)
23+
+# define _mesa_free(m) free(m)
24+
# endif /* XFree86Server */
25+
#endif /* !defined(IN_MINI_GLX) */
26+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Index: Mesa/include/GL/xmesa_xf86.h
2+
===================================================================
3+
--- Mesa.orig/include/GL/xmesa_xf86.h
4+
+++ Mesa/include/GL/xmesa_xf86.h
5+
@@ -142,7 +142,7 @@ do { \
6+
7+
/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
8+
#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
9+
- (*__d->CreatePixmap)(__d, __w, __h, __depth)
10+
+ (*__d->CreatePixmap)(__d, __w, __h, __depth, 0)
11+
12+
#define XMesaFreePixmap(__d,__b) \
13+
(*__d->DestroyPixmap)(__b)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Author: Mike Gabriel <[email protected]>
2+
Description: define USE_IEEE for __aarch64__ and __mc68000__, as well
3+
4+
Index: Mesa/src/mesa/main/imports.h
5+
===================================================================
6+
--- Mesa.orig/src/mesa/main/imports.h
7+
+++ Mesa/src/mesa/main/imports.h
8+
@@ -205,6 +205,8 @@ typedef union { GLfloat f; GLint i; } fi
9+
defined(__hppa__) || defined(hpux) || \
10+
defined(__mips) || defined(_MIPS_ARCH) || \
11+
defined(__arm__) || \
12+
+ defined(__aarch64__) || \
13+
+ defined(__mc68000__) || \
14+
defined(__sh__) || \
15+
(defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
16+
#define USE_IEEE
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Description: Assure that headers from libNX_X11 are always included from ${INCDIR}/nx-X11/.
2+
Author: Mike Gabriel <[email protected]>
3+
4+
Index: Mesa/include/GL/xmesa.h
5+
===================================================================
6+
--- Mesa.orig/include/GL/xmesa.h
7+
+++ Mesa/include/GL/xmesa.h
8+
@@ -75,8 +75,8 @@ extern "C" {
9+
#ifdef XFree86Server
10+
#include "xmesa_xf86.h"
11+
#else
12+
-#include <X11/Xlib.h>
13+
-#include <X11/Xutil.h>
14+
+#include <nx-X11/Xlib.h>
15+
+#include <nx-X11/Xutil.h>
16+
#include "xmesa_x.h"
17+
#endif
18+
#include "GL/gl.h"
19+
Index: Mesa/src/glx/x11/glcontextmodes.c
20+
===================================================================
21+
--- Mesa.orig/src/glx/x11/glcontextmodes.c
22+
+++ Mesa/src/glx/x11/glcontextmodes.c
23+
@@ -37,7 +37,7 @@
24+
#if defined(HAVE_DIX_CONFIG_H)
25+
# include <dix-config.h>
26+
#endif
27+
-#include <X11/X.h>
28+
+#include <nx-X11/X.h>
29+
#include <GL/glx.h>
30+
#include "GL/glxint.h"
31+
#endif
32+
@@ -57,7 +57,7 @@
33+
# define _mesa_free(m) free(m)
34+
# define _mesa_memset memset
35+
# else
36+
-# include <X11/Xlibint.h>
37+
+# include <nx-X11/Xlibint.h>
38+
# define _mesa_memset memset
39+
# define _mesa_malloc(b) malloc(b)
40+
# define _mesa_free(m) free(m)
41+
Index: Mesa/src/mesa/drivers/x11/glxheader.h
42+
===================================================================
43+
--- Mesa.orig/src/mesa/drivers/x11/glxheader.h
44+
+++ Mesa/src/mesa/drivers/x11/glxheader.h
45+
@@ -39,13 +39,13 @@
46+
47+
#else
48+
49+
-# include <X11/Xlib.h>
50+
-# include <X11/Xlibint.h>
51+
-# include <X11/Xutil.h>
52+
+# include <nx-X11/Xlib.h>
53+
+# include <nx-X11/Xlibint.h>
54+
+# include <nx-X11/Xutil.h>
55+
# ifdef USE_XSHM /* was SHM */
56+
# include <sys/ipc.h>
57+
# include <sys/shm.h>
58+
-# include <X11/extensions/XShm.h>
59+
+# include <nx-X11/extensions/XShm.h>
60+
# endif
61+
# include <GL/glx.h>
62+
# include <sys/time.h>
63+
Index: Mesa/src/mesa/glapi/glthread.h
64+
===================================================================
65+
--- Mesa.orig/src/mesa/glapi/glthread.h
66+
+++ Mesa/src/mesa/glapi/glthread.h
67+
@@ -185,7 +185,7 @@ typedef CRITICAL_SECTION _glthread_Mutex;
68+
* We wrap it again for GL.
69+
*/
70+
#ifdef USE_XTHREADS
71+
-#include <X11/Xthreads.h>
72+
+#include <nx-X11/Xthreads.h>
73+
74+
typedef struct {
75+
xthread_key_t key;
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Description: Some nasty typos fixed to silence lintian et al.
2+
Author: Mike Gabriel <[email protected]>
3+
4+
Index: Mesa/src/mesa/main/debug.c
5+
===================================================================
6+
--- Mesa.orig/src/mesa/main/debug.c
7+
+++ Mesa/src/mesa/main/debug.c
8+
@@ -43,7 +43,7 @@ const char *_mesa_prim_name[GL_POLYGON+4
9+
"GL_QUAD_STRIP",
10+
"GL_POLYGON",
11+
"outside begin/end",
12+
- "inside unkown primitive",
13+
+ "inside unknown primitive",
14+
"unknown state"
15+
};
16+
17+
Index: Mesa/src/mesa/shader/arbprogparse.c
18+
===================================================================
19+
--- Mesa.orig/src/mesa/shader/arbprogparse.c
20+
+++ Mesa/src/mesa/shader/arbprogparse.c
21+
@@ -127,8 +127,8 @@
22+
*
23+
* Cosmetic Stuff
24+
* -----------------------------------------------------
25+
- * - remove any leftover unused grammer.c stuff (dict_ ?)
26+
- * - fix grammer.c error handling so its not static
27+
+ * - remove any leftover unused grammar.c stuff (dict_ ?)
28+
+ * - fix grammar.c error handling so its not static
29+
* - #ifdef around stuff pertaining to extentions
30+
*
31+
* Outstanding Questions:
32+
@@ -1673,7 +1673,7 @@
33+
if (found) {
34+
error_msg = (char *)
35+
_mesa_malloc (_mesa_strlen ((char *) attrib_var->name) + 40);
36+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
37+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
38+
attrib_var->name);
39+
40+
_mesa_set_program_error (ctx, Program->Position, error_msg);
41+
@@ -1864,7 +1864,7 @@
42+
if (found) {
43+
char *error_msg = (char *)
44+
_mesa_malloc (_mesa_strlen ((char *) param_var->name) + 40);
45+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
46+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
47+
param_var->name);
48+
49+
_mesa_set_program_error (ctx, Program->Position, error_msg);
50+
@@ -1972,7 +1972,7 @@
51+
if (found) {
52+
char *error_msg = (char *)
53+
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
54+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
55+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
56+
temp_var->name);
57+
58+
_mesa_set_program_error (ctx, Program->Position, error_msg);
59+
@@ -2023,7 +2023,7 @@
60+
if (found) {
61+
char *error_msg = (char *)
62+
_mesa_malloc (_mesa_strlen ((char *) output_var->name) + 40);
63+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
64+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
65+
output_var->name);
66+
67+
_mesa_set_program_error (ctx, Program->Position, error_msg);
68+
@@ -2057,7 +2057,7 @@
69+
if (found) {
70+
char *error_msg = (char *)
71+
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
72+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
73+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
74+
temp_var->name);
75+
76+
_mesa_set_program_error (ctx, Program->Position, error_msg);
77+
@@ -2106,7 +2106,7 @@
78+
if (found) {
79+
char *error_msg = (char *)
80+
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
81+
- _mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
82+
+ _mesa_sprintf (error_msg, "Duplicate Variable Declaration: %s",
83+
temp_var->name);
84+
85+
_mesa_set_program_error (ctx, Program->Position, error_msg);
86+
@@ -3904,7 +3904,7 @@
87+
grammar_get_last_error ((GLubyte *) error_msg, 300, &error_pos);
88+
_mesa_set_program_error (ctx, error_pos, error_msg);
89+
_mesa_error (ctx, GL_INVALID_OPERATION,
90+
- "glProgramString(Error loading grammer rule set)");
91+
+ "glProgramString(Error loading grammar rule set)");
92+
return GL_FALSE;
93+
}
94+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch
2+
4002_no-special-glx-memfunctions.patch
3+
4003_CreatePixmap-AllocationHints.patch
4+
#4004_define-USE_IEEE-macro-for-more-platforms.patch
5+
#5001_nasty-typo-fixes.patch
6+
4005_adapt-all-libX11-include-paths-to-libNX_X11.patch

0 commit comments

Comments
 (0)