Mesa (master): sched.h needs to be imported on Darwin/OSX targets.
Module: Mesa Branch: master Commit: 361f79c97f6eb4bfdb2162672d2ca8f3c486f22c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=361f79c97f6eb4bfdb2162672d2ca8f3c486f22c Author: Apple SWE Date: Tue Mar 13 18:29:45 2018 -0700 sched.h needs to be imported on Darwin/OSX targets. sched_yield is used but the include reference on Darwin is missing. This patch conditionally guards on Darwin/OSX to import sched.h first. Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/swr_fence.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/swr/swr_fence.cpp b/src/gallium/drivers/swr/swr_fence.cpp index 3005eb9aaa..b05ac8cec0 100644 --- a/src/gallium/drivers/swr/swr_fence.cpp +++ b/src/gallium/drivers/swr/swr_fence.cpp @@ -29,6 +29,10 @@ #include "swr_screen.h" #include "swr_fence.h" +#ifdef __APPLE__ +#include +#endif + #if defined(PIPE_CC_MSVC) // portable thread yield #define sched_yield SwitchToThread #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Add processor topology calculation implementation for Darwin/OSX targets.
Module: Mesa Branch: master Commit: 67f27b1e18d8e68c795f2eb43c06abfe4b6fcaca URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=67f27b1e18d8e68c795f2eb43c06abfe4b6fcaca Author: Apple SWE Date: Tue Mar 13 18:24:26 2018 -0700 Add processor topology calculation implementation for Darwin/OSX targets. The implementation for bootstrapping SWR on Darwin targets is based on the Linux version. Instead of reading the output of /proc/cpuinfo, sysctlbyname is used to determine the physical identifiers, processor identifiers, core counts and thread-processor affinities. With this patch, it is possible to use SWR as an alternate renderer on OSX to softpipe and llvmpipe. Reviewed-by: Jeremy Huddleston Sequoia Reviewed-by: Bruce Cherniak --- .../drivers/swr/rasterizer/core/threads.cpp| 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp b/src/gallium/drivers/swr/rasterizer/core/threads.cpp index 4d79168d2d..3eb20abcbf 100644 --- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp @@ -36,6 +36,11 @@ #include #endif +#ifdef __APPLE__ +#include +#include +#endif + #include "common/os.h" #include "context.h" #include "frontend.h" @@ -219,6 +224,56 @@ void CalculateProcessorTopology(CPUNumaNodes& out_nodes, uint32_t& out_numThread #elif defined(__APPLE__) +auto numProcessors = 0; +auto numCores = 0; +auto numPhysicalIds = 0; + +int value; +size_t size = sizeof(value); + +int result = sysctlbyname("hw.packages", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numPhysicalIds = value; + +result = sysctlbyname("hw.logicalcpu", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numProcessors = value; + +result = sysctlbyname("hw.physicalcpu", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numCores = value; + +out_nodes.resize(numPhysicalIds); + +for (auto physId = 0; physId < numPhysicalIds; ++physId) +{ +auto &numaNode = out_nodes[physId]; +auto procId = 0; + +numaNode.cores.resize(numCores); + +while (procId < numProcessors) +{ +for (auto coreId = 0; coreId < numaNode.cores.size(); ++coreId, ++procId) +{ +auto &core = numaNode.cores[coreId]; + +core.procGroup = coreId; +core.threadIds.push_back(procId); +} +} +} + +out_numThreadsPerProcGroup = 0; + +for (auto &node : out_nodes) +{ +for (auto &core : node.cores) +{ +out_numThreadsPerProcGroup += core.threadIds.size(); +} +} + #else #error Unsupported platform @@ -253,7 +308,6 @@ void CalculateProcessorTopology(CPUNumaNodes& out_nodes, uint32_t& out_numThread } } - void bindThread(SWR_CONTEXT* pContext, uint32_t threadId, uint32_t procGroupId = 0, bool bindProcGroup=false) { // Only bind threads when MAX_WORKER_THREADS isn't set. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): sched.h needs to be imported on Darwin/OSX targets.
Module: Mesa Branch: master Commit: 9dc5063262d0a5130cf0723a33079f3fd17560c3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dc5063262d0a5130cf0723a33079f3fd17560c3 Author: Apple SWE Date: Tue Mar 13 18:29:45 2018 -0700 sched.h needs to be imported on Darwin/OSX targets. sched_yield is used but the include reference on Darwin is missing. This patch conditionally guards on Darwin/OSX to import sched.h first. Reviewed-by: Jeremy Huddleston Sequoia Signed-off-by: Jeremy Huddleston Sequoia --- src/gallium/drivers/swr/swr_fence.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/swr/swr_fence.cpp b/src/gallium/drivers/swr/swr_fence.cpp index 3005eb9aaa..b05ac8cec0 100644 --- a/src/gallium/drivers/swr/swr_fence.cpp +++ b/src/gallium/drivers/swr/swr_fence.cpp @@ -29,6 +29,10 @@ #include "swr_screen.h" #include "swr_fence.h" +#ifdef __APPLE__ +#include +#endif + #if defined(PIPE_CC_MSVC) // portable thread yield #define sched_yield SwitchToThread #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Add processor topology calculation implementation for Darwin/OSX targets.
Module: Mesa Branch: master Commit: de0d10db93d85de79c7b4451c4851ace2976f8f4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=de0d10db93d85de79c7b4451c4851ace2976f8f4 Author: Apple SWE Date: Tue Mar 13 18:24:26 2018 -0700 Add processor topology calculation implementation for Darwin/OSX targets. The implementation for bootstrapping SWR on Darwin targets is based on the Linux version. Instead of reading the output of /proc/cpuinfo, sysctlbyname is used to determine the physical identifiers, processor identifiers, core counts and thread-processor affinities. With this patch, it is possible to use SWR as an alternate renderer on OSX to softpipe and llvmpipe. Reviewed-by: Jeremy Huddleston Sequoia Signed-off-by: Jeremy Huddleston Sequoia --- .../drivers/swr/rasterizer/core/threads.cpp| 55 ++ 1 file changed, 55 insertions(+) diff --git a/src/gallium/drivers/swr/rasterizer/core/threads.cpp b/src/gallium/drivers/swr/rasterizer/core/threads.cpp index 4d79168d2d..fd7a42e472 100644 --- a/src/gallium/drivers/swr/rasterizer/core/threads.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/threads.cpp @@ -36,6 +36,11 @@ #include #endif +#ifdef __APPLE__ +#include +#include +#endif + #include "common/os.h" #include "context.h" #include "frontend.h" @@ -253,6 +258,56 @@ void CalculateProcessorTopology(CPUNumaNodes& out_nodes, uint32_t& out_numThread } } +auto numProcessors = 0; +auto numCores = 0; +auto numPhysicalIds = 0; + +int value; +size_t size = sizeof(value); + +int result = sysctlbyname("hw.packages", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numPhysicalIds = value; + +result = sysctlbyname("hw.logicalcpu", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numProcessors = value; + +result = sysctlbyname("hw.physicalcpu", &value, &size, NULL, 0); +SWR_ASSERT(result == 0); +numCores = value; + +out_nodes.resize(numPhysicalIds); + +for (auto physId = 0; physId < numPhysicalIds; ++physId) +{ +auto &numaNode = out_nodes[physId]; +auto procId = 0; + +numaNode.cores.resize(numCores); + +while (procId < numProcessors) +{ +for (auto coreId = 0; coreId < numaNode.cores.size(); ++coreId, ++procId) +{ +auto &core = numaNode.cores[coreId]; + +core.procGroup = coreId; +core.threadIds.push_back(procId); +} +} +} + +out_numThreadsPerProcGroup = 0; + +for (auto &node : out_nodes) +{ +for (auto &core : node.cores) +{ +out_numThreadsPerProcGroup += core.threadIds.size(); +} +} + void bindThread(SWR_CONTEXT* pContext, uint32_t threadId, uint32_t procGroupId = 0, bool bindProcGroup=false) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB
Module: Mesa Branch: master Commit: e7ef901650b92052d07f578a7884c53e93554d4c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7ef901650b92052d07f578a7884c53e93554d4c Author: Jeremy Huddleston Sequoia Date: Sun May 8 00:47:10 2016 -0700 mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Matt Turner --- src/mesa/main/shaderapi.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 6dd617be7e..7282435583 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -513,10 +513,12 @@ detach_shader_no_error(struct gl_context *ctx, GLuint program, GLuint shader) /** * Return list of shaders attached to shader program. + * \param objOut returns GLuint ids + * \param handleOut returns GLhandleARB handles */ static void get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount, - GLsizei *count, GLuint *obj) + GLsizei *countOut, GLuint *objOut, GLhandleARB *handleOut) { struct gl_shader_program *shProg; @@ -531,14 +533,20 @@ get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount, if (shProg) { GLuint i; for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) { - obj[i] = shProg->Shaders[i]->Name; + if (objOut) { +objOut[i] = shProg->Shaders[i]->Name; + } + + if (handleOut) { +handleOut[i] = (GLhandleARB) shProg->Shaders[i]->Name; + } + } + if (countOut) { + *countOut = i; } - if (count) - *count = i; } } - /** * glGetHandleARB() - return ID/name of currently bound shader program. */ @@ -1575,7 +1583,7 @@ _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount, GLsizei * count, GLhandleARB * obj) { GET_CURRENT_CONTEXT(ctx); - get_attached_shaders(ctx, container, maxCount, count, obj); + get_attached_shaders(ctx, (GLuint)container, maxCount, count, NULL, obj); } @@ -1584,7 +1592,7 @@ _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj) { GET_CURRENT_CONTEXT(ctx); - get_attached_shaders(ctx, program, maxCount, count, obj); + get_attached_shaders(ctx, program, maxCount, count, obj, NULL); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (17.2): glxcmds: Fix a typo in the __APPLE__ codepath
Module: Mesa Branch: 17.2 Commit: cc8ae8842b97bad48280b51d770d4291be575097 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc8ae8842b97bad48280b51d770d4291be575097 Author: Jeremy Huddleston Sequoia Date: Thu Aug 17 15:08:36 2017 -0700 glxcmds: Fix a typo in the __APPLE__ codepath s/DummyContext/dummyContext/ Regressed-in: 5d9b50e596c9d81c37ce0844ae0f8c9da3f6bea6 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit c1c4c18a80bb36946b1596f14c0397d4fb029f6e) --- src/glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 290c86c6cd..44992f18cf 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -820,7 +820,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable) { #ifdef GLX_USE_APPLEGL struct glx_context * gc = __glXGetCurrentContext(); - if(gc != &DummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { + if(gc != &dummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { apple_glx_swap_buffers(gc->driContext); } else { __glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glxcmds: Fix a typo in the __APPLE__ codepath
Module: Mesa Branch: master Commit: c1c4c18a80bb36946b1596f14c0397d4fb029f6e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1c4c18a80bb36946b1596f14c0397d4fb029f6e Author: Jeremy Huddleston Sequoia Date: Thu Aug 17 15:08:36 2017 -0700 glxcmds: Fix a typo in the __APPLE__ codepath s/DummyContext/dummyContext/ Regressed-in: 5d9b50e596c9d81c37ce0844ae0f8c9da3f6bea6 Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/glxcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 290c86c6cd..44992f18cf 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -820,7 +820,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable) { #ifdef GLX_USE_APPLEGL struct glx_context * gc = __glXGetCurrentContext(); - if(gc != &DummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { + if(gc != &dummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { apple_glx_swap_buffers(gc->driContext); } else { __glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Revert "mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB "
Module: Mesa Branch: master Commit: 7c99557f53b9109a777b771e3e6479862e556071 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c99557f53b9109a777b771e3e6479862e556071 Author: Jeremy Huddleston Sequoia Date: Fri Jan 22 13:02:01 2016 -0800 Revert "mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB" This reverts commit 739ac3d39dacdede853d150b9903001524453330. This will be done a differnet way. See http://lists.freedesktop.org/archives/mesa-dev/2016-January/105642.html --- src/mesa/main/shaderapi.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 5854369..a988f41 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1374,26 +1374,10 @@ _mesa_DetachShader(GLuint program, GLuint shader) void GLAPIENTRY _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount, -GLsizei * count, GLhandleARB * objARB) +GLsizei * count, GLhandleARB * obj) { - int i; - GLuint *obj; - GET_CURRENT_CONTEXT(ctx); - - obj = calloc(maxCount, sizeof(GLuint)); - if (!obj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetAttachedObjectsARB"); - return; - } - get_attached_shaders(ctx, container, maxCount, count, obj); - - for (i = 0 ; i < *count; i++) { - objARB[i] = (GLhandleARB)obj[i]; - } - - free(obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Fix format warnings
Module: Mesa Branch: master Commit: b20d6bf96d8a751cdc2ec36886c9c47d6e93a8ef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b20d6bf96d8a751cdc2ec36886c9c47d6e93a8ef Author: Jeremy Huddleston Sequoia Date: Wed Jan 20 17:03:26 2016 -0800 mesa: Fix format warnings main/shaderapi.c:1318:51: warning: format specifies type 'unsigned int' but the argument has type 'GLhandleARB' (aka 'unsigned long') [-Wformat] _mesa_debug(ctx, "glDeleteObjectARB(%u)\n", obj); ~~ ^~~ %lu Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Nicolai Hähnle --- src/mesa/main/shaderapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 9512e3b..a988f41 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1315,7 +1315,7 @@ _mesa_DeleteObjectARB(GLhandleARB obj) { if (MESA_VERBOSE & VERBOSE_API) { GET_CURRENT_CONTEXT(ctx); - _mesa_debug(ctx, "glDeleteObjectARB(%u)\n", obj); + _mesa_debug(ctx, "glDeleteObjectARB(%lu)\n", (unsigned long)obj); } if (obj) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB
Module: Mesa Branch: master Commit: 739ac3d39dacdede853d150b9903001524453330 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=739ac3d39dacdede853d150b9903001524453330 Author: Jeremy Huddleston Sequoia Date: Wed Jan 20 17:10:54 2016 -0800 mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Nicolai Hähnle --- src/mesa/main/shaderapi.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index a988f41..5854369 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1374,10 +1374,26 @@ _mesa_DetachShader(GLuint program, GLuint shader) void GLAPIENTRY _mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount, -GLsizei * count, GLhandleARB * obj) +GLsizei * count, GLhandleARB * objARB) { + int i; + GLuint *obj; + GET_CURRENT_CONTEXT(ctx); + + obj = calloc(maxCount, sizeof(GLuint)); + if (!obj) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetAttachedObjectsARB"); + return; + } + get_attached_shaders(ctx, container, maxCount, count, obj); + + for (i = 0 ; i < *count; i++) { + objARB[i] = (GLhandleARB)obj[i]; + } + + free(obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Fix some function prototype mismatching
Module: Mesa Branch: master Commit: a087a09fa86f9617af98f6294dd2228555a4891c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a087a09fa86f9617af98f6294dd2228555a4891c Author: Jeremy Huddleston Sequoia Date: Wed Jan 20 16:59:45 2016 -0800 mesa: Fix some function prototype mismatching main/api_exec.c:543:36: warning: incompatible pointer types passing 'void (GLhandleARB, GLuint, const GLcharARB *)' (aka 'void (unsigned long, unsigned int, const char *)') to parameter of type 'void (*)(GLuint, GLuint, const GLchar *)' (aka 'void (*)(unsigned int, unsigned int, const char *)') [-Wincompatible-pointer-types] SET_BindAttribLocation(exec, _mesa_BindAttribLocation); ^~~~ ./main/dispatch.h:7590:88: note: passing argument to parameter 'fn' here static inline void SET_BindAttribLocation(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, const GLchar *)) { ^ main/api_exec.c:547:31: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned int)') [-Wincompatible-pointer-types] SET_CompileShader(exec, _mesa_CompileShader); ^~~ ./main/dispatch.h:7612:83: note: passing argument to parameter 'fn' here static inline void SET_CompileShader(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) { ^ main/api_exec.c:568:33: warning: incompatible pointer types passing 'void (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)' (aka 'void (unsigned long, unsigned int, int, int *, int *, unsigned int *, char *)') to parameter of type 'void (*)(GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *)' (aka 'void (*)(unsigned int, unsigned int, int, int *, int *, unsigned int *, char *)') [-Wincompatible-pointer-types] SET_GetActiveAttrib(exec, _mesa_GetActiveAttrib); ^ ./main/dispatch.h:7711:85: note: passing argument to parameter 'fn' here static inline void SET_GetActiveAttrib(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, GLsizei , GLsizei *, GLint *, GLenum *, GLchar *)) { ^ main/api_exec.c:571:35: warning: incompatible pointer types passing 'GLint (GLhandleARB, const GLcharARB *)' (aka 'int (unsigned long, const char *)') to parameter of type 'GLint (*)(GLuint, const GLchar *)' (aka 'int (*)(unsigned int, const char *)') [-Wincompatible-pointer-types] SET_GetAttribLocation(exec, _mesa_GetAttribLocation); ^~~ ./main/dispatch.h:7744:88: note: passing argument to parameter 'fn' here static inline void SET_GetAttribLocation(struct _glapi_table *disp, GLint (GLAPIENTRYP fn)(GLuint, const GLchar *)) { ^ main/api_exec.c:585:33: warning: incompatible pointer types passing 'void (GLhandleARB, GLsizei, GLsizei *, GLcharARB *)' (aka 'void (unsigned long, int, int *, char *)') to parameter of type 'void (*)(GLuint, GLsizei, GLsizei *, GLchar *)' (aka 'void (*)(unsigned int, int, int *, char *)') [-Wincompatible-pointer-types] SET_GetShaderSource(exec, _mesa_GetShaderSource); ^ ./main/dispatch.h:7788:85: note: passing argument to parameter 'fn' here static inline void SET_GetShaderSource(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, GLsizei *, GLchar *)) { ^ main/api_exec.c:597:29: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned int)') [-Wincompatible-pointer-types] SET_LinkProgram(exec, _mesa_LinkProgram); ^ ./main/dispatch.h:7909:81: note: passing argument to parameter 'fn' here static inline void SET_LinkProgram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) { ^ main/api_exec.c:628:30: warning: incompatible pointer types passing 'void (GLhandleARB, GLsizei, const GLcharARB *const *, const GLint *)' (aka
Mesa (10.4): darwin: build fix
Module: Mesa Branch: 10.4 Commit: 162cee83ba98abb6ee21bb270ff0c6a09e97cd1f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=162cee83ba98abb6ee21bb270ff0c6a09e97cd1f Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 20:32:02 2015 -0800 darwin: build fix ../../../src/mesa/main/compiler.h:47:10: fatal error: 'util/macros.h' file not found Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 1c67a5687a35e984323b6034adb914a66d64bb2f) --- src/glx/apple/Makefile.am |1 + 1 file changed, 1 insertion(+) diff --git a/src/glx/apple/Makefile.am b/src/glx/apple/Makefile.am index 894ab5b..8d03225 100644 --- a/src/glx/apple/Makefile.am +++ b/src/glx/apple/Makefile.am @@ -1,6 +1,7 @@ noinst_LTLIBRARIES = libappleglx.la AM_CFLAGS = \ + -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/glx \ -I$(top_srcdir)/src/mesa \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.4): darwin: build fix
Module: Mesa Branch: 10.4 Commit: 654f197f1965d5be52b96c2f1af27d8bc96f9c78 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=654f197f1965d5be52b96c2f1af27d8bc96f9c78 Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 22:21:47 2015 -0800 darwin: build fix xfont.c:237:14: error: implicit declaration of function 'GetGLXDRIDrawable' is invalid in C99 [-Werror,-Wimplicit-function-declaration] glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); ^ Fixes regression from 291be28476ea60c6fb1eb2a882e2e25def5d3735 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit e68b67b53fce39a8c93188262d9e795ca50750ac) --- src/glx/xfont.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/glx/xfont.c b/src/glx/xfont.c index a086b7a..00498bc 100644 --- a/src/glx/xfont.c +++ b/src/glx/xfont.c @@ -221,7 +221,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis XGCValues values; unsigned long valuemask; XFontStruct *fs; + +#if !defined(GLX_USE_APPLEGL) __GLXDRIdrawable *glxdraw; +#endif GLint swapbytes, lsbfirst, rowlength; GLint skiprows, skippixels, alignment; @@ -234,9 +237,11 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis dpy = CC->currentDpy; win = CC->currentDrawable; +#if !defined(GLX_USE_APPLEGL) glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); if (glxdraw) win = glxdraw->xDrawable; +#endif fs = XQueryFont(dpy, font); if (!fs) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.5): darwin: build fix
Module: Mesa Branch: 10.5 Commit: b1b7b5b068441eccac382edab0f0872e3834be45 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1b7b5b068441eccac382edab0f0872e3834be45 Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 20:32:02 2015 -0800 darwin: build fix ../../../src/mesa/main/compiler.h:47:10: fatal error: 'util/macros.h' file not found Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 1c67a5687a35e984323b6034adb914a66d64bb2f) --- src/glx/apple/Makefile.am |1 + 1 file changed, 1 insertion(+) diff --git a/src/glx/apple/Makefile.am b/src/glx/apple/Makefile.am index b500a45..2cbff9e 100644 --- a/src/glx/apple/Makefile.am +++ b/src/glx/apple/Makefile.am @@ -3,6 +3,7 @@ EXTRA_DIST = RELEASE_NOTES noinst_LTLIBRARIES = libappleglx.la AM_CFLAGS = \ + -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/glx \ -I$(top_srcdir)/src/mesa \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.5): darwin: build fix
Module: Mesa Branch: 10.5 Commit: d03de1dd7d2261382305ea5695f9f510bc9e7dd4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d03de1dd7d2261382305ea5695f9f510bc9e7dd4 Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 22:21:47 2015 -0800 darwin: build fix xfont.c:237:14: error: implicit declaration of function 'GetGLXDRIDrawable' is invalid in C99 [-Werror,-Wimplicit-function-declaration] glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); ^ Fixes regression from 291be28476ea60c6fb1eb2a882e2e25def5d3735 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit e68b67b53fce39a8c93188262d9e795ca50750ac) --- src/glx/xfont.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/glx/xfont.c b/src/glx/xfont.c index a086b7a..00498bc 100644 --- a/src/glx/xfont.c +++ b/src/glx/xfont.c @@ -221,7 +221,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis XGCValues values; unsigned long valuemask; XFontStruct *fs; + +#if !defined(GLX_USE_APPLEGL) __GLXDRIdrawable *glxdraw; +#endif GLint swapbytes, lsbfirst, rowlength; GLint skiprows, skippixels, alignment; @@ -234,9 +237,11 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis dpy = CC->currentDpy; win = CC->currentDrawable; +#if !defined(GLX_USE_APPLEGL) glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); if (glxdraw) win = glxdraw->xDrawable; +#endif fs = XQueryFont(dpy, font); if (!fs) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: build fix
Module: Mesa Branch: master Commit: e68b67b53fce39a8c93188262d9e795ca50750ac URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e68b67b53fce39a8c93188262d9e795ca50750ac Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 22:21:47 2015 -0800 darwin: build fix xfont.c:237:14: error: implicit declaration of function 'GetGLXDRIDrawable' is invalid in C99 [-Werror,-Wimplicit-function-declaration] glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); ^ Fixes regression from 291be28476ea60c6fb1eb2a882e2e25def5d3735 Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/xfont.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/glx/xfont.c b/src/glx/xfont.c index a086b7a..00498bc 100644 --- a/src/glx/xfont.c +++ b/src/glx/xfont.c @@ -221,7 +221,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis XGCValues values; unsigned long valuemask; XFontStruct *fs; + +#if !defined(GLX_USE_APPLEGL) __GLXDRIdrawable *glxdraw; +#endif GLint swapbytes, lsbfirst, rowlength; GLint skiprows, skippixels, alignment; @@ -234,9 +237,11 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis dpy = CC->currentDpy; win = CC->currentDrawable; +#if !defined(GLX_USE_APPLEGL) glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable); if (glxdraw) win = glxdraw->xDrawable; +#endif fs = XQueryFont(dpy, font); if (!fs) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: build fix
Module: Mesa Branch: master Commit: 1c67a5687a35e984323b6034adb914a66d64bb2f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c67a5687a35e984323b6034adb914a66d64bb2f Author: Jeremy Huddleston Sequoia Date: Tue Feb 10 20:32:02 2015 -0800 darwin: build fix ../../../src/mesa/main/compiler.h:47:10: fatal error: 'util/macros.h' file not found Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/Makefile.am |1 + 1 file changed, 1 insertion(+) diff --git a/src/glx/apple/Makefile.am b/src/glx/apple/Makefile.am index b500a45..2cbff9e 100644 --- a/src/glx/apple/Makefile.am +++ b/src/glx/apple/Makefile.am @@ -3,6 +3,7 @@ EXTRA_DIST = RELEASE_NOTES noinst_LTLIBRARIES = libappleglx.la AM_CFLAGS = \ + -I$(top_srcdir)/src \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/glx \ -I$(top_srcdir)/src/mesa \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): swrast: Fix -Wduplicate-decl-specifier warning
Module: Mesa Branch: master Commit: 61711316f50294959e48156229f1383002e1cdb8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=61711316f50294959e48156229f1383002e1cdb8 Author: Jeremy Huddleston Sequoia Date: Thu Jan 1 19:54:41 2015 -0800 swrast: Fix -Wduplicate-decl-specifier warning swrast.c:67:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const char const *swrast_vendor_string = "Mesa Project"; ^ swrast.c:68:12: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] const char const *swrast_renderer_string = "Software Rasterizer"; ^ Signed-off-by: Jeremy Huddleston Sequoia --- src/mesa/drivers/dri/swrast/swrast.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index e8a2c12..d62fed3 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -61,8 +61,8 @@ const __DRIextension **__driDriverGetExtensions_swrast(void); -const char const *swrast_vendor_string = "Mesa Project"; -const char const *swrast_renderer_string = "Software Rasterizer"; +const char * const swrast_vendor_string = "Mesa Project"; +const char * const swrast_renderer_string = "Software Rasterizer"; /** * Screen and config-related functions ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context
Module: Mesa Branch: master Commit: b4f34241ec850fbeffcb3278fea85f06d1666c43 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4f34241ec850fbeffcb3278fea85f06d1666c43 Author: Jeremy Huddleston Sequoia Date: Sat May 31 03:44:51 2014 -0700 darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context https://xquartz.macosforge.org/trac/ticket/650 Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_visual.c |2 -- 1 file changed, 2 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 046581b..d665cd7 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -89,8 +89,6 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m ("offscreen rendering enabled. Using kCGLPFAOffScreen\n"); attr[numattr++] = kCGLPFAOffScreen; - attr[numattr++] = kCGLPFAColorSize; - attr[numattr++] = 32; } else if (getenv("LIBGL_ALWAYS_SOFTWARE") != NULL) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context
Module: Mesa Branch: 8.0 Commit: 13b415f1011cdf8737562398b892516eb65cc9e6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13b415f1011cdf8737562398b892516eb65cc9e6 Author: Jeremy Huddleston Sequoia Date: Sat May 31 03:44:51 2014 -0700 darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context https://xquartz.macosforge.org/trac/ticket/650 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit b4f34241ec850fbeffcb3278fea85f06d1666c43) --- src/glx/apple/apple_visual.c |2 -- 1 file changed, 2 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 046581b..d665cd7 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -89,8 +89,6 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m ("offscreen rendering enabled. Using kCGLPFAOffScreen\n"); attr[numattr++] = kCGLPFAOffScreen; - attr[numattr++] = kCGLPFAColorSize; - attr[numattr++] = 32; } else if (getenv("LIBGL_ALWAYS_SOFTWARE") != NULL) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Write errors in choosing the pixel format to the crash log
Module: Mesa Branch: 8.0 Commit: 1b2f877c8ef052b183c1f20ece6c6e4a7bfd237c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b2f877c8ef052b183c1f20ece6c6e4a7bfd237c Author: Jeremy Huddleston Sequoia Date: Sat May 24 14:13:33 2014 -0700 darwin: Write errors in choosing the pixel format to the crash log Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 9eb1d36c978a9b15ae2e999c630492dfffd7f165) --- src/glx/apple/apple_visual.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index c6ede51..951b213 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -63,6 +63,16 @@ enum MAX_ATTR = 60 }; +static char __crashreporter_info_buff__[4096] = { 0 }; +static const char *__crashreporter_info__ __attribute__((__used__)) = +&__crashreporter_info_buff__[0]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 +// This is actually a toolchain requirement, but I'm not sure the correct check, +// but it should be fine to just only include it for Leopard and later. This line +// just tells the linker to never strip this symbol (such as for space optimization) +__asm__ (".desc ___crashreporter_info__, 0x10"); +#endif + void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode, bool * double_buffered, bool * uses_stereo, @@ -164,12 +174,16 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); if (error) { - fprintf(stderr, "error: %s\n", apple_cgl.error_string(error)); + snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), + "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error)); + fprintf(stderr, "%s", __crashreporter_info_buff__); abort(); } if (!*pfobj) { - fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n"); + snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), + "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n"); + fprintf(stderr, "%s", __crashreporter_info_buff__); abort(); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Guard Core Profile usage behind a testing envvar
Module: Mesa Branch: 8.0 Commit: 9d6e12eb6b06202519e48a7321f32944d7a34b0f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d6e12eb6b06202519e48a7321f32944d7a34b0f Author: Jeremy Huddleston Sequoia Date: Sat May 24 14:08:16 2014 -0700 darwin: Guard Core Profile usage behind a testing envvar Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 04ce3be4010305902cc5ae81e8e0c8550d043a1e) --- src/glx/apple/apple_visual.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 951b213..046581b 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -82,16 +82,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m int numattr = 0; GLint vsref = 0; CGLError error = 0; - - /* Request an OpenGL 3.2 profile if one is available and supported */ - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - - /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ - attr[numattr] = 0; - error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); - if (error == kCGLBadAttribute) - numattr -= 2; + bool use_core_profile = getenv("LIBGL_PROFILE_CORE"); if (offscreen) { apple_glx_diagnostic @@ -167,12 +158,31 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m attr[numattr++] = mode->samples; } + /* Debugging support for Core profiles to support newer versions of OpenGL */ + if (use_core_profile) { + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + } + attr[numattr++] = 0; assert(numattr < MAX_ATTR); error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if ((error == kCGLBadAttribute || vsref == 0) && use_core_profile) { + apple_glx_diagnostic + ("Trying again without CoreProfile: error=%s, vsref=%d\n", apple_cgl.error_string(error), vsref); + + if (!error) + apple_cgl.destroy_pixel_format(*pfobj); + + numattr -= 3; + attr[numattr++] = 0; + + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + } + if (error) { snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): appleglx: Improve error reporting if CGLChoosePixelFormat() didn't find any matching pixel formats.
Module: Mesa Branch: 8.0 Commit: f0702d6e631bb912a230c081463bb51a0dde1bff URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0702d6e631bb912a230c081463bb51a0dde1bff Author: Jon TURNEY Date: Mon May 12 15:38:26 2014 +0100 appleglx: Improve error reporting if CGLChoosePixelFormat() didn't find any matching pixel formats. Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia (cherry picked from commit 002a3a74273b81dfb226e1c3f0a8c18525ed0af4) --- src/glx/apple/apple_visual.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 238c248..c6ede51 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -167,4 +167,9 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m fprintf(stderr, "error: %s\n", apple_cgl.error_string(error)); abort(); } + + if (!*pfobj) { + fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n"); + abort(); + } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Guard Core Profile usage behind a testing envvar
Module: Mesa Branch: master Commit: 04ce3be4010305902cc5ae81e8e0c8550d043a1e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ce3be4010305902cc5ae81e8e0c8550d043a1e Author: Jeremy Huddleston Sequoia Date: Sat May 24 14:08:16 2014 -0700 darwin: Guard Core Profile usage behind a testing envvar Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_visual.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 951b213..046581b 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -82,16 +82,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m int numattr = 0; GLint vsref = 0; CGLError error = 0; - - /* Request an OpenGL 3.2 profile if one is available and supported */ - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - - /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ - attr[numattr] = 0; - error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); - if (error == kCGLBadAttribute) - numattr -= 2; + bool use_core_profile = getenv("LIBGL_PROFILE_CORE"); if (offscreen) { apple_glx_diagnostic @@ -167,12 +158,31 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m attr[numattr++] = mode->samples; } + /* Debugging support for Core profiles to support newer versions of OpenGL */ + if (use_core_profile) { + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + } + attr[numattr++] = 0; assert(numattr < MAX_ATTR); error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if ((error == kCGLBadAttribute || vsref == 0) && use_core_profile) { + apple_glx_diagnostic + ("Trying again without CoreProfile: error=%s, vsref=%d\n", apple_cgl.error_string(error), vsref); + + if (!error) + apple_cgl.destroy_pixel_format(*pfobj); + + numattr -= 3; + attr[numattr++] = 0; + + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + } + if (error) { snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Write errors in choosing the pixel format to the crash log
Module: Mesa Branch: master Commit: 9eb1d36c978a9b15ae2e999c630492dfffd7f165 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9eb1d36c978a9b15ae2e999c630492dfffd7f165 Author: Jeremy Huddleston Sequoia Date: Sat May 24 14:13:33 2014 -0700 darwin: Write errors in choosing the pixel format to the crash log Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_visual.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index c6ede51..951b213 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -63,6 +63,16 @@ enum MAX_ATTR = 60 }; +static char __crashreporter_info_buff__[4096] = { 0 }; +static const char *__crashreporter_info__ __attribute__((__used__)) = +&__crashreporter_info_buff__[0]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 +// This is actually a toolchain requirement, but I'm not sure the correct check, +// but it should be fine to just only include it for Leopard and later. This line +// just tells the linker to never strip this symbol (such as for space optimization) +__asm__ (".desc ___crashreporter_info__, 0x10"); +#endif + void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode, bool * double_buffered, bool * uses_stereo, @@ -164,12 +174,16 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); if (error) { - fprintf(stderr, "error: %s\n", apple_cgl.error_string(error)); + snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), + "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error)); + fprintf(stderr, "%s", __crashreporter_info_buff__); abort(); } if (!*pfobj) { - fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n"); + snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), + "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n"); + fprintf(stderr, "%s", __crashreporter_info_buff__); abort(); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Module: Mesa Branch: master Commit: 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a109268ab5b3544e7f7b99e84ef1fdf54023fb4 Author: Jeremy Huddleston Sequoia Date: Tue May 20 10:53:00 2014 -0700 darwin: Fix test for kCGLPFAOpenGLProfile support at runtime Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_visual.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 282934f..238c248 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m GLint vsref = 0; CGLError error = 0; - /* Request an OpenGL 3.2 profile if one is available */ - if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) { - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - } + /* Request an OpenGL 3.2 profile if one is available and supported */ + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + + /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ + attr[numattr] = 0; + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if (error == kCGLBadAttribute) + numattr -= 2; if (offscreen) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Module: Mesa Branch: 8.0 Commit: ba59a779ed41e08fa16805c1c60da39885546d0e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba59a779ed41e08fa16805c1c60da39885546d0e Author: Jeremy Huddleston Sequoia Date: Tue May 20 10:53:00 2014 -0700 darwin: Fix test for kCGLPFAOpenGLProfile support at runtime Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4) --- src/glx/apple/apple_visual.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 282934f..238c248 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m GLint vsref = 0; CGLError error = 0; - /* Request an OpenGL 3.2 profile if one is available */ - if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) { - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - } + /* Request an OpenGL 3.2 profile if one is available and supported */ + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + + /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ + attr[numattr] = 0; + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if (error == kCGLBadAttribute) + numattr -= 2; if (offscreen) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.1): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Module: Mesa Branch: 10.1 Commit: ec83a39e2b950982307825cbb64fbbe3c2934838 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec83a39e2b950982307825cbb64fbbe3c2934838 Author: Jeremy Huddleston Sequoia Date: Tue May 20 10:53:00 2014 -0700 darwin: Fix test for kCGLPFAOpenGLProfile support at runtime Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4) --- src/glx/apple/apple_visual.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 282934f..238c248 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m GLint vsref = 0; CGLError error = 0; - /* Request an OpenGL 3.2 profile if one is available */ - if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) { - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - } + /* Request an OpenGL 3.2 profile if one is available and supported */ + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + + /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ + attr[numattr] = 0; + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if (error == kCGLBadAttribute) + numattr -= 2; if (offscreen) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.2): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Module: Mesa Branch: 10.2 Commit: 25e641213fdbf43ee3b57f2b9f5a92aad7397a69 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=25e641213fdbf43ee3b57f2b9f5a92aad7397a69 Author: Jeremy Huddleston Sequoia Date: Tue May 20 10:53:00 2014 -0700 darwin: Fix test for kCGLPFAOpenGLProfile support at runtime Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4) --- src/glx/apple/apple_visual.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index 282934f..238c248 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m GLint vsref = 0; CGLError error = 0; - /* Request an OpenGL 3.2 profile if one is available */ - if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) { - attr[numattr++] = kCGLPFAOpenGLProfile; - attr[numattr++] = kCGLOGLPVersion_3_2_Core; - } + /* Request an OpenGL 3.2 profile if one is available and supported */ + attr[numattr++] = kCGLPFAOpenGLProfile; + attr[numattr++] = kCGLOGLPVersion_3_2_Core; + + /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */ + attr[numattr] = 0; + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + if (error == kCGLBadAttribute) + numattr -= 2; if (offscreen) { apple_glx_diagnostic ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): glapi: Avoid heap corruption in _glapi_table
Module: Mesa Branch: 8.0 Commit: 629600450b3845a768c0edc92ea3f444d03a2738 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=629600450b3845a768c0edc92ea3f444d03a2738 Author: Jeremy Huddleston Sequoia Date: Tue May 20 01:37:58 2014 -0700 glapi: Avoid heap corruption in _glapi_table Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Chia-I Wu (cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e) --- src/mapi/glapi/gen/gl_gentable.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 5657e32..0d0a02d 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -111,7 +111,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.2): glapi: Avoid heap corruption in _glapi_table
Module: Mesa Branch: 10.2 Commit: ac49f97f12324733220428128bce3f460fbffbbd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac49f97f12324733220428128bce3f460fbffbbd Author: Jeremy Huddleston Sequoia Date: Tue May 20 01:37:58 2014 -0700 glapi: Avoid heap corruption in _glapi_table Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Chia-I Wu (cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e) --- src/mapi/glapi/gen/gl_gentable.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 35dddc7..d45a5e0 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -113,7 +113,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (10.1): glapi: Avoid heap corruption in _glapi_table
Module: Mesa Branch: 10.1 Commit: ea5839c8fef1fbaee8a8a5a6389f35dd537dccfc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea5839c8fef1fbaee8a8a5a6389f35dd537dccfc Author: Jeremy Huddleston Sequoia Date: Tue May 20 01:37:58 2014 -0700 glapi: Avoid heap corruption in _glapi_table Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Chia-I Wu (cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e) --- src/mapi/glapi/gen/gl_gentable.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 35dddc7..d45a5e0 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -113,7 +113,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: Avoid heap corruption in _glapi_table
Module: Mesa Branch: master Commit: ff5456d1acf6f627a6837be3f3f37c6a268c9e8e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff5456d1acf6f627a6837be3f3f37c6a268c9e8e Author: Jeremy Huddleston Sequoia Date: Tue May 20 01:37:58 2014 -0700 glapi: Avoid heap corruption in _glapi_table Signed-off-by: Jeremy Huddleston Sequoia Reviewed-by: Chia-I Wu --- src/mapi/glapi/gen/gl_gentable.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py index 35dddc7..d45a5e0 100644 --- a/src/mapi/glapi/gen/gl_gentable.py +++ b/src/mapi/glapi/gen/gl_gentable.py @@ -113,7 +113,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (9.0): Apple: glFlush() is not needed with CGLFlushDrawable()
Module: Mesa Branch: 9.0 Commit: 1041bfe6ddc14623d95de318972b65386a0e235b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1041bfe6ddc14623d95de318972b65386a0e235b Author: Jeremy Huddleston Sequoia Date: Sat Jul 20 10:25:28 2013 -0700 Apple: glFlush() is not needed with CGLFlushDrawable() Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398) --- src/glx/apple/apple_glx.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index 56cff64..4e2aa33 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr) { struct apple_glx_context *ac = ptr; - /* This may not be needed with CGLFlushDrawable: */ - glFlush(); apple_cgl.flush_drawable(ac->context_obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): Apple: glFlush() is not needed with CGLFlushDrawable()
Module: Mesa Branch: 8.0 Commit: 9c50093adff0c7531ab32a7ec9ce3b91712b4d20 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c50093adff0c7531ab32a7ec9ce3b91712b4d20 Author: Jeremy Huddleston Sequoia Date: Sat Jul 20 10:25:28 2013 -0700 Apple: glFlush() is not needed with CGLFlushDrawable() Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398) --- src/glx/apple/apple_glx.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index 56cff64..4e2aa33 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr) { struct apple_glx_context *ac = ptr; - /* This may not be needed with CGLFlushDrawable: */ - glFlush(); apple_cgl.flush_drawable(ac->context_obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Apple: glFlush() is not needed with CGLFlushDrawable()
Module: Mesa Branch: master Commit: fa5ed99d8e809fb86e486a40273a4a6971055398 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa5ed99d8e809fb86e486a40273a4a6971055398 Author: Jeremy Huddleston Sequoia Date: Sat Jul 20 10:25:28 2013 -0700 Apple: glFlush() is not needed with CGLFlushDrawable() Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_glx.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index 56cff64..4e2aa33 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr) { struct apple_glx_context *ac = ptr; - /* This may not be needed with CGLFlushDrawable: */ - glFlush(); apple_cgl.flush_drawable(ac->context_obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (9.1): Apple: glFlush() is not needed with CGLFlushDrawable()
Module: Mesa Branch: 9.1 Commit: 226ea340d9a440be0577876e031ebd05ab0ce508 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=226ea340d9a440be0577876e031ebd05ab0ce508 Author: Jeremy Huddleston Sequoia Date: Sat Jul 20 10:25:28 2013 -0700 Apple: glFlush() is not needed with CGLFlushDrawable() Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398) --- src/glx/apple/apple_glx.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index 56cff64..4e2aa33 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr) { struct apple_glx_context *ac = ptr; - /* This may not be needed with CGLFlushDrawable: */ - glFlush(); apple_cgl.flush_drawable(ac->context_obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (9.2): Apple: glFlush() is not needed with CGLFlushDrawable()
Module: Mesa Branch: 9.2 Commit: ee421aec32aa543d8409a053ca3472e8997ddd30 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee421aec32aa543d8409a053ca3472e8997ddd30 Author: Jeremy Huddleston Sequoia Date: Sat Jul 20 10:25:28 2013 -0700 Apple: glFlush() is not needed with CGLFlushDrawable() Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398) --- src/glx/apple/apple_glx.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index 56cff64..4e2aa33 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr) { struct apple_glx_context *ac = ptr; - /* This may not be needed with CGLFlushDrawable: */ - glFlush(); apple_cgl.flush_drawable(ac->context_obj); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (9.0): darwin: do not create double-buffered offscreen pixel formats
Module: Mesa Branch: 9.0 Commit: 2fe673fec3d602ba2b686eedbdf2d70a42794a82 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fe673fec3d602ba2b686eedbdf2d70a42794a82 Author: Jonas Maebe Date: Mon Sep 10 00:44:15 2012 +0200 darwin: do not create double-buffered offscreen pixel formats http://xquartz.macosforge.org/trac/ticket/536 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 5fdf1f784bf449d7ce9839506fa23c5357696c4c) --- src/glx/apple/apple_visual.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index a246164..282934f 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m *uses_stereo = false; } - if (mode->doubleBufferMode) { + if (!offscreen && mode->doubleBufferMode) { attr[numattr++] = kCGLPFADoubleBuffer; *double_buffered = true; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: do not create double-buffered offscreen pixel formats
Module: Mesa Branch: 8.0 Commit: 59997d619d8957fca3b2042fe4ebeed0709c0204 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=59997d619d8957fca3b2042fe4ebeed0709c0204 Author: Jonas Maebe Date: Mon Sep 10 00:44:15 2012 +0200 darwin: do not create double-buffered offscreen pixel formats http://xquartz.macosforge.org/trac/ticket/536 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 5fdf1f784bf449d7ce9839506fa23c5357696c4c) --- src/glx/apple/apple_visual.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index a246164..282934f 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m *uses_stereo = false; } - if (mode->doubleBufferMode) { + if (!offscreen && mode->doubleBufferMode) { attr[numattr++] = kCGLPFADoubleBuffer; *double_buffered = true; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): darwin: do not create double-buffered offscreen pixel formats
Module: Mesa Branch: 7.11 Commit: 1bdf31e8da56b0660421d7b9ac253d92bed24352 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1bdf31e8da56b0660421d7b9ac253d92bed24352 Author: Jonas Maebe Date: Mon Sep 10 00:44:15 2012 +0200 darwin: do not create double-buffered offscreen pixel formats http://xquartz.macosforge.org/trac/ticket/536 Signed-off-by: Jeremy Huddleston Sequoia (cherry picked from commit 5fdf1f784bf449d7ce9839506fa23c5357696c4c) --- src/glx/apple/apple_visual.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index a246164..282934f 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m *uses_stereo = false; } - if (mode->doubleBufferMode) { + if (!offscreen && mode->doubleBufferMode) { attr[numattr++] = kCGLPFADoubleBuffer; *double_buffered = true; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: do not create double-buffered offscreen pixel formats
Module: Mesa Branch: master Commit: 5fdf1f784bf449d7ce9839506fa23c5357696c4c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fdf1f784bf449d7ce9839506fa23c5357696c4c Author: Jonas Maebe Date: Mon Sep 10 00:44:15 2012 +0200 darwin: do not create double-buffered offscreen pixel formats http://xquartz.macosforge.org/trac/ticket/536 Signed-off-by: Jeremy Huddleston Sequoia --- src/glx/apple/apple_visual.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index a246164..282934f 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m *uses_stereo = false; } - if (mode->doubleBufferMode) { + if (!offscreen && mode->doubleBufferMode) { attr[numattr++] = kCGLPFADoubleBuffer; *double_buffered = true; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Address a build failure on Leopard and earlier OS versions
Module: Mesa Branch: master Commit: 27b821bc95ea01cc4292ada9c7c65211580d1f98 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=27b821bc95ea01cc4292ada9c7c65211580d1f98 Author: Jeremy Huddleston Date: Fri May 18 11:31:24 2012 -0700 darwin: Address a build failure on Leopard and earlier OS versions <https://trac.macports.org/ticket/34499> Regression-from: 51691f0767f6a75a1f549cd979a878a0ad12a228 Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glx_log.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c index 9ebf666..5b9a865 100644 --- a/src/glx/apple/apple_glx_log.c +++ b/src/glx/apple/apple_glx_log.c @@ -76,7 +76,17 @@ void _apple_glx_vlog(int level, const char *file, const char *function, uint64_t thread = 0; if (pthread_is_threaded_np()) { +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +thread = (uint64_t)(uintptr_t)pthread_self(); +#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +if (&pthread_threadid_np) { +pthread_threadid_np(NULL, &thread); +} else { +thread = (uint64_t)(uintptr_t)pthread_self(); +} +#else pthread_threadid_np(NULL, &thread); +#endif } if (diagnostic) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Address a build failure on Leopard and earlier OS versions
Module: Mesa Branch: 8.0 Commit: e69758260b0403d47ec61692e1fc18bcbb14865e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e69758260b0403d47ec61692e1fc18bcbb14865e Author: Jeremy Huddleston Date: Fri May 18 11:31:24 2012 -0700 darwin: Address a build failure on Leopard and earlier OS versions <https://trac.macports.org/ticket/34499> Regression-from: 51691f0767f6a75a1f549cd979a878a0ad12a228 Signed-off-by: Jeremy Huddleston (cherry picked from commit 27b821bc95ea01cc4292ada9c7c65211580d1f98) --- src/glx/apple/apple_glx_log.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c index 9ebf666..5b9a865 100644 --- a/src/glx/apple/apple_glx_log.c +++ b/src/glx/apple/apple_glx_log.c @@ -76,7 +76,17 @@ void _apple_glx_vlog(int level, const char *file, const char *function, uint64_t thread = 0; if (pthread_is_threaded_np()) { +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +thread = (uint64_t)(uintptr_t)pthread_self(); +#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060 +if (&pthread_threadid_np) { +pthread_threadid_np(NULL, &thread); +} else { +thread = (uint64_t)(uintptr_t)pthread_self(); +} +#else pthread_threadid_np(NULL, &thread); +#endif } if (diagnostic) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Eliminate a possible race condition while destroying a surface
Module: Mesa Branch: master Commit: d65bd195ecbd6623b962a3c98725a484ef2791a8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d65bd195ecbd6623b962a3c98725a484ef2791a8 Author: Jeremy Huddleston Date: Fri Apr 27 18:36:33 2012 -0700 darwin: Eliminate a possible race condition while destroying a surface Introduced by: c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34 Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glx_surface.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index d42fa3b..9155202 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -207,9 +207,6 @@ apple_glx_surface_destroy(unsigned int uid) d->types.surface.pending_destroy = true; d->release(d); - /* apple_glx_drawable_find_by_uid returns a locked drawable */ - d->unlock(d); - /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -220,6 +217,9 @@ apple_glx_surface_destroy(unsigned int uid) * to actually destroy it when the pending_destroy is processed * by a glViewport callback (see apple_glx_context_update()). */ - d->destroy(d); + if (!d->destroy(d)) { + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + } } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Unlock our mutex before destroying it
Module: Mesa Branch: master Commit: a73a800b3200d21c32fac9f28e2f86919bc0a2ba URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a73a800b3200d21c32fac9f28e2f86919bc0a2ba Author: Jeremy Huddleston Date: Thu May 10 18:56:50 2012 -0700 darwin: Unlock our mutex before destroying it http://xquartz.macosforge.org/trac/ticket/575 Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glx_drawable.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 3f84d56..b261a55 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -174,6 +174,9 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + /* Stupid recursive locks */ + while (pthread_mutex_unlock(&d->mutex) == 0); + err = pthread_mutex_destroy(&d->mutex); if (err) { fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Eliminate a possible race condition while destroying a surface
Module: Mesa Branch: 8.0 Commit: 9724c8d13c09773dcf9674f15accd8f2f4d148ff URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9724c8d13c09773dcf9674f15accd8f2f4d148ff Author: Jeremy Huddleston Date: Fri Apr 27 18:36:33 2012 -0700 darwin: Eliminate a possible race condition while destroying a surface Introduced by: c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34 Signed-off-by: Jeremy Huddleston (cherry picked from commit d65bd195ecbd6623b962a3c98725a484ef2791a8) --- src/glx/apple/apple_glx_surface.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index d42fa3b..9155202 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -207,9 +207,6 @@ apple_glx_surface_destroy(unsigned int uid) d->types.surface.pending_destroy = true; d->release(d); - /* apple_glx_drawable_find_by_uid returns a locked drawable */ - d->unlock(d); - /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -220,6 +217,9 @@ apple_glx_surface_destroy(unsigned int uid) * to actually destroy it when the pending_destroy is processed * by a glViewport callback (see apple_glx_context_update()). */ - d->destroy(d); + if (!d->destroy(d)) { + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + } } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Unlock our mutex before destroying it
Module: Mesa Branch: 8.0 Commit: 7e624edba4c9f0fb2bcc322ef0b1b6401aa0a075 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e624edba4c9f0fb2bcc322ef0b1b6401aa0a075 Author: Jeremy Huddleston Date: Thu May 10 18:56:50 2012 -0700 darwin: Unlock our mutex before destroying it http://xquartz.macosforge.org/trac/ticket/575 Signed-off-by: Jeremy Huddleston (cherry picked from commit a73a800b3200d21c32fac9f28e2f86919bc0a2ba) --- src/glx/apple/apple_glx_drawable.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 3f84d56..b261a55 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -174,6 +174,9 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + /* Stupid recursive locks */ + while (pthread_mutex_unlock(&d->mutex) == 0); + err = pthread_mutex_destroy(&d->mutex); if (err) { fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): darwin: Eliminate a possible race condition while destroying a surface
Module: Mesa Branch: 7.11 Commit: ecf0bef4cdd58010d25fe845c6da76bbb35f8898 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecf0bef4cdd58010d25fe845c6da76bbb35f8898 Author: Jeremy Huddleston Date: Fri Apr 27 18:36:33 2012 -0700 darwin: Eliminate a possible race condition while destroying a surface Introduced by: c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34 Signed-off-by: Jeremy Huddleston (cherry picked from commit d65bd195ecbd6623b962a3c98725a484ef2791a8) --- src/glx/apple/apple_glx_surface.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index d42fa3b..9155202 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -207,9 +207,6 @@ apple_glx_surface_destroy(unsigned int uid) d->types.surface.pending_destroy = true; d->release(d); - /* apple_glx_drawable_find_by_uid returns a locked drawable */ - d->unlock(d); - /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -220,6 +217,9 @@ apple_glx_surface_destroy(unsigned int uid) * to actually destroy it when the pending_destroy is processed * by a glViewport callback (see apple_glx_context_update()). */ - d->destroy(d); + if (!d->destroy(d)) { + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + } } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): darwin: Unlock our mutex before destroying it
Module: Mesa Branch: 7.11 Commit: 60fa18b90fef1c67f52d610abed0d2ac39238deb URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=60fa18b90fef1c67f52d610abed0d2ac39238deb Author: Jeremy Huddleston Date: Thu May 10 18:56:50 2012 -0700 darwin: Unlock our mutex before destroying it http://xquartz.macosforge.org/trac/ticket/575 Signed-off-by: Jeremy Huddleston (cherry picked from commit a73a800b3200d21c32fac9f28e2f86919bc0a2ba) --- src/glx/apple/apple_glx_drawable.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index db28302..aaa2774 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -173,6 +173,9 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + /* Stupid recursive locks */ + while (pthread_mutex_unlock(&d->mutex) == 0); + err = pthread_mutex_destroy(&d->mutex); if (err) { fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Use ASL for logging
Module: Mesa Branch: 8.0 Commit: f36e638c761c0b11a053cc2b21c9fda2402119ca URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f36e638c761c0b11a053cc2b21c9fda2402119ca Author: Jeremy Huddleston Date: Sat Apr 28 23:19:42 2012 -0700 darwin: Use ASL for logging Signed-off-by: Jeremy Huddleston (cherry picked from commit 51691f0767f6a75a1f549cd979a878a0ad12a228) --- src/glx/apple/Makefile|1 + src/glx/apple/apple_glx.c | 25 ++--- src/glx/apple/apple_glx.h |3 +- src/glx/apple/apple_glx_log.c | 118 + src/glx/apple/apple_glx_log.h | 57 5 files changed, 183 insertions(+), 21 deletions(-) diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile index dc64295..68fe6ad 100644 --- a/src/glx/apple/Makefile +++ b/src/glx/apple/Makefile @@ -26,6 +26,7 @@ SOURCES = \ apple_glx.c \ apple_glx_context.c \ apple_glx_drawable.c \ + apple_glx_log.c \ apple_glx_pbuffer.c \ apple_glx_pixmap.c \ apple_glx_surface.c \ diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index d94c1e0..56cff64 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include "appledri.h" #include "apple_glx.h" #include "apple_glx_context.h" @@ -43,22 +45,6 @@ static int dri_event_base = 0; const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; -static bool diagnostic = false; - -void -apple_glx_diagnostic(const char *fmt, ...) -{ - va_list vl; - - if (diagnostic) { - fprintf(stderr, "DIAG: "); - - va_start(vl, fmt); - vfprintf(stderr, fmt, vl); - va_end(vl); - } -} - int apple_get_dri_event_base(void) { @@ -125,10 +111,9 @@ apple_init_glx(Display * dpy) if (initialized) return false; - if (getenv("LIBGL_DIAGNOSTIC")) { - printf("initializing libGL in %s\n", __func__); - diagnostic = true; - } + apple_glx_log_init(); + + apple_glx_log(ASL_LEVEL_INFO, "Initializing libGL."); apple_cgl_init(); (void) apple_glx_get_client_id(); diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h index ce8c488..0967f18 100644 --- a/src/glx/apple/apple_glx.h +++ b/src/glx/apple/apple_glx.h @@ -38,7 +38,8 @@ #define XP_NO_X_HEADERS #include -void apple_glx_diagnostic(const char *fmt, ...); +#include "apple_glx_log.h" + xp_client_id apple_glx_get_client_id(void); bool apple_init_glx(Display * dpy); void apple_glx_swap_buffers(void *ptr); diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c new file mode 100644 index 000..9ebf666 --- /dev/null +++ b/src/glx/apple/apple_glx_log.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2012 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "apple_glx_log.h" + +static bool diagnostic = false; +static aslclient aslc; + +void apple_glx_log_init(void) { +if (getenv("LIBGL_DIAGNOSTIC")) { +diagnostic = true; +} + +aslc = asl_open(NULL, NULL, 0); +} + +void _apple_glx_log(int level, const char *file, const char *function, +int line, const char *fmt, ...) { +va_list v; +va_start(v, fmt); +_apple_glx_vlog(level, file, function, line, fmt, v); +va_end(v); +} + +static const char * +_asl_level_string(int level) +{ +if (level == ASL_LEVEL_EMERG) return ASL_STRING_EMERG; +
Mesa (8.0): darwin: Make reported errors more user-friendly
Module: Mesa Branch: 8.0 Commit: f818673acbff14cbf6dc57bd420ef6a0db164df3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f818673acbff14cbf6dc57bd420ef6a0db164df3 Author: Jeremy Huddleston Date: Sat Apr 28 16:50:00 2012 -0700 darwin: Make reported errors more user-friendly Signed-off-by: Jeremy Huddleston (cherry picked from commit cf5db0a418b63d71385b43897a7ea9be7bb785d1) --- src/glx/apple/apple_glx_drawable.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index db28302..3f84d56 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "apple_glx.h" #include "apple_glx_context.h" #include "apple_glx_drawable.h" @@ -48,8 +49,8 @@ lock_drawables_list(void) err = pthread_mutex_lock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -62,8 +63,8 @@ unlock_drawables_list(void) err = pthread_mutex_unlock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -95,7 +96,7 @@ drawable_lock(struct apple_glx_drawable *agd) err = pthread_mutex_lock(&agd->mutex); if (err) { - fprintf(stderr, "pthread_mutex_lock error: %d\n", err); + fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err)); abort(); } } @@ -108,7 +109,7 @@ drawable_unlock(struct apple_glx_drawable *d) err = pthread_mutex_unlock(&d->mutex); if (err) { - fprintf(stderr, "pthread_mutex_unlock error: %d\n", err); + fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err)); abort(); } } @@ -245,7 +246,7 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_init(&attr); if (err) { - fprintf(stderr, "pthread_mutexattr_init error: %d\n", err); + fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err)); abort(); } @@ -257,14 +258,14 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); if (err) { - fprintf(stderr, "error: setting pthread mutex type: %d\n", err); + fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err)); abort(); } err = pthread_mutex_init(&d->mutex, &attr); if (err) { - fprintf(stderr, "pthread_mutex_init error: %d\n", err); + fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err)); abort(); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Fix an error message
Module: Mesa Branch: 8.0 Commit: 8010ff17ae931e17dd9d5eead91b144dce146147 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8010ff17ae931e17dd9d5eead91b144dce146147 Author: Jeremy Huddleston Date: Sun Apr 29 00:27:03 2012 -0700 darwin: Fix an error message Signed-off-by: Jeremy Huddleston (cherry picked from commit 244dc0521439379a0a44f81ba432aa04ca6c1a91) --- src/glx/apple/apple_glx_context.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_glx_context.c b/src/glx/apple/apple_glx_context.c index c58d05a..0bb25b4 100644 --- a/src/glx/apple/apple_glx_context.c +++ b/src/glx/apple/apple_glx_context.c @@ -421,7 +421,7 @@ apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr, */ if (same_drawable && ac->is_current) { - apple_glx_diagnostic("%s: same_drawable and ac->is_current\n"); + apple_glx_diagnostic("same_drawable and ac->is_current\n"); return false; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Use ASL for logging
Module: Mesa Branch: master Commit: 51691f0767f6a75a1f549cd979a878a0ad12a228 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=51691f0767f6a75a1f549cd979a878a0ad12a228 Author: Jeremy Huddleston Date: Sat Apr 28 23:19:42 2012 -0700 darwin: Use ASL for logging Signed-off-by: Jeremy Huddleston --- src/glx/apple/Makefile|1 + src/glx/apple/apple_glx.c | 25 ++--- src/glx/apple/apple_glx.h |3 +- src/glx/apple/apple_glx_log.c | 118 + src/glx/apple/apple_glx_log.h | 57 5 files changed, 183 insertions(+), 21 deletions(-) diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile index dc64295..68fe6ad 100644 --- a/src/glx/apple/Makefile +++ b/src/glx/apple/Makefile @@ -26,6 +26,7 @@ SOURCES = \ apple_glx.c \ apple_glx_context.c \ apple_glx_drawable.c \ + apple_glx_log.c \ apple_glx_pbuffer.c \ apple_glx_pixmap.c \ apple_glx_surface.c \ diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index d94c1e0..56cff64 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include "appledri.h" #include "apple_glx.h" #include "apple_glx_context.h" @@ -43,22 +45,6 @@ static int dri_event_base = 0; const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; -static bool diagnostic = false; - -void -apple_glx_diagnostic(const char *fmt, ...) -{ - va_list vl; - - if (diagnostic) { - fprintf(stderr, "DIAG: "); - - va_start(vl, fmt); - vfprintf(stderr, fmt, vl); - va_end(vl); - } -} - int apple_get_dri_event_base(void) { @@ -125,10 +111,9 @@ apple_init_glx(Display * dpy) if (initialized) return false; - if (getenv("LIBGL_DIAGNOSTIC")) { - printf("initializing libGL in %s\n", __func__); - diagnostic = true; - } + apple_glx_log_init(); + + apple_glx_log(ASL_LEVEL_INFO, "Initializing libGL."); apple_cgl_init(); (void) apple_glx_get_client_id(); diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h index ce8c488..0967f18 100644 --- a/src/glx/apple/apple_glx.h +++ b/src/glx/apple/apple_glx.h @@ -38,7 +38,8 @@ #define XP_NO_X_HEADERS #include -void apple_glx_diagnostic(const char *fmt, ...); +#include "apple_glx_log.h" + xp_client_id apple_glx_get_client_id(void); bool apple_init_glx(Display * dpy); void apple_glx_swap_buffers(void *ptr); diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c new file mode 100644 index 000..9ebf666 --- /dev/null +++ b/src/glx/apple/apple_glx_log.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2012 Apple Inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT + * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above + * copyright holders shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "apple_glx_log.h" + +static bool diagnostic = false; +static aslclient aslc; + +void apple_glx_log_init(void) { +if (getenv("LIBGL_DIAGNOSTIC")) { +diagnostic = true; +} + +aslc = asl_open(NULL, NULL, 0); +} + +void _apple_glx_log(int level, const char *file, const char *function, +int line, const char *fmt, ...) { +va_list v; +va_start(v, fmt); +_apple_glx_vlog(level, file, function, line, fmt, v); +va_end(v); +} + +static const char * +_asl_level_string(int level) +{ +if (level == ASL_LEVEL_EMERG) return ASL_STRING_EMERG; +if (level == ASL_LEVEL_ALERT) return ASL_STRING_ALERT;
Mesa (master): darwin: Make reported errors more user-friendly
Module: Mesa Branch: master Commit: cf5db0a418b63d71385b43897a7ea9be7bb785d1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf5db0a418b63d71385b43897a7ea9be7bb785d1 Author: Jeremy Huddleston Date: Sat Apr 28 16:50:00 2012 -0700 darwin: Make reported errors more user-friendly Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glx_drawable.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index db28302..3f84d56 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "apple_glx.h" #include "apple_glx_context.h" #include "apple_glx_drawable.h" @@ -48,8 +49,8 @@ lock_drawables_list(void) err = pthread_mutex_lock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -62,8 +63,8 @@ unlock_drawables_list(void) err = pthread_mutex_unlock(&drawables_lock); if (err) { - fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n", - __func__, err); + fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n", + __func__, strerror(err)); abort(); } } @@ -95,7 +96,7 @@ drawable_lock(struct apple_glx_drawable *agd) err = pthread_mutex_lock(&agd->mutex); if (err) { - fprintf(stderr, "pthread_mutex_lock error: %d\n", err); + fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err)); abort(); } } @@ -108,7 +109,7 @@ drawable_unlock(struct apple_glx_drawable *d) err = pthread_mutex_unlock(&d->mutex); if (err) { - fprintf(stderr, "pthread_mutex_unlock error: %d\n", err); + fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err)); abort(); } } @@ -245,7 +246,7 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_init(&attr); if (err) { - fprintf(stderr, "pthread_mutexattr_init error: %d\n", err); + fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err)); abort(); } @@ -257,14 +258,14 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d) err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); if (err) { - fprintf(stderr, "error: setting pthread mutex type: %d\n", err); + fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err)); abort(); } err = pthread_mutex_init(&d->mutex, &attr); if (err) { - fprintf(stderr, "pthread_mutex_init error: %d\n", err); + fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err)); abort(); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Fix an error message
Module: Mesa Branch: master Commit: 244dc0521439379a0a44f81ba432aa04ca6c1a91 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=244dc0521439379a0a44f81ba432aa04ca6c1a91 Author: Jeremy Huddleston Date: Sun Apr 29 00:27:03 2012 -0700 darwin: Fix an error message Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glx_context.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/apple_glx_context.c b/src/glx/apple/apple_glx_context.c index c58d05a..0bb25b4 100644 --- a/src/glx/apple/apple_glx_context.c +++ b/src/glx/apple/apple_glx_context.c @@ -421,7 +421,7 @@ apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr, */ if (same_drawable && ac->is_current) { - apple_glx_diagnostic("%s: same_drawable and ac->is_current\n"); + apple_glx_diagnostic("same_drawable and ac->is_current\n"); return false; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Eliminate a pthread mutex leak
Module: Mesa Branch: 8.0 Commit: 69d8a25d429bccf960e98e5c126e1ef2ae4ffe9d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69d8a25d429bccf960e98e5c126e1ef2ae4ffe9d Author: Jeremy Huddleston Date: Mon Apr 23 16:43:22 2012 -0700 darwin: Eliminate a pthread mutex leak Signed-off-by: Jeremy Huddleston Tested-by: Charles Davis (cherry picked from commit 1a33c1b2b895566299ec76643659adacc239a3dc) --- src/glx/apple/apple_glx_drawable.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 5530224..db28302 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d) static bool destroy_drawable(struct apple_glx_drawable *d) { + int err; d->lock(d); @@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + err = pthread_mutex_destroy(&d->mutex); + if (err) { + fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); + abort(); + } + free(d); /* So that the locks are balanced and the caller correctly unlocks. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): darwin: Eliminate a pthread mutex leak
Module: Mesa Branch: 7.11 Commit: 62058968e71352083fc4513e3d6068116ecf99ba URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=62058968e71352083fc4513e3d6068116ecf99ba Author: Jeremy Huddleston Date: Mon Apr 23 16:43:22 2012 -0700 darwin: Eliminate a pthread mutex leak Signed-off-by: Jeremy Huddleston Tested-by: Charles Davis (cherry picked from commit 1a33c1b2b895566299ec76643659adacc239a3dc) --- src/glx/apple/apple_glx_drawable.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 5530224..db28302 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d) static bool destroy_drawable(struct apple_glx_drawable *d) { + int err; d->lock(d); @@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + err = pthread_mutex_destroy(&d->mutex); + if (err) { + fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); + abort(); + } + free(d); /* So that the locks are balanced and the caller correctly unlocks. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Eliminate a pthread mutex leak
Module: Mesa Branch: master Commit: 1a33c1b2b895566299ec76643659adacc239a3dc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a33c1b2b895566299ec76643659adacc239a3dc Author: Jeremy Huddleston Date: Mon Apr 23 16:43:22 2012 -0700 darwin: Eliminate a pthread mutex leak Signed-off-by: Jeremy Huddleston Tested-by: Charles Davis --- src/glx/apple/apple_glx_drawable.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c index 5530224..db28302 100644 --- a/src/glx/apple/apple_glx_drawable.c +++ b/src/glx/apple/apple_glx_drawable.c @@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d) static bool destroy_drawable(struct apple_glx_drawable *d) { + int err; d->lock(d); @@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d) apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d); + err = pthread_mutex_destroy(&d->mutex); + if (err) { + fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err)); + abort(); + } + free(d); /* So that the locks are balanced and the caller correctly unlocks. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): apple: Fix a use after free
Module: Mesa Branch: 8.0 Commit: 6095a17534c2694760300701fee59a320950f271 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6095a17534c2694760300701fee59a320950f271 Author: Jonas Maebe Date: Mon Apr 23 16:02:16 2012 -0700 apple: Fix a use after free Reviewed-by: Jeremy Huddleston (cherry picked from commit c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34) --- src/glx/apple/apple_glx_surface.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index 39f5130..d42fa3b 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid) if (d) { d->types.surface.pending_destroy = true; d->release(d); + + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid) * by a glViewport callback (see apple_glx_context_update()). */ d->destroy(d); - - d->unlock(d); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): apple: Fix a use after free
Module: Mesa Branch: 7.11 Commit: 1fa6c87c88ad8494355431ba5134236e8f819a74 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fa6c87c88ad8494355431ba5134236e8f819a74 Author: Jonas Maebe Date: Mon Apr 23 16:02:16 2012 -0700 apple: Fix a use after free Reviewed-by: Jeremy Huddleston (cherry picked from commit c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34) --- src/glx/apple/apple_glx_surface.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index 39f5130..d42fa3b 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid) if (d) { d->types.surface.pending_destroy = true; d->release(d); + + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid) * by a glViewport callback (see apple_glx_context_update()). */ d->destroy(d); - - d->unlock(d); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Don't build gallium
Module: Mesa Branch: master Commit: d9c9c7a1119abd3f1d5461ad4e8ee1f11e80ca6f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9c9c7a1119abd3f1d5461ad4e8ee1f11e80ca6f Author: Jeremy Huddleston Date: Mon Apr 23 16:13:51 2012 -0700 darwin: Don't build gallium fe3f98ed70be01a49dd2e93870907d092fe4a283 intentionally broke it, so don't build it. Signed-off-by: Jeremy Huddleston --- configs/darwin |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/darwin b/configs/darwin index 721fbc7..12e6e3a 100644 --- a/configs/darwin +++ b/configs/darwin @@ -52,10 +52,10 @@ OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS) GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS) GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS) -SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu +SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa glu GLU_DIRS = sgi DRIVER_DIRS = osmesa #DRIVER_DIRS = dri DRI_DIRS = swrast -GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad +#GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad #GALLIUM_DRIVERS_DIRS += llvmpipe ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Fix a use after free
Module: Mesa Branch: master Commit: c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34 Author: Jonas Maebe Date: Mon Apr 23 16:02:16 2012 -0700 apple: Fix a use after free Reviewed-by: Jeremy Huddleston --- src/glx/apple/apple_glx_surface.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index 39f5130..d42fa3b 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid) if (d) { d->types.surface.pending_destroy = true; d->release(d); + + /* apple_glx_drawable_find_by_uid returns a locked drawable */ + d->unlock(d); + /* * We release 2 references to the surface. One was acquired by * the find, and the other was leftover from a context, or @@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid) * by a glViewport callback (see apple_glx_context_update()). */ d->destroy(d); - - d->unlock(d); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): glapi: Correct size of allocated _glapi_table struct
Module: Mesa Branch: 7.11 Commit: 00d310a1304b6fe2c63b14391898703ee2582a14 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=00d310a1304b6fe2c63b14391898703ee2582a14 Author: Jonas Maebe Date: Sun Apr 22 20:39:32 2012 -0700 glapi: Correct size of allocated _glapi_table struct The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct as an array of _glapi_get_dispatch_table_size() pointers, so we have to allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than sizeof(struct _glapi_struct) bytes. Reviewed-by: Jeremy Huddleston (cherry picked from commit 8d09f4d0cc8d2ac5398c8b26638d5659429a4280) --- src/mapi/glapi/glapi_gentable.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c index 6dd02a7..346f773 100644 --- a/src/mapi/glapi/glapi_gentable.c +++ b/src/mapi/glapi/glapi_gentable.c @@ -77,7 +77,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): glapi: Correct size of allocated _glapi_table struct
Module: Mesa Branch: 8.0 Commit: bb30e76328e9dd80b0c7a7688828e3cf8e662b1b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb30e76328e9dd80b0c7a7688828e3cf8e662b1b Author: Jonas Maebe Date: Sun Apr 22 20:39:32 2012 -0700 glapi: Correct size of allocated _glapi_table struct The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct as an array of _glapi_get_dispatch_table_size() pointers, so we have to allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than sizeof(struct _glapi_struct) bytes. Reviewed-by: Jeremy Huddleston (cherry picked from commit 8d09f4d0cc8d2ac5398c8b26638d5659429a4280) --- src/mapi/glapi/glapi_gentable.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c index 5c04801..640c495 100644 --- a/src/mapi/glapi/glapi_gentable.c +++ b/src/mapi/glapi/glapi_gentable.c @@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: Correct size of allocated _glapi_table struct
Module: Mesa Branch: master Commit: 8d09f4d0cc8d2ac5398c8b26638d5659429a4280 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d09f4d0cc8d2ac5398c8b26638d5659429a4280 Author: Jonas Maebe Date: Sun Apr 22 20:39:32 2012 -0700 glapi: Correct size of allocated _glapi_table struct The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct as an array of _glapi_get_dispatch_table_size() pointers, so we have to allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than sizeof(struct _glapi_struct) bytes. Reviewed-by: Jeremy Huddleston --- src/mapi/glapi/glapi_gentable.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c index cc083d9..7552af2 100644 --- a/src/mapi/glapi/glapi_gentable.c +++ b/src/mapi/glapi/glapi_gentable.c @@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { -struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table)); +struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *)); char symboln[512]; if(!disp) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Link against libxcb
Module: Mesa Branch: 8.0 Commit: d982036c3ae1350c60874f5c4ea13c1867ed1c2c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d982036c3ae1350c60874f5c4ea13c1867ed1c2c Author: Jeremy Huddleston Date: Fri Mar 16 17:07:06 2012 -0700 darwin: Link against libxcb Signed-off-by: Jeremy Huddleston (cherry picked from commit 90a51753c40465c1253c612e0fef2aef96441668) --- configs/darwin |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configs/darwin b/configs/darwin index fe721d7..721fbc7 100644 --- a/configs/darwin +++ b/configs/darwin @@ -47,7 +47,7 @@ GLW_LIB_GLOB = lib$(GLW_LIB).*dylib OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib VG_LIB_GLOB = lib$(VG_LIB).*dylib -GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread $(EXTRA_LDFLAGS) +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11-xcb -lxcb -lX11 -lXext $(EXTRA_LDFLAGS) OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS) GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS) GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: Build create_context.c
Module: Mesa Branch: 8.0 Commit: 63c8f7142c49007e9cb49ffcd73d85f8f4d71497 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=63c8f7142c49007e9cb49ffcd73d85f8f4d71497 Author: Jeremy Huddleston Date: Fri Mar 16 17:03:54 2012 -0700 darwin: Build create_context.c Fixes a build regression from: 588042a8ec4ea91a952c07a0768516fd590758f4 Signed-off-by: Jeremy Huddleston (cherry picked from commit f9e1295cffc3cf096611e193cca016326715e6ca) --- src/glx/apple/Makefile |1 + src/glx/create_context.c |7 ++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile index 66e6658..dc64295 100644 --- a/src/glx/apple/Makefile +++ b/src/glx/apple/Makefile @@ -35,6 +35,7 @@ SOURCES = \ apple_xgl_api_stereo.c \ apple_xgl_api_viewport.c \ appledri.c \ + ../create_context.c \ ../clientattrib.c \ ../compsize.c \ ../glxconfig.c \ diff --git a/src/glx/create_context.c b/src/glx/create_context.c index 714f0e5..a1a55b3 100644 --- a/src/glx/create_context.c +++ b/src/glx/create_context.c @@ -80,8 +80,13 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, &dummy_err); } - if (gc == NULL) + if (gc == NULL) { +#ifdef GLX_USE_APPLEGL + gc = applegl_create_context(psc, cfg, share, 0); +#else gc = indirect_create_context(psc, cfg, share, 0); +#endif + } gc->xid = xcb_generate_id(c); gc->share_xid = (share != NULL) ? share->xid : 0; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): darwin: config file cleanups
Module: Mesa Branch: 8.0 Commit: 485d1c491aabb30f29f52ec72842af2e6a649c6b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=485d1c491aabb30f29f52ec72842af2e6a649c6b Author: Jeremy Huddleston Date: Fri Mar 16 17:01:01 2012 -0700 darwin: config file cleanups Set our default compiler based on what our installed XCode prefers Signed-off-by: Jeremy Huddleston (cherry picked from commit 61f6aff5d9136c91ca4a16de04c7ae673e9433df) --- configs/darwin | 23 +-- configs/darwin-fat-intel |7 +++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/configs/darwin b/configs/darwin index e2ca70a..fe721d7 100644 --- a/configs/darwin +++ b/configs/darwin @@ -9,8 +9,8 @@ INSTALL_DIR = /usr/X11 X11_DIR = $(INSTALL_DIR) # Compiler and flags -CC = gcc -CXX = g++ +CC = $(shell xcrun -find cc) +CXX = $(shell xcrun -find c++) PIC_FLAGS = -fPIC DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \ -DGLX_ALIAS_UNSUPPORTED \ @@ -24,11 +24,14 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \ # -DIN_DRI_DRIVER ARCH_FLAGS += $(RC_CFLAGS) +INCLUDE_FLAGS = -I$(INSTALL_DIR)/include -I$(X11_DIR)/include +OPT_FLAGS = -g3 -gdwarf-2 -Os -ffast-math -fno-strict-aliasing +WARN_FLAGS = -Wall -Wmissing-prototypes -CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \ - -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) -CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \ - -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) +CFLAGS = -std=c99 -fvisibility=hidden \ + $(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS) +CXXFLAGS = -fvisibility=hidden \ + $(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS) # Library names (actual file names) GL_LIB_NAME = lib$(GL_LIB).dylib @@ -44,10 +47,10 @@ GLW_LIB_GLOB = lib$(GLW_LIB).*dylib OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib VG_LIB_GLOB = lib$(VG_LIB).*dylib -GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread $(EXTRA_LDFLAGS) +OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS) +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS) SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu GLU_DIRS = sgi diff --git a/configs/darwin-fat-intel b/configs/darwin-fat-intel new file mode 100644 index 000..273ae3d --- /dev/null +++ b/configs/darwin-fat-intel @@ -0,0 +1,7 @@ +# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs for intel + +RC_CFLAGS=-arch i386 -arch x86_64 + +include $(TOP)/configs/darwin + +CONFIG_NAME = darwin-fat-intel ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Link against libxcb
Module: Mesa Branch: master Commit: 90a51753c40465c1253c612e0fef2aef96441668 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=90a51753c40465c1253c612e0fef2aef96441668 Author: Jeremy Huddleston Date: Fri Mar 16 17:07:06 2012 -0700 darwin: Link against libxcb Signed-off-by: Jeremy Huddleston --- configs/darwin |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configs/darwin b/configs/darwin index fe721d7..721fbc7 100644 --- a/configs/darwin +++ b/configs/darwin @@ -47,7 +47,7 @@ GLW_LIB_GLOB = lib$(GLW_LIB).*dylib OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib VG_LIB_GLOB = lib$(VG_LIB).*dylib -GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread $(EXTRA_LDFLAGS) +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11-xcb -lxcb -lX11 -lXext $(EXTRA_LDFLAGS) OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS) GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS) GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Build create_context.c
Module: Mesa Branch: master Commit: f9e1295cffc3cf096611e193cca016326715e6ca URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9e1295cffc3cf096611e193cca016326715e6ca Author: Jeremy Huddleston Date: Fri Mar 16 17:03:54 2012 -0700 darwin: Build create_context.c Fixes a build regression from: 588042a8ec4ea91a952c07a0768516fd590758f4 Signed-off-by: Jeremy Huddleston --- src/glx/apple/Makefile |1 + src/glx/create_context.c |7 ++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile index 66e6658..dc64295 100644 --- a/src/glx/apple/Makefile +++ b/src/glx/apple/Makefile @@ -35,6 +35,7 @@ SOURCES = \ apple_xgl_api_stereo.c \ apple_xgl_api_viewport.c \ appledri.c \ + ../create_context.c \ ../clientattrib.c \ ../compsize.c \ ../glxconfig.c \ diff --git a/src/glx/create_context.c b/src/glx/create_context.c index 714f0e5..a1a55b3 100644 --- a/src/glx/create_context.c +++ b/src/glx/create_context.c @@ -80,8 +80,13 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, &dummy_err); } - if (gc == NULL) + if (gc == NULL) { +#ifdef GLX_USE_APPLEGL + gc = applegl_create_context(psc, cfg, share, 0); +#else gc = indirect_create_context(psc, cfg, share, 0); +#endif + } gc->xid = xcb_generate_id(c); gc->share_xid = (share != NULL) ? share->xid : 0; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: config file cleanups
Module: Mesa Branch: master Commit: 61f6aff5d9136c91ca4a16de04c7ae673e9433df URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=61f6aff5d9136c91ca4a16de04c7ae673e9433df Author: Jeremy Huddleston Date: Fri Mar 16 17:01:01 2012 -0700 darwin: config file cleanups Set our default compiler based on what our installed XCode prefers Signed-off-by: Jeremy Huddleston --- configs/darwin | 23 +-- configs/darwin-fat-intel |7 +++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/configs/darwin b/configs/darwin index e2ca70a..fe721d7 100644 --- a/configs/darwin +++ b/configs/darwin @@ -9,8 +9,8 @@ INSTALL_DIR = /usr/X11 X11_DIR = $(INSTALL_DIR) # Compiler and flags -CC = gcc -CXX = g++ +CC = $(shell xcrun -find cc) +CXX = $(shell xcrun -find c++) PIC_FLAGS = -fPIC DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \ -DGLX_ALIAS_UNSUPPORTED \ @@ -24,11 +24,14 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \ # -DIN_DRI_DRIVER ARCH_FLAGS += $(RC_CFLAGS) +INCLUDE_FLAGS = -I$(INSTALL_DIR)/include -I$(X11_DIR)/include +OPT_FLAGS = -g3 -gdwarf-2 -Os -ffast-math -fno-strict-aliasing +WARN_FLAGS = -Wall -Wmissing-prototypes -CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \ - -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) -CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \ - -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) +CFLAGS = -std=c99 -fvisibility=hidden \ + $(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS) +CXXFLAGS = -fvisibility=hidden \ + $(OPT_FLAGS) $(WARN_FLAGS) $(INCLUDE_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) $(EXTRA_CFLAGS) # Library names (actual file names) GL_LIB_NAME = lib$(GL_LIB).dylib @@ -44,10 +47,10 @@ GLW_LIB_GLOB = lib$(GLW_LIB).*dylib OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib VG_LIB_GLOB = lib$(VG_LIB).*dylib -GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread -OSMESA_LIB_DEPS = -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt +GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread $(EXTRA_LDFLAGS) +OSMESA_LIB_DEPS = $(EXTRA_LDFLAGS) +GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LDFLAGS) +GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt $(EXTRA_LDFLAGS) SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu GLU_DIRS = sgi diff --git a/configs/darwin-fat-intel b/configs/darwin-fat-intel new file mode 100644 index 000..273ae3d --- /dev/null +++ b/configs/darwin-fat-intel @@ -0,0 +1,7 @@ +# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs for intel + +RC_CFLAGS=-arch i386 -arch x86_64 + +include $(TOP)/configs/darwin + +CONFIG_NAME = darwin-fat-intel ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (8.0): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.
Module: Mesa Branch: 8.0 Commit: e406659b8bed4dd8450935e2f3ee697b99d278cf URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e406659b8bed4dd8450935e2f3ee697b99d278cf Author: Jeremy Huddleston Date: Thu May 5 14:08:57 2011 -0700 configure.ac: Don't use $CLANG since it will collide with the static analyzer. We just prefix the $CLANG environment variable in configure.ac with acv_mesa_ Found by: tinderbox Signed-off-by: Jeremy Huddleston Reviewed-by: Ian Romanick (cherry picked from commit b728eefb06c26e4b5a25db31bbda9fcf4d015e17) --- configure.ac |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 7c50e3c..1fcfdbc 100644 --- a/configure.ac +++ b/configure.ac @@ -88,13 +88,13 @@ AC_COMPILE_IFELSE( not clang #endif ]])], -[CLANG=yes], [CLANG=no]) +[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no]) -AC_MSG_RESULT([$CLANG]) +AC_MSG_RESULT([$acv_mesa_CLANG]) dnl If we're using GCC, make sure that it is at least version 3.3.0. Older dnl versions are explictly not supported. -if test "x$GCC" = xyes -a "x$CLANG" = xno; then +if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then AC_MSG_CHECKING([whether gcc version is sufficient]) major=0 minor=0 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.
Module: Mesa Branch: 7.11 Commit: 906f670f1a1f33d69139f520ee931b268049eac6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=906f670f1a1f33d69139f520ee931b268049eac6 Author: Jeremy Huddleston Date: Thu May 5 14:08:57 2011 -0700 configure.ac: Don't use $CLANG since it will collide with the static analyzer. We just prefix the $CLANG environment variable in configure.ac with acv_mesa_ Found by: tinderbox Signed-off-by: Jeremy Huddleston Reviewed-by: Ian Romanick (cherry picked from commit b728eefb06c26e4b5a25db31bbda9fcf4d015e17) --- configure.ac |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 817bf8b..fb74cfd 100644 --- a/configure.ac +++ b/configure.ac @@ -75,13 +75,13 @@ AC_COMPILE_IFELSE( not clang #endif ]])], -[CLANG=yes], [CLANG=no]) +[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no]) -AC_MSG_RESULT([$CLANG]) +AC_MSG_RESULT([$acv_mesa_CLANG]) dnl If we're using GCC, make sure that it is at least version 3.3.0. Older dnl versions are explictly not supported. -if test "x$GCC" = xyes -a "x$CLANG" = xno; then +if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then AC_MSG_CHECKING([whether gcc version is sufficient]) major=0 minor=0 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.
Module: Mesa Branch: master Commit: b728eefb06c26e4b5a25db31bbda9fcf4d015e17 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b728eefb06c26e4b5a25db31bbda9fcf4d015e17 Author: Jeremy Huddleston Date: Thu May 5 14:08:57 2011 -0700 configure.ac: Don't use $CLANG since it will collide with the static analyzer. We just prefix the $CLANG environment variable in configure.ac with acv_mesa_ Found by: tinderbox Signed-off-by: Jeremy Huddleston Reviewed-by: Ian Romanick --- configure.ac |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 507cfff..06d400f 100644 --- a/configure.ac +++ b/configure.ac @@ -97,13 +97,13 @@ AC_COMPILE_IFELSE( not clang #endif ]])], -[CLANG=yes], [CLANG=no]) +[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no]) -AC_MSG_RESULT([$CLANG]) +AC_MSG_RESULT([$acv_mesa_CLANG]) dnl If we're using GCC, make sure that it is at least version 3.3.0. Older dnl versions are explictly not supported. -if test "x$GCC" = xyes -a "x$CLANG" = xno; then +if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then AC_MSG_CHECKING([whether gcc version is sufficient]) major=0 minor=0 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Build fix for -Werror=int-to-pointer-cast -Werror= pointer-to-int-cast
Module: Mesa Branch: master Commit: 666c70ce8eb7c8a21536f03be3a68a3c11997e09 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=666c70ce8eb7c8a21536f03be3a68a3c11997e09 Author: Jeremy Huddleston Date: Tue Nov 1 21:04:34 2011 -0700 Build fix for -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast Signed-off-by: Jeremy Huddleston --- src/mesa/drivers/dri/r200/r200_tcl.c |4 ++-- src/mesa/drivers/dri/radeon/radeon_tcl.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 48563dd..3ece7a3 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -218,8 +218,8 @@ static void r200EmitPrim( struct gl_context *ctx, #ifdef MESA_BIG_ENDIAN /* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */ #define EMIT_ELT(dest, offset, x) do { \ -int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ -GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 );\ +int off = offset + ( ( (uintptr_t)dest & 0x2 ) >> 1 ); \ +GLushort *des = (GLushort *)( (uintptr_t)dest & ~0x2 );\ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x);\ (void)rmesa; } while (0) #else diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 5d2e8f4..874ba92 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -207,8 +207,8 @@ static void radeonEmitPrim( struct gl_context *ctx, #ifdef MESA_BIG_ENDIAN /* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */ #define EMIT_ELT(dest, offset, x) do { \ - int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ - GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 );\ + int off = offset + ( ( (uintptr_t)dest & 0x2 ) >> 1 ); \ + GLushort *des = (GLushort *)( (uintptr_t)dest & ~0x2 ); \ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \ (void)rmesa; } while (0) #else ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.10): apple: Implement applegl_unbind_context
Module: Mesa Branch: 7.10 Commit: a96360a9517c38ead6c1381362ec49d7f7afd41c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a96360a9517c38ead6c1381362ec49d7f7afd41c Author: Jeremy Huddleston Date: Mon Oct 24 16:21:28 2011 -0700 apple: Implement applegl_unbind_context glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context causing subsequent GLX requests to fail in peculiar ways http://xquartz.macosforge.org/trac/ticket/514 Signed-off-by: Jeremy Huddleston (cherry picked from commit 5c44c1348ea13f51a1616968daa7034bb48e42b1) --- src/glx/applegl_glx.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 92c785f..1fd30bf 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -65,6 +65,24 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old, static void applegl_unbind_context(struct glx_context *gc, struct glx_context *new) { + Display *dpy; + bool error; + + /* If we don't have a context, then we have nothing to unbind */ + if (!gc) + return; + + /* If we have a new context, keep this one around and remove it during bind. */ + if (new) + return; + + dpy = gc->psc->dpy; + + error = apple_glx_make_current_context(dpy, + (gc != &dummyContext) ? gc->driContext : NULL, + NULL, None); + + apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.10): apple: Silence some debug spew
Module: Mesa Branch: 7.10 Commit: c8f2665f028d2a34370059f3aa204986f6341697 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8f2665f028d2a34370059f3aa204986f6341697 Author: Jeremy Huddleston Date: Thu Oct 20 22:54:08 2011 -0700 apple: Silence some debug spew Signed-off-by: Jeremy Huddleston (cherry picked from commit 098ecfad83a63bd8eb04c37f268c18d8744dff2c) --- src/glx/apple/appledri.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glx/apple/appledri.c b/src/glx/apple/appledri.c index 46c84f3..e3f9b84 100644 --- a/src/glx/apple/appledri.c +++ b/src/glx/apple/appledri.c @@ -332,12 +332,12 @@ XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable, return False; } - printf("rep.stringLength %d\n", (int) rep.stringLength); + /* printf("rep.stringLength %d\n", (int) rep.stringLength); */ if (rep.stringLength > 0 && rep.stringLength <= pathlen) { _XReadPad(dpy, path, rep.stringLength); - printf("path: %s\n", path); + /* printf("path: %s\n", path); */ *width = rep.width; *height = rep.height; @@ -404,7 +404,7 @@ XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable, if (rep.stringLength > 0 && rep.stringLength <= bufnamesize) { _XReadPad(dpy, bufname, rep.stringLength); - printf("path: %s\n", bufname); + /* printf("path: %s\n", bufname); */ *width = rep.width; *height = rep.height; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Implement applegl_unbind_context
Module: Mesa Branch: master Commit: 5c44c1348ea13f51a1616968daa7034bb48e42b1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c44c1348ea13f51a1616968daa7034bb48e42b1 Author: Jeremy Huddleston Date: Mon Oct 24 16:21:28 2011 -0700 apple: Implement applegl_unbind_context glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context causing subsequent GLX requests to fail in peculiar ways http://xquartz.macosforge.org/trac/ticket/514 Signed-off-by: Jeremy Huddleston --- src/glx/applegl_glx.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 8766c88..9be12b0 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -69,6 +69,24 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old, static void applegl_unbind_context(struct glx_context *gc, struct glx_context *new) { + Display *dpy; + bool error; + + /* If we don't have a context, then we have nothing to unbind */ + if (!gc) + return; + + /* If we have a new context, keep this one around and remove it during bind. */ + if (new) + return; + + dpy = gc->psc->dpy; + + error = apple_glx_make_current_context(dpy, + (gc != &dummyContext) ? gc->driContext : NULL, + NULL, None); + + apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): apple: Implement applegl_unbind_context
Module: Mesa Branch: 7.11 Commit: 681f4820ab7339b0ecc4cf656ae1e0adac6ed8f6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=681f4820ab7339b0ecc4cf656ae1e0adac6ed8f6 Author: Jeremy Huddleston Date: Mon Oct 24 16:21:28 2011 -0700 apple: Implement applegl_unbind_context glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context causing subsequent GLX requests to fail in peculiar ways http://xquartz.macosforge.org/trac/ticket/514 Signed-off-by: Jeremy Huddleston (cherry picked from commit 5c44c1348ea13f51a1616968daa7034bb48e42b1) --- src/glx/applegl_glx.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 8766c88..9be12b0 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -69,6 +69,24 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old, static void applegl_unbind_context(struct glx_context *gc, struct glx_context *new) { + Display *dpy; + bool error; + + /* If we don't have a context, then we have nothing to unbind */ + if (!gc) + return; + + /* If we have a new context, keep this one around and remove it during bind. */ + if (new) + return; + + dpy = gc->psc->dpy; + + error = apple_glx_make_current_context(dpy, + (gc != &dummyContext) ? gc->driContext : NULL, + NULL, None); + + apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Module: Mesa Branch: 7.11 Commit: bf7b347c1041edc77472c117e0ffcfbb71d5c13b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf7b347c1041edc77472c117e0ffcfbb71d5c13b Author: Jeremy Huddleston Date: Fri Oct 21 00:22:40 2011 -0700 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init Signed-off-by: Jeremy Huddleston (cherry picked from commit 9f2abbee6215d89e48b7fe042f8a905997f5c232) --- src/glx/apple/apple_glapi.c | 15 +++ src/glx/apple/apple_glx.h |1 + src/glx/apple/apple_glx_pbuffer.c |3 +-- src/glx/apple/apple_glx_pixmap.c |3 +-- src/glx/apple/apple_glx_surface.c |3 +-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 34f726e..9a670bc 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -49,11 +49,9 @@ struct _glapi_table * __ogl_framework_api = NULL; struct _glapi_table * __applegl_api = NULL; -void apple_glapi_set_dispatch(void) { -if(__applegl_api) { -_glapi_set_dispatch(__applegl_api); +static void _apple_glapi_create_table(void) { +if (__applegl_api) return; -} __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl"); assert(__ogl_framework_api); @@ -68,6 +66,15 @@ void apple_glapi_set_dispatch(void) { SET_DrawBuffer(__applegl_api, __applegl_glDrawBuffer); SET_DrawBuffersARB(__applegl_api, __applegl_glDrawBuffersARB); SET_Viewport(__applegl_api, __applegl_glViewport); +} +void apple_glapi_set_dispatch(void) { +_apple_glapi_create_table(); _glapi_set_dispatch(__applegl_api); } + +void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height) { +_apple_glapi_create_table(); +__ogl_framework_api->Viewport(x, y, width, height); +__ogl_framework_api->Scissor(x, y, width, height); +} diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h index c70fc00..ce8c488 100644 --- a/src/glx/apple/apple_glx.h +++ b/src/glx/apple/apple_glx.h @@ -46,5 +46,6 @@ void apple_glx_waitx(Display * dpy, void *ptr); int apple_get_dri_event_base(void); void apple_glapi_set_dispatch(void); +void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height); #endif diff --git a/src/glx/apple/apple_glx_pbuffer.c b/src/glx/apple/apple_glx_pbuffer.c index 2817cda..142f4cc 100644 --- a/src/glx/apple/apple_glx_pbuffer.c +++ b/src/glx/apple/apple_glx_pbuffer.c @@ -84,8 +84,7 @@ pbuffer_make_current(struct apple_glx_context *ac, } if (!ac->made_current) { - glViewport(0, 0, pbuf->width, pbuf->height); - glScissor(0, 0, pbuf->width, pbuf->height); + apple_glapi_oglfw_viewport_scissor(0, 0, pbuf->width, pbuf->height); ac->made_current = true; } diff --git a/src/glx/apple/apple_glx_pixmap.c b/src/glx/apple/apple_glx_pixmap.c index 4586707..bee0ec9 100644 --- a/src/glx/apple/apple_glx_pixmap.c +++ b/src/glx/apple/apple_glx_pixmap.c @@ -80,8 +80,7 @@ pixmap_make_current(struct apple_glx_context *ac, } if (!ac->made_current) { - glViewport(0, 0, p->width, p->height); - glScissor(0, 0, p->width, p->height); + apple_glapi_oglfw_viewport_scissor(0, 0, p->width, p->height); ac->made_current = true; } diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index 6db2910..39f5130 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -53,8 +53,7 @@ update_viewport_and_scissor(Display * dpy, GLXDrawable drawable) XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &bd, &depth); - glViewport(0, 0, width, height); - glScissor(0, 0, width, height); + apple_glapi_oglfw_viewport_scissor(0, 0, width, height); } static bool ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): apple: Silence some debug spew
Module: Mesa Branch: 7.11 Commit: 7e90db0ddcc2b4bb3139ae2852b342e30250618d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e90db0ddcc2b4bb3139ae2852b342e30250618d Author: Jeremy Huddleston Date: Thu Oct 20 22:54:08 2011 -0700 apple: Silence some debug spew Signed-off-by: Jeremy Huddleston (cherry picked from commit 098ecfad83a63bd8eb04c37f268c18d8744dff2c) --- src/glx/apple/appledri.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glx/apple/appledri.c b/src/glx/apple/appledri.c index 46c84f3..e3f9b84 100644 --- a/src/glx/apple/appledri.c +++ b/src/glx/apple/appledri.c @@ -332,12 +332,12 @@ XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable, return False; } - printf("rep.stringLength %d\n", (int) rep.stringLength); + /* printf("rep.stringLength %d\n", (int) rep.stringLength); */ if (rep.stringLength > 0 && rep.stringLength <= pathlen) { _XReadPad(dpy, path, rep.stringLength); - printf("path: %s\n", path); + /* printf("path: %s\n", path); */ *width = rep.width; *height = rep.height; @@ -404,7 +404,7 @@ XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable, if (rep.stringLength > 0 && rep.stringLength <= bufnamesize) { _XReadPad(dpy, bufname, rep.stringLength); - printf("path: %s\n", bufname); + /* printf("path: %s\n", bufname); */ *width = rep.width; *height = rep.height; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Module: Mesa Branch: master Commit: 9f2abbee6215d89e48b7fe042f8a905997f5c232 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f2abbee6215d89e48b7fe042f8a905997f5c232 Author: Jeremy Huddleston Date: Fri Oct 21 00:22:40 2011 -0700 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glapi.c | 15 +++ src/glx/apple/apple_glx.h |1 + src/glx/apple/apple_glx_pbuffer.c |3 +-- src/glx/apple/apple_glx_pixmap.c |3 +-- src/glx/apple/apple_glx_surface.c |3 +-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 34f726e..9a670bc 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -49,11 +49,9 @@ struct _glapi_table * __ogl_framework_api = NULL; struct _glapi_table * __applegl_api = NULL; -void apple_glapi_set_dispatch(void) { -if(__applegl_api) { -_glapi_set_dispatch(__applegl_api); +static void _apple_glapi_create_table(void) { +if (__applegl_api) return; -} __ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl"); assert(__ogl_framework_api); @@ -68,6 +66,15 @@ void apple_glapi_set_dispatch(void) { SET_DrawBuffer(__applegl_api, __applegl_glDrawBuffer); SET_DrawBuffersARB(__applegl_api, __applegl_glDrawBuffersARB); SET_Viewport(__applegl_api, __applegl_glViewport); +} +void apple_glapi_set_dispatch(void) { +_apple_glapi_create_table(); _glapi_set_dispatch(__applegl_api); } + +void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height) { +_apple_glapi_create_table(); +__ogl_framework_api->Viewport(x, y, width, height); +__ogl_framework_api->Scissor(x, y, width, height); +} diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h index c70fc00..ce8c488 100644 --- a/src/glx/apple/apple_glx.h +++ b/src/glx/apple/apple_glx.h @@ -46,5 +46,6 @@ void apple_glx_waitx(Display * dpy, void *ptr); int apple_get_dri_event_base(void); void apple_glapi_set_dispatch(void); +void apple_glapi_oglfw_viewport_scissor(GLint x, GLint y, GLsizei width, GLsizei height); #endif diff --git a/src/glx/apple/apple_glx_pbuffer.c b/src/glx/apple/apple_glx_pbuffer.c index 2817cda..142f4cc 100644 --- a/src/glx/apple/apple_glx_pbuffer.c +++ b/src/glx/apple/apple_glx_pbuffer.c @@ -84,8 +84,7 @@ pbuffer_make_current(struct apple_glx_context *ac, } if (!ac->made_current) { - glViewport(0, 0, pbuf->width, pbuf->height); - glScissor(0, 0, pbuf->width, pbuf->height); + apple_glapi_oglfw_viewport_scissor(0, 0, pbuf->width, pbuf->height); ac->made_current = true; } diff --git a/src/glx/apple/apple_glx_pixmap.c b/src/glx/apple/apple_glx_pixmap.c index 4586707..bee0ec9 100644 --- a/src/glx/apple/apple_glx_pixmap.c +++ b/src/glx/apple/apple_glx_pixmap.c @@ -80,8 +80,7 @@ pixmap_make_current(struct apple_glx_context *ac, } if (!ac->made_current) { - glViewport(0, 0, p->width, p->height); - glScissor(0, 0, p->width, p->height); + apple_glapi_oglfw_viewport_scissor(0, 0, p->width, p->height); ac->made_current = true; } diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c index 6db2910..39f5130 100644 --- a/src/glx/apple/apple_glx_surface.c +++ b/src/glx/apple/apple_glx_surface.c @@ -53,8 +53,7 @@ update_viewport_and_scissor(Display * dpy, GLXDrawable drawable) XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &bd, &depth); - glViewport(0, 0, width, height); - glScissor(0, 0, width, height); + apple_glapi_oglfw_viewport_scissor(0, 0, width, height); } static bool ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Silence some debug spew
Module: Mesa Branch: master Commit: 098ecfad83a63bd8eb04c37f268c18d8744dff2c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=098ecfad83a63bd8eb04c37f268c18d8744dff2c Author: Jeremy Huddleston Date: Thu Oct 20 22:54:08 2011 -0700 apple: Silence some debug spew Signed-off-by: Jeremy Huddleston --- src/glx/apple/appledri.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glx/apple/appledri.c b/src/glx/apple/appledri.c index 46c84f3..e3f9b84 100644 --- a/src/glx/apple/appledri.c +++ b/src/glx/apple/appledri.c @@ -332,12 +332,12 @@ XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable, return False; } - printf("rep.stringLength %d\n", (int) rep.stringLength); + /* printf("rep.stringLength %d\n", (int) rep.stringLength); */ if (rep.stringLength > 0 && rep.stringLength <= pathlen) { _XReadPad(dpy, path, rep.stringLength); - printf("path: %s\n", path); + /* printf("path: %s\n", path); */ *width = rep.width; *height = rep.height; @@ -404,7 +404,7 @@ XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable, if (rep.stringLength > 0 && rep.stringLength <= bufnamesize) { _XReadPad(dpy, bufname, rep.stringLength); - printf("path: %s\n", bufname); + /* printf("path: %s\n", bufname); */ *width = rep.width; *height = rep.height; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.10): Fix PPC detection on darwin
Module: Mesa Branch: 7.10 Commit: 7c3cf50d9988d721e79277180e29aaf6afa40be5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c3cf50d9988d721e79277180e29aaf6afa40be5 Author: Jeremy Huddleston Date: Sun Jul 31 09:21:56 2011 -0700 Fix PPC detection on darwin Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e Signed-off-by: Jeremy Huddleston (cherry picked from commit e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8) --- src/gallium/include/pipe/p_config.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2..2b55745 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,9 +99,9 @@ #endif #endif -#if defined(__PPC__) +#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) #define PIPE_ARCH_PPC -#if defined(__PPC64__) +#if defined(__ppc64__) || defined(__PPC64__) #define PIPE_ARCH_PPC_64 #endif #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): darwin: Use machine/endian.h to determine endianness
Module: Mesa Branch: 7.11 Commit: 6c72801c2b0eab1b98491244282b98dbeac5d140 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c72801c2b0eab1b98491244282b98dbeac5d140 Author: Jeremy Huddleston Date: Sun Jul 31 09:31:48 2011 -0700 darwin: Use machine/endian.h to determine endianness Signed-off-by: Jeremy Huddleston (cherry picked from commit 5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5) --- src/gallium/include/pipe/p_config.h |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 803b806..8a5d892 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -120,6 +120,15 @@ # define PIPE_ARCH_BIG_ENDIAN #endif +#elif defined(__APPLE__) +#include + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN +# define PIPE_ARCH_LITTLE_ENDIAN +#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN +# define PIPE_ARCH_BIG_ENDIAN +#endif + #else #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.11): Fix PPC detection on darwin
Module: Mesa Branch: 7.11 Commit: 0d2c36953539043b14bb5d785981fab6126866b3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d2c36953539043b14bb5d785981fab6126866b3 Author: Jeremy Huddleston Date: Sun Jul 31 09:21:56 2011 -0700 Fix PPC detection on darwin Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e Signed-off-by: Jeremy Huddleston (cherry picked from commit e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8) --- src/gallium/include/pipe/p_config.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index eea3d79..803b806 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,9 +99,9 @@ #endif #endif -#if defined(__PPC__) +#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) #define PIPE_ARCH_PPC -#if defined(__PPC64__) +#if defined(__ppc64__) || defined(__PPC64__) #define PIPE_ARCH_PPC_64 #endif #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Use machine/endian.h to determine endianness
Module: Mesa Branch: master Commit: 5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5 Author: Jeremy Huddleston Date: Sun Jul 31 09:31:48 2011 -0700 darwin: Use machine/endian.h to determine endianness Signed-off-by: Jeremy Huddleston --- src/gallium/include/pipe/p_config.h |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 803b806..8a5d892 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -120,6 +120,15 @@ # define PIPE_ARCH_BIG_ENDIAN #endif +#elif defined(__APPLE__) +#include + +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN +# define PIPE_ARCH_LITTLE_ENDIAN +#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN +# define PIPE_ARCH_BIG_ENDIAN +#endif + #else #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Fix PPC detection on darwin
Module: Mesa Branch: master Commit: e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8 Author: Jeremy Huddleston Date: Sun Jul 31 09:21:56 2011 -0700 Fix PPC detection on darwin Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e Signed-off-by: Jeremy Huddleston --- src/gallium/include/pipe/p_config.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index eea3d79..803b806 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,9 +99,9 @@ #endif #endif -#if defined(__PPC__) +#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) #define PIPE_ARCH_PPC -#if defined(__PPC64__) +#if defined(__ppc64__) || defined(__PPC64__) #define PIPE_ARCH_PPC_64 #endif #endif ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): darwin: Include glxhash.c in libGL on darwin
Module: Mesa Branch: master Commit: 7eed3d4808097606bf2854e687589a8503db435d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eed3d4808097606bf2854e687589a8503db435d Author: Jeremy Huddleston Date: Sat Jul 16 22:02:55 2011 -0700 darwin: Include glxhash.c in libGL on darwin Fixes a build regression introduced by 4df137691ee29bb812347fa2c5f19095243ede22 Signed-off-by: Jeremy Huddleston --- src/glx/apple/Makefile |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile index c27f7d1..6868d28 100644 --- a/src/glx/apple/Makefile +++ b/src/glx/apple/Makefile @@ -46,6 +46,7 @@ SOURCES = \ ../glxcurrent.c \ ../glxext.c \ ../glxextensions.c \ + ../glxhash.c \ glxreply.c \ ../pixel.c \ ../xfont.c \ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Bind to our context before __glXSetCurrentContext
Module: Mesa Branch: master Commit: 4fbdde889ce5875243c588e4c7c9f4b775d0d7a5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fbdde889ce5875243c588e4c7c9f4b775d0d7a5 Author: Jeremy Huddleston Date: Fri Jun 17 12:24:55 2011 -0700 glx: Bind to our context before __glXSetCurrentContext We want to bind to our context before calling __glXSetCurrentContext or messing with the gc rect in order to properly handle error conditions. Signed-off-by: Jeremy Huddleston --- src/glx/glxcurrent.c | 25 - 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 0f39ee5..6f048ae 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -212,7 +212,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, { struct glx_context *gc = (struct glx_context *) gc_user; struct glx_context *oldGC = __glXGetCurrentContext(); - int ret = Success; /* XXX: If this is left out, then libGL ends up not having this * symbol, and drivers using it fail to load. Compare the @@ -259,15 +258,28 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, } if (gc) { + /* Attempt to bind the context. We do this before mucking with + * gc and __glXSetCurrentContext to properly handle our state in + * case of an error. + * + * If an error occurs, set the Null context since we've already + * blown away our old context. The caller is responsible for + * figuring out how to handle setting a valid context. + */ + if (gc->vtable->bind(gc, oldGC, draw, read) != Success) { + __glXSetCurrentContextNull(); + __glXUnlock(); + __glXGenerateError(dpy, None, GLXBadContext, X_GLXMakeContextCurrent); + return GL_FALSE; + } + if (gc->thread_refcount == 0) gc->currentDpy = dpy; - __glXSetCurrentContext(gc); - ret = gc->vtable->bind(gc, oldGC, draw, read); - if (gc->thread_refcount == 0) { gc->currentDrawable = draw; gc->currentReadable = read; } gc->thread_refcount++; + __glXSetCurrentContext(gc); } else { __glXSetCurrentContextNull(); } @@ -281,11 +293,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, __glXUnlock(); - if (ret) { - __glXGenerateError(dpy, None, ret, X_GLXMakeContextCurrent); - return GL_FALSE; - } - return GL_TRUE; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Destroy the old context only after the new one has been bound
Module: Mesa Branch: master Commit: 517614141be2a1f392a4ea87c1077911ccadf35f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=517614141be2a1f392a4ea87c1077911ccadf35f Author: Jeremy Huddleston Date: Fri Jun 17 12:28:05 2011 -0700 glx: Destroy the old context only after the new one has been bound This fixes a regression introduced by 49d7e48b33264d94e30af6129c281b6acafa9427 Signed-off-by: Jeremy Huddleston --- src/glx/glxcurrent.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 9eb7d5a..0f39ee5 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -255,13 +255,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, if (--oldGC->thread_refcount == 0) { oldGC->vtable->unbind(oldGC, gc); oldGC->currentDpy = 0; - -if (oldGC->xid == None && oldGC != gc) { - /* We are switching away from a context that was -* previously destroyed, so we need to free the memory -* for the old handle. */ - oldGC->vtable->destroy(oldGC); -} } } @@ -279,6 +272,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, __glXSetCurrentContextNull(); } + if (oldGC->thread_refcount == 0 && oldGC != &dummyContext && oldGC->xid == None) { + /* We are switching away from a context that was + * previously destroyed, so we need to free the memory + * for the old handle. */ + oldGC->vtable->destroy(oldGC); + } + __glXUnlock(); if (ret) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glx: Allow a context-specific fallback for glXGetProcAddress
Module: Mesa Branch: master Commit: 559e4f8ebcb186b491d7d687ac43f22a62448fc1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=559e4f8ebcb186b491d7d687ac43f22a62448fc1 Author: Jeremy Huddleston Date: Wed Jun 15 00:27:55 2011 -0700 glx: Allow a context-specific fallback for glXGetProcAddress In applegl, GLX advertises the same extensions provided by OpenGL.framework even if such extensions are not provided by glapi. This allows a client to get access to such API. Signed-off-by: Jeremy Huddleston --- src/glx/applegl_glx.c |9 + src/glx/dri2_glx.c |1 + src/glx/dri_glx.c |1 + src/glx/drisw_glx.c|1 + src/glx/glxclient.h|2 +- src/glx/glxcmds.c |6 ++ src/glx/indirect_glx.c |1 + 7 files changed, 20 insertions(+), 1 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 4bf4672..8766c88 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -34,10 +34,12 @@ #if defined(GLX_USE_APPLEGL) #include +#include #include "glxclient.h" #include "apple_glx_context.h" #include "apple_glx.h" +#include "apple_cgl.h" #include "glx_error.h" static void @@ -82,6 +84,12 @@ applegl_wait_x(struct glx_context *gc) apple_glx_waitx(dpy, gc->driContext); } +static void * +applegl_get_proc_address(const char *symbol) +{ + return dlsym(apple_cgl_get_dl_handle(), symbol); +} + static const struct glx_context_vtable applegl_context_vtable = { applegl_destroy_context, applegl_bind_context, @@ -91,6 +99,7 @@ static const struct glx_context_vtable applegl_context_vtable = { DRI_glXUseXFont, NULL, /* bind_tex_image, */ NULL, /* release_tex_image, */ + applegl_get_proc_address, }; struct glx_context * diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index e7c18ff..80e4da3 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -767,6 +767,7 @@ static const struct glx_context_vtable dri2_context_vtable = { DRI_glXUseXFont, dri2_bind_tex_image, dri2_release_tex_image, + NULL, /* get_proc_address */ }; static void diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index d59784c..6f3b2b8 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -558,6 +558,7 @@ static const struct glx_context_vtable dri_context_vtable = { DRI_glXUseXFont, NULL, NULL, + NULL, /* get_proc_address */ }; static struct glx_context * diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 0075695..07d4955 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -296,6 +296,7 @@ static const struct glx_context_vtable drisw_context_vtable = { DRI_glXUseXFont, NULL, NULL, + NULL, /* get_proc_address */ }; static struct glx_context * diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 88a6edd..0641528 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -224,7 +224,7 @@ struct glx_context_vtable { GLXDrawable drawable, int buffer, const int *attrib_list); void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer); - + void * (*get_proc_address)(const char *symbol); }; extern void diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index cd8bc97..e6816ea 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -2521,6 +2521,12 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void) #endif if (!f) f = (gl_function) _glapi_get_proc_address((const char *) procName); + if (!f) { + struct glx_context *gc = __glXGetCurrentContext(); + + if (gc != NULL && gc->vtable->get_proc_address != NULL) +f = gc->vtable->get_proc_address((const char *) procName); + } } return f; } diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index b4f16c7..7b542dd 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -335,6 +335,7 @@ static const struct glx_context_vtable indirect_context_vtable = { indirect_use_x_font, indirect_bind_tex_image, indirect_release_tex_image, + NULL, /* get_proc_address */ }; /** ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
Module: Mesa Branch: master Commit: fbd7448977efd49afba322cbb0853e9981ec2d2d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fbd7448977efd49afba322cbb0853e9981ec2d2d Author: Jeremy Huddleston Date: Wed Jun 15 17:30:56 2011 -0700 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so FramebufferTextureLayerARB needs to be listed as an alias of FramebufferTextureLayerEXT rather than FramebufferTextureLayer. Signed-off-by: Jeremy Huddleston --- src/mapi/glapi/gen/ARB_geometry_shader4.xml |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml b/src/mapi/glapi/gen/ARB_geometry_shader4.xml index ca9a101..d9e540f 100644 --- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml +++ b/src/mapi/glapi/gen/ARB_geometry_shader4.xml @@ -38,7 +38,7 @@ - + ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Module: Mesa Branch: master Commit: cb5a5f055b6a9f05aed927d28a242bde81dd5bfc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb5a5f055b6a9f05aed927d28a242bde81dd5bfc Author: Jeremy Huddleston Date: Wed Jun 15 00:22:00 2011 -0700 apple: Use apple_cgl_get_dl_handle() rather than opening a new handle Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glapi.c | 24 ++-- 1 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 0c89f46..34f726e 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -44,38 +44,18 @@ #include "apple_glx.h" #include "apple_xgl_api.h" - -#ifndef OPENGL_FRAMEWORK_PATH -#define OPENGL_FRAMEWORK_PATH "/System/Library/Frameworks/OpenGL.framework/OpenGL" -#endif +#include "apple_cgl.h" struct _glapi_table * __ogl_framework_api = NULL; struct _glapi_table * __applegl_api = NULL; void apple_glapi_set_dispatch(void) { -static void *handle; -const char *opengl_framework_path; - if(__applegl_api) { _glapi_set_dispatch(__applegl_api); return; } -opengl_framework_path = getenv("OPENGL_FRAMEWORK_PATH"); -if (!opengl_framework_path) { -opengl_framework_path = OPENGL_FRAMEWORK_PATH; -} - -(void) dlerror();/*drain dlerror */ -handle = dlopen(opengl_framework_path, RTLD_LOCAL); - -if (!handle) { -fprintf(stderr, "error: unable to dlopen %s : %s\n", -opengl_framework_path, dlerror()); -abort(); -} - -__ogl_framework_api = _glapi_create_table_from_handle(handle, "gl"); +__ogl_framework_api = _glapi_create_table_from_handle(apple_cgl_get_dl_handle(), "gl"); assert(__ogl_framework_api); __applegl_api = malloc(sizeof(struct _glapi_table)); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
Module: Mesa Branch: master Commit: 1e16c34c5c86690b26739fbad82617768b1bd837 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e16c34c5c86690b26739fbad82617768b1bd837 Author: Jeremy Huddleston Date: Tue Jun 14 12:34:49 2011 -0700 glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL This change to _glapi_create_table_from_handle causes it to fill the dispatch table with NoOps for unimplemented functionality. This matches what is done in indirect_init.c and also allows us to enable logging (when built with -DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to catch cases where clients are trying to use these unimplemented extentions. Additionally, this fixes some gcc -pedantic warnings. Signed-off-by: Jeremy Huddleston --- src/mapi/glapi/gen/gl_gentable.py | 44 +- src/mapi/glapi/glapi_gentable.c | 5208 +++-- 2 files changed, 2666 insertions(+), 2586 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=1e16c34c5c86690b26739fbad82617768b1bd837 ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): apple: Set the glapi dispatch table on context bind
Module: Mesa Branch: master Commit: a128355ecb5b782a69461a04991e4cffb32249db URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a128355ecb5b782a69461a04991e4cffb32249db Author: Jeremy Huddleston Date: Tue Jun 14 00:45:12 2011 -0700 apple: Set the glapi dispatch table on context bind Signed-off-by: Jeremy Huddleston --- src/glx/apple/apple_glapi.c |2 +- src/glx/apple/apple_glx.c |1 - src/glx/apple/apple_glx.h |2 +- src/glx/applegl_glx.c |2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/glx/apple/apple_glapi.c b/src/glx/apple/apple_glapi.c index 66933f5..0c89f46 100644 --- a/src/glx/apple/apple_glapi.c +++ b/src/glx/apple/apple_glapi.c @@ -52,7 +52,7 @@ struct _glapi_table * __ogl_framework_api = NULL; struct _glapi_table * __applegl_api = NULL; -void apple_xgl_init_direct(void) { +void apple_glapi_set_dispatch(void) { static void *handle; const char *opengl_framework_path; diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index a76cb4c..d94c1e0 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -131,7 +131,6 @@ apple_init_glx(Display * dpy) } apple_cgl_init(); - apple_xgl_init_direct(); (void) apple_glx_get_client_id(); XAppleDRISetSurfaceNotifyHandler(surface_notify_handler); diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h index 25f5ea6..c70fc00 100644 --- a/src/glx/apple/apple_glx.h +++ b/src/glx/apple/apple_glx.h @@ -45,6 +45,6 @@ void apple_glx_swap_buffers(void *ptr); void apple_glx_waitx(Display * dpy, void *ptr); int apple_get_dri_event_base(void); -void apple_xgl_init_direct(void); +void apple_glapi_set_dispatch(void); #endif diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 92c785f..4bf4672 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -59,6 +59,8 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old, if (error) return 1; /* GLXBadContext is the same as Success (0) */ + apple_glapi_set_dispatch(); + return Success; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.10): apple: Dead code removal
Module: Mesa Branch: 7.10 Commit: 338e8e5f146eb0f2497d21222d2ebbaf6a5774a4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=338e8e5f146eb0f2497d21222d2ebbaf6a5774a4 Author: Jeremy Huddleston Date: Mon Jun 13 12:10:38 2011 -0700 apple: Dead code removal Signed-off-by: Jeremy Huddleston (cherry picked from commit e903cc17bbf7152b3f7d64fe7fbb5ceebcc7452e) (cherry picked from commit 5078cb68586a52e2a2a991c6e89ed42e8bac7d96) --- src/glx/applegl_glx.c |1 - src/glx/glxclient.h |1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index e888a0f..92c785f 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -116,7 +116,6 @@ applegl_create_context(struct glx_screen *psc, gc->vtable = &applegl_context_vtable; gc->driContext = NULL; - gc->do_destroy = False; /* TODO: darwin: Integrate with above to do indirect */ if(apple_glx_create_context(&gc->driContext, dpy, screen, config, diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 2152e16..9b795ff 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -343,7 +343,6 @@ struct glx_context #if defined(GLX_DIRECT_RENDERING) && defined(GLX_USE_APPLEGL) void *driContext; - Bool do_destroy; #endif /** ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.10): apple: applegl_destroy_context: Pass along the correct display
Module: Mesa Branch: 7.10 Commit: 5255e844afb7b2618cfdbe9a724d95382dc203f8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5255e844afb7b2618cfdbe9a724d95382dc203f8 Author: Jeremy Huddleston Date: Mon Jun 13 12:00:55 2011 -0700 apple: applegl_destroy_context: Pass along the correct display Signed-off-by: Jeremy Huddleston (cherry picked from commit c6cf82fb553405bee241170f6e51cafd751d46ea) --- src/glx/applegl_glx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 9b8605f..e888a0f 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -43,7 +43,7 @@ static void applegl_destroy_context(struct glx_context *gc) { - apple_glx_destroy_context(&gc->driContext, gc->currentDpy); + apple_glx_destroy_context(&gc->driContext, gc->psc->dpy); } static int ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (7.9): apple: Dead code removal
Module: Mesa Branch: 7.9 Commit: 5078cb68586a52e2a2a991c6e89ed42e8bac7d96 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5078cb68586a52e2a2a991c6e89ed42e8bac7d96 Author: Jeremy Huddleston Date: Mon Jun 13 12:10:38 2011 -0700 apple: Dead code removal Signed-off-by: Jeremy Huddleston (cherry picked from commit e903cc17bbf7152b3f7d64fe7fbb5ceebcc7452e) --- src/glx/applegl_glx.c |1 - src/glx/glxclient.h |1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index e888a0f..92c785f 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -116,7 +116,6 @@ applegl_create_context(struct glx_screen *psc, gc->vtable = &applegl_context_vtable; gc->driContext = NULL; - gc->do_destroy = False; /* TODO: darwin: Integrate with above to do indirect */ if(apple_glx_create_context(&gc->driContext, dpy, screen, config, diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 0c99024..390e6b0 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -344,7 +344,6 @@ struct glx_context #if defined(GLX_DIRECT_RENDERING) && defined(GLX_USE_APPLEGL) void *driContext; - Bool do_destroy; #endif /** ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit