grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / mesa / src / aros / mesa.diff
blob3a0a06ae96dffeafa825cb5ee663ce8904f3ed20
1 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/include/EGL/eglplatform.h ./mesa/include/EGL/eglplatform.h
2 --- /data/deadwood/source/Mesa-7.11-staging/include/EGL/eglplatform.h 2011-07-09 03:37:09.000000000 +0200
3 +++ ./mesa/include/EGL/eglplatform.h 2011-10-18 19:34:24.000000000 +0200
4 @@ -90,6 +90,14 @@
5 typedef struct gbm_bo *EGLNativePixmapType;
6 typedef void *EGLNativeWindowType;
8 +#elif defined(__AROS__)
10 +#include <intuition/intuition.h>
12 +typedef APTR EGLNativeDisplayType;
13 +typedef struct Bitmap *EGLNativePixmapType;
14 +typedef struct Window *EGLNativeWindowType;
16 #elif defined(__unix__) || defined(__unix)
18 #ifdef MESA_EGL_NO_X11_HEADERS
19 @@ -127,6 +135,6 @@
20 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
21 * integer type.
23 -typedef khronos_int32_t EGLint;
24 +typedef SIPTR EGLint;
26 #endif /* __eglplatform_h */
27 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglcompiler.h ./mesa/src/egl/main/eglcompiler.h
28 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglcompiler.h 2011-07-09 03:37:09.000000000 +0200
29 +++ ./mesa/src/egl/main/eglcompiler.h 2013-01-04 19:25:40.000000000 +0100
30 @@ -36,6 +36,7 @@
32 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
33 # include <stdint.h>
34 +# include <stddef.h>
35 #elif defined(_MSC_VER)
36 typedef __int8 int8_t;
37 typedef unsigned __int8 uint8_t;
38 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglconfig.c ./mesa/src/egl/main/eglconfig.c
39 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglconfig.c 2011-07-09 03:37:09.000000000 +0200
40 +++ ./mesa/src/egl/main/eglconfig.c 2013-01-04 19:25:40.000000000 +0100
41 @@ -263,7 +263,7 @@
43 /* check attributes by their types */
44 for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
45 - EGLint mask;
46 + EGLint mask = 0;
48 attr = _eglValidationTable[i].attr;
49 val = _eglGetConfigKey(conf, attr);
50 @@ -700,7 +700,7 @@
54 -static int
55 +static EGLint
56 _eglFallbackCompare(const _EGLConfig *conf1, const _EGLConfig *conf2,
57 void *priv_data)
59 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglcurrent.c ./mesa/src/egl/main/eglcurrent.c
60 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglcurrent.c 2011-07-09 03:37:09.000000000 +0200
61 +++ ./mesa/src/egl/main/eglcurrent.c 2011-09-05 20:03:01.000000000 +0200
62 @@ -108,6 +108,55 @@
63 return EGL_TRUE;
66 +#elif defined(_EGL_OS_AROS)
68 +#include "aros/tls.h"
70 +static struct TaskLocalStorage * tls = NULL;
71 +static void (*_egl_FreeTSD)(_EGLThreadInfo *);
73 +static INLINE void _eglFiniTSD(void)
75 + DestroyTLS(tls);
78 +static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
80 + InsertIntoTLS(tls, (APTR)t);
83 +static INLINE _EGLThreadInfo *_eglGetTSD(void)
85 + return (_EGLThreadInfo *)GetFromTLS(tls);
88 +static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
90 + if (!tls)
91 + {
92 + tls = CreateTLS();
93 + _egl_FreeTSD = dtor;
94 + _eglAddAtExitCall(_eglFiniTSD);
95 + }
97 + if (tls)
98 + return EGL_TRUE;
99 + else
100 + return EGL_FALSE;
103 +#include <aros/symbolsets.h>
105 +static VOID _egl_FreeTSD_fn()
107 + _EGLThreadInfo *t = NULL;
109 + if (!tls) return;
111 + t = _eglGetTSD();
113 + if (t && _egl_FreeTSD)
114 + _egl_FreeTSD((void *) t);
115 + ClearFromTLS(tls);
117 +ADD2CLOSELIB(_egl_FreeTSD_fn, 10)
119 #else /* PTHREADS */
120 static const _EGLThreadInfo *_egl_TSD;
121 static void (*_egl_FreeTSD)(_EGLThreadInfo *);
122 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldisplay.c ./mesa/src/egl/main/egldisplay.c
123 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldisplay.c 2011-07-09 03:37:09.000000000 +0200
124 +++ ./mesa/src/egl/main/egldisplay.c 2011-09-05 20:03:01.000000000 +0200
125 @@ -59,7 +59,8 @@
126 { _EGL_PLATFORM_X11, "x11" },
127 { _EGL_PLATFORM_WAYLAND, "wayland" },
128 { _EGL_PLATFORM_DRM, "drm" },
129 - { _EGL_PLATFORM_FBDEV, "fbdev" }
130 + { _EGL_PLATFORM_FBDEV, "fbdev" },
131 + { _EGL_PLATFORM_AROS, "aros" }
133 _EGLPlatformType plat = _EGL_INVALID_PLATFORM;
134 const char *plat_name;
135 @@ -148,8 +149,15 @@
136 /* search the display list first */
137 dpy = _eglGlobal.DisplayList;
138 while (dpy) {
139 +#if !defined(_EGL_OS_AROS)
140 + /* It seems the _eglGlobal.DisplayList should unique per opener (not per task).
141 + This is not true on AROS (_eglGlobal.DisplayList is global for all
142 + openers). The workaround is to always create a new display object. This
143 + might fail with multithreaded applications as they might expect to have
144 + the same display object returned by GetDisplay */
145 if (dpy->Platform == plat && dpy->PlatformDisplay == plat_dpy)
146 break;
147 +#endif
148 dpy = dpy->Next;
151 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldisplay.h ./mesa/src/egl/main/egldisplay.h
152 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldisplay.h 2011-07-09 03:37:09.000000000 +0200
153 +++ ./mesa/src/egl/main/egldisplay.h 2011-09-05 20:03:01.000000000 +0200
154 @@ -44,6 +44,7 @@
155 _EGL_PLATFORM_WAYLAND,
156 _EGL_PLATFORM_DRM,
157 _EGL_PLATFORM_FBDEV,
158 + _EGL_PLATFORM_AROS,
160 _EGL_NUM_PLATFORMS,
161 _EGL_INVALID_PLATFORM = -1
162 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldriver.c ./mesa/src/egl/main/egldriver.c
163 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldriver.c 2011-07-09 03:37:09.000000000 +0200
164 +++ ./mesa/src/egl/main/egldriver.c 2012-01-22 09:08:51.000000000 +0100
165 @@ -32,7 +32,6 @@
166 * Functions for choosing and opening/loading device drivers.
170 #include <assert.h>
171 #include <string.h>
172 #include <stdio.h>
173 @@ -79,6 +78,7 @@
174 { NULL, NULL }
179 * Wrappers for dlopen/dlclose()
181 @@ -107,6 +107,16 @@
185 +#elif defined(_EGL_OS_AROS)
187 +typedef void * lib_handle;
189 +static void
190 +close_library(void *lib)
192 + /* No-Op */
195 #elif defined(_EGL_OS_UNIX)
198 @@ -141,6 +151,7 @@
199 static _EGLMain_t
200 _eglOpenLibrary(const char *driverPath, lib_handle *handle)
202 +#if !defined(_EGL_OS_AROS)
203 lib_handle lib;
204 _EGLMain_t mainFunc = NULL;
205 const char *error = "unknown error";
206 @@ -187,6 +198,9 @@
208 *handle = lib;
209 return mainFunc;
210 +#else
211 + return NULL;
212 +#endif
216 @@ -314,6 +328,7 @@
220 +#if !defined(_EGL_OS_AROS)
222 * A loader function for use with _eglPreloadForEach. The loader data is the
223 * filename of the driver. This function stops on the first valid driver.
224 @@ -531,7 +546,7 @@
225 _eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
226 #endif
229 +#endif /* !defined(_EGL_OS_AROS) */
232 * Add built-in drivers to the module array.
233 @@ -560,6 +575,7 @@
234 if (_eglModules)
235 return EGL_TRUE;
237 +#if !defined(_EGL_OS_AROS)
238 if (!_eglAddUserDriver()) {
240 * Add other drivers only when EGL_DRIVER is not set. The order here
241 @@ -568,6 +584,9 @@
242 _eglAddGalliumDriver();
243 _eglAddBuiltInDrivers();
245 +#else
246 + _eglAddBuiltInDrivers();
247 +#endif
249 return (_eglModules != NULL);
251 @@ -698,7 +717,7 @@
256 +#if !defined(_EGL_OS_AROS)
258 * Invoke a callback function on each EGL search path.
260 @@ -712,3 +731,4 @@
261 const char *search_path = _eglGetSearchPath();
262 _eglPreloadForEach(search_path, callback, callback_data);
264 +#endif
265 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldriver.h ./mesa/src/egl/main/egldriver.h
266 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egldriver.h 2011-07-09 03:37:09.000000000 +0200
267 +++ ./mesa/src/egl/main/egldriver.h 2012-01-21 16:25:55.000000000 +0100
268 @@ -95,6 +95,10 @@
269 extern _EGLDriver *
270 _eglBuiltInDriverGLX(const char *args);
272 +#if defined(_EGL_OS_AROS)
273 +extern _EGLDriver *
274 +_eglBuiltInDriverAROSMesa(const char *args);
275 +#endif
277 PUBLIC _EGLDriver *
278 _eglMain(const char *args);
279 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egllog.c ./mesa/src/egl/main/egllog.c
280 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/egllog.c 2011-07-09 03:37:09.000000000 +0200
281 +++ ./mesa/src/egl/main/egllog.c 2011-09-05 20:03:01.000000000 +0200
282 @@ -56,11 +56,18 @@
283 _EGLLogProc logger;
284 EGLint num_messages;
285 } logging = {
286 +#if !defined(_EGL_OS_AROS)
287 _EGL_MUTEX_INITIALIZER,
288 EGL_FALSE,
289 FALLBACK_LOG_LEVEL,
290 NULL,
292 +#else
293 + .initialized = EGL_FALSE,
294 + .level = FALLBACK_LOG_LEVEL,
295 + .logger = NULL,
296 + .num_messages = 0
297 +#endif
300 static const char *level_strings[] = {
301 @@ -122,13 +129,20 @@
305 +#if defined(_EGL_OS_AROS)
306 +#include <aros/debug.h>
307 +#endif
309 * The default logger. It prints the message to stderr.
311 static void
312 _eglDefaultLogger(EGLint level, const char *msg)
314 +#if !defined(_EGL_OS_AROS)
315 fprintf(stderr, "libEGL %s: %s\n", level_strings[level], msg);
316 +#else
317 + bug("[EGL]: %s: %s\n", level_strings[level], msg);
318 +#endif
322 @@ -160,6 +174,9 @@
323 logging.logger = _eglDefaultLogger;
324 logging.level = (level >= 0) ? level : FALLBACK_LOG_LEVEL;
325 logging.initialized = EGL_TRUE;
326 +#if defined(_EGL_OS_AROS)
327 + _eglInitMutex(&logging.mutex);
328 +#endif
330 /* it is fine to call _eglLog now */
331 if (log_env && level < 0) {
332 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglmutex.h ./mesa/src/egl/main/eglmutex.h
333 --- /data/deadwood/source/Mesa-7.11-staging/src/egl/main/eglmutex.h 2011-07-09 03:37:09.000000000 +0200
334 +++ ./mesa/src/egl/main/eglmutex.h 2011-09-05 20:03:01.000000000 +0200
335 @@ -63,6 +63,48 @@
336 #define _EGL_DECLARE_MUTEX(m) \
337 _EGLMutex m = _EGL_MUTEX_INITIALIZER
339 +#elif defined(_EGL_OS_AROS)
341 +#include <proto/exec.h>
343 +typedef struct SignalSemaphore _EGLMutex;
345 +static INLINE void _eglInitMutex(_EGLMutex *m)
347 + InitSemaphore(m);
350 +static INLINE void
351 +_eglDestroyMutex(_EGLMutex *m)
353 + /* No Op */
356 +static INLINE void
357 +_eglLockMutex(_EGLMutex *m)
359 + ObtainSemaphore(m);
362 +static INLINE void
363 +_eglUnlockMutex(_EGLMutex *m)
365 + ReleaseSemaphore(m);
368 +/* This is not supported. _eglInitMutex must alway be used */
369 +/* #define _EGL_MUTEX_INITIALIZER */
371 +#include <aros/symbolsets.h> /* For ADD2INIT */
372 +/* Declare variable, declare init function, add to auto init. Ugly but works. */
373 +#define _EGL_DECLARE_MUTEX(m) \
374 + _EGLMutex m; \
375 +static void init##m() \
376 +{ \
377 + _eglInitMutex(&m); \
378 +} \
379 +ADD2INIT(init##m, 5);
381 #else
383 typedef int _EGLMutex;
384 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_thread.h ./mesa/src/gallium/auxiliary/os/os_thread.h
385 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_thread.h 2011-07-09 03:37:09.000000000 +0200
386 +++ ./mesa/src/gallium/auxiliary/os/os_thread.h 2011-09-05 20:03:01.000000000 +0200
387 @@ -237,6 +237,63 @@
389 #endif /* pre-Vista win32 */
391 +#elif defined(PIPE_OS_AROS)
393 +#include <proto/exec.h>
395 +#include "os/os_time.h"
397 +typedef struct SignalSemaphore pipe_mutex;
399 +#include <aros/symbolsets.h> /* For ADD2INIT */
401 +/* Declare variable, declare init function, add to auto init. Ugly but works. */
402 +#define pipe_static_mutex(mutex) \
403 +static pipe_mutex mutex; \
404 +static void init##mutex() \
405 +{ \
406 + pipe_mutex_init(mutex); \
407 +} \
408 +ADD2INIT(init##mutex, 5);
410 +#define pipe_mutex_init(mutex) \
411 + InitSemaphore(&mutex)
413 +#define pipe_mutex_destroy(mutex) \
414 + (void) mutex
416 +#define pipe_mutex_lock(mutex) \
417 + ObtainSemaphore(&mutex)
419 +#define pipe_mutex_unlock(mutex) \
420 + ReleaseSemaphore(&mutex)
422 +typedef int64_t pipe_condvar;
424 +#define pipe_static_condvar(condvar) \
425 + static pipe_condvar condvar = 1000
427 +#define pipe_condvar_init(condvar) \
428 + (void) (condvar = 1000)
430 +#define pipe_condvar_destroy(condvar) \
431 + (void) condvar
433 +/* Poor man's pthread_cond_wait():
434 + Just release the mutex and sleep for one millisecond.
435 + The caller's while() loop does all the work. */
436 +#define pipe_condvar_wait(condvar, mutex) \
437 + do { pipe_mutex_unlock(mutex); \
438 + os_time_sleep(condvar); \
439 + pipe_mutex_lock(mutex); \
440 + } while (0)
442 +#define pipe_condvar_signal(condvar) \
443 + (void) condvar
445 +#define pipe_condvar_broadcast(condvar) \
446 + (void) condvar
448 #else
450 #include "os/os_time.h"
451 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_time.c ./mesa/src/gallium/auxiliary/os/os_time.c
452 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_time.c 2011-07-09 03:37:09.000000000 +0200
453 +++ ./mesa/src/gallium/auxiliary/os/os_time.c 2011-09-05 20:03:01.000000000 +0200
454 @@ -35,7 +35,7 @@
456 #include "pipe/p_config.h"
458 -#if defined(PIPE_OS_UNIX)
459 +#if defined(PIPE_OS_UNIX) || defined(PIPE_OS_AROS)
460 # include <sys/time.h> /* timeval */
461 #elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
462 # include <windows.h>
463 @@ -55,7 +55,7 @@
464 int64_t
465 os_time_get(void)
467 -#if defined(PIPE_OS_UNIX)
468 +#if defined(PIPE_OS_UNIX) || defined(PIPE_OS_AROS)
470 struct timeval tv;
471 gettimeofday(&tv, NULL);
472 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_time.h ./mesa/src/gallium/auxiliary/os/os_time.h
473 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/os/os_time.h 2010-04-27 23:41:59.000000000 +0200
474 +++ ./mesa/src/gallium/auxiliary/os/os_time.h 2011-08-31 12:37:34.000000000 +0200
475 @@ -38,7 +38,7 @@
477 #include "pipe/p_config.h"
479 -#if defined(PIPE_OS_UNIX)
480 +#if defined(PIPE_OS_UNIX) || defined(PIPE_OS_AROS)
481 # include <unistd.h> /* usleep */
482 #endif
484 @@ -60,7 +60,7 @@
486 * Sleep.
488 -#if defined(PIPE_OS_UNIX)
489 +#if defined(PIPE_OS_UNIX) || defined(PIPE_OS_AROS)
490 #define os_time_sleep(_usecs) usleep(_usecs)
491 #else
492 void
493 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_atomic.h ./mesa/src/gallium/auxiliary/util/u_atomic.h
494 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_atomic.h 2010-10-19 19:58:28.000000000 +0200
495 +++ ./mesa/src/gallium/auxiliary/util/u_atomic.h 2011-12-17 11:25:59.000000000 +0100
496 @@ -29,8 +29,12 @@
497 #define PIPE_ATOMIC_ASM_MSVC_X86
498 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86))
499 #define PIPE_ATOMIC_ASM_GCC_X86
500 +#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_ARM))
501 +#define PIPE_ATOMIC_ASM_GCC_ARM
502 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64))
503 #define PIPE_ATOMIC_ASM_GCC_X86_64
504 +#elif defined(PIPE_OS_AROS) && defined(PIPE_ARCH_M68K)
505 +#define PIPE_ATOMIC_OS_AROS_CPU_M68K
506 #elif defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 401)
507 #define PIPE_ATOMIC_GCC_INTRINSIC
508 #else
509 @@ -130,6 +134,69 @@
511 #endif
513 +#if defined(PIPE_ATOMIC_ASM_GCC_ARM)
515 +#define PIPE_ATOMIC "GCC ARM assembly"
517 +#ifdef __cplusplus
518 +extern "C" {
519 +#endif
521 +#define p_atomic_set(_v, _i) (*(_v) = (_i))
522 +#define p_atomic_read(_v) (*(_v))
524 +static INLINE boolean
525 +p_atomic_dec_zero(int32_t *v)
527 + unsigned long temp;
528 + int result;
529 + unsigned long cc;
530 + __asm__ __volatile__("\n1: ldrex %0, [%3]; subs %0, %0, #1; moveq %2, #1; movne %2, #0; strex %1, %0, [%3]; teq %1, #0; bne 1b"
531 + :"=&r"(result), "=&r"(temp), "=&r"(cc)
532 + :"r"(v)
533 + :"cc");
534 + return cc;
537 +static INLINE void
538 +p_atomic_inc(int32_t *v)
540 + unsigned long temp;
541 + int result;
542 + __asm__ __volatile__("\n1: ldrex %0, [%2]; add %0, %0, #1; strex %1, %0, [%2]; teq %1, #0; bne 1b"
543 + :"=&r"(result), "=&r"(temp)
544 + :"r"(v)
545 + :"cc");
548 +static INLINE void
549 +p_atomic_dec(int32_t *v)
551 + unsigned long temp;
552 + int result;
553 + __asm__ __volatile__("\n1: ldrex %0, [%2]; sub %0, %0, #1; strex %1, %0, [%2]; teq %1, #0; bne 1b"
554 + :"=&r"(result), "=&r"(temp)
555 + :"r"(v)
556 + :"cc");
559 +static INLINE int32_t
560 +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
562 + int32_t oldval;
563 + unsigned long temp;
564 + __asm__ __volatile__("\n1: ldrex %0,[%2]; teq %0, %3; strexeq %1, %4, [%2]; teq %1, #0; bne 1b"
565 + :"=&r"(oldval), "=&r"(temp)
566 + :"r"(v), "Ir"(old), "r"(_new)
567 + :"cc");
568 + return oldval;
571 +#ifdef __cplusplus
573 +#endif
575 +#endif
578 /* Implementation using GCC-provided synchronization intrinsics
579 @@ -338,6 +405,64 @@
581 #ifdef __cplusplus
583 +#endif
585 +#endif
588 +#if defined(PIPE_ATOMIC_OS_AROS_CPU_M68K)
590 +#define PIPE_ATOMIC "AROS OS atomic functions"
592 +#include <aros/atomic.h>
594 +#ifdef __cplusplus
595 +extern "C" {
596 +#endif
598 +#define p_atomic_set(_v, _i) (*(_v) = (_i))
599 +#define p_atomic_read(_v) (*(_v))
601 +static INLINE boolean
602 +p_atomic_dec_zero(int32_t *v)
604 + boolean n;
606 + /* FIXME: AROS needs an atomic decrement and return... */
607 + Disable();
608 + AROS_ATOMIC_DEC(*(LONG *)v);
609 + n = (*v == 0) ? TRUE : FALSE;
610 + Enable();
612 + return n;
615 +#define p_atomic_inc(_v) AROS_ATOMIC_INC(*(LONG *)_v)
616 +#define p_atomic_dec(_v) AROS_ATOMIC_DEC(*(LONG *)_v)
618 +static INLINE int32_t
619 +p_atomic_cmpxchg(int32_t *v, int32_t o, int32_t n)
621 + int32_t ret;
623 + /* FIXME: AROS needs an atomic cmpxchg, using CAS.
624 + * However we can't do this if:
625 + * a) We are on a 68000 or
626 + * b) The 'v' points to Chip RAM (no r/m/w possible)
628 + * Settle for Disable()/Enable() for now.
629 + */
630 + Disable();
631 + if (*v == o)
632 + *v = (n);
633 + ret = *v;
634 + Enable();
636 + return ret;
639 +#ifdef __cplusplus
641 #endif
643 #endif
644 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_math.c ./mesa/src/gallium/auxiliary/util/u_math.c
645 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_math.c 2010-02-05 01:10:39.000000000 +0100
646 +++ ./mesa/src/gallium/auxiliary/util/u_math.c 2011-08-31 12:37:34.000000000 +0200
647 @@ -42,6 +42,13 @@
648 pow2_table[i] = (float) pow(2.0, (i - POW2_TABLE_OFFSET) / POW2_TABLE_SCALE);
651 +#if defined(PIPE_OS_AROS)
653 + * NOTE: log_base_2(x) = log(x) / log(2)
654 + * NOTE: 1.442695 = 1/log(2).
655 + */
656 +#define log2(x) ((float) (log(x) * 1.442695f))
657 +#endif
659 /** log2(x), for x in [1.0, 2.0) */
660 float log2_table[LOG2_TABLE_SIZE];
661 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_math.h ./mesa/src/gallium/auxiliary/util/u_math.h
662 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_math.h 2011-07-09 03:37:09.000000000 +0200
663 +++ ./mesa/src/gallium/auxiliary/util/u_math.h 2011-09-05 20:03:01.000000000 +0200
664 @@ -411,6 +411,8 @@
666 #elif defined(__MINGW32__)
667 #define ffs __builtin_ffs
668 +#elif defined(PIPE_OS_AROS)
669 +#define ffs __builtin_ffs
670 #endif
673 @@ -530,7 +532,15 @@
674 util_bitcount(unsigned n)
676 #if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 304)
677 +#if defined(PIPE_OS_AROS)
678 + unsigned int bits;
679 + for (bits = 0; n > 0; n = n >> 1) {
680 + bits += (n & 1);
682 + return bits;
683 +#else
684 return __builtin_popcount(n);
685 +#endif
686 #else
687 /* K&R classic bitcount.
689 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_network.c ./mesa/src/gallium/auxiliary/util/u_network.c
690 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/auxiliary/util/u_network.c 2010-10-05 18:56:51.000000000 +0200
691 +++ ./mesa/src/gallium/auxiliary/util/u_network.c 2013-03-13 22:19:46.000000000 +0100
692 @@ -6,7 +6,7 @@
693 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
694 # include <winsock2.h>
695 # include <windows.h>
696 -#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN)
697 +#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_AROS)
698 # include <sys/socket.h>
699 # include <netinet/in.h>
700 # include <unistd.h>
701 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_context.c ./mesa/src/gallium/drivers/i915/i915_context.c
702 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_context.c 2011-07-09 03:37:09.000000000 +0200
703 +++ ./mesa/src/gallium/drivers/i915/i915_context.c 2013-03-13 22:19:46.000000000 +0100
704 @@ -54,13 +54,10 @@
705 struct i915_context *i915 = i915_context(pipe);
706 struct draw_context *draw = i915->draw;
707 void *mapped_indices = NULL;
708 - unsigned cbuf_dirty;
712 * Ack vs contants here, helps ipers a lot.
714 - cbuf_dirty = i915->dirty & I915_NEW_VS_CONSTANTS;
715 i915->dirty &= ~I915_NEW_VS_CONSTANTS;
717 if (i915->dirty)
718 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_prim_vbuf.c ./mesa/src/gallium/drivers/i915/i915_prim_vbuf.c
719 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_prim_vbuf.c 2011-07-09 03:37:09.000000000 +0200
720 +++ ./mesa/src/gallium/drivers/i915/i915_prim_vbuf.c 2013-01-04 19:25:40.000000000 +0100
721 @@ -400,8 +400,8 @@
722 case PIPE_PRIM_LINE_LOOP:
723 if (nr >= 2) {
724 for (i = start + 1; i < end; i++)
725 - OUT_BATCH((i-0) | (i+0) << 16);
726 - OUT_BATCH((i-0) | ( start) << 16);
727 + OUT_BATCH((i-1) | (i+0) << 16);
728 + OUT_BATCH((i-1) | ( start) << 16);
730 break;
731 case PIPE_PRIM_QUADS:
732 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_screen.c ./mesa/src/gallium/drivers/i915/i915_screen.c
733 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_screen.c 2011-07-09 03:37:09.000000000 +0200
734 +++ ./mesa/src/gallium/drivers/i915/i915_screen.c 2013-01-04 19:25:40.000000000 +0100
735 @@ -274,6 +274,12 @@
736 PIPE_FORMAT_YUYV,
737 /* XXX why not?
738 PIPE_FORMAT_Z16_UNORM, */
740 + // AROS Quoke1 fix,seems to work,but probably better to fix SDL so
741 + // that some other format is used.
742 + // Sami
743 + PIPE_FORMAT_Z16_UNORM,
745 PIPE_FORMAT_DXT1_RGB,
746 PIPE_FORMAT_DXT1_RGBA,
747 PIPE_FORMAT_DXT3_RGBA,
748 @@ -294,6 +300,7 @@
749 static const enum pipe_format depth_supported[] = {
750 /* XXX why not?
751 PIPE_FORMAT_Z16_UNORM, */
752 + PIPE_FORMAT_Z16_UNORM, // AROS quake1 fix
753 PIPE_FORMAT_Z24X8_UNORM,
754 PIPE_FORMAT_Z24_UNORM_S8_USCALED,
755 PIPE_FORMAT_NONE /* list terminator */
756 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_state_immediate.c ./mesa/src/gallium/drivers/i915/i915_state_immediate.c
757 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/i915/i915_state_immediate.c 2011-07-09 03:32:30.000000000 +0200
758 +++ ./mesa/src/gallium/drivers/i915/i915_state_immediate.c 2013-03-13 22:19:46.000000000 +0100
759 @@ -189,13 +189,13 @@
761 static void upload_S7(struct i915_context *i915)
763 +#if 0
764 unsigned LIS7;
766 /* I915_NEW_RASTERIZER
768 LIS7 = i915->rasterizer->LIS7;
770 -#if 0
771 set_immediate(i915, I915_IMMEDIATE_S7, LIS7);
772 #endif
774 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nouveau/nouveau_fence.c ./mesa/src/gallium/drivers/nouveau/nouveau_fence.c
775 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nouveau/nouveau_fence.c 2011-07-09 03:37:09.000000000 +0200
776 +++ ./mesa/src/gallium/drivers/nouveau/nouveau_fence.c 2013-01-04 19:25:40.000000000 +0100
777 @@ -31,6 +31,10 @@
778 #include <sched.h>
779 #endif
781 +#ifdef PIPE_OS_AROS
782 +#include "drm_aros_config.h" /* for MOCK_HARDWARE define */
783 +#endif
785 boolean
786 nouveau_fence_new(struct nouveau_screen *screen, struct nouveau_fence **fence,
787 boolean emit)
788 @@ -93,8 +97,6 @@
789 /* set this now, so that if fence.emit triggers a flush we don't recurse */
790 fence->state = NOUVEAU_FENCE_STATE_EMITTED;
792 - screen->fence.emit(&screen->base, fence->sequence);
794 ++fence->ref;
796 if (screen->fence.tail)
797 @@ -103,6 +105,8 @@
798 screen->fence.head = fence;
800 screen->fence.tail = fence;
802 + screen->fence.emit(&screen->base, fence->sequence);
805 void
806 @@ -138,7 +142,13 @@
808 struct nouveau_fence *fence;
809 struct nouveau_fence *next = NULL;
811 +#if defined(PIPE_OS_AROS) && defined(MOCK_HARDWARE)
812 + /* For purpose of simulation, assume all fences are signalled */
813 + u32 sequence = screen->fence.tail->sequence;
814 +#else
815 u32 sequence = screen->fence.update(&screen->base);
816 +#endif
818 if (screen->fence.sequence_ack == sequence)
819 return;
820 @@ -219,5 +229,7 @@
821 if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTED)
822 nouveau_fence_emit(screen->fence.current);
824 + nouveau_fence_ref(NULL, &screen->fence.current);
826 nouveau_fence_new(screen, &screen->fence.current, FALSE);
828 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c ./mesa/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
829 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c 2011-07-09 03:37:09.000000000 +0200
830 +++ ./mesa/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c 2011-09-05 20:03:01.000000000 +0200
831 @@ -1480,7 +1480,7 @@
833 struct nv_value *t[4], *s[3];
834 uint opcode = translate_opcode(insn->Instruction.Opcode);
835 - int arg, dim, c;
836 + int arg = 0, dim = 0, c;
837 const int tic = insn->Src[1].Register.Index;
838 const int tsc = tic;
839 const int cube = (insn->Texture.Texture == TGSI_TEXTURE_CUBE) ? 1 : 0;
840 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nvfx/nv30_fragtex.c ./mesa/src/gallium/drivers/nvfx/nv30_fragtex.c
841 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nvfx/nv30_fragtex.c 2011-04-08 21:31:18.000000000 +0200
842 +++ ./mesa/src/gallium/drivers/nvfx/nv30_fragtex.c 2011-09-30 21:45:16.000000000 +0200
843 @@ -9,7 +9,9 @@
844 struct nvfx_sampler_state *ps,
845 const struct pipe_sampler_state *cso)
847 +#if 0 /* unused */
848 float limit;
849 +#endif
851 if (cso->max_anisotropy >= 2)
853 @@ -21,7 +23,9 @@
854 ps->en |= NV30_3D_TEX_ENABLE_ANISO_2X;
857 +#if 0 /* unused */
858 limit = CLAMP(cso->lod_bias, -16.0, 15.0 + (255.0 / 256.0));
859 +#endif
860 ps->filt |= (int)(cso->lod_bias * 256.0) & 0x1fff;
862 ps->max_lod = (int)CLAMP(cso->max_lod, 0.0, 15.0);
863 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nvfx/nv40_fragtex.c ./mesa/src/gallium/drivers/nvfx/nv40_fragtex.c
864 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/nvfx/nv40_fragtex.c 2011-04-08 21:31:18.000000000 +0200
865 +++ ./mesa/src/gallium/drivers/nvfx/nv40_fragtex.c 2011-09-30 21:45:16.000000000 +0200
866 @@ -8,7 +8,9 @@
867 struct nvfx_sampler_state *ps,
868 const struct pipe_sampler_state *cso)
870 +#if 0 /* unused */
871 float limit;
872 +#endif
873 if (cso->max_anisotropy >= 2) {
874 /* no idea, binary driver sets it, works without it.. meh.. */
875 ps->wrap |= (1 << 5);
876 @@ -29,7 +31,9 @@
877 ps->en |= NV40_3D_TEX_ENABLE_ANISO_2X;
880 +#if 0 /* unused */
881 limit = CLAMP(cso->lod_bias, -16.0, 15.0 + (255.0 / 256.0));
882 +#endif
883 ps->filt |= (int)(cso->lod_bias * 256.0) & 0x1fff;
885 ps->max_lod = (int)(CLAMP(cso->max_lod, 0.0, 15.0 + (255.0 / 256.0)) * 256.0);
886 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/softpipe/sp_query.c ./mesa/src/gallium/drivers/softpipe/sp_query.c
887 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/drivers/softpipe/sp_query.c 2010-10-05 18:56:51.000000000 +0200
888 +++ ./mesa/src/gallium/drivers/softpipe/sp_query.c 2013-03-13 22:19:46.000000000 +0100
889 @@ -157,7 +157,7 @@
890 /*os_get_time is in microseconds*/
891 td.frequency = 1000000;
892 td.disjoint = FALSE;
893 - memcpy(vresult, &sq->so,
894 + memcpy(vresult, &td,
895 sizeof(struct pipe_query_data_timestamp_disjoint));
897 break;
898 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/include/pipe/p_config.h ./mesa/src/gallium/include/pipe/p_config.h
899 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/include/pipe/p_config.h 2011-08-01 05:23:42.000000000 +0200
900 +++ ./mesa/src/gallium/include/pipe/p_config.h 2013-03-13 22:19:46.000000000 +0100
901 @@ -82,10 +82,18 @@
902 #define PIPE_ARCH_X86
903 #endif
905 +#if defined(__arm__)
906 +#define PIPE_ARCH_ARM
907 +#endif
909 #if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || defined(_M_AMD64) /* msvc */ || defined(__x86_64) /* Sun cc */
910 #define PIPE_ARCH_X86_64
911 #endif
913 +#if defined(__mc68000) /* gcc */
914 +#define PIPE_ARCH_M68K
915 +#endif
917 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
918 #if defined(PIPE_CC_GCC) && !defined(__SSE2__)
919 /* #warning SSE2 support requires -msse -msse2 compiler options */
920 @@ -99,7 +107,7 @@
921 #endif
922 #endif
924 -#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__)
925 +#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) || defined(__powerpc__)
926 #define PIPE_ARCH_PPC
927 #if defined(__ppc64__) || defined(__PPC64__)
928 #define PIPE_ARCH_PPC_64
929 @@ -131,9 +139,9 @@
931 #else
933 -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
934 +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM)
935 #define PIPE_ARCH_LITTLE_ENDIAN
936 -#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
937 +#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_M68K)
938 #define PIPE_ARCH_BIG_ENDIAN
939 #endif
941 @@ -149,6 +157,15 @@
942 * See subsystem below for a more fine-grained distinction.
946 + * In some situations __AROS__ definition can coexist with anything of
947 + * the below (for example this happens on ARM port which is compiled using Linux
948 + * compiler at the moment). So if we have __AROS__ we don't evaluate anything else
949 + */
950 +#if defined(__AROS__)
951 +#define PIPE_OS_AROS
952 +#else
954 #if defined(__linux__)
955 #define PIPE_OS_LINUX
956 #define PIPE_OS_UNIX
957 @@ -201,6 +218,8 @@
958 #define PIPE_OS_UNIX
959 #endif
961 +#endif
964 * Try to auto-detect the subsystem.
966 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_api.c ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_api.c
967 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_api.c 2011-07-09 03:37:09.000000000 +0200
968 +++ ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_api.c 2012-01-22 09:28:44.000000000 +0100
969 @@ -86,7 +86,7 @@
970 return stapi;
973 -static int
974 +static EGLint
975 egl_g3d_compare_config(const _EGLConfig *conf1, const _EGLConfig *conf2,
976 void *priv_data)
978 @@ -125,6 +125,28 @@
980 if (!num_configs)
981 return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
982 +#if defined(_EGL_OS_AROS)
983 + /* This is the earliest place where client indicates which API is it interested in. Due to fact that
984 + * HostGL is not providing Gallium st_api, we detected if we are capable of continuing with Gallium EGL
985 + * driver and if not we "chain load" the display into AROSMesa EGL driver
986 + */
987 + int j = -1;
988 + while (attribs[++j] != EGL_NONE)
990 + if (attribs[j] == EGL_RENDERABLE_TYPE)
992 + if (attribs[++j] == EGL_OPENGL_BIT)
994 + if (egl_g3d_get_st_api(drv, EGL_OPENGL_BIT) == NULL)
996 + dpy->Driver = _eglBuiltInDriverAROSMesa(NULL);
997 + dpy->Driver->API.Initialize(dpy->Driver, dpy);
998 + return dpy->Driver->API.ChooseConfig(dpy->Driver, dpy,attribs, configs, size, num_configs);
1003 +#endif
1005 if (!_eglParseConfigAttribList(&criteria, dpy, attribs))
1006 return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
1007 @@ -247,6 +269,7 @@
1008 struct egl_g3d_surface *gsurf;
1009 struct native_surface *nsurf;
1010 const char *err;
1011 + int w,h;
1013 switch (arg->type) {
1014 case EGL_WINDOW_BIT:
1015 @@ -304,8 +327,9 @@
1016 return NULL;
1018 /* initialize the geometry */
1019 - if (!nsurf->validate(nsurf, 0x0, &gsurf->sequence_number, NULL,
1020 - &gsurf->base.Width, &gsurf->base.Height)) {
1021 + if (!nsurf->validate(nsurf, 0x0, &gsurf->sequence_number, NULL, &w, &h)) {
1022 + gsurf->base.Width = w;
1023 + gsurf->base.Height = h;
1024 nsurf->destroy(nsurf);
1025 FREE(gsurf);
1026 return NULL;
1027 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d.c ./mesa/src/gallium/state_trackers/egl/common/egl_g3d.c
1028 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d.c 2011-07-09 03:37:09.000000000 +0200
1029 +++ ./mesa/src/gallium/state_trackers/egl/common/egl_g3d.c 2011-09-05 20:03:01.000000000 +0200
1030 @@ -56,6 +56,7 @@
1031 gctx->stctxi->notify_invalid_framebuffer(gctx->stctxi, gsurf->stfbi);
1034 +#if !defined(PIPE_OS_AROS)
1035 static struct pipe_screen *
1036 egl_g3d_new_drm_screen(struct native_display *ndpy, const char *name, int fd)
1038 @@ -71,6 +72,7 @@
1039 struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
1040 return gdpy->loader->create_sw_screen(ws);
1042 +#endif
1044 static struct pipe_resource *
1045 egl_g3d_lookup_egl_image(struct native_display *ndpy, void *egl_image)
1046 @@ -87,13 +89,19 @@
1047 return resource;
1050 +#if !defined(PIPE_OS_AROS)
1051 static const struct native_event_handler egl_g3d_native_event_handler = {
1052 egl_g3d_invalid_surface,
1053 egl_g3d_new_drm_screen,
1054 egl_g3d_new_sw_screen,
1055 egl_g3d_lookup_egl_image
1058 +#else
1059 +static const struct native_event_handler egl_g3d_native_event_handler = {
1060 + egl_g3d_invalid_surface,
1061 + egl_g3d_lookup_egl_image
1063 +#endif
1065 * Get the native platform.
1067 @@ -137,6 +145,12 @@
1068 nplat = native_get_fbdev_platform(&egl_g3d_native_event_handler);
1069 #endif
1070 break;
1071 + case _EGL_PLATFORM_AROS:
1072 + plat_name = "AROS";
1073 +#ifdef HAVE_AROS_BACKEND
1074 + nplat = native_get_aros_platform(&egl_g3d_native_event_handler);
1075 +#endif
1076 + break;
1077 default:
1078 break;
1080 @@ -157,7 +171,7 @@
1082 struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
1083 const struct native_connector **native_connectors;
1084 - EGLint num_connectors, i;
1085 + int num_connectors, i;
1087 native_connectors =
1088 gdpy->native->modeset->get_connectors(gdpy->native, &num_connectors, NULL);
1089 @@ -171,7 +185,7 @@
1090 const struct native_connector *nconn = native_connectors[i];
1091 struct egl_g3d_screen *gscr;
1092 const struct native_mode **native_modes;
1093 - EGLint num_modes, j;
1094 + int num_modes, j;
1096 /* TODO support for hotplug */
1097 native_modes =
1098 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_loader.h ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_loader.h
1099 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_loader.h 2011-07-09 03:37:09.000000000 +0200
1100 +++ ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_loader.h 2011-09-05 20:03:01.000000000 +0200
1101 @@ -40,8 +40,10 @@
1102 uint profile_masks[ST_API_COUNT];
1103 struct st_api *(*get_st_api)(enum st_api_type api);
1105 +#if !defined(PIPE_OS_AROS)
1106 struct pipe_screen *(*create_drm_screen)(const char *name, int fd);
1107 struct pipe_screen *(*create_sw_screen)(struct sw_winsys *ws);
1108 +#endif
1111 _EGLDriver *
1112 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_st.c ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_st.c
1113 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/egl_g3d_st.c 2011-07-07 02:04:59.000000000 +0200
1114 +++ ./mesa/src/gallium/state_trackers/egl/common/egl_g3d_st.c 2011-09-05 20:03:01.000000000 +0200
1115 @@ -207,6 +207,7 @@
1116 struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS];
1117 uint attachment_mask = 0;
1118 unsigned i;
1119 + int w, h;
1121 for (i = 0; i < count; i++) {
1122 int natt;
1123 @@ -234,10 +235,12 @@
1126 if (!gsurf->native->validate(gsurf->native, attachment_mask,
1127 - &gsurf->sequence_number, textures, &gsurf->base.Width,
1128 - &gsurf->base.Height))
1129 + &gsurf->sequence_number, textures, &w, &h)) {
1130 + gsurf->base.Width = w;
1131 + gsurf->base.Height = h;
1132 return FALSE;
1136 for (i = 0; i < count; i++) {
1137 struct pipe_resource *tex;
1138 int natt;
1139 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/native.h ./mesa/src/gallium/state_trackers/egl/common/native.h
1140 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/native.h 2011-07-09 03:37:09.000000000 +0200
1141 +++ ./mesa/src/gallium/state_trackers/egl/common/native.h 2011-09-05 20:03:01.000000000 +0200
1142 @@ -220,10 +220,12 @@
1143 struct native_surface *nsurf,
1144 unsigned int seq_num);
1146 +#if !defined(PIPE_OS_AROS)
1147 struct pipe_screen *(*new_drm_screen)(struct native_display *ndpy,
1148 const char *name, int fd);
1149 struct pipe_screen *(*new_sw_screen)(struct native_display *ndpy,
1150 struct sw_winsys *ws);
1151 +#endif
1153 struct pipe_resource *(*lookup_egl_image)(struct native_display *ndpy,
1154 void *egl_image);
1155 @@ -288,8 +290,14 @@
1156 const struct native_platform *
1157 native_get_fbdev_platform(const struct native_event_handler *event_handler);
1159 +#if defined(PIPE_OS_AROS)
1160 +const struct native_platform *
1161 +native_get_aros_platform(const struct native_event_handler *event_handler);
1162 +#endif
1164 #ifdef __cplusplus
1166 #endif
1169 #endif /* _NATIVE_H_ */
1170 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/native_helper.c ./mesa/src/gallium/state_trackers/egl/common/native_helper.c
1171 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/egl/common/native_helper.c 2011-07-09 03:37:09.000000000 +0200
1172 +++ ./mesa/src/gallium/state_trackers/egl/common/native_helper.c 2013-03-13 22:19:46.000000000 +0100
1173 @@ -282,10 +282,10 @@
1174 btex, 0, &src_box);
1175 ret = TRUE;
1177 - out_no_ftex:
1178 pipe_resource_reference(&btex, NULL);
1179 out_no_btex:
1180 pipe_resource_reference(&ftex, NULL);
1181 + out_no_ftex:
1183 return ret;
1185 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/vega/mask.c ./mesa/src/gallium/state_trackers/vega/mask.c
1186 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/vega/mask.c 2011-07-09 03:37:09.000000000 +0200
1187 +++ ./mesa/src/gallium/state_trackers/vega/mask.c 2011-09-05 20:03:01.000000000 +0200
1188 @@ -384,9 +384,11 @@
1189 VGint width, VGint height,
1190 VGfloat value)
1192 +#if 0 /* unused */
1193 VGfloat alpha_color[4] = {0, 0, 0, 0};
1195 alpha_color[3] = value;
1196 +#endif
1198 mask_resource_fill(layer->sampler_view->texture,
1199 x, y, width, height, value);
1200 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/vega/path.c ./mesa/src/gallium/state_trackers/vega/path.c
1201 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/state_trackers/vega/path.c 2011-01-23 03:05:41.000000000 +0100
1202 +++ ./mesa/src/gallium/state_trackers/vega/path.c 2011-09-05 20:03:01.000000000 +0200
1203 @@ -1093,8 +1093,8 @@
1204 y2 = data[1];
1205 x3 = data[2];
1206 y3 = data[3];
1207 - map_if_relative(pd->ox, pd->oy, relative, &x2, &y2);
1208 - map_if_relative(pd->ox, pd->oy, relative, &x3, &y3);
1209 + map_if_relative(x0, y0, relative, &x2, &y2);
1210 + map_if_relative(x0, y0, relative, &x3, &y3);
1211 pd->ox = x3;
1212 pd->oy = y3;
1213 pd->px = x2;
1214 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/targets/egl-static/egl.c ./mesa/src/gallium/targets/egl-static/egl.c
1215 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/targets/egl-static/egl.c 2011-07-09 03:37:09.000000000 +0200
1216 +++ ./mesa/src/gallium/targets/egl-static/egl.c 2011-09-05 20:03:01.000000000 +0200
1217 @@ -60,6 +60,7 @@
1218 return stmod->stapi;
1221 +#if !defined(PIPE_OS_AROS)
1222 static const char *
1223 drm_fd_get_screen_name(int fd)
1225 @@ -145,6 +146,7 @@
1227 return egl_pipe_create_swrast_screen(ws);
1229 +#endif
1231 static const struct egl_g3d_loader *
1232 loader_init(void)
1233 @@ -155,8 +157,10 @@
1234 egl_g3d_loader.profile_masks[i] = egl_st_get_profile_mask(i);
1236 egl_g3d_loader.get_st_api = get_st_api;
1237 +#if !defined(PIPE_OS_AROS)
1238 egl_g3d_loader.create_drm_screen = create_drm_screen;
1239 egl_g3d_loader.create_sw_screen = create_sw_screen;
1240 +#endif
1242 return &egl_g3d_loader;
1244 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/gallium/targets/egl-static/st_GL.c ./mesa/src/gallium/targets/egl-static/st_GL.c
1245 --- /data/deadwood/source/Mesa-7.11-staging/src/gallium/targets/egl-static/st_GL.c 2011-07-09 03:37:09.000000000 +0200
1246 +++ ./mesa/src/gallium/targets/egl-static/st_GL.c 2012-01-21 20:54:03.000000000 +0100
1247 @@ -1,38 +1,33 @@
1249 - * Mesa 3-D graphics library
1250 - * Version: 7.10
1252 - * Copyright (C) 2011 LunarG Inc.
1254 - * Permission is hereby granted, free of charge, to any person obtaining a
1255 - * copy of this software and associated documentation files (the "Software"),
1256 - * to deal in the Software without restriction, including without limitation
1257 - * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1258 - * and/or sell copies of the Software, and to permit persons to whom the
1259 - * Software is furnished to do so, subject to the following conditions:
1261 - * The above copyright notice and this permission notice shall be included
1262 - * in all copies or substantial portions of the Software.
1264 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1265 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1266 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1267 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1268 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1269 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1270 - * DEALINGS IN THE SOFTWARE.
1272 - * Authors:
1273 - * Chia-I Wu <olv@lunarg.com>
1274 - */
1275 -#include "state_tracker/st_gl_api.h"
1276 -#include "pipe/p_compiler.h"
1277 +#include <proto/exec.h>
1278 +#if !defined(__mc68000)
1279 +#include <proto/mesa.h>
1280 +#endif
1281 +#include <aros/symbolsets.h>
1283 -PUBLIC struct st_api *
1284 -st_api_create_OpenGL(void);
1285 +#include "egl_st.h"
1287 -struct st_api *
1288 -st_api_create_OpenGL(void)
1289 +struct Library * MesaBase = NULL;
1291 +PUBLIC struct st_api * st_gl_api_create(void)
1293 +#if !defined(__mc68000)
1294 + if (!MesaBase)
1295 + MesaBase = OpenLibrary("mesa.library", 0L);
1297 + if (MesaBase)
1298 + return (struct st_api *) AROSMesaGetOpenGLStateTrackerApi();
1299 + else
1300 +#endif
1301 + return NULL;
1304 +static VOID CloseMesa()
1306 - return st_gl_api_create();
1307 + if (MesaBase)
1309 + CloseLibrary(MesaBase);
1310 + MesaBase = NULL;
1314 +ADD2EXPUNGELIB(CloseMesa, 5)
1315 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir_function.cpp ./mesa/src/glsl/ir_function.cpp
1316 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir_function.cpp 2011-07-20 01:39:56.000000000 +0200
1317 +++ ./mesa/src/glsl/ir_function.cpp 2013-01-04 19:25:40.000000000 +0100
1318 @@ -111,7 +111,7 @@
1319 * but the actual parameter can be coerced to the type of the declared
1320 * parameter, the match score is one.
1322 - int score;
1323 + int score = -1;
1324 switch ((enum ir_variable_mode)(param->mode)) {
1325 case ir_var_auto:
1326 case ir_var_uniform:
1327 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir_function_detect_recursion.cpp ./mesa/src/glsl/ir_function_detect_recursion.cpp
1328 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir_function_detect_recursion.cpp 2011-07-23 10:54:07.000000000 +0200
1329 +++ ./mesa/src/glsl/ir_function_detect_recursion.cpp 2013-10-03 18:47:38.000000000 +0200
1330 @@ -238,7 +238,11 @@
1331 bool progress;
1334 -static void
1335 +/* AROS: Removing static fixes an invalid compilation under
1336 + * gcc 4.6.2 -O2 mode where code generated remove_unlinked_functions
1337 + * in would loop indefinatelly
1338 + */
1339 +void
1340 destroy_links(exec_list *list, function *f)
1342 foreach_list_safe(node, list) {
1343 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir.h ./mesa/src/glsl/ir.h
1344 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/ir.h 2011-07-23 10:54:07.000000000 +0200
1345 +++ ./mesa/src/glsl/ir.h 2013-01-04 19:25:40.000000000 +0100
1346 @@ -41,6 +41,14 @@
1347 * @{
1350 +#if defined(__AROS__)
1351 +#include <aros/debug.h>
1352 +#undef VOLATILE
1353 +#undef STATIC
1354 +#define log2(x) ((float) (log(x) * 1.442695f))
1355 +#define printf(fmt, ...) bug(fmt, ##__VA_ARGS__)
1356 +#endif
1359 * Class tags
1361 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/ralloc.c ./mesa/src/glsl/ralloc.c
1362 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/ralloc.c 2011-07-09 03:31:41.000000000 +0200
1363 +++ ./mesa/src/glsl/ralloc.c 2011-09-05 20:03:01.000000000 +0200
1364 @@ -28,6 +28,10 @@
1365 #include <string.h>
1366 #include <stdint.h>
1368 +#if defined(__AROS__)
1369 +#define SIZE_MAX INT32_MAX
1370 +#endif
1372 #include "ralloc.h"
1374 #ifdef __GNUC__
1375 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/ralloc.h ./mesa/src/glsl/ralloc.h
1376 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/ralloc.h 2011-07-09 03:31:41.000000000 +0200
1377 +++ ./mesa/src/glsl/ralloc.h 2011-09-05 20:03:01.000000000 +0200
1378 @@ -53,7 +53,9 @@
1380 #include <stddef.h>
1381 #include <stdarg.h>
1382 +#ifndef __cplusplus
1383 #include <stdbool.h>
1384 +#endif
1387 * \def ralloc(ctx, type)
1388 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glsl/s_expression.cpp ./mesa/src/glsl/s_expression.cpp
1389 --- /data/deadwood/source/Mesa-7.11-staging/src/glsl/s_expression.cpp 2011-07-09 03:32:30.000000000 +0200
1390 +++ ./mesa/src/glsl/s_expression.cpp 2011-09-05 20:03:01.000000000 +0200
1391 @@ -25,6 +25,11 @@
1392 #include <assert.h>
1393 #include "s_expression.h"
1395 +#if defined(__AROS__)
1396 +#include <aros/debug.h>
1397 +#define printf(fmt, ...) bug(fmt, ##__VA_ARGS__)
1398 +#endif
1400 s_symbol::s_symbol(const char *tmp, size_t n)
1402 this->str = ralloc_strndup (this, tmp, n);
1403 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/glu/sgi/libutil/mipmap.c ./mesa/src/glu/sgi/libutil/mipmap.c
1404 --- /data/deadwood/source/Mesa-7.11-staging/src/glu/sgi/libutil/mipmap.c 2011-07-09 03:37:10.000000000 +0200
1405 +++ ./mesa/src/glu/sgi/libutil/mipmap.c 2011-09-05 20:03:01.000000000 +0200
1406 @@ -4886,7 +4886,7 @@
1407 GLint group_size;
1408 GLint elements_per_line;
1409 const GLubyte *start;
1410 - const GLubyte *iter;
1411 + const GLubyte *iter = NULL;
1412 GLushort *iter2;
1413 GLint i, j, k;
1414 GLint myswap_bytes;
1415 @@ -5149,7 +5149,7 @@
1416 GLint group_size;
1417 GLint elements_per_line;
1418 GLubyte *start;
1419 - GLubyte *iter;
1420 + GLubyte *iter = NULL;
1421 const GLushort *iter2;
1422 GLint i, j, k;
1423 GLint myswap_bytes;
1424 @@ -6034,7 +6034,7 @@
1425 int i,j,k,xindex;
1427 const char *temp, *temp0;
1428 - int outindex;
1429 + int outindex = 0;
1431 int lowx_int, highx_int, lowy_int, highy_int;
1432 float x_percent, y_percent;
1433 @@ -6695,7 +6695,7 @@
1434 int elementsPerLine;
1435 int rowsPerImage;
1436 int imageSize;
1437 - const GLubyte *start, *rowStart, *iter;
1438 + const GLubyte *start, *rowStart, *iter = NULL;
1439 GLushort *iter2;
1440 int ww, hh, dd, k;
1442 @@ -7057,7 +7057,7 @@
1443 int groupSize;
1444 int rowSize;
1445 int padding;
1446 - GLubyte *start, *rowStart, *iter;
1447 + GLubyte *start, *rowStart, *iter = NULL;
1448 int elementsPerLine;
1449 const GLushort *iter2;
1450 int ii, jj, dd, k;
1451 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_API.xml ./mesa/src/mapi/glapi/gen/gl_API.xml
1452 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_API.xml 2011-07-09 03:37:10.000000000 +0200
1453 +++ ./mesa/src/mapi/glapi/gen/gl_API.xml 2011-09-05 20:03:01.000000000 +0200
1454 @@ -12318,7 +12318,7 @@
1455 <function name="TextureRangeAPPLE" offset="assign" static_dispatch="false">
1456 <param name="target" type="GLenum"/>
1457 <param name="length" type="GLsizei"/>
1458 - <param name="pointer" type="GLvoid *"/>
1459 + <param name="pointer" type="const GLvoid *"/>
1460 </function>
1461 <function name="GetTexParameterPointervAPPLE" offset="assign" static_dispatch="false">
1462 <param name="target" type="GLenum"/>
1463 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_procs.py ./mesa/src/mapi/glapi/gen/gl_procs.py
1464 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_procs.py 2011-01-06 01:19:15.000000000 +0100
1465 +++ ./mesa/src/mapi/glapi/gen/gl_procs.py 2011-09-08 18:20:04.000000000 +0200
1466 @@ -107,7 +107,11 @@
1467 for func in api.functionIterateByOffset():
1468 for n in func.entry_points:
1469 if n != func.name:
1470 - name = func.dispatch_name()
1471 + # AROS: call into a static dispach instead of alliased function dispatch
1472 + # This will be needed as long as gl_procs.h is used to generate the
1473 + # AROSMesaGetProcAddress function table which is located in libGL.a
1474 + # name = func.dispatch_name()
1475 + name = n
1476 self.printFunctionString( n )
1478 if func.has_different_protocol(n):
1479 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_XML.py ./mesa/src/mapi/glapi/gen/gl_XML.py
1480 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/gl_XML.py 2011-07-09 03:37:10.000000000 +0200
1481 +++ ./mesa/src/mapi/glapi/gen/gl_XML.py 2011-09-05 20:03:01.000000000 +0200
1482 @@ -629,8 +629,9 @@
1483 name = element.nsProp( "name", None )
1484 alias = element.nsProp( "alias", None )
1486 - if is_attr_true(element, "static_dispatch"):
1487 - self.static_entry_points.append(name)
1488 + # if is_attr_true(element, "static_dispatch"):
1489 + # AROS version requires all entry points to be available in library base
1490 + self.static_entry_points.append( name )
1492 self.entry_points.append( name )
1493 if alias:
1494 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/Makefile ./mesa/src/mapi/glapi/gen/Makefile
1495 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/gen/Makefile 2011-07-09 03:37:10.000000000 +0200
1496 +++ ./mesa/src/mapi/glapi/gen/Makefile 2011-09-05 20:03:01.000000000 +0200
1497 @@ -5,7 +5,9 @@
1500 TOP = ../../../..
1501 -include $(TOP)/configs/current
1502 +#include $(TOP)/configs/current
1503 +PYTHON2 = python
1504 +PYTHON_FLAGS = -t -O -O
1506 MESA_DIR = $(TOP)/src/mesa
1507 MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi
1508 @@ -30,11 +32,12 @@
1509 $(MESA_DIR)/main/enums.c \
1510 $(MESA_DIR)/main/dispatch.h \
1511 $(MESA_DIR)/main/remap_helper.h \
1512 - $(MESA_GLX_DIR)/indirect.c \
1513 - $(MESA_GLX_DIR)/indirect.h \
1514 - $(MESA_GLX_DIR)/indirect_init.c \
1515 - $(MESA_GLX_DIR)/indirect_size.h \
1516 - $(MESA_GLX_DIR)/indirect_size.c
1518 +# $(MESA_GLX_DIR)/indirect.c \
1519 +# $(MESA_GLX_DIR)/indirect.h \
1520 +# $(MESA_GLX_DIR)/indirect_init.c \
1521 +# $(MESA_GLX_DIR)/indirect_size.h \
1522 +# $(MESA_GLX_DIR)/indirect_size.c
1524 ######################################################################
1526 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi_entrypoint.c ./mesa/src/mapi/glapi/glapi_entrypoint.c
1527 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi_entrypoint.c 2010-10-19 19:58:29.000000000 +0200
1528 +++ ./mesa/src/mapi/glapi/glapi_entrypoint.c 2011-09-05 20:03:01.000000000 +0200
1529 @@ -309,10 +309,12 @@
1531 #else /* USE_*_ASM */
1533 +#if defined(PTHREADS) || defined(GLX_USE_TLS)
1534 static void
1535 init_glapi_relocs( void )
1538 +#endif
1541 _glapi_proc
1542 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi_gentable.c ./mesa/src/mapi/glapi/glapi_gentable.c
1543 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi_gentable.c 2011-07-09 03:37:10.000000000 +0200
1544 +++ ./mesa/src/mapi/glapi/glapi_gentable.c 2011-09-07 20:43:14.000000000 +0200
1545 @@ -27,6 +27,7 @@
1546 * SOFTWARE.
1549 +#if !defined(__AROS__)
1551 #if defined(DEBUG) && !defined(_WIN32_WCE)
1552 #include <execinfo.h>
1553 @@ -8727,6 +8728,13 @@
1555 if(!disp->FramebufferTextureLayerEXT) {
1556 void ** procp = (void **) &disp->FramebufferTextureLayerEXT;
1557 + snprintf(symboln, sizeof(symboln), "%sFramebufferTextureLayerARB", symbol_prefix);
1558 + *procp = dlsym(handle, symboln);
1562 + if(!disp->FramebufferTextureLayerEXT) {
1563 + void ** procp = (void **) &disp->FramebufferTextureLayerEXT;
1564 snprintf(symboln, sizeof(symboln), "%sFramebufferTextureLayerEXT", symbol_prefix);
1565 *procp = dlsym(handle, symboln);
1567 @@ -9135,4 +9143,5 @@
1569 return disp;
1571 +#endif
1573 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi.h ./mesa/src/mapi/glapi/glapi.h
1574 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/glapi/glapi.h 2011-07-09 03:37:10.000000000 +0200
1575 +++ ./mesa/src/mapi/glapi/glapi.h 2011-09-05 20:03:01.000000000 +0200
1576 @@ -92,6 +92,17 @@
1577 # define GET_DISPATCH() _glapi_tls_Dispatch
1578 # define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
1580 +#elif defined(__AROS__)
1582 +#define GET_DISPATCH() _glapi_get_dispatch()
1583 +#define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_get_context()
1585 #else
1587 _GLAPI_EXPORT extern struct _glapi_table *_glapi_Dispatch;
1588 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/mapi/u_current.c ./mesa/src/mapi/mapi/u_current.c
1589 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/mapi/u_current.c 2011-07-09 03:37:10.000000000 +0200
1590 +++ ./mesa/src/mapi/mapi/u_current.c 2011-12-17 11:25:59.000000000 +0100
1591 @@ -108,9 +108,17 @@
1593 #else
1595 +#if defined(__AROS__)
1596 +#include "aros/tls.h"
1598 +DECLARE_STATIC_TLS(u_current_table);
1599 +DECLARE_STATIC_TLS(u_current_user);
1601 +#else
1602 struct mapi_table *u_current_table =
1603 (struct mapi_table *) table_noop_array;
1604 void *u_current_user;
1605 +#endif
1607 #ifdef THREADS
1608 struct u_tsd u_current_table_tsd;
1609 @@ -200,6 +208,8 @@
1610 #elif defined(THREADS)
1611 u_tsd_set(&u_current_user_tsd, (void *) ptr);
1612 u_current_user = (ThreadSafe) ? NULL : (void *) ptr;
1613 +#elif defined(__AROS__)
1614 + InsertIntoTLS(u_current_user, (APTR)ptr);
1615 #else
1616 u_current_user = (void *) ptr;
1617 #endif
1618 @@ -219,6 +229,8 @@
1619 return (ThreadSafe)
1620 ? u_tsd_get(&u_current_user_tsd)
1621 : u_current_user;
1622 +#elif defined(__AROS__)
1623 + return GetFromTLS(u_current_user);
1624 #else
1625 return u_current_user;
1626 #endif
1627 @@ -244,6 +256,8 @@
1628 #elif defined(THREADS)
1629 u_tsd_set(&u_current_table_tsd, (void *) tbl);
1630 u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
1631 +#elif defined(__AROS__)
1632 + InsertIntoTLS(u_current_table, (APTR)tbl);
1633 #else
1634 u_current_table = (struct mapi_table *) tbl;
1635 #endif
1636 @@ -260,6 +274,12 @@
1637 #elif defined(THREADS)
1638 return (struct mapi_table *) ((ThreadSafe) ?
1639 u_tsd_get(&u_current_table_tsd) : (void *) u_current_table);
1640 +#elif defined(__AROS__)
1641 + struct mapi_table *tbl;
1642 + tbl = (struct mapi_table *)GetFromTLS(u_current_table);
1643 + if (tbl == NULL)
1644 + tbl = (struct mapi_table *) table_noop_array;
1645 + return tbl;
1646 #else
1647 return u_current_table;
1648 #endif
1649 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mapi/mapi/u_current.h ./mesa/src/mapi/mapi/u_current.h
1650 --- /data/deadwood/source/Mesa-7.11-staging/src/mapi/mapi/u_current.h 2011-05-13 01:47:18.000000000 +0200
1651 +++ ./mesa/src/mapi/mapi/u_current.h 2011-09-05 20:03:01.000000000 +0200
1652 @@ -36,6 +36,8 @@
1653 extern __thread void *u_current_user
1654 __attribute__((tls_model("initial-exec")));
1656 +#elif defined(__AROS__)
1658 #else /* GLX_USE_TLS */
1660 extern struct mapi_table *u_current_table;
1661 @@ -68,6 +70,8 @@
1663 #ifdef GLX_USE_TLS
1664 return u_current_table;
1665 +#elif defined(__AROS__)
1666 + return u_current_get_internal();
1667 #else
1668 return (likely(u_current_table) ?
1669 u_current_table : u_current_get_internal());
1670 @@ -79,6 +83,8 @@
1672 #ifdef GLX_USE_TLS
1673 return u_current_user;
1674 +#elif defined(__AROS__)
1675 + return u_current_get_user_internal();
1676 #else
1677 return likely(u_current_user) ? u_current_user : u_current_get_user_internal();
1678 #endif
1679 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/compiler.h ./mesa/src/mesa/main/compiler.h
1680 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/compiler.h 2011-07-09 03:37:10.000000000 +0200
1681 +++ ./mesa/src/mesa/main/compiler.h 2011-09-05 20:03:01.000000000 +0200
1682 @@ -255,6 +255,8 @@
1683 #elif defined(__APPLE__)
1684 #include <CoreFoundation/CFByteOrder.h>
1685 #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
1686 +#elif defined(__AROS__)
1687 +#define CPU_TO_LE32( x ) AROS_BE2LONG( x )
1688 #elif (defined(_AIX) || defined(__blrts))
1689 static INLINE GLuint CPU_TO_LE32(GLuint x)
1691 @@ -322,6 +324,9 @@
1693 * ASSERT macro
1695 +#if defined(__AROS__)
1696 +#undef ASSERT
1697 +#endif
1698 #if !defined(_WIN32_WCE)
1699 #if defined(BUILD_FOR_SNAP) && defined(CHECKED)
1700 # define ASSERT(X) _CHECK(X)
1701 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/dispatch.h ./mesa/src/mesa/main/dispatch.h
1702 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/dispatch.h 2011-07-09 03:37:10.000000000 +0200
1703 +++ ./mesa/src/mesa/main/dispatch.h 2011-09-07 20:43:00.000000000 +0200
1704 @@ -12099,14 +12099,14 @@
1705 SET_by_offset(disp, _gloffset_GetTexParameterPointervAPPLE, fn);
1708 -typedef void (GLAPIENTRYP _glptr_TextureRangeAPPLE)(GLenum, GLsizei, GLvoid *);
1709 +typedef void (GLAPIENTRYP _glptr_TextureRangeAPPLE)(GLenum, GLsizei, const GLvoid *);
1710 #define CALL_TextureRangeAPPLE(disp, parameters) \
1711 (* GET_TextureRangeAPPLE(disp)) parameters
1712 static INLINE _glptr_TextureRangeAPPLE GET_TextureRangeAPPLE(struct _glapi_table *disp) {
1713 return (_glptr_TextureRangeAPPLE) (GET_by_offset(disp, _gloffset_TextureRangeAPPLE));
1716 -static INLINE void SET_TextureRangeAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLvoid *)) {
1717 +static INLINE void SET_TextureRangeAPPLE(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, const GLvoid *)) {
1718 SET_by_offset(disp, _gloffset_TextureRangeAPPLE, fn);
1721 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/dlist.c ./mesa/src/mesa/main/dlist.c
1722 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/dlist.c 2011-07-09 03:37:10.000000000 +0200
1723 +++ ./mesa/src/mesa/main/dlist.c 2011-09-05 20:03:01.000000000 +0200
1724 @@ -7541,6 +7541,7 @@
1725 CALL_Clear(ctx->Exec, (n[1].bf));
1726 break;
1727 case OPCODE_CLEAR_BUFFER_IV:
1728 +#if 0 /* unused */
1730 GLint value[4];
1731 value[0] = n[3].i;
1732 @@ -7549,8 +7550,10 @@
1733 value[3] = n[6].i;
1734 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
1736 +#endif
1737 break;
1738 case OPCODE_CLEAR_BUFFER_UIV:
1739 +#if 0 /* unused */
1741 GLuint value[4];
1742 value[0] = n[3].ui;
1743 @@ -7559,8 +7562,10 @@
1744 value[3] = n[6].ui;
1745 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
1747 +#endif
1748 break;
1749 case OPCODE_CLEAR_BUFFER_FV:
1750 +#if 0 /* unused */
1752 GLfloat value[4];
1753 value[0] = n[3].f;
1754 @@ -7569,6 +7574,7 @@
1755 value[3] = n[6].f;
1756 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
1758 +#endif
1759 break;
1760 case OPCODE_CLEAR_BUFFER_FI:
1761 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
1762 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/imports.c ./mesa/src/mesa/main/imports.c
1763 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/imports.c 2011-07-09 03:37:10.000000000 +0200
1764 +++ ./mesa/src/mesa/main/imports.c 2011-09-05 20:03:01.000000000 +0200
1765 @@ -453,14 +453,14 @@
1766 #endif
1769 -#ifndef __GNUC__
1770 +#if !defined(__GNUC__) || defined(__AROS__)
1772 * Find the first bit set in a word.
1775 _mesa_ffs(int32_t i)
1777 -#if (defined(_WIN32) ) || defined(__IBMC__) || defined(__IBMCPP__)
1778 +#if (defined(_WIN32) ) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__AROS__)
1779 register int bit = 0;
1780 if (i != 0) {
1781 if ((i & 0xffff) == 0) {
1782 @@ -513,7 +513,7 @@
1784 #endif
1786 -#if !defined(__GNUC__) ||\
1787 +#if !defined(__GNUC__) || defined(__AROS__) ||\
1788 ((_GNUC__ == 3 && __GNUC_MINOR__ < 4) && __GNUC__ < 4)
1790 * Return number of bits set in given GLuint.
1791 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/imports.h ./mesa/src/mesa/main/imports.h
1792 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/imports.h 2011-07-09 03:37:10.000000000 +0200
1793 +++ ./mesa/src/mesa/main/imports.h 2011-09-05 20:03:01.000000000 +0200
1794 @@ -560,7 +560,7 @@
1795 extern void
1796 _mesa_init_sqrt_table(void);
1798 -#ifdef __GNUC__
1799 +#if defined(__GNUC__) && !defined(__AROS__)
1801 #ifdef __MINGW32__
1802 #define ffs __builtin_ffs
1803 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/querymatrix.c ./mesa/src/mesa/main/querymatrix.c
1804 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/querymatrix.c 2010-12-14 22:43:15.000000000 +0100
1805 +++ ./mesa/src/mesa/main/querymatrix.c 2011-08-31 12:37:50.000000000 +0200
1806 @@ -76,6 +76,10 @@
1807 (defined(__sun) && defined(__GNUC__))
1809 /* fpclassify is available. */
1810 +#elif defined(__AROS__)
1812 +#undef fpclassify
1813 +#define fpclassify(x) FP_NORMAL
1815 #elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600
1817 diff -ur '--exclude-from=./mesa/src/aros/mesa.diff.excluded' -I '^.*\bRevision.*Date.*\b.*$' /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/version.c ./mesa/src/mesa/main/version.c
1818 --- /data/deadwood/source/Mesa-7.11-staging/src/mesa/main/version.c 2011-07-09 03:37:10.000000000 +0200
1819 +++ ./mesa/src/mesa/main/version.c 2011-09-05 20:03:01.000000000 +0200
1820 @@ -25,7 +25,9 @@
1821 #include "imports.h"
1822 #include "mtypes.h"
1823 #include "version.h"
1824 +#ifdef MESA_GIT_SHA1
1825 #include "git_sha1.h"
1826 +#endif