Bug 29162 - mesa/darwin is severly broken
mesa/darwin is severly broken
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Other
git
x86 (IA32) Mac OS X (All)
: highest blocker
Assigned To: Kristian Høgsberg
:
Depends on:
Blocks: mesa-7.9
  Show dependency treegraph
 
Reported: 2010-07-19 23:00 UTC by Vinson Lee
Modified: 2011-06-06 18:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vinson Lee 2010-07-19 23:00:21 UTC
mesa: 87290a383be2eeffef4407eeb17c1070d1122b2f (master)

$ make
Making sources for darwin
...
gcc -c -I. -Iinclude -I.. -I../../../include -I../../../include/GL/internal -I../../../src/mesa -I../../../src/mapi -I../../../src/mapi/glapi    -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -I/usr/X11/include -I/usr/X11/include  -fPIC   -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE -DGLX_ALIAS_UNSUPPORTED -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL  apple_glx_context.c -o apple_glx_context.o
In file included from apple_glx_context.c:49:
../glxclient.h:617: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
make[2]: *** [apple_glx_context.o] Error 1
make[1]: *** [subdirs] Error 1
make: *** [default] Error 1
 

3750ebd540510324ef5ada769537ae05309adadb is the first bad commit
commit 3750ebd540510324ef5ada769537ae05309adadb
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Jul 19 09:37:07 2010 -0400

    glx: Fix drawable lookup in DRI2 event handler
    
    DRI2 events are sent to the X drawable ID used to create the DRI2 drawable,
    not the GLX drawable ID.  So when an event comes in, we need to look up
    the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.

:040000 040000 abf6a328893ae46ad7358f8c8e58f939070b22d4 fcb7ddcde45004c5a954b5f2b28d72f9feb60fff M	src
bisect run success
Comment 1 Kristian Høgsberg 2010-07-20 04:48:08 UTC
I've #ifdef'ed the DRI prototype with commit
c1cbdbfde0a1f016f9d3f23a39cb7bc0b9825e12.
Comment 2 Vinson Lee 2010-07-20 12:03:14 UTC
mesa: 5ed6627ceb82845a7b578419b3cd4168ad0106d3 (master)

gcc -c -I. -Iinclude -I.. -I../../../include -I../../../include/GL/internal -I../../../src/mesa -I../../../src/mapi -I../../../src/mapi/glapi    -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -I/usr/X11/include -I/usr/X11/include  -fPIC   -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE -DGLX_ALIAS_UNSUPPORTED -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL  ../glxext.c -o ../glxext.o
../glxext.c:137: warning: no previous prototype for ‘__glXFindDisplay’
../glxext.c: In function ‘__glXFreeDisplayPrivate’:
../glxext.c:297: error: ‘__GLXdisplayPrivate’ has no member named ‘drawHash’
../glxext.c: In function ‘glx_screen_init’:
../glxext.c:753: error: ‘__GLXscreenConfigs’ has no member named ‘scr’
../glxext.c:754: error: ‘__GLXscreenConfigs’ has no member named ‘dpy’
make[2]: *** [../glxext.o] Error 1
make[1]: *** [subdirs] Error 1
make: *** [default] Error 1
Comment 3 Vinson Lee 2010-07-21 23:13:29 UTC
mesa: c686ee0fa7e2298408259f5533b739c7d05c78b8 (master)

$ make
Making sources for darwin
...
gcc -c -I. -Iinclude -I.. -I../../../include -I../../../include/GL/internal -I../../../src/mesa -I../../../src/mapi -I../../../src/mapi/glapi    -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -I/usr/X11/include -I/usr/X11/include  -fPIC   -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE -DGLX_ALIAS_UNSUPPORTED -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL  ../glxext.c -o ../glxext.o
../glxext.c:137: warning: no previous prototype for ‘__glXFindDisplay’
../glxext.c: In function ‘__glXFreeDisplayPrivate’:
../glxext.c:297: error: ‘__GLXdisplayPrivate’ has no member named ‘drawHash’
../glxext.c: In function ‘glx_screen_init’:
../glxext.c:753: error: ‘__GLXscreenConfigs’ has no member named ‘scr’
../glxext.c:754: error: ‘__GLXscreenConfigs’ has no member named ‘dpy’
Comment 4 Vinson Lee 2010-07-22 11:57:17 UTC
Ping.
Comment 5 Kristian Høgsberg 2010-07-22 14:10:06 UTC
I refer to

  http://lists.freedesktop.org/archives/mesa-dev/2010-May/000757.html

and will ping Jeremy once I'm done moving things around.
Comment 6 Jeremy Huddleston 2010-07-23 09:12:12 UTC
I'm up to my ears and won't have much time to do the big cleanup I promised until late August
Comment 7 Marek Olšák 2011-03-02 09:11:16 UTC
Is this still an issue with current Mesa git?
Comment 8 Jeremy Huddleston 2011-03-02 10:43:17 UTC
I'll pull the latest git later today and test it, but last time I looked, mesa wouldn't even build for Mac OSX.  We're still using 7.8.x (which was not fully packaged, so I made an additional tarball with the apple sources)
Comment 9 Vinson Lee 2011-03-03 01:21:39 UTC
mesa: 118ecb1a2226494929a87c36b7802b64451ca004 (master)

$ make darwin
[...]
gcc -c -I. -Iinclude -I.. -I../../../include -I../../../include/GL/internal -I../../../src/mesa -I../../../src/mapi -I../../../src/mapi/glapi    -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -I/usr/X11/include -I/usr/X11/include  -fPIC   -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE -DGLX_ALIAS_UNSUPPORTED -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL  apple_glx_pbuffer.c -o apple_glx_pbuffer.o
apple_glx_pbuffer.c:47:28: error: glcontextmodes.h: No such file or directory
apple_glx_pbuffer.c: In function ‘apple_glx_pbuffer_create’:
apple_glx_pbuffer.c:131: error: ‘__GLcontextModes’ undeclared (first use in this function)
apple_glx_pbuffer.c:131: error: (Each undeclared identifier is reported only once
apple_glx_pbuffer.c:131: error: for each function it appears in.)
apple_glx_pbuffer.c:131: error: expected expression before ‘)’ token
apple_glx_pbuffer.c:162: error: dereferencing pointer to incomplete type
apple_glx_pbuffer.c:172: error: dereferencing pointer to incomplete type


$ scons
[...]
scons: Building targets ...
  Compiling src/egl/main/eglapi.c ...
In file included from include/EGL/egl.h:36,
                 from src/egl/main/egltypedefs.h:6,
                 from src/egl/main/eglcontext.h:5,
                 from src/egl/main/eglapi.c:60:
include/EGL/eglplatform.h:108:2: error: #error "Platform not recognized"
Comment 10 Jeremy Huddleston 2011-06-05 15:41:32 UTC
I've fixed it as far as I can.

Kristian, I think you didn't finish something with appleglDisplay ... can you please look into this?  I've addressed all the other build failures that I ran into (I obviously can't test the runtime yet)


So I've finally sat down and tried to fix regressions on master due to glx restructuring last year ... mostly these are changes where people forgot to make corresponding changes in the apple subdirectory.

There is one standout that I'm not sure how to fix (glxext.c).  This is a build failure introduced by (http://cgit.freedesktop.org/mesa/mesa/commit/?id=6849916170c0275c13510251a7b217c20f2b993e

This commit added a new reference to appleglDisplay, but it was never defined.  What is supposed to be happening here?

../glxext.c: In function ‘AllocAndFetchScreenConfigs’:
../glxext.c:782: error: ‘struct glx_display’ has no member named ‘appleglDisplay’
../glxext.c:783: error: ‘struct glx_display’ has no member named ‘appleglDisplay’
../glxext.c: In function ‘__glXInitialize’:
../glxext.c:869: warning: implicit declaration of function ‘applegl_create_display’
Comment 11 Jeremy Huddleston 2011-06-05 17:32:11 UTC
Also,

6ec39db726beead21d97bf64ddbe1f0b2d2d6ca1 introduced applegl_create_context, but it never gets called.

It was later added to appegl_screen_vtable, but that vtable is never used.
Comment 12 Jeremy Huddleston 2011-06-05 18:21:30 UTC
Ok, I figured out the above problems ... some typos and some incorrect API usage... now I'm trying to figure out how to get applegl_glx.c building ...

I've gotten to here:

../applegl_glx.c: In function ‘applegl_bind_context’:
../applegl_glx.c:55: error: ‘oldGC’ undeclared (first use in this function)
../applegl_glx.c:55: error: (Each undeclared identifier is reported only once
../applegl_glx.c:55: error: for each function it appears in.)
../applegl_glx.c:56: error: expected ‘)’ before ‘gc’
../applegl_glx.c:56: error: too few arguments to function ‘apple_glx_make_current_context’
../applegl_glx.c: In function ‘applegl_create_context’:
../applegl_glx.c:123: error: ‘screen’ undeclared (first use in this function)
../applegl_glx.c:123: error: ‘fbconfig’ undeclared (first use in this function)
../applegl_glx.c:132: error: ‘struct glx_context’ has no member named ‘mode’
../applegl_glx.c:133: error: ‘allowDirect’ undeclared (first use in this function)
Comment 13 Jeremy Huddleston 2011-06-06 08:42:03 UTC
Ok, I figured out the rest of the API changes to fix up most of the remaining changes.  So it *builds* now...
Comment 14 Jeremy Huddleston 2011-06-06 08:47:14 UTC
"make install" is still broken.  The built libGL works well enough to run glxinfo and glxgears, but I haven't done much more than that in testing.

I think after fixing the install target, this bug should be closed, and any remaining issues should be managed in a new bug report.
Comment 15 Jeremy Huddleston 2011-06-06 18:58:33 UTC
master and 7.10 both build for darwin on Snow Leopard.  If any other issues arise, please open a new bug report (and CC me)