[86428] trunk/dports/x11/mesa
jeremyhu at macports.org
jeremyhu at macports.org
Tue Oct 25 10:07:39 PDT 2011
Revision: 86428
http://trac.macports.org/changeset/86428
Author: jeremyhu at macports.org
Date: 2011-10-25 10:07:38 -0700 (Tue, 25 Oct 2011)
Log Message:
-----------
mesa: Revbump to fix some mesa-7.11 regressions with context switching and GLXPixmaps
Modified Paths:
--------------
trunk/dports/x11/mesa/Portfile
Added Paths:
-----------
trunk/dports/x11/mesa/files/0001.GLXPixmap.patch
trunk/dports/x11/mesa/files/0002.GLXPixmap.patch
trunk/dports/x11/mesa/files/0003.GLXPixmap.patch
Modified: trunk/dports/x11/mesa/Portfile
===================================================================
--- trunk/dports/x11/mesa/Portfile 2011-10-25 16:29:16 UTC (rev 86427)
+++ trunk/dports/x11/mesa/Portfile 2011-10-25 17:07:38 UTC (rev 86428)
@@ -6,7 +6,7 @@
name mesa
epoch 1
version 7.11
-revision 1
+revision 2
categories x11 graphics
maintainers jeremyhu openmaintainer
# GLUT license isn't clear, but is intended to be a permissive license:
@@ -47,6 +47,11 @@
use_configure no
use_parallel_build yes
+patchfiles \
+ 0001.GLXPixmap.patch \
+ 0002.GLXPixmap.patch \
+ 0003.GLXPixmap.patch
+
patch.pre_args -p1
build.target default
Added: trunk/dports/x11/mesa/files/0001.GLXPixmap.patch
===================================================================
--- trunk/dports/x11/mesa/files/0001.GLXPixmap.patch (rev 0)
+++ trunk/dports/x11/mesa/files/0001.GLXPixmap.patch 2011-10-25 17:07:38 UTC (rev 86428)
@@ -0,0 +1,37 @@
+commit 7e90db0ddcc2b4bb3139ae2852b342e30250618d
+Author: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Thu Oct 20 22:54:08 2011 -0700
+
+ apple: Silence some debug spew
+
+ Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+ (cherry picked from commit 098ecfad83a63bd8eb04c37f268c18d8744dff2c)
+
+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;
Added: trunk/dports/x11/mesa/files/0002.GLXPixmap.patch
===================================================================
--- trunk/dports/x11/mesa/files/0002.GLXPixmap.patch (rev 0)
+++ trunk/dports/x11/mesa/files/0002.GLXPixmap.patch 2011-10-25 17:07:38 UTC (rev 86428)
@@ -0,0 +1,96 @@
+commit bf7b347c1041edc77472c117e0ffcfbb71d5c13b
+Author: Jeremy Huddleston <jeremyhu at 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 <jeremyhu at apple.com>
+ (cherry picked from commit 9f2abbee6215d89e48b7fe042f8a905997f5c232)
+
+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
Added: trunk/dports/x11/mesa/files/0003.GLXPixmap.patch
===================================================================
--- trunk/dports/x11/mesa/files/0003.GLXPixmap.patch (rev 0)
+++ trunk/dports/x11/mesa/files/0003.GLXPixmap.patch 2011-10-25 17:07:38 UTC (rev 86428)
@@ -0,0 +1,43 @@
+commit 681f4820ab7339b0ecc4cf656ae1e0adac6ed8f6
+Author: Jeremy Huddleston <jeremyhu at 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 <jeremyhu at apple.com>
+ (cherry picked from commit 5c44c1348ea13f51a1616968daa7034bb48e42b1)
+
+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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111025/1740dc91/attachment.html>
More information about the macports-changes
mailing list