Mesa (master): Add processor topology calculation implementation for Darwin/OSX targets.

2018-03-14 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 67f27b1e18d8e68c795f2eb43c06abfe4b6fcaca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=67f27b1e18d8e68c795f2eb43c06abfe4b6fcaca

Author: Apple SWE <jerem...@apple.com>
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 <jerem...@apple.com>
Reviewed-by: Bruce Cherniak <bruce.chern...@intel.com>

---

 .../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", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numPhysicalIds = value;
+
+result = sysctlbyname("hw.logicalcpu", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numProcessors = value;
+
+result = sysctlbyname("hw.physicalcpu", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numCores = value;
+
+out_nodes.resize(numPhysicalIds);
+
+for (auto physId = 0; physId < numPhysicalIds; ++physId)
+{
+auto  = out_nodes[physId];
+auto procId = 0;
+
+numaNode.cores.resize(numCores);
+
+while (procId < numProcessors)
+{
+for (auto coreId = 0; coreId < numaNode.cores.size(); ++coreId, 
++procId)
+{
+auto  = numaNode.cores[coreId];
+
+core.procGroup = coreId;
+core.threadIds.push_back(procId);
+}
+}
+}
+
+out_numThreadsPerProcGroup = 0;
+
+for (auto  : out_nodes)
+{
+for (auto  : 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.

2018-03-14 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 361f79c97f6eb4bfdb2162672d2ca8f3c486f22c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=361f79c97f6eb4bfdb2162672d2ca8f3c486f22c

Author: Apple SWE <jerem...@apple.com>
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 <jerem...@apple.com>
Reviewed-by: Bruce Cherniak <bruce.chern...@intel.com>

---

 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): sched.h needs to be imported on Darwin/OSX targets.

2018-03-13 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 9dc5063262d0a5130cf0723a33079f3fd17560c3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dc5063262d0a5130cf0723a33079f3fd17560c3

Author: Apple SWE <jerem...@apple.com>
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 <jerem...@apple.com>
Signed-off-by: Jeremy Huddleston Sequoia <jerem...@apple.com>

---

 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.

2018-03-13 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: de0d10db93d85de79c7b4451c4851ace2976f8f4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=de0d10db93d85de79c7b4451c4851ace2976f8f4

Author: Apple SWE <jerem...@apple.com>
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 <jerem...@apple.com>
Signed-off-by: Jeremy Huddleston Sequoia <jerem...@apple.com>

---

 .../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", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numPhysicalIds = value;
+
+result = sysctlbyname("hw.logicalcpu", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numProcessors = value;
+
+result = sysctlbyname("hw.physicalcpu", , , NULL, 0);
+SWR_ASSERT(result == 0);
+numCores = value;
+
+out_nodes.resize(numPhysicalIds);
+
+for (auto physId = 0; physId < numPhysicalIds; ++physId)
+{
+auto  = out_nodes[physId];
+auto procId = 0;
+
+numaNode.cores.resize(numCores);
+
+while (procId < numProcessors)
+{
+for (auto coreId = 0; coreId < numaNode.cores.size(); ++coreId, 
++procId)
+{
+auto  = numaNode.cores[coreId];
+
+core.procGroup = coreId;
+core.threadIds.push_back(procId);
+}
+}
+}
+
+out_numThreadsPerProcGroup = 0;
+
+for (auto  : out_nodes)
+{
+for (auto  : 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

2017-09-13 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: e7ef901650b92052d07f578a7884c53e93554d4c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7ef901650b92052d07f578a7884c53e93554d4c

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 <jerem...@apple.com>
Reviewed-by: Matt Turner <matts...@gmail.com>

---

 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

2017-08-17 Thread Jeremy Huddleston
Module: Mesa
Branch: 17.2
Commit: cc8ae8842b97bad48280b51d770d4291be575097
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc8ae8842b97bad48280b51d770d4291be575097

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 <jerem...@apple.com>
(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 !=  && apple_glx_is_current_drawable(dpy, 
gc->driContext, drawable)) {
+   if(gc !=  && 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

2017-08-17 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: c1c4c18a80bb36946b1596f14c0397d4fb029f6e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1c4c18a80bb36946b1596f14c0397d4fb029f6e

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 <jerem...@apple.com>

---

 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 !=  && apple_glx_is_current_drawable(dpy, 
gc->driContext, drawable)) {
+   if(gc !=  && 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 "

2016-01-22 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 7c99557f53b9109a777b771e3e6479862e556071
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c99557f53b9109a777b771e3e6479862e556071

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 some function prototype mismatching

2016-01-21 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: a087a09fa86f9617af98f6294dd2228555a4891c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a087a09fa86f9617af98f6294dd2228555a4891c

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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
  'void (unsigned long, int, const char *const *, const int *)') to 
parameter of type 'void (*)(GLuint, GLsizei, const GLchar *const *, const GLint 
*)' (aka 'void (*)(unsigned
int, int,
  const char *const *, const int *)') [-Wincompatible-pointer-types]
  SET_ShaderSourc

Mesa (master): mesa: Fix format warnings

2016-01-21 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: b20d6bf96d8a751cdc2ec36886c9c47d6e93a8ef
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b20d6bf96d8a751cdc2ec36886c9c47d6e93a8ef

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 <jerem...@apple.com>
Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>

---

 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

2016-01-21 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 739ac3d39dacdede853d150b9903001524453330
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=739ac3d39dacdede853d150b9903001524453330

Author: Jeremy Huddleston Sequoia <jerem...@apple.com>
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 <jerem...@apple.com>
Reviewed-by: Nicolai Hähnle <nhaeh...@gmail.com>

---

 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): darwin: build fix

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: e68b67b53fce39a8c93188262d9e795ca50750ac
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e68b67b53fce39a8c93188262d9e795ca50750ac

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com

---

 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

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.5
Commit: d03de1dd7d2261382305ea5695f9f510bc9e7dd4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d03de1dd7d2261382305ea5695f9f510bc9e7dd4

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 1c67a5687a35e984323b6034adb914a66d64bb2f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c67a5687a35e984323b6034adb914a66d64bb2f

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com

---

 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

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.5
Commit: b1b7b5b068441eccac382edab0f0872e3834be45
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1b7b5b068441eccac382edab0f0872e3834be45

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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.4): darwin: build fix

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.4
Commit: 162cee83ba98abb6ee21bb270ff0c6a09e97cd1f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=162cee83ba98abb6ee21bb270ff0c6a09e97cd1f

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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

2015-02-11 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.4
Commit: 654f197f1965d5be52b96c2f1af27d8bc96f9c78
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=654f197f1965d5be52b96c2f1af27d8bc96f9c78

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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): swrast: Fix -Wduplicate-decl-specifier warning

2015-01-01 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 61711316f50294959e48156229f1383002e1cdb8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=61711316f50294959e48156229f1383002e1cdb8

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com

---

 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 (8.0): darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context

2014-05-31 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 13b415f1011cdf8737562398b892516eb65cc9e6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13b415f1011cdf8737562398b892516eb65cc9e6

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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 (master): darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context

2014-05-31 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: b4f34241ec850fbeffcb3278fea85f06d1666c43
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4f34241ec850fbeffcb3278fea85f06d1666c43

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com

---

 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 (master): darwin: Write errors in choosing the pixel format to the crash log

2014-05-24 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 9eb1d36c978a9b15ae2e999c630492dfffd7f165
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9eb1d36c978a9b15ae2e999c630492dfffd7f165

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com

---

 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: Guard Core Profile usage behind a testing envvar

2014-05-24 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 04ce3be4010305902cc5ae81e8e0c8550d043a1e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ce3be4010305902cc5ae81e8e0c8550d043a1e

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat May 24 14:08:16 2014 -0700

darwin: Guard Core Profile usage behind a testing envvar

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com

---

 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.

2014-05-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: f0702d6e631bb912a230c081463bb51a0dde1bff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0702d6e631bb912a230c081463bb51a0dde1bff

Author: Jon TURNEY jon.tur...@dronecode.org.uk
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 jon.tur...@dronecode.org.uk
Reviewed-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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 (8.0): darwin: Write errors in choosing the pixel format to the crash log

2014-05-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 1b2f877c8ef052b183c1f20ece6c6e4a7bfd237c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b2f877c8ef052b183c1f20ece6c6e4a7bfd237c

Author: Jeremy Huddleston Sequoia jerem...@apple.com
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 jerem...@apple.com
(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

2014-05-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 9d6e12eb6b06202519e48a7321f32944d7a34b0f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d6e12eb6b06202519e48a7321f32944d7a34b0f

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat May 24 14:08:16 2014 -0700

darwin: Guard Core Profile usage behind a testing envvar

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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 (master): glapi: Avoid heap corruption in _glapi_table

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: ff5456d1acf6f627a6837be3f3f37c6a268c9e8e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff5456d1acf6f627a6837be3f3f37c6a268c9e8e

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 01:37:58 2014 -0700

glapi: Avoid heap corruption in _glapi_table

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
Reviewed-by: Chia-I Wu o...@lunarg.com

---

 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.2): glapi: Avoid heap corruption in _glapi_table

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.2
Commit: ac49f97f12324733220428128bce3f460fbffbbd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac49f97f12324733220428128bce3f460fbffbbd

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 01:37:58 2014 -0700

glapi: Avoid heap corruption in _glapi_table

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
Reviewed-by: Chia-I Wu o...@lunarg.com
(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

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.1
Commit: ea5839c8fef1fbaee8a8a5a6389f35dd537dccfc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea5839c8fef1fbaee8a8a5a6389f35dd537dccfc

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 01:37:58 2014 -0700

glapi: Avoid heap corruption in _glapi_table

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
Reviewed-by: Chia-I Wu o...@lunarg.com
(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 (8.0): glapi: Avoid heap corruption in _glapi_table

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 629600450b3845a768c0edc92ea3f444d03a2738
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=629600450b3845a768c0edc92ea3f444d03a2738

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 01:37:58 2014 -0700

glapi: Avoid heap corruption in _glapi_table

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
Reviewed-by: Chia-I Wu o...@lunarg.com
(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): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.2
Commit: 25e641213fdbf43ee3b57f2b9f5a92aad7397a69
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=25e641213fdbf43ee3b57f2b9f5a92aad7397a69

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 10:53:00 2014 -0700

darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 10.1
Commit: ec83a39e2b950982307825cbb64fbbe3c2934838
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec83a39e2b950982307825cbb64fbbe3c2934838

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 10:53:00 2014 -0700

darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: ba59a779ed41e08fa16805c1c60da39885546d0e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba59a779ed41e08fa16805c1c60da39885546d0e

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 10:53:00 2014 -0700

darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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 (master): darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

2014-05-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a109268ab5b3544e7f7b99e84ef1fdf54023fb4

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Tue May 20 10:53:00 2014 -0700

darwin: Fix test for kCGLPFAOpenGLProfile support at runtime

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com

---

 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 (9.2): Apple: glFlush() is not needed with CGLFlushDrawable()

2013-07-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 9.2
Commit: ee421aec32aa543d8409a053ca3472e8997ddd30
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee421aec32aa543d8409a053ca3472e8997ddd30

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat Jul 20 10:25:28 2013 -0700

Apple: glFlush() is not needed with CGLFlushDrawable()

rdar://problem/14496373

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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.1): Apple: glFlush() is not needed with CGLFlushDrawable()

2013-07-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 9.1
Commit: 226ea340d9a440be0577876e031ebd05ab0ce508
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=226ea340d9a440be0577876e031ebd05ab0ce508

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat Jul 20 10:25:28 2013 -0700

Apple: glFlush() is not needed with CGLFlushDrawable()

rdar://problem/14496373

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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): Apple: glFlush() is not needed with CGLFlushDrawable()

2013-07-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 9.0
Commit: 1041bfe6ddc14623d95de318972b65386a0e235b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1041bfe6ddc14623d95de318972b65386a0e235b

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat Jul 20 10:25:28 2013 -0700

Apple: glFlush() is not needed with CGLFlushDrawable()

rdar://problem/14496373

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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()

2013-07-20 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 9c50093adff0c7531ab32a7ec9ce3b91712b4d20
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c50093adff0c7531ab32a7ec9ce3b91712b4d20

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat Jul 20 10:25:28 2013 -0700

Apple: glFlush() is not needed with CGLFlushDrawable()

rdar://problem/14496373

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com
(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()

2013-07-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: fa5ed99d8e809fb86e486a40273a4a6971055398
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa5ed99d8e809fb86e486a40273a4a6971055398

Author: Jeremy Huddleston Sequoia jerem...@apple.com
Date:   Sat Jul 20 10:25:28 2013 -0700

Apple: glFlush() is not needed with CGLFlushDrawable()

rdar://problem/14496373

Signed-off-by: Jeremy Huddleston Sequoia jerem...@apple.com

---

 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): darwin: do not create double-buffered offscreen pixel formats

2012-09-24 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 5fdf1f784bf449d7ce9839506fa23c5357696c4c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fdf1f784bf449d7ce9839506fa23c5357696c4c

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com

---

 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

2012-09-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 59997d619d8957fca3b2042fe4ebeed0709c0204
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=59997d619d8957fca3b2042fe4ebeed0709c0204

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com
(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 (9.0): darwin: do not create double-buffered offscreen pixel formats

2012-09-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 9.0
Commit: 2fe673fec3d602ba2b686eedbdf2d70a42794a82
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fe673fec3d602ba2b686eedbdf2d70a42794a82

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com
(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: Address a build failure on Leopard and earlier OS versions

2012-05-18 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: e69758260b0403d47ec61692e1fc18bcbb14865e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e69758260b0403d47ec61692e1fc18bcbb14865e

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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: Address a build failure on Leopard and earlier OS versions

2012-05-18 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 27b821bc95ea01cc4292ada9c7c65211580d1f98
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=27b821bc95ea01cc4292ada9c7c65211580d1f98

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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 (7.11): darwin: Unlock our mutex before destroying it

2012-05-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 60fa18b90fef1c67f52d610abed0d2ac39238deb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=60fa18b90fef1c67f52d610abed0d2ac39238deb

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (7.11): darwin: Eliminate a possible race condition while destroying a surface

2012-05-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: ecf0bef4cdd58010d25fe845c6da76bbb35f8898
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecf0bef4cdd58010d25fe845c6da76bbb35f8898

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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

2012-05-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 7e624edba4c9f0fb2bcc322ef0b1b6401aa0a075
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e624edba4c9f0fb2bcc322ef0b1b6401aa0a075

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (8.0): darwin: Eliminate a possible race condition while destroying a surface

2012-05-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 9724c8d13c09773dcf9674f15accd8f2f4d148ff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9724c8d13c09773dcf9674f15accd8f2f4d148ff

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (master): darwin: Eliminate a possible race condition while destroying a surface

2012-05-16 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: d65bd195ecbd6623b962a3c98725a484ef2791a8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d65bd195ecbd6623b962a3c98725a484ef2791a8

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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: Fix an error message

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 244dc0521439379a0a44f81ba432aa04ca6c1a91
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=244dc0521439379a0a44f81ba432aa04ca6c1a91

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Apr 29 00:27:03 2012 -0700

darwin: Fix an error message

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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: Make reported errors more user-friendly

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: cf5db0a418b63d71385b43897a7ea9be7bb785d1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf5db0a418b63d71385b43897a7ea9be7bb785d1

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sat Apr 28 16:50:00 2012 -0700

darwin: Make reported errors more user-friendly

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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 stdlib.h
 #include assert.h
 #include pthread.h
+#include string.h
 #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: Use ASL for logging

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 51691f0767f6a75a1f549cd979a878a0ad12a228
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=51691f0767f6a75a1f549cd979a878a0ad12a228

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sat Apr 28 23:19:42 2012 -0700

darwin: Use ASL for logging

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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 assert.h
 #include stdarg.h
 #include dlfcn.h
+#include pthread.h
+#include inttypes.h
 #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 Xplugin.h
 
-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 sys/cdefs.h
+#include asl.h
+#include stdio.h
+#include stdbool.h
+#include stdint.h
+#include stdlib.h
+#include inttypes.h
+#include pthread.h
+#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 (8.0): darwin: Fix an error message

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 8010ff17ae931e17dd9d5eead91b144dce146147
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8010ff17ae931e17dd9d5eead91b144dce146147

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Apr 29 00:27:03 2012 -0700

darwin: Fix an error message

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (8.0): darwin: Make reported errors more user-friendly

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: f818673acbff14cbf6dc57bd420ef6a0db164df3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f818673acbff14cbf6dc57bd420ef6a0db164df3

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sat Apr 28 16:50:00 2012 -0700

darwin: Make reported errors more user-friendly

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 stdlib.h
 #include assert.h
 #include pthread.h
+#include string.h
 #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: Use ASL for logging

2012-05-03 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: f36e638c761c0b11a053cc2b21c9fda2402119ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f36e638c761c0b11a053cc2b21c9fda2402119ca

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sat Apr 28 23:19:42 2012 -0700

darwin: Use ASL for logging

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 assert.h
 #include stdarg.h
 #include dlfcn.h
+#include pthread.h
+#include inttypes.h
 #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 Xplugin.h
 
-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 sys/cdefs.h
+#include asl.h
+#include stdio.h
+#include stdbool.h
+#include stdint.h
+#include stdlib.h
+#include inttypes.h
+#include pthread.h
+#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

Mesa (master): darwin: Eliminate a pthread mutex leak

2012-04-24 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 1a33c1b2b895566299ec76643659adacc239a3dc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a33c1b2b895566299ec76643659adacc239a3dc

Author: Jeremy Huddleston jerem...@apple.com
Date:   Mon Apr 23 16:43:22 2012 -0700

darwin: Eliminate a pthread mutex leak

Signed-off-by: Jeremy Huddleston jerem...@apple.com
Tested-by: Charles Davis cda...@mines.edu

---

 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

2012-04-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 62058968e71352083fc4513e3d6068116ecf99ba
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=62058968e71352083fc4513e3d6068116ecf99ba

Author: Jeremy Huddleston jerem...@apple.com
Date:   Mon Apr 23 16:43:22 2012 -0700

darwin: Eliminate a pthread mutex leak

Signed-off-by: Jeremy Huddleston jerem...@apple.com
Tested-by: Charles Davis cda...@mines.edu
(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 (8.0): darwin: Eliminate a pthread mutex leak

2012-04-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 69d8a25d429bccf960e98e5c126e1ef2ae4ffe9d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=69d8a25d429bccf960e98e5c126e1ef2ae4ffe9d

Author: Jeremy Huddleston jerem...@apple.com
Date:   Mon Apr 23 16:43:22 2012 -0700

darwin: Eliminate a pthread mutex leak

Signed-off-by: Jeremy Huddleston jerem...@apple.com
Tested-by: Charles Davis cda...@mines.edu
(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): apple: Fix a use after free

2012-04-23 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34

Author: Jonas Maebe jonas.ma...@elis.ugent.be
Date:   Mon Apr 23 16:02:16 2012 -0700

apple: Fix a use after free

Reviewed-by: Jeremy Huddleston jerem...@apple.com

---

 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

2012-04-23 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 1fa6c87c88ad8494355431ba5134236e8f819a74
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fa6c87c88ad8494355431ba5134236e8f819a74

Author: Jonas Maebe jonas.ma...@elis.ugent.be
Date:   Mon Apr 23 16:02:16 2012 -0700

apple: Fix a use after free

Reviewed-by: Jeremy Huddleston jerem...@apple.com
(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 (8.0): apple: Fix a use after free

2012-04-23 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 6095a17534c2694760300701fee59a320950f271
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6095a17534c2694760300701fee59a320950f271

Author: Jonas Maebe jonas.ma...@elis.ugent.be
Date:   Mon Apr 23 16:02:16 2012 -0700

apple: Fix a use after free

Reviewed-by: Jeremy Huddleston jerem...@apple.com
(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): glapi: Correct size of allocated _glapi_table struct

2012-04-22 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 8d09f4d0cc8d2ac5398c8b26638d5659429a4280
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d09f4d0cc8d2ac5398c8b26638d5659429a4280

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com

---

 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): glapi: Correct size of allocated _glapi_table struct

2012-04-22 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: bb30e76328e9dd80b0c7a7688828e3cf8e662b1b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb30e76328e9dd80b0c7a7688828e3cf8e662b1b

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com
(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 (7.11): glapi: Correct size of allocated _glapi_table struct

2012-04-22 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 00d310a1304b6fe2c63b14391898703ee2582a14
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=00d310a1304b6fe2c63b14391898703ee2582a14

Author: Jonas Maebe jonas.ma...@elis.ugent.be
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 jerem...@apple.com
(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 (master): darwin: config file cleanups

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 61f6aff5d9136c91ca4a16de04c7ae673e9433df
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=61f6aff5d9136c91ca4a16de04c7ae673e9433df

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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: Build create_context.c

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: f9e1295cffc3cf096611e193cca016326715e6ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9e1295cffc3cf096611e193cca016326715e6ca

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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: Link against libxcb

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 90a51753c40465c1253c612e0fef2aef96441668
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=90a51753c40465c1253c612e0fef2aef96441668

Author: Jeremy Huddleston jerem...@apple.com
Date:   Fri Mar 16 17:07:06 2012 -0700

darwin: Link against libxcb

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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: config file cleanups

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 485d1c491aabb30f29f52ec72842af2e6a649c6b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=485d1c491aabb30f29f52ec72842af2e6a649c6b

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (8.0): darwin: Build create_context.c

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: 63c8f7142c49007e9cb49ffcd73d85f8f4d71497
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=63c8f7142c49007e9cb49ffcd73d85f8f4d71497

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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: Link against libxcb

2012-03-16 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: d982036c3ae1350c60874f5c4ea13c1867ed1c2c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d982036c3ae1350c60874f5c4ea13c1867ed1c2c

Author: Jeremy Huddleston jerem...@apple.com
Date:   Fri Mar 16 17:07:06 2012 -0700

darwin: Link against libxcb

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (master): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.

2012-01-27 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: b728eefb06c26e4b5a25db31bbda9fcf4d015e17
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b728eefb06c26e4b5a25db31bbda9fcf4d015e17

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
Reviewed-by: Ian Romanick ian.d.roman...@intel.com

---

 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 (7.11): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.

2012-01-27 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 906f670f1a1f33d69139f520ee931b268049eac6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=906f670f1a1f33d69139f520ee931b268049eac6

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
Reviewed-by: Ian Romanick ian.d.roman...@intel.com
(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 (8.0): configure.ac: Don' t use $CLANG since it will collide with the static analyzer.

2012-01-27 Thread Jeremy Huddleston
Module: Mesa
Branch: 8.0
Commit: e406659b8bed4dd8450935e2f3ee697b99d278cf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e406659b8bed4dd8450935e2f3ee697b99d278cf

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
Reviewed-by: Ian Romanick ian.d.roman...@intel.com
(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 (master): Build fix for -Werror=int-to-pointer-cast -Werror= pointer-to-int-cast

2011-11-01 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 666c70ce8eb7c8a21536f03be3a68a3c11997e09
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=666c70ce8eb7c8a21536f03be3a68a3c11997e09

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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.11): apple: Implement applegl_unbind_context

2011-10-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 681f4820ab7339b0ecc4cf656ae1e0adac6ed8f6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=681f4820ab7339b0ecc4cf656ae1e0adac6ed8f6

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (master): apple: Implement applegl_unbind_context

2011-10-24 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 5c44c1348ea13f51a1616968daa7034bb48e42b1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c44c1348ea13f51a1616968daa7034bb48e42b1

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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.10): apple: Silence some debug spew

2011-10-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.10
Commit: c8f2665f028d2a34370059f3aa204986f6341697
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8f2665f028d2a34370059f3aa204986f6341697

Author: Jeremy Huddleston jerem...@apple.com
Date:   Thu Oct 20 22:54:08 2011 -0700

apple: Silence some debug spew

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (7.10): apple: Implement applegl_unbind_context

2011-10-24 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.10
Commit: a96360a9517c38ead6c1381362ec49d7f7afd41c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a96360a9517c38ead6c1381362ec49d7f7afd41c

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (master): apple: Silence some debug spew

2011-10-21 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 098ecfad83a63bd8eb04c37f268c18d8744dff2c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=098ecfad83a63bd8eb04c37f268c18d8744dff2c

Author: Jeremy Huddleston jerem...@apple.com
Date:   Thu Oct 20 22:54:08 2011 -0700

apple: Silence some debug spew

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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

2011-10-21 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 9f2abbee6215d89e48b7fe042f8a905997f5c232
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f2abbee6215d89e48b7fe042f8a905997f5c232

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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

2011-10-21 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 7e90db0ddcc2b4bb3139ae2852b342e30250618d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e90db0ddcc2b4bb3139ae2852b342e30250618d

Author: Jeremy Huddleston jerem...@apple.com
Date:   Thu Oct 20 22:54:08 2011 -0700

apple: Silence some debug spew

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (7.11): apple: Use the correct (OpenGL.framework) glViewport and glScissor during init

2011-10-21 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: bf7b347c1041edc77472c117e0ffcfbb71d5c13b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf7b347c1041edc77472c117e0ffcfbb71d5c13b

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com
(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 (master): Fix PPC detection on darwin

2011-07-31 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e737a99a6fbafe3ba4b5175eea25d1598dbeb9d8

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jul 31 09:21:56 2011 -0700

Fix PPC detection on darwin

Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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

2011-07-31 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jul 31 09:31:48 2011 -0700

darwin: Use machine/endian.h to determine endianness

Signed-off-by: Jeremy Huddleston jerem...@apple.com

---

 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 machine/endian.h
+
+#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

2011-07-31 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 0d2c36953539043b14bb5d785981fab6126866b3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d2c36953539043b14bb5d785981fab6126866b3

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jul 31 09:21:56 2011 -0700

Fix PPC detection on darwin

Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (7.11): darwin: Use machine/endian.h to determine endianness

2011-07-31 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.11
Commit: 6c72801c2b0eab1b98491244282b98dbeac5d140
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c72801c2b0eab1b98491244282b98dbeac5d140

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jul 31 09:31:48 2011 -0700

darwin: Use machine/endian.h to determine endianness

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 machine/endian.h
+
+#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.10): Fix PPC detection on darwin

2011-07-31 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.10
Commit: 7c3cf50d9988d721e79277180e29aaf6afa40be5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c3cf50d9988d721e79277180e29aaf6afa40be5

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jul 31 09:21:56 2011 -0700

Fix PPC detection on darwin

Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(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 (master): darwin: Include glxhash.c in libGL on darwin

2011-07-16 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 7eed3d4808097606bf2854e687589a8503db435d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7eed3d4808097606bf2854e687589a8503db435d

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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): glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT

2011-06-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: fbd7448977efd49afba322cbb0853e9981ec2d2d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fbd7448977efd49afba322cbb0853e9981ec2d2d

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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 @@
 param name=texture type=GLuint/
 param name=level type=GLint/
 /function
-function name=FramebufferTextureLayerARB 
alias=FramebufferTextureLayer
+function name=FramebufferTextureLayerARB 
alias=FramebufferTextureLayerEXT
 param name=target type=GLenum/
 param name=attachment type=GLenum/
 param name=texture type=GLuint/

___
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

2011-06-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 559e4f8ebcb186b491d7d687ac43f22a62448fc1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=559e4f8ebcb186b491d7d687ac43f22a62448fc1

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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 stdbool.h
+#include dlfcn.h
 
 #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): glx: Destroy the old context only after the new one has been bound

2011-06-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 517614141be2a1f392a4ea87c1077911ccadf35f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=517614141be2a1f392a4ea87c1077911ccadf35f

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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: Bind to our context before __glXSetCurrentContext

2011-06-20 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: 4fbdde889ce5875243c588e4c7c9f4b775d0d7a5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fbdde889ce5875243c588e4c7c9f4b775d0d7a5

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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): apple: Use apple_cgl_get_dl_handle() rather than opening a new handle

2011-06-17 Thread Jeremy Huddleston
Module: Mesa
Branch: master
Commit: cb5a5f055b6a9f05aed927d28a242bde81dd5bfc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb5a5f055b6a9f05aed927d28a242bde81dd5bfc

Author: Jeremy Huddleston jerem...@apple.com
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 jerem...@apple.com

---

 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 (7.9): apple: Rename glcontextmodes.[ch] to glxconfig.[ch]

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: ff7e6622fcdd30d505104375e7d271969ac3b88f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff7e6622fcdd30d505104375e7d271969ac3b88f

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 16:56:01 2011 -0400

apple: Rename glcontextmodes.[ch] to glxconfig.[ch]

Fixes regression introduced by: 65d98e25770487456eb3d7eb8ec3ec8272f170b1

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 4c9bab78a118953baf307e31cd53e731299f0151)

---

 src/glx/apple/Makefile|2 +-
 src/glx/apple/apple_glx_pbuffer.c |2 +-
 src/glx/apple/apple_glx_pixmap.c  |2 +-
 src/glx/apple/apple_visual.c  |2 +-
 src/glx/apple/glx_empty.c |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
index fd47b3d..757e811 100644
--- a/src/glx/apple/Makefile
+++ b/src/glx/apple/Makefile
@@ -38,7 +38,7 @@ SOURCES = \
appledri.c \
../clientattrib.c \
../compsize.c \
-   ../glcontextmodes.c \
+   ../glxconfig.c \
glx_empty.c \
glx_error.c \
../glx_pbuffer.c \
diff --git a/src/glx/apple/apple_glx_pbuffer.c 
b/src/glx/apple/apple_glx_pbuffer.c
index a5ef59c..d79125d 100644
--- a/src/glx/apple/apple_glx_pbuffer.c
+++ b/src/glx/apple/apple_glx_pbuffer.c
@@ -44,7 +44,7 @@
 #include pthread.h
 #include assert.h
 #include apple_glx.h
-#include glcontextmodes.h
+#include glxconfig.h
 #include apple_cgl.h
 
 /* mesa defines in glew.h, Apple in glext.h.
diff --git a/src/glx/apple/apple_glx_pixmap.c b/src/glx/apple/apple_glx_pixmap.c
index fec05e0..4586707 100644
--- a/src/glx/apple/apple_glx_pixmap.c
+++ b/src/glx/apple/apple_glx_pixmap.c
@@ -40,7 +40,7 @@
 #include apple_visual.h
 #include apple_glx_drawable.h
 #include appledri.h
-#include glcontextmodes.h
+#include glxconfig.h
 
 static bool pixmap_make_current(struct apple_glx_context *ac,
 struct apple_glx_drawable *d);
diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
index 7a9525e..29c6f16 100644
--- a/src/glx/apple/apple_visual.c
+++ b/src/glx/apple/apple_visual.c
@@ -47,7 +47,7 @@
 #include apple_cgl.h
 #include apple_visual.h
 #include apple_glx.h
-#include glcontextmodes.h
+#include glxconfig.h
 
 enum
 {
diff --git a/src/glx/apple/glx_empty.c b/src/glx/apple/glx_empty.c
index 5967eca..1e9593c 100644
--- a/src/glx/apple/glx_empty.c
+++ b/src/glx/apple/glx_empty.c
@@ -1,6 +1,6 @@
 #include glxclient.h
 #include glxextensions.h
-#include glcontextmodes.h
+#include glxconfig.h
 
 /*
 ** GLX_SGI_swap_control

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: Update GL specs

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: 4f362e04942750e3dfe669c5dc4504dfe7cdf850
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f362e04942750e3dfe669c5dc4504dfe7cdf850

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 17:14:04 2011 -0400

apple: Update GL specs

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 8e89d0bea7df553a6c937aaa87b1a3c179f69599)

---

 src/glx/apple/specs/enum.spec   |  711 ++-
 src/glx/apple/specs/enumext.spec|  507 +-
 src/glx/apple/specs/gl.spec | 3652 ---
 src/glx/apple/specs/gl.tm   |   12 +-
 src/glx/apple/specs/glxenum.spec|   73 +-
 src/glx/apple/specs/glxenumext.spec |   56 +-
 src/glx/apple/specs/glxext.spec |  166 ++-
 7 files changed, 4738 insertions(+), 439 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=4f362e04942750e3dfe669c5dc4504dfe7cdf850
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: Rename GLXcontext

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: a6a5772250bb6e0b6eebbb687717559e3699e5ba
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6a5772250bb6e0b6eebbb687717559e3699e5ba

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 18:22:47 2011 -0400

apple: Rename GLXcontext

Fixes regression introduced by: c356f5867f2c1fad7155df538b9affa8dbdcf869

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 279e471750e3ee6a4841ebf16ef2d038e1c12077)

---

 src/glx/glxcmds.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index f26ba1d..0d41fe0 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -710,7 +710,7 @@ _X_EXPORT void
 glXSwapBuffers(Display * dpy, GLXDrawable drawable)
 {
 #ifdef GLX_USE_APPLEGL
-   GLXContext gc = glXGetCurrentContext();
+   struct glx_context * gc = __glXGetCurrentContext();
if(gc  apple_glx_is_current_drawable(dpy, gc-driContext, drawable)) {
   apple_glx_swap_buffers(gc-driContext);
} else {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: Change from XExtDisplayInfo to struct glx_display

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: 7c4cc8d2b9393227c65e73fc0200bcaeecbad06f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c4cc8d2b9393227c65e73fc0200bcaeecbad06f

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 19:26:19 2011 -0400

apple: Change from XExtDisplayInfo to struct glx_display

Fixes regression introduced by: ab434f6b7641a64d30725a9ac24929240362d466 and
c356f5867f2c1fad7155df538b9affa8dbdcf869

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 7cdf969527fa6d753ad2eb3dd971fe16725eb440)

---

 src/glx/apple/glx_error.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/glx/apple/glx_error.c b/src/glx/apple/glx_error.c
index b3a071c..d44a80c 100644
--- a/src/glx/apple/glx_error.c
+++ b/src/glx/apple/glx_error.c
@@ -27,22 +27,24 @@
  prior written authorization.
 */
 #include stdbool.h
+#include assert.h
 #include X11/Xlibint.h
 #include X11/extensions/extutil.h
 #include X11/extensions/Xext.h
 #include glxclient.h
 #include glx_error.h
 
-extern XExtDisplayInfo *__glXFindDisplay(Display * dpy);
-
 void
 __glXSendError(Display * dpy, int errorCode, unsigned long resourceID,
unsigned long minorCode, bool coreX11error)
 {
-   XExtDisplayInfo *info = __glXFindDisplay(dpy);
+   struct glx_display *glx_dpy = __glXInitialize(dpy);
struct glx_context *gc = __glXGetCurrentContext();
xError error;
 
+   assert(glx_dpy);
+   assert(gc);
+
LockDisplay(dpy);
 
error.type = X_Error;
@@ -51,7 +53,7 @@ __glXSendError(Display * dpy, int errorCode, unsigned long 
resourceID,
   error.errorCode = errorCode;
}
else {
-  error.errorCode = info-codes-first_error + errorCode;
+  error.errorCode = glx_dpy-codes-first_error + errorCode;
}
 
error.sequenceNumber = dpy-request;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): glx: Dead code removal

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: 858db8cd4e717c8bc08db8cffa489b5b88058988
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=858db8cd4e717c8bc08db8cffa489b5b88058988

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 19:55:51 2011 -0400

glx: Dead code removal

Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 3843bbcb4ca4de232dbae6ba3ae619ddfc93508b)

---

 src/glx/glxcurrent.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index ce9d778..4b1133c 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -160,12 +160,10 @@ _X_HIDDEN void
 __glXSetCurrentContextNull(void)
 {
__glXSetCurrentContext(dummyContext);
-#ifndef GLX_USE_APPLEGL
 #if defined(GLX_DIRECT_RENDERING)  !defined(GLX_USE_APPLEGL)
_glapi_set_dispatch(NULL);   /* no-op functions */
_glapi_set_context(NULL);
 #endif
-#endif
 }
 
 _X_EXPORT GLXContext

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: ifdef out come glapi-foo on darwin

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: d8802cd242e6ef1b5f19ce8fc927c219981ece81
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8802cd242e6ef1b5f19ce8fc927c219981ece81

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 19:57:52 2011 -0400

apple: ifdef out come glapi-foo on darwin

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 8593bb32eae5368c1ba52504133b0bf200bf8e74)

---

 src/glx/glxcurrent.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index 3631738..ce9d778 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -234,6 +234,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
   return False;
}
 
+#ifndef GLX_USE_APPLEGL
_glapi_check_multithread();
 
if (gc != NULL  gc-thread_id != 0  gc-thread_id != _glthread_GetID()) 
{
@@ -241,6 +242,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
  BadAccess, X_GLXMakeContextCurrent);
   return False;
}
+#endif
 
if (oldGC == gc 
gc-currentDrawable == draw  gc-currentReadable == read)
@@ -258,7 +260,9 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
   gc-currentDpy = dpy;
   gc-currentDrawable = draw;
   gc-currentReadable = read;
+#ifndef GLX_USE_APPLEGL
   gc-thread_id = _glthread_GetID();
+#endif
   __glXSetCurrentContext(gc);
   ret = gc-vtable-bind(gc, oldGC, draw, read);
} else {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: Build darwin using applegl rather than indirect

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: 9cbc705e83f31929fbcf4b0b582e14e0f0242e7f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9cbc705e83f31929fbcf4b0b582e14e0f0242e7f

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 18:50:55 2011 -0400

apple: Build darwin using applegl rather than indirect

This reverts portions of 6849916170c0275c13510251a7b217c20f2b993e that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston jerem...@apple.com
(cherry picked from commit 1885cf27c9c4642a049c60a8236cb84735cb9eba)

---

 src/glx/glxclient.h |   12 
 src/glx/glxcmds.c   |4 
 src/glx/glxext.c|7 ---
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index 897fb74..0c99024 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -776,7 +776,19 @@ GarbageCollectDRIDrawables(struct glx_screen *psc);
 
 extern __GLXDRIdrawable *
 GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifdef GLX_USE_APPLEGL
+extern struct glx_screen *
+applegl_create_screen(int screen, struct glx_display * priv);
+
+extern struct glx_context *
+applegl_create_context(struct glx_screen *psc,
+   struct glx_config *mode,
+   struct glx_context *shareList, int renderType);
 
+extern int
+applegl_create_display(struct glx_display *display);
 #endif
 
 extern struct glx_context dummyContext;
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 0d41fe0..55fdeb6 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -228,10 +228,14 @@ CreateContext(Display * dpy, int generic_id,
   return NULL;
 
gc = NULL;
+#ifdef GLX_USE_APPLEGL
+   gc = applegl_create_context(psc, config, shareList, renderType);
+#else
if (allowDirect  psc-vtable-create_context)
   gc = psc-vtable-create_context(psc, config, shareList, renderType);
if (!gc)
   gc = indirect_create_context(psc, config, shareList, renderType);
+#endif
if (!gc)
   return NULL;
 
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index c75c9bf..d9560cd 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -764,11 +764,12 @@ AllocAndFetchScreenConfigs(Display * dpy, struct 
glx_display * priv)
 psc = (*priv-driswDisplay-createScreen) (i, priv);
 #endif
 #if defined(GLX_USE_APPLEGL)
-  if (psc == NULL  priv-appleglDisplay)
-psc = (*priv-appleglDisplay-createScreen) (i, priv);
-#endif
+  if (psc == NULL)
+ psc = applegl_create_screen(i, priv);
+#else
   if (psc == NULL)
 psc = indirect_create_screen(i, priv);
+#endif
   priv-screens[i] = psc;
}
SyncHandle();

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (7.9): apple: Fix build failures in applegl_glx.c

2011-06-14 Thread Jeremy Huddleston
Module: Mesa
Branch: 7.9
Commit: e004ac273d492354d1d7c8f4e77b8c9ceaa4a84e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e004ac273d492354d1d7c8f4e77b8c9ceaa4a84e

Author: Jeremy Huddleston jerem...@apple.com
Date:   Sun Jun  5 21:19:40 2011 -0400

apple: Fix build failures in applegl_glx.c

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston jerem...@apple.com

This commit squashes three cherry-picks:
(cherry picked from commit 5d35343d12ab462100c9eec50a579b73463e465a)
(cherry picked from commit 7c5f37c032231ad144a8a5c5a0b18f3e26c0aea7)
(cherry picked from commit 2ee5272e1671aff8c8d9e0c12bf37ed006717283)

---

 src/glx/apple/Makefile |3 ++-
 src/glx/applegl_glx.c  |   45 +
 2 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
index 757e811..1196701 100644
--- a/src/glx/apple/Makefile
+++ b/src/glx/apple/Makefile
@@ -49,7 +49,8 @@ SOURCES = \
../glxextensions.c \
glxreply.c \
../pixel.c \
-   ../xfont.c
+   ../xfont.c \
+   ../applegl_glx.c
 
 include $(TOP)/src/mesa/sources.mak
 
diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c
index 3da1f19..9b8605f 100644
--- a/src/glx/applegl_glx.c
+++ b/src/glx/applegl_glx.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2010 Intel Corporation
+ * Copyright © 2011 Apple Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the Soft-
@@ -32,6 +33,13 @@
 
 #if defined(GLX_USE_APPLEGL)
 
+#include stdbool.h
+
+#include glxclient.h
+#include apple_glx_context.h
+#include apple_glx.h
+#include glx_error.h
+
 static void
 applegl_destroy_context(struct glx_context *gc)
 {
@@ -42,13 +50,14 @@ static int
 applegl_bind_context(struct glx_context *gc, struct glx_context *old,
 GLXDrawable draw, GLXDrawable read)
 {
+   Display *dpy = gc-psc-dpy;
bool error = apple_glx_make_current_context(dpy,
-  (oldGC  oldGC != 
dummyContext) ? oldGC-driContext : NUL~
+  (old  old != dummyContext) ? 
old-driContext : NULL,
   gc ? gc-driContext : NULL, 
draw);
 
apple_glx_diagnostic(%s: error %s\n, __func__, error ? YES : NO);
if (error)
-  return GLXBadContext;
+  return 1; /* GLXBadContext is the same as Success (0) */
 
return Success;
 }
@@ -67,7 +76,8 @@ applegl_wait_gl(struct glx_context *gc)
 static void
 applegl_wait_x(struct glx_context *gc)
 {
-   apple_glx_waitx(gc-dpy, gc-driContext);
+   Display *dpy = gc-psc-dpy;
+   apple_glx_waitx(dpy, gc-driContext);
 }
 
 static const struct glx_context_vtable applegl_context_vtable = {
@@ -81,24 +91,25 @@ static const struct glx_context_vtable 
applegl_context_vtable = {
NULL, /* release_tex_image, */
 };
 
-static struct glx_context *
+struct glx_context *
 applegl_create_context(struct glx_screen *psc,
-  struct glx_config *mode,
+  struct glx_config *config,
   struct glx_context *shareList, int renderType)
 {
struct glx_context *gc;
int errorcode;
bool x11error;
+   Display *dpy = psc-dpy;
+   int screen = psc-scr;
 
/* TODO: Integrate this with apple_glx_create_context and make
 * struct apple_glx_context inherit from struct glx_context. */
 
-   gc = Xmalloc(sizeof *gc);
-   if (pcp == NULL)
+   gc = Xcalloc(1, sizeof (*gc));
+   if (gc == NULL)
   return NULL;
 
-   memset(gc, 0, sizeof *gc);
-   if (!glx_context_init(gc-base, psc-base, mode)) {
+   if (!glx_context_init(gc, psc, config)) {
   Xfree(gc);
   return NULL;
}
@@ -108,7 +119,7 @@ applegl_create_context(struct glx_screen *psc,
gc-do_destroy = False;
 
/* TODO: darwin: Integrate with above to do indirect */
-   if(apple_glx_create_context(gc-driContext, dpy, screen, fbconfig, 
+   if(apple_glx_create_context(gc-driContext, dpy, screen, config, 
   shareList ? shareList-driContext : NULL,
   errorcode, x11error)) {
   __glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error);
@@ -117,15 +128,15 @@ applegl_create_context(struct glx_screen *psc,
}
 
gc-currentContextTag = -1;
-   gc-mode = fbconfig;
-   gc-isDirect = allowDirect;
+   gc-config = config;
+   gc-isDirect = GL_TRUE;
gc-xid = 1; /* Just something not None, so we know when to destroy
 * it in MakeContextCurrent. */
 
return gc;
 }
 
-struct glx_screen_vtable appegl_screen_vtable = {
+struct glx_screen_vtable applegl_screen_vtable = {
applegl_create_context
 };
 
@@ -146,10 +157,12 @@ applegl_create_screen(int screen, struct glx_display * 
priv)
 }
 
 _X_HIDDEN int
-applegl_create_display(struct glx_display *display)
+applegl_create_display(struct glx_display

  1   2   3   >