[Mesa-dev] [PATCH 1/6] glx: Convert to automake.
Marek Olšák
maraeo at gmail.com
Thu Mar 1 07:50:40 PST 2012
Hi Eric,
this commit breaks StarCraft II running on Wine traced by apitrace
on r600g. Wine is most probably stuck in a deadlock. It prints these
error messages:
err:seh:setup_exception_record stack overflow 2412 bytes in thread
0024 eip 00437fdb esp 00c409c4 stack 0xc40000-0xc41000-0xd40000
err:ntdll:RtlpWaitForCriticalSection section 0x7dce41e0
"x11drv_main.c: X11DRV_CritSection" wait timed out in thread 0025,
blocked by 0024, retrying (60 sec)
err:ntdll:RtlpWaitForCriticalSection section 0x72e200 "?" wait timed
out in thread 0023, blocked by 0024, retrying (60 sec)
err:ntdll:RtlpWaitForCriticalSection section 0x72e200 "?" wait timed
out in thread 0009, blocked by 0024, retrying (60 sec)
etc.
Reverting this commit (and also the egl automake commits to avoid
conflicts) fixes the issue.
Do you have any idea about what might have gone wrong?
Marek
On Thu, Feb 9, 2012 at 3:09 AM, Eric Anholt <eric at anholt.net> wrote:
> ---
> configure.ac | 4 ++
> src/glx/.gitignore | 5 ++
> src/glx/Makefile | 119 -------------------------------------------------
> src/glx/Makefile.am | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++
> src/mesa/Makefile | 2 -
> 5 files changed, 131 insertions(+), 121 deletions(-)
> create mode 100644 src/glx/.gitignore
> delete mode 100644 src/glx/Makefile
> create mode 100644 src/glx/Makefile.am
>
> diff --git a/configure.ac b/configure.ac
> index b2b1ab8..389cdb0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -379,6 +379,7 @@ fi
> AC_SUBST([GL_LIB])
> AC_SUBST([GLU_LIB])
> AC_SUBST([OSMESA_LIB])
> +AM_CONDITIONAL(HAVE_MANGLED_GL, test $GL_LIB = MangledGL)
>
> dnl
> dnl potentially-infringing-but-nobody-knows-for-sure stuff
> @@ -700,6 +701,7 @@ if test "x$enable_shared_glapi" = xyes; then
> SHARED_GLAPI="1"
> fi
> AC_SUBST([SHARED_GLAPI])
> +AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1)
>
> dnl
> dnl Driver configuration. Options are xlib, dri and osmesa right now.
> @@ -1037,6 +1039,7 @@ esac
> # builds.
> AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
> test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
> +AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
>
> GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
> GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
> @@ -1935,6 +1938,7 @@ AC_CONFIG_FILES([configs/autoconf
> src/egl/wayland/wayland-egl/Makefile
> src/egl/wayland/wayland-egl/wayland-egl.pc
> src/egl/wayland/wayland-drm/Makefile
> + src/glx/Makefile
> src/mesa/drivers/dri/dri.pc
> src/mesa/drivers/dri/Makefile
> src/mesa/drivers/dri/common/Makefile
> diff --git a/src/glx/.gitignore b/src/glx/.gitignore
> new file mode 100644
> index 0000000..ea7b611
> --- /dev/null
> +++ b/src/glx/.gitignore
> @@ -0,0 +1,5 @@
> +.deps
> +.libs
> +Makefile
> +Makefile.in
> +libGL.la
> diff --git a/src/glx/Makefile b/src/glx/Makefile
> deleted file mode 100644
> index f702f95..0000000
> --- a/src/glx/Makefile
> +++ /dev/null
> @@ -1,119 +0,0 @@
> -TOP = ../..
> -include $(TOP)/configs/current
> -
> -ifeq ($(HAVE_XF86VIDMODE),yes)
> -EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
> -endif
> -
> -EXTRA_DEFINES = $(EXTRA_DEFINES_XF86VIDMODE) -D_REENTRANT \
> - -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
> -
> -SOURCES = \
> - clientattrib.c \
> - clientinfo.c \
> - compsize.c \
> - create_context.c \
> - eval.c \
> - glxconfig.c \
> - glxcmds.c \
> - glxcurrent.c \
> - glx_error.c \
> - glxext.c \
> - glxextensions.c \
> - indirect_glx.c \
> - indirect.c \
> - indirect_init.c \
> - indirect_size.c \
> - indirect_window_pos.c \
> - indirect_texture_compression.c \
> - indirect_transpose_matrix.c \
> - indirect_vertex_array.c \
> - indirect_vertex_program.c \
> - pixel.c \
> - pixelstore.c \
> - render2.c \
> - renderpix.c \
> - single2.c \
> - singlepix.c \
> - vertarr.c \
> - xfont.c \
> - glx_pbuffer.c \
> - glx_query.c \
> - drisw_glx.c \
> - dri_common.c \
> - dri_glx.c \
> - XF86dri.c \
> - glxhash.c \
> - dri2_glx.c \
> - dri2.c \
> - applegl_glx.c
> -
> -
> -ifeq ($(SHARED_GLAPI),1)
> -GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
> -EXTRA_DEFINES += -DGLX_SHARED_GLAPI
> -endif
> -
> -# override GLAPI_LIB
> -GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
> -
> -OBJECTS = $(SOURCES:.c=.o)
> -
> -INCLUDES = -I. \
> - -I$(TOP)/include \
> - -I$(TOP)/include/GL/internal \
> - -I$(TOP)/src/mesa \
> - -I$(TOP)/src/mapi \
> - -I$(TOP)/src/mapi/glapi \
> - $(LIBDRM_CFLAGS) \
> - $(DRI2PROTO_CFLAGS) \
> - $(GLPROTO_CFLAGS) \
> - $(X11_INCLUDES)
> -
> -
> -##### RULES #####
> -
> -.c.o:
> - $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
> -
> -.S.o:
> - $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
> -
> -##### TARGETS #####
> -
> -default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
> -
> -libglx.a: $(OBJECTS)
> - $(MKLIB) -cplusplus -o glx -static $(OBJECTS)
> -
> -# Make libGL
> -$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): libglx.a $(OBJECTS) $(GLAPI_LIB) Makefile
> - $(MKLIB) -o $(GL_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
> - -major 1 -minor 2 \
> - -cplusplus $(MKLIB_OPTIONS) \
> - -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
> - $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
> -
> -$(GLAPI_LIB):
> - @$(MAKE) -C $(TOP)/src/mapi/glapi
> -
> -depend: $(SOURCES) Makefile
> - rm -f depend
> - touch depend
> - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES)
> -
> -
> -# Emacs tags
> -tags:
> - etags `find . -name \*.[ch]` `find $(TOP)/include`
> -
> -install: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
> - $(MAKE) -C $(TOP)/src/mesa install-libgl
> -
> -# Remove .o and backup files
> -clean:
> - -rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)
> - -rm -f *.o *~
> - -rm -f depend depend.bak
> -
> --include depend
> diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
> new file mode 100644
> index 0000000..b5bbebd
> --- /dev/null
> +++ b/src/glx/Makefile.am
> @@ -0,0 +1,122 @@
> +# Copyright © 2012 Intel Corporation
> +#
> +# 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 (including the next
> +# paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
> +
> +if HAVE_SHARED_GLAPI
> +SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI
> +SHARED_GLAPI_LIBS = -L$(top_builddir)/$(LIB_DIR) -lglapi
> +endif
> +
> +GLAPI_LIB = ../mapi/glapi/libglapi.a
> +
> +if HAVE_XF86VIDMODE
> +EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
> +endif
> +
> +AM_CFLAGS = \
> + -I$(top_srcdir)/include \
> + -I$(top_srcdir)/include/GL/internal \
> + -I$(top_srcdir)/src/mapi \
> + -I$(top_srcdir)/src/mapi/glapi \
> + $(SHARED_GLAPI_CFLAGS) \
> + $(EXTRA_DEFINES_XF86VIDMODE) \
> + -D_REENTRANT \
> + -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
> + $(DEFINES) \
> + $(LIBDRM_CFLAGS) \
> + $(DRI2PROTO_CFLAGS) \
> + $(GLPROTO_CFLAGS) \
> + $(X11_INCLUDES)
> +
> +if HAVE_MANGLED_GL
> +MANGLED_GL_LIB = libMangledGL.la
> +else
> +NORMAL_GL_LIB = libGL.la
> +endif
> +
> +lib_LTLIBRARIES = \
> + $(NORMAL_GL_LIB) \
> + $(MANGLED_GL_LIB)
> +
> +GL_FILES = \
> + clientattrib.c \
> + clientinfo.c \
> + compsize.c \
> + create_context.c \
> + eval.c \
> + glxconfig.c \
> + glxcmds.c \
> + glxcurrent.c \
> + glx_error.c \
> + glxext.c \
> + glxextensions.c \
> + indirect_glx.c \
> + indirect.c \
> + indirect_init.c \
> + indirect_size.c \
> + indirect_window_pos.c \
> + indirect_texture_compression.c \
> + indirect_transpose_matrix.c \
> + indirect_vertex_array.c \
> + indirect_vertex_program.c \
> + pixel.c \
> + pixelstore.c \
> + render2.c \
> + renderpix.c \
> + single2.c \
> + singlepix.c \
> + vertarr.c \
> + xfont.c \
> + glx_pbuffer.c \
> + glx_query.c \
> + drisw_glx.c \
> + dri_common.c \
> + dri_glx.c \
> + XF86dri.c \
> + glxhash.c \
> + dri2_glx.c \
> + dri2.c \
> + applegl_glx.c
> +
> +GL_LIBS = \
> + $(SHARED_GLAPI_LIBS) \
> + $(GLAPI_LIB) \
> + $(GL_LIB_DEPS)
> +
> +GL_LDFLAGS = \
> + -version-number 1:2
> +
> +libGL_la_SOURCES = $(GL_FILES)
> +libMangledGL_la_SOURCES = $(GL_FILES)
> +libGL_la_LIBADD = $(GL_LIBS)
> +libMangledGL_la_LIBADD = $(GL_LIBS)
> +libGL_la_LDFLAGS = $(GL_LDFLAGS)
> +libMangledGL_la_LDFLAGS = $(GL_LDFLAGS)
> +
> +# Provide compatibility with scripts for the old Mesa build system for
> +# a while by putting a link to the driver into /lib of the build tree.
> +if !HAVE_MANGLED_GL
> +all-local: $(NORMAL_GL_LIB) $(MANGLED_GL_LIB)
> + $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
> + ln -f .libs/libGL.so.1.2.0 $(top_builddir)/$(LIB_DIR)/libGL.so.1
> +endif
> +
> +$(GLAPI_LIB):
> + @$(MAKE) -C $(TOP)/src/mapi/glapi
> diff --git a/src/mesa/Makefile b/src/mesa/Makefile
> index 0e15d61..71e22b9 100644
> --- a/src/mesa/Makefile
> +++ b/src/mesa/Makefile
> @@ -206,8 +206,6 @@ install-headers:
> install-libgl: default gl.pc install-headers
> $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
> $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
> - $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \
> - $(DESTDIR)$(INSTALL_LIB_DIR)
> $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
>
> install-osmesa: default osmesa.pc
> --
> 1.7.9
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list