On Sun, May 30, 2010 at 1:38 PM, Dave Airlie <[email protected]> wrote: > On Sun, May 30, 2010 at 5:52 PM, Dave Airlie <[email protected]> wrote: >> Running texture_from_pixmap in xdemos against r300g >> >> Program received signal SIGSEGV, Segmentation fault. >> dri2_invalidate_drawable (dPriv=0x8066990) at dri2.c:57 >> 57 struct dri_context *ctx = dri_context(dPriv->driContextPriv); >> Missing separate debuginfos, use: debuginfo-install >> expat-2.0.1-8.fc12.i686 glew-1.5.4-1.fc14.i686 glibc-2.11.1-6.i686 >> libX11-1.3-1.fc12.i686 libXdamage-1.1.2-1.fc12.i686 >> libXext-1.1-2.fc12.i686 libXfixes-4.0.4-1.fc12.i686 >> libXxf86vm-1.1.0-1.fc12.i686 libdrm-2.4.21-0.1.fc14.i686 >> libgcc-4.4.3-4.fc12.i686 libselinux-2.0.90-5.fc12.i686 >> libstdc++-4.4.3-4.fc12.i686 libxcb-1.5-1.fc12.i686 >> mesa-libGLU-7.7-4.fc12.i686 >> (gdb) bt >> #0 dri2_invalidate_drawable (dPriv=0x8066990) at dri2.c:57 >> #1 0xb7f9ee73 in dri2_bind_tex_image (dpy=0x804b008, drawable=75497476, >> buffer=8414, attrib_list=0x0) at dri2_glx.c:581 >> #2 0xb7f7dab6 in __glXBindTexImageEXT (dpy=0x804b008, drawable=75497476, >> buffer=8414, attrib_list=0x0) at glxcmds.c:3098 >> #3 0x0804978c in BindPixmapTexture (argc=1, argv=0xbffff304) >> at texture_from_pixmap.c:257 >> #4 main (argc=1, argv=0xbffff304) at texture_from_pixmap.c:391 >> >> dPriv->driContextPriv is NULL and dri_context macro derferences it. >> >> attached patch "fixes" it but not sure if we want drI_context macro to >> catch this or whether something else is doing something wrong and >> causing this. > > I've no idea what the code in dri2_invalidate_drawable is for, the > intel + nouveau legacy drivers don't seem to need this extra codepath > and just call the generic invalidate. > > This patch + a patch to dri_util.c to always initialise > pdp->driContextPriv to NULL in driCreateNewDrawable works for me, but > it would be nice to know why the dri2 st cares about context in this > place.
Its probably better to just check for null in the dri_context macro. Thanks for looking into and fixing this. To answer your question: st/dri pushes the invalidate notify into the the API state tracker (st/mesa) so that it set a invalidate flag, this is instead of it calling back into st/dri all the time. st/mesa implements the flag itself and private from st/dri and due to various reasons it needs to keep the st_framebuffer_iface <-> gl_framebuffer binding on the context. Cheers Jakob. _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
