Re: [Mesa-dev] [PATCH 5/5] osx: fix asm support on darwin
On 19/06/2015 00:36, Julien Isorce wrote: On 18 June 2015 at 19:46, Emil Velikov wrote: On 18 June 2015 at 06:53, Julien Isorce wrote: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90908 I don't think it's necessary to create a bugzilla entry just to link to it in your patch. A bit more commentary about what this patch is doing and why it is right would help review it. This patch seems to be doing 2 things: Changing xform4.S to use assyntax.h, and turning on the use of asm for darwin, so might be best broken in two. diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S index c185f62..17eb7fa 100644 --- a/src/mesa/x86-64/xform4.S +++ b/src/mesa/x86-64/xform4.S @@ -24,14 +24,15 @@ #ifdef USE_X86_64_ASM +#include "x86/assyntax.h" #include "matypes.h" .text .align 16 -.globl _mesa_x86_64_cpuid -.hidden _mesa_x86_64_cpuid -_mesa_x86_64_cpuid: +GLOBL GLNAME(_mesa_x86_64_cpuid) +HIDDEN(_mesa_x86_64_cpuid) +GLNAME(_mesa_x86_64_cpuid): Whilst the use of HIDDEN is necessary, I'm don't think there are any x86_64 platforms which use a leading underscore, so I'm not sure if using GLNAME makes sense in an x86_64 specific file. - + +#if defined (__ELF__) && defined (__linux__) .section .rodata +#endif This looks wrong. I don't see why this is linux/ELF specific. Perhaps something like: #ifdef __APPLE__ .const #else .section .rodata #endif maybe that needs to be conditional on __MACH__? maybe that needs to explicitly use a .section directive with segment and section? --- a/src/mesa/x86/assyntax.h +++ b/src/mesa/x86/assyntax.h @@ -255,7 +255,7 @@ #endif /* ACK_ASSEMBLER */ -#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__MINGW32__) +#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__MINGW32__) && !defined(__APPLE__) #define GLNAME(a) a #else #define GLNAME(a) CONCAT(_,a) Considering that this is a fragile area in mesa, can you confirm what kind of testing you've done ? Would be nice to avoid breaking things in various subtle ways. Very minimal tests: only glxgears and es2gears_x11, on osx. Also "make check" succeeds until it reaches glx-test which fails to build (link error). I need to submit a bug. In my OSX dev enviroment (which I haven't used for a year :D), I have CFLAGS containing "-arch i386 -arch x86_64" (because that's what [1] says to use). With this patch applied, that fails to build for i386. That's a tricky problem to solve within the mesa build system. I don't know if building for OSX i386 is useful anymore? [1] http://xquartz.macosforge.org/trac/wiki/DeveloperInfo ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] applegl: Provide requirements of _SET_DrawBuffers
On 19/06/2015 12:51, Emil Velikov wrote: On 19 June 2015 at 00:05, Julien Isorce wrote: Sorry for removing the XXX line. Original message is here: https://bugs.freedesktop.org/attachment.cgi?id=115539 At the time src/glx/apple/apple_glapi.c has been developed this patch was not needed I guess so I wonder which change made the regression. I'm not sure bisecting is going to work too well, as you might find it's apple-glx isn't buildable for most of the range, and you will probably land on a commit which say "rewrite glapi (again)" :D That's one way to get to the bottom of it. Alternatively we can take a look at how other glx (indirect, xlib) handle it. As is, the patch gets a big fat NACK, sorry. This smells to me like there's something not quite right about the partitioning of stuff between libmesa and libglapi, but I don't have any insight into what exactly the problem is. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] applegl: Provide requirements of _SET_DrawBuffers
On 02/07/2015 13:42, Emil Velikov wrote: On 27 June 2015 at 12:21, Jon TURNEY wrote: This smells to me like there's something not quite right about the partitioning of stuff between libmesa and libglapi, but I don't have any insight into what exactly the problem is. Quite likely. Although it would be better to resolve it, as (if my understanding is correct) libGL should not know anything about mesa's internals. It ought to interact with DRI and glapi alone. Mildly related: Jon what happened to the applegl-vtable branches ? I really liked the direction that they were going. I'd quite forgotten about those. Currently, there is a build-time choice between using apple-dri, or indirect and swrast. This is not ideal (I believe it makes remote clients under OSX useless), so they should all be runtime alternatives. Those branches are really just experiments of mine to try to understand what that might look like before I did a similar implementation for Windows. But I think I came to the conclusion that it was less work to use the existing __GLXDRIdisplay implementations as a model, rather than convert appple-dri to that interface and then use it as a model for my windows-dri implementation (see [1]) [1] http://cgit.freedesktop.org/~jturney/mesa/commit/?h=windows-dri&id=84b173c63727099ec74edc74a15c6ea953312360 I think it's perfectly possibly to put apple-dri into a similar form, it's just someone has to do it :) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallium/util: Define ffsll on OpenBSD.
On 06/02/2015 19:58, Matt Turner wrote: On Fri, Feb 6, 2015 at 3:38 AM, Jonathan Gray wrote: OpenBSD has ffs in libc but does not have ffsll so use the compiler builtin. PIPE_OS_BSD isn't suitable here as FreeBSD has ffsll in libc. Signed-off-by: Jonathan Gray --- src/gallium/auxiliary/util/u_math.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 5db5b66..ec282f3 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -531,6 +531,8 @@ unsigned ffs( unsigned u ) #elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) #define ffs __builtin_ffs #define ffsll __builtin_ffsll +#elif defined(__OpenBSD__) +#define ffsll __builtin_ffsll #endif Autoconf checks for presence of a bunch of builtins. Please use those instead (in this case, HAVE___BUILTIN_FFSLL). Yes, please. This has just been 'fixed' for MinGW, now for OpenBSD, and also needs fixing for Cygwin. Attached is a patch which attempts to do this using autoconf checks. From 580eb16295a94012c488db7ac44d09cb3ca8ff55 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 7 Feb 2015 14:17:35 + Subject: [PATCH] gallium/util: Use autoconf check for ffs() and ffsll() u_math.h should probably explicitly include config.h, but it didn't before and already relies on some HAVE_ defines, so I haven't added it. This makes a subtle change on non-linux platforms: previously we were explicitly using __builtin_ffs(), whereas now we are using ffs(), and the compiler might decide to convert that to a builtin. If we wanted to ensure the builtin was used for some reason, this isn't quite right. Since ffs() is used, we need to include for the prototype, which I think we expect to find on all POSIX systems, but not on MSVC. Add an autoconf check for that header and use that to conditionalize it's use. Define _GNU_SOURCE on Cygwin so that the GNU extension ffsll() is prototyped. I think I've put the right defines in the right place for the Android build system, but I haven't build tested that. Signed-off-by: Jon TURNEY --- Android.common.mk | 3 +++ configure.ac| 6 +- src/gallium/auxiliary/util/u_math.h | 12 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Android.common.mk b/Android.common.mk index 3e6d4c3..7719096 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -42,6 +42,9 @@ LOCAL_CFLAGS += \ LOCAL_CFLAGS += \ -DHAVE_PTHREAD=1 \ + -DHAVE_STRINGS_H \ + -DHAVE___BUILTIN_FFS \ + -DHAVE___BUILTIN_FFSLL \ -fvisibility=hidden \ -Wno-sign-compare diff --git a/configure.ac b/configure.ac index 7c2692e..cd4d7ed 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,10 @@ if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then fi fi +dnl Check for ffs and ffsll +AC_CHECK_HEADER([strings.h]) +AC_CHECK_FUNCS([ffs ffsll]) + dnl Check for compiler builtins AX_GCC_BUILTIN([__builtin_bswap32]) AX_GCC_BUILTIN([__builtin_bswap64]) @@ -219,7 +223,7 @@ solaris*) DEFINES="$DEFINES -DSVR4" ;; cygwin*) -DEFINES="$DEFINES -D_XOPEN_SOURCE=700" +DEFINES="$DEFINES -D_GNU_SOURCE" ;; esac diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 5db5b66..45587fb 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -52,7 +52,7 @@ extern "C" { #include #include -#ifdef PIPE_OS_UNIX +#ifdef HAVE_STRINGS_H #include /* for ffs */ #endif @@ -528,10 +528,18 @@ unsigned ffs( unsigned u ) return i; } -#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) +#else +#ifndef HAVE_FFS +#ifdef HAVE___BUILTIN_FFS #define ffs __builtin_ffs +#endif +#endif +#ifndef HAVE_FFSLL +#ifdef HAVE___BUILTIN_FFSLL #define ffsll __builtin_ffsll #endif +#endif +#endif #endif /* FFS_DEFINED */ -- 2.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] auxiliary/vl: bring back the VL code for the dri targets
On 10/02/2015 22:29, Emil Velikov wrote: With commit c642e87d9f4(auxiliary/vl: rework the build of the VL code) we split out the VL code into a separate static library that was meant to be used by the VL targets alone - va, vdpau, xvmc. The commit failed to consider the way we handle vdpau-gl interop and broke it. Bring back the functionality by keeping the vl <> vl_stub separation as requrested by Christian. v2: Update the omx target as well. Update mesa-stable email address. This now makes us try to build vl_winsys_dri.c on targets which don't have DRI2 (See [1]) I guess something like the attached is needed. [1] http://tinderbox.x.org/builds/2015-02-13-0007/logs/mesa-mesa/#build From 19c254ca57cad4b67466e6bbfb76a1460ea0821d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 14 Feb 2015 17:12:41 + Subject: [PATCH] auxiliary/vl: Only build vl_winsys_dri.c if we have DRI2 Refine commit c39dbfdd0f764b1aaa7319b4694e7335692993dd so it only turns on building of vl_winsys_dri.c if we have DRI2 Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am index 453282a..5c96161 100644 --- a/src/gallium/auxiliary/Makefile.am +++ b/src/gallium/auxiliary/Makefile.am @@ -74,6 +74,7 @@ libgalliumvl_la_CFLAGS = \ libgalliumvl_la_SOURCES = \ $(VL_SOURCES) +if HAVE_DRI2 noinst_LTLIBRARIES += libgalliumvlwinsys.la libgalliumvlwinsys_la_CFLAGS = \ @@ -81,6 +82,7 @@ libgalliumvlwinsys_la_CFLAGS = \ libgalliumvlwinsys_la_SOURCES = \ $(VL_WINSYS_SOURCES) +endif endif -- 2.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] auxiliary/vl: Build vl_winsys_dri.c only when needed.
On 16/02/2015 18:22, Emil Velikov wrote: With commit c39dbfdd0f7(auxiliary/vl: bring back the VL code for the dri targets) we did not fully consider users of dri-swrast alone. Thus we ended up trying to compile the dri2 specific code on platform which lack it - Cygwin for example. Cc: "10.5" Cc: Jon TURNEY Reported-by: Jon TURNEY Signed-off-by: Emil Velikov --- Hi Jon, Can you give this patch a try. I realise it's longer solution than the one you sent, but imho this makes sense (in a way) considering all the craziness that we have around. Works for me. Reviewed-by: Jon TURNEY ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] gallium/util: Define ffsll on OpenBSD.
On 26/02/2015 03:55, Jonathan Gray wrote: On Wed, Feb 25, 2015 at 07:09:26PM -0800, Matt Turner wrote: On Wed, Feb 25, 2015 at 7:03 PM, Jonathan Gray wrote: On Wed, Feb 25, 2015 at 06:53:14PM -0800, Matt Turner wrote: On Wed, Feb 25, 2015 at 5:37 PM, Jonathan Gray wrote: If it isn't going to be configure checks could someone merge the original patch in this thread? I committed commit 3492e88090d2d0c0bfbc934963b8772b45fc8880 Author: Matt Turner Date: Fri Feb 20 18:46:43 2015 -0800 gallium/util: Use HAVE___BUILTIN_* macros. Reviewed-by: Eric Anholt Reviewed-by: Jose Fonseca which switched over a bunch of preprocessor checks around __builtin* calls to use the macros defined by autotools. Thanks. From cba39ba72115e57d262cb4b099c4e72106f01812 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 26 Feb 2015 14:46:45 +1100 Subject: [PATCH] gallium/util: use ffs* builtins if available Required to build on OpenBSD which doesn't have ffsll in libc. Thanks. This works for me also. Reviewed-by: Jon TURNEY ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] c99_alloca.h: Include stdlib.h on all non-Windows.
On 01/03/2015 21:00, Alan Coopersmith wrote: On 03/ 1/15 12:52 PM, Vinson Lee wrote: Fix build on FreeBSD. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89364 Signed-off-by: Vinson Lee --- include/c99_alloca.h | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/c99_alloca.h b/include/c99_alloca.h index 7a81c50..575f719 100644 --- a/include/c99_alloca.h +++ b/include/c99_alloca.h @@ -35,13 +35,9 @@ # define alloca _alloca -#elif defined(__MINGW32__) - -# include - #else /* !defined(_MSC_VER) */ -# include +# include #endif /* !defined(_MSC_VER) */ Solaris defines alloca() in , not Same on Cygwin. http://tinderbox.x.org/builds/2015-03-05-0008/logs/mesa-mesa/#build From 699e450a2f5b39a68bf239a41e99ecc8240ceed7 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 5 Mar 2015 15:29:32 + Subject: [PATCH] Also use for cygwin Signed-off-by: Jon TURNEY --- include/c99_alloca.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/c99_alloca.h b/include/c99_alloca.h index ed66fda..5a3b8c1 100644 --- a/include/c99_alloca.h +++ b/include/c99_alloca.h @@ -35,7 +35,7 @@ # define alloca _alloca -#elif defined(__sun) +#elif defined(__sun) || defined(__CYGWIN__) # include -- 2.1.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glx/windows: Add wgl.h to the sources list
On 02/11/2016 11:13, Andreas Boll wrote: Otherwise it won't be picked in the tarball and the build will fail. Thanks, my bad. Reviewed-by: Jon Turney Fixes: 533b3530c12 ("direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI")") Cc: "13.0" Signed-off-by: Andreas Boll --- src/glx/windows/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glx/windows/Makefile.am b/src/glx/windows/Makefile.am index c76af81..9806988 100644 --- a/src/glx/windows/Makefile.am +++ b/src/glx/windows/Makefile.am @@ -16,7 +16,8 @@ libwindowsglx_la_SOURCES = \ windowsgl.h \ windowsgl_internal.h \ windows_drawable.c \ - wgl.c + wgl.c \ + wgl.h libwindowsglx_la_CFLAGS = \ -I$(top_srcdir)/include \ ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/6] ddebug: record and dump apitrace call numbers
On 01/07/2016 00:21, Marek Olšák wrote: [...] diff --git a/src/gallium/drivers/ddebug/dd_util.h b/src/gallium/drivers/ddebug/dd_util.h index 093bdff..3649644 100644 --- a/src/gallium/drivers/ddebug/dd_util.h +++ b/src/gallium/drivers/ddebug/dd_util.h @@ -71,4 +71,27 @@ dd_get_debug_file(bool verbose) return f; } +static inline void +dd_parse_apitrace_marker(const char *string, int len, unsigned *call_number) +{ + unsigned num; + char *s; + + if (len <= 0) + return; + + /* Make it zero-terminated. */ + s = alloca(len + 1); This adds a use of alloca(), without a corresponding #include This fails to build, for me: In file included from dd_pipe.h:34:0, from dd_screen.c:28: dd_util.h: In function 'dd_parse_apitrace_marker': dd_util.h:84:4: error: implicit declaration of function 'alloca' [-Werror=implicit-function-declaration] s = alloca(len + 1); Perhaps the attached is needed? From 5f606bff8e5ed92a42956c10ee6b2b77360feaf5 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 5 Jul 2016 10:40:05 +0100 Subject: [PATCH] Add alloca.h include to fix compilation on Cygwin Fix compilation on Cygwin, since 50b22354, by adding #include Signed-off-by: Jon Turney --- src/gallium/drivers/ddebug/dd_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/ddebug/dd_util.h b/src/gallium/drivers/ddebug/dd_util.h index 3649644..9b9b3e0 100644 --- a/src/gallium/drivers/ddebug/dd_util.h +++ b/src/gallium/drivers/ddebug/dd_util.h @@ -28,6 +28,7 @@ #ifndef DD_UTIL_H #define DD_UTIL_H +#include #include #include #include -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/6] ddebug: record and dump apitrace call numbers
On 05/07/2016 11:17, Marek Olšák wrote: On Tue, Jul 5, 2016 at 12:13 PM, Jon Turney wrote: On 01/07/2016 00:21, Marek Olšák wrote: [...] This adds a use of alloca(), without a corresponding #include This fails to build, for me: In file included from dd_pipe.h:34:0, from dd_screen.c:28: dd_util.h: In function 'dd_parse_apitrace_marker': dd_util.h:84:4: error: implicit declaration of function 'alloca' [-Werror=implicit-function-declaration] s = alloca(len + 1); Perhaps the attached is needed? Yeah. Reviewed-by: Marek Olšák Actually, I guess this should use c99_alloca.h, since that seems to be the mechanism for doing this portably. Pushed with that correction. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI")
Structurally, this is very similar to the existing Apple-DRI code, except I have chosen to implement this using the __GLXDRIdisplay, etc. vtables (as suggested originally in [1]), rather than a maze of ifdefs. This also means that LIBGL_ALWAYS_SOFTWARE and LIBGL_ALWAYS_INDIRECT work as expected. [1] https://lists.freedesktop.org/archives/mesa-dev/2010-May/000756.html This adds: * the Windows-DRI extension protocol headers and the windowsdriproto.pc file, for use in building the Windows-DRI extension for the X server * a Windows-DRI extension helper client library * a Windows-specific DRI implementation for GLX clients The server is queried for Windows-DRI extension support on the screen before using it (to detect the case where WGL is disabled or can't be activated). The server is queried for fbconfigID to pixelformatindex mapping, which is used to augment glx_config. The server is queried for a native handle for the drawable (which is of a different type for windows, pixmaps and pbuffers), which is used to augment __GLXDRIdrawable. Various GLX extensions are enabled depending on if the equivalent WGL extension is available. Signed-off-by: Jon Turney --- configure.ac | 10 +- src/glx/Makefile.am | 14 + src/glx/driwindows_glx.c | 609 ++ src/glx/glxclient.h | 11 +- src/glx/glxext.c | 19 ++ src/glx/windows/Makefile.am | 31 ++ src/glx/windows/wgl.c | 108 ++ src/glx/windows/wgl.h | 44 +++ src/glx/windows/windows_drawable.c| 192 +++ src/glx/windows/windowsdriconst.h | 45 +++ src/glx/windows/windowsdriproto.pc.in | 9 + src/glx/windows/windowsdristr.h | 152 + src/glx/windows/windowsgl.c | 403 ++ src/glx/windows/windowsgl.h | 52 +++ src/glx/windows/windowsgl_internal.h | 67 src/glx/windows/xwindowsdri.c | 237 + src/glx/windows/xwindowsdri.h | 59 src/mapi/Makefile.am | 3 + src/mapi/glapi/gen/Makefile.am| 3 + src/mapi/glapi/glapi.h| 2 +- 20 files changed, 2066 insertions(+), 4 deletions(-) create mode 100644 src/glx/driwindows_glx.c create mode 100644 src/glx/windows/Makefile.am create mode 100644 src/glx/windows/wgl.c create mode 100644 src/glx/windows/wgl.h create mode 100644 src/glx/windows/windows_drawable.c create mode 100644 src/glx/windows/windowsdriconst.h create mode 100644 src/glx/windows/windowsdriproto.pc.in create mode 100644 src/glx/windows/windowsdristr.h create mode 100644 src/glx/windows/windowsgl.c create mode 100644 src/glx/windows/windowsgl.h create mode 100644 src/glx/windows/windowsgl_internal.h create mode 100644 src/glx/windows/xwindowsdri.c create mode 100644 src/glx/windows/xwindowsdri.h diff --git a/configure.ac b/configure.ac index 54416b4..9cefc28 100644 --- a/configure.ac +++ b/configure.ac @@ -1114,7 +1114,9 @@ fi case "$host_os" in darwin*) dri_platform='apple' ;; -gnu*|cygwin*) +cygwin*) +dri_platform='windows' ;; +gnu*) dri_platform='none' ;; *) dri_platform='drm' ;; @@ -1130,6 +1132,7 @@ AM_CONDITIONAL(HAVE_DRISW_KMS, test "x$have_drisw_kms" = xyes ) AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes ) AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes -a "x$dri_platform" = xdrm -a "x$have_libdrm" = xyes ) AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xapple ) +AM_CONDITIONAL(HAVE_WINDOWSDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xwindows ) AC_ARG_ENABLE([shared-glapi], [AS_HELP_STRING([--enable-shared-glapi], @@ -1394,6 +1397,9 @@ xdri) if test x"$dri_platform" = xapple ; then DEFINES="$DEFINES -DGLX_USE_APPLEGL" fi +if test x"$dri_platform" = xwindows ; then +DEFINES="$DEFINES -DGLX_USE_WINDOWSGL" +fi fi # add xf86vidmode if available @@ -2744,6 +2750,8 @@ AC_CONFIG_FILES([Makefile src/glx/Makefile src/glx/apple/Makefile src/glx/tests/Makefile + src/glx/windows/Makefile + src/glx/windows/windowsdriproto.pc src/gtest/Makefile src/intel/Makefile src/intel/genxml/Makefile diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index 3c0cb5f..5884e33 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -145,6 +145,16 @@ SUBDIRS += apple libglx_la_LIBADD += $(builddir)/apple/libappleglx.la endif +if HAVE_WINDOWSDRI +libglx_la_SOURCES += \ +
[Mesa-dev] [PATCH 0/3] translate, rtasm fixes for 64-bit Cygwin
Since 64-bit Cygwin is now a thing, fix translate_sse for it. (It's unclear that it's ever worked on the Windows 64-bit target. Commit c2da8e77023325f46dde2009def2947b1a687c7b "translate_sse: major rewrite (v5)" adds untested support for 64-bit Windows, and then commit f4dd0991719ef3e2606920c5100b372181c60899 disabled tranlate_sse.c on MinGW x86_64 because of crashes.) Jon TURNEY (3): rtasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap() rtasm: Cygwin uses the msabi calling convention on x86_64 traslate_sse: Fix generated code argument handling for msabi on x86_64 src/gallium/auxiliary/rtasm/rtasm_execmem.c | 2 +- src/gallium/auxiliary/rtasm/rtasm_x86sse.h | 2 +- src/gallium/auxiliary/translate/translate_sse.c | 14 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] rtasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap()
The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap() to allocate an anonymous page with execute permission, rather than the one which just uses malloc(). Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/rtasm/rtasm_execmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c index 8f7cc20..3c4b048 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c +++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c @@ -49,7 +49,7 @@ #include #endif -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN) /* -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] rtasm: Cygwin uses the msabi calling convention on x86_64
Cygwin also uses the msabi calling convention on x86_64, not the sysvabi calling convention Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/rtasm/rtasm_x86sse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/rtasm/rtasm_x86sse.h b/src/gallium/auxiliary/rtasm/rtasm_x86sse.h index 67c9bdd..498ca82 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_x86sse.h +++ b/src/gallium/auxiliary/rtasm/rtasm_x86sse.h @@ -140,7 +140,7 @@ static INLINE enum x86_target x86_target( struct x86_function* p ) { #ifdef PIPE_ARCH_X86 return X86_32; -#elif defined(_WIN64) +#elif (defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_WINDOWS)) && defined(PIPE_ARCH_X86_64) return X86_64_WIN64_ABI; #elif defined(PIPE_ARCH_X86_64) return X86_64_STD_ABI; -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] traslate_sse: Fix generated code argument handling for msabi on x86_64
translate_sse.c contains code for msabi on x86_64, but it appears to be untested. Currently arguments 1 and 2 passed to the generated code are moved as 32-bit quantities into the registers used by sysvabi, irrespective of the architecture. Since these may be pointers, they must be moved as 64-bit quantities to avoid truncation. Commit f4dd0991719ef3e2606920c5100b372181c60899 disabled tranlate_sse.c on MinGW x86_64, I don't know if was due to this issue, or a different one... Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/translate/translate_sse.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/translate/translate_sse.c b/src/gallium/auxiliary/translate/translate_sse.c index 726a9b1..3e12f1e 100644 --- a/src/gallium/auxiliary/translate/translate_sse.c +++ b/src/gallium/auxiliary/translate/translate_sse.c @@ -1308,14 +1308,22 @@ static boolean build_vertex_emit( struct translate_sse *p, x86_push(p->func, p->outbuf_EBX); x86_push(p->func, p->count_EBP); -/* on non-Win64 x86-64, these are already in the right registers */ + /* on non-Win64 x86-64, these are already in the right registers */ if(x86_target(p->func) != X86_64_STD_ABI) { x86_push(p->func, p->machine_EDI); x86_push(p->func, p->idx_ESI); - x86_mov(p->func, p->machine_EDI, x86_fn_arg(p->func, 1)); - x86_mov(p->func, p->idx_ESI, x86_fn_arg(p->func, 2)); + if(x86_target(p->func) != X86_32) + { +x64_mov64(p->func, p->machine_EDI, x86_fn_arg(p->func, 1)); +x64_mov64(p->func, p->idx_ESI, x86_fn_arg(p->func, 2)); + } + else + { +x86_mov(p->func, p->machine_EDI, x86_fn_arg(p->func, 1)); +x86_mov(p->func, p->idx_ESI, x86_fn_arg(p->func, 2)); + } } x86_mov(p->func, p->count_EBP, x86_fn_arg(p->func, 3)); -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] tests: Fix make check for out of tree builds.
On 11/11/2013 22:06, Matt Turner wrote: > On Mon, Nov 11, 2013 at 12:18 PM, Rico Schüller wrote: >> Signed-off-by: Rico Schüller >> --- >> src/mapi/shared-glapi/tests/Makefile.am | 1 + >> src/mesa/main/tests/Makefile.am | 1 + >> 2 Dateien geändert, 2 Zeilen hinzugefügt(+) >> >> diff --git a/src/mapi/shared-glapi/tests/Makefile.am >> b/src/mapi/shared-glapi/tests/Makefile.am >> index 98065fc..7e71b4f 100644 >> --- a/src/mapi/shared-glapi/tests/Makefile.am >> +++ b/src/mapi/shared-glapi/tests/Makefile.am >> @@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS) >> AM_CPPFLAGS = \ >> -I$(top_srcdir)/src/gtest/include \ >> -I$(top_srcdir)/src/mapi \ >> + -I$(top_builddir)/src/mapi \ >> -I$(top_srcdir)/include >> >> TESTS = shared-glapi-test > > Thanks! Reviewed-by and committed. It seems that 'make check' for unshared glapi needs a similar fix. Patch attached. >From 76130730ad77db1225190d1afa0ec2a07a055d58 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 8 Nov 2013 13:22:54 + Subject: [PATCH 2/4] Fix 'make check' in src/mapi/glapi/tests when builddir != srcdir make[5]: Entering directory `/jhbuild/build/mesa/mesa/src/mapi/glapi/tests' CXX check_table.o /jhbuild/checkout/mesa/mesa/src/mapi/glapi/tests/check_table.cpp:29:30: fatal error: glapi/glapitable.h: No such file or directory We should look for the generated file glapi/glapitable.h in builddir, not srcdir Signed-off-by: Jon TURNEY --- src/mapi/glapi/tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mapi/glapi/tests/Makefile.am b/src/mapi/glapi/tests/Makefile.am index 26149c9..da1094b 100644 --- a/src/mapi/glapi/tests/Makefile.am +++ b/src/mapi/glapi/tests/Makefile.am @@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS = \ $(DEFINES) \ -I$(top_srcdir)/src/gtest/include \ + -I$(top_builddir)/src/mapi \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/include -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure.ac: Do not use Pthreads with MinGW.
On 04/06/2014 01:06, Vinson Lee wrote: Match the behavior of the SCons MinGW build. This patch also fixes these build errors. CC glapi_entrypoint.lo glapi_entrypoint.c: In function 'init_glapi_relocs_once': glapi_entrypoint.c:341:4: error: unknown type name 'pthread_once_t' static pthread_once_t once_control = PTHREAD_ONCE_INIT; ^ glapi_entrypoint.c:341:41: error: 'PTHREAD_ONCE_INIT' undeclared (first use in this function) static pthread_once_t once_control = PTHREAD_ONCE_INIT; ^ glapi_entrypoint.c:341:41: note: each undeclared identifier is reported only once for each function it appears in glapi_entrypoint.c:342:4: error: implicit declaration of function 'pthread_once' [-Werror=implicit-function-declaration] pthread_once( & once_control, init_glapi_relocs ); ^ Signed-off-by: Vinson Lee --- configure.ac | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9c64400..ab3b91d 100644 --- a/configure.ac +++ b/configure.ac @@ -552,7 +552,12 @@ dnl See if posix_memalign is available AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) dnl Check for pthreads -AX_PTHREAD +case "$host_os" in +mingw*) +;; +*) +AX_PTHREAD +esac dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS dnl to -pthread, which causes problems if we need -lpthread to appear in dnl pkgconfig files. I'm not sure this is right. Current versions of both the pthreads libraries for MinGW/MinGW64 (pthreads-win32, winpthreads) seem to have pthread_once() I guess maybe the actual issue is that there is some path here where pthread.h isn't included? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 0/2] Build a driswrast-using libGL on non-DRM targets
On 03/06/2014 17:37, Emil Velikov wrote: On 03/06/14 14:14, Jon TURNEY wrote: As a follow-up to my "Fix Apple-DRI GLX" patchset, allow building of a libGL capable of using driswrast on targets without libdrm, and make that the default configuration. The --disable-driglx-direct option only appears to exist for the benefit of such targets, so it could probably be removed in future. IIRC people that build non-dri glx(libGL) i.e. --enable-xlib-glx normally set --disable-driglx-direct as well. Not sure if they will be affected by your patches though. I will take a closer look over the weekend, unless you beat me to it. Good point. Looking at configure.ac, it doesn't look like --disable-driglx-direct has any meaning when --enable-xlib-glx is used. It seems that --enable-xlib-glx requires --disable-dri currently, and it seems to build fine with these patches applied. My comment that --disable-driglx-direct only exists for the benefit of non-DRM targets was based on [1] et seq. [1] http://cgit.freedesktop.org/mesa/mesa/commit/?id=758561786c3a34303e6c85dfdb996b94a4eed678 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glx: Add an error message when a direct renderer's createScreen() routine fails because no matching fbConfigs or visuals could be found.
Nearly all the error cases in *createScreen() issue an error message to diagnose the failure to initialize before branching to handle_error. The few remaining error cases which don't should probably do the same. (At the moment, it seems this can be triggered in drisw with an X server which reports definite values for MAX_PBUFFFER_(WIDTH|HEIGHT|SIZE), because those attributes are checked for an exact match against 0.) Signed-off-by: Jon TURNEY --- src/glx/dri2_glx.c | 4 +++- src/glx/dri3_glx.c | 4 +++- src/glx/dri_glx.c | 4 +++- src/glx/drisw_glx.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index bd7ed8b..462d560 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1263,8 +1263,10 @@ dri2CreateScreen(int screen, struct glx_display * priv) configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs); - if (!configs || !visuals) + if (!configs || !visuals) { + ErrorMessageF("No matching fbConfigs or visuals found\n"); goto handle_error; + } glx_config_destroy_list(psc->base.configs); psc->base.configs = configs; diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 3d8a662..55eed39 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -1741,8 +1741,10 @@ dri3_create_screen(int screen, struct glx_display * priv) configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs); - if (!configs || !visuals) + if (!configs || !visuals) { + ErrorMessageF("No matching fbConfigs or visuals found\n"); goto handle_error; + } glx_config_destroy_list(psc->base.configs); psc->base.configs = configs; diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 04a0847..5295331 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -460,8 +460,10 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc, configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs); - if (!configs || !visuals) + if (!configs || !visuals) { + ErrorMessageF("No matching fbConfigs or visuals found\n"); goto handle_error; + } glx_config_destroy_list(psc->base.configs); psc->base.configs = configs; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 5885b66..fcb5d8f 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -733,8 +733,10 @@ driswCreateScreen(int screen, struct glx_display *priv) configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs); - if (!configs || !visuals) + if (!configs || !visuals) { + ErrorMessageF("No matching fbConfigs or visuals found\n"); goto handle_error; + } glx_config_destroy_list(psc->base.configs); psc->base.configs = configs; -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] configure: Don't special case Cygwin to use gnu99, define _XOPEN_SOURCE instead
Revert "build: Build on Cygwin with gnu99 instead of c99." and define _XOPEN_SOURCE appropriately. This reverts commit 53e36d333c9b619c1a5fe9a8d2d08665654b0234. Since Cygwin 1.7.18 (April 2013), it's headers correctly prototype strtoll() when using -std=c99, and correctly prototype strdup() when _XOPEN_SOURCE is defined appropriately, so this workaround is no longer needed. Signed-off-by: Jon TURNEY Cc: Vinson Lee --- configure.ac | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 1525b20..802b05a 100644 --- a/configure.ac +++ b/configure.ac @@ -159,20 +159,13 @@ solaris*) DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4" ;; cygwin*) -DEFINES="$DEFINES -DHAVE_PTHREAD" +DEFINES="$DEFINES -D_XOPEN_SOURCE=500 -DHAVE_PTHREAD" ;; esac dnl Add flags for gcc and g++ if test "x$GCC" = xyes; then -case "$host_os" in -cygwin*) -CFLAGS="$CFLAGS -Wall -std=gnu99" -;; -*) -CFLAGS="$CFLAGS -Wall -std=c99" -;; -esac +CFLAGS="$CFLAGS -Wall -std=c99" # Enable -Werror=implicit-function-declaration and # -Werror=missing-prototypes, if available, or otherwise, just -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Avoid mesa_dri_drivers import lib being installed
On Cygwin and MinGW, linking a shared library also generates an import library Use a wildcard which also matches the name of the megadriver import lib, mesa_dri_drivers.dll.a, so that is also removed after megadriver symlinks are created (This then matches src/gallium/targets/dri/Makefile.am, which already does things this way) Signed-off-by: Jon TURNEY --- src/mesa/drivers/dri/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am index 37136b9..1a93645 100644 --- a/src/mesa/drivers/dri/Makefile.am +++ b/src/mesa/drivers/dri/Makefile.am @@ -91,7 +91,6 @@ install-data-hook: ln -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so \ $(DESTDIR)$(dridir)/$$i; \ done; - $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.so - $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.la + $(RM) -f $(DESTDIR)$(dridir)/mesa_dri_drivers.* endif -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/2] Teach some platform checks about Cygwin
A couple of small fixes to teach platform checks about Cygwin's characteristics Ideally, these would be autoconf checks, and we wouldn't have to do anything here, but it seems that ship has long sailed. Yaakov Selkowitz (2): xmlconfig: Use program_invocation_short_name when building for cygwin os_process.c: Add cygwin as an expected platform src/gallium/auxiliary/os/os_process.c | 4 ++-- src/mesa/drivers/dri/common/xmlconfig.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] xmlconfig: Use program_invocation_short_name when building for cygwin
From: Yaakov Selkowitz mesa/mesa/src/mesa/drivers/dri/common/xmlconfig.c:104:10: warning: #warning "Per application configuration won't work with your OS version." [-Wcpp] #warning "Per application configuration won't work with your OS version." Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY --- src/mesa/drivers/dri/common/xmlconfig.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 58d0e06..ce37647 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -45,6 +45,8 @@ extern char *program_invocation_name, *program_invocation_short_name; #endif #define GET_PROGRAM_NAME() program_invocation_short_name +#elif defined(__CYGWIN__) +#define GET_PROGRAM_NAME() program_invocation_short_name #elif defined(__FreeBSD__) && (__FreeBSD__ >= 2) #include #if (__FreeBSD_version >= 44) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] os_process.c: Add cygwin as an expected platform
From: Yaakov Selkowitz mesa/mesa/src/gallium/auxiliary/os/os_process.c:40:2: warning: #warning unexpected platform in os_process.c [-Wcpp] #warning unexpected platform in os_process.c mesa/mesa/src/gallium/auxiliary/os/os_process.c:77:2: warning: #warning unexpected platform in os_process.c [-Wcpp] #warning unexpected platform in os_process.c Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY --- src/gallium/auxiliary/os/os_process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c index ef38e1d..3e060b9 100644 --- a/src/gallium/auxiliary/os/os_process.c +++ b/src/gallium/auxiliary/os/os_process.c @@ -32,7 +32,7 @@ #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) # include -#elif defined(__GLIBC__) +#elif defined(__GLIBC__) || defined(__CYGWIN__) # include #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) # include @@ -68,7 +68,7 @@ os_get_process_name(char *procname, size_t size) name = lpProcessName; -#elif defined(__GLIBC__) +#elif defined(__GLIBC__) || defined(__CYGWIN__) name = program_invocation_short_name; #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) /* *BSD and OS X */ -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 4/6] gallium: Add a dumb drm/kms winsys backed swrast provider
On 24/07/2014 01:43, Emil Velikov wrote: From: Giovanni Campagna Add a new winsys and target that can be used with a dri2 state tracker and loader instead of drisw. This allows to use gbm as a dri2/image loader and avoid the extra copy from the backbuffer to the shadow frontbuffer. The new driver is called "kms_swrast", and is loaded by gbm as a fallback, because it is only useful with the gbm platform (as no buffer sharing is possible) To force select the driver set the environment variable GBM_ALWAYS_SOFTWARE [Emil Velikov] - Rebase on top of gallium megadriver. - s/text/test/ in configure.ac (Spotted by Andreas Pokorny). - Add scons support for winsys/sw/kms-dri and fix the build. - Provide separate DriverAPI, due to different InitScreen hook. Unfortunately, this seems to break my build. I guess something like the attached is needed. [1] http://tinderbox.x.org/builds/2014-07-31-0006/logs/mesa-mesa/#build From fd1aaf61a9e4c50db26fc89d608c8ec164cadbcc Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 31 Jul 2014 16:30:37 +0100 Subject: [PATCH] Fix build since 3b176c441b7ddc5f7d2f891da3f76cf3c1814ce1 for dri_platform=none hosts Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/target-helpers/inline_drm_helper.h | 2 ++ src/gallium/targets/dri/Makefile.am | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/target-helpers/inline_drm_helper.h b/src/gallium/auxiliary/target-helpers/inline_drm_helper.h index 751ceb1..5d02da7 100644 --- a/src/gallium/auxiliary/target-helpers/inline_drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_drm_helper.h @@ -60,6 +60,7 @@ static char* driver_name = NULL; #if defined(GALLIUM_SOFTPIPE) #if defined(DRI_TARGET) +#if defined(HAVE_LIBDRM) const __DRIextension **__driDriverGetExtensions_kms_swrast(void); @@ -84,6 +85,7 @@ kms_swrast_create_screen(int fd) } #endif #endif +#endif #if defined(GALLIUM_I915) #if defined(DRI_TARGET) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index 65b0a32..a9b4d44 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -8,6 +8,7 @@ AM_CFLAGS = \ $(GALLIUM_TARGET_CFLAGS) AM_CPPFLAGS = \ + $(DEFINES) \ -DDRI_TARGET \ -DGALLIUM_GALAHAD \ -DGALLIUM_NOOP \ -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glx: Verify that drawable creation on the client side actually worked
On 04/05/2011 22:50, Adam Jackson wrote: > ... and clean up if it didn't. > > Signed-off-by: Adam Jackson > --- > src/glx/glx_pbuffer.c | 76 > - > src/glx/glxcmds.c | 74 +++- > 2 files changed, 98 insertions(+), 52 deletions(-) > > diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c > index 5f91bc6..1d9c1e9 100644 > --- a/src/glx/glx_pbuffer.c > +++ b/src/glx/glx_pbuffer.c > > #else > > -static void > +static GLboolean > CreateDRIDrawable(Display *dpy, const struct glx_config * fbconfig, > XID drawable, XID glxdrawable, > const int *attrib_list, size_t num_attribs) > { > +return GL_FALSE; > } > Always returning GL_FALSE (failed) here when built without GLX_DIRECT_RENDERING defined ... > /** > * Create a non-pbuffer GLX drawable. > * > @@ -378,6 +402,7 @@ CreateDrawable(Display *dpy, struct glx_config *config, > Drawable drawable, const int *attrib_list, CARD8 glxCode) > { > xGLXCreateWindowReq *req; > + GLXDrawable ret; > CARD32 *data; > unsigned int i; > CARD8 opcode; > @@ -401,7 +426,7 @@ CreateDrawable(Display *dpy, struct glx_config *config, > req->screen = config->screen; > req->fbconfig = config->fbconfigID; > req->window = drawable; > - req->glxwindow = XAllocID(dpy); > + req->glxwindow = ret = XAllocID(dpy); > req->numAttribs = i; > > if (attrib_list) > @@ -410,9 +435,16 @@ CreateDrawable(Display *dpy, struct glx_config *config, > UnlockDisplay(dpy); > SyncHandle(); > > - CreateDRIDrawable(dpy, config, drawable, req->glxwindow, attrib_list, i); > + if (!CreateDRIDrawable(dpy, config, drawable, ret, attrib_list, i)) { > + if (glxCode == X_GLXCreatePixmap) > + glxCode = X_GLXDestroyPixmap; > + else > + glxCode = X_GLXDestroyWindow; > + protocolDestroyDrawable(dpy, ret, glxCode); > + ret = None; > + } ... and then always checking the result here, looks like this makes CreateDrawable (and hence glXCreateWindow() and glXCreatePbuffer()) always fail (when built without GLX_DIRECT_RENDERING defined) > > - return req->glxwindow; > + return ret; > } > > @@ -474,6 +490,7 @@ CreatePbuffer(Display * dpy, struct glx_config *config, > CARD8 opcode; > unsigned int i; > Pixmap pixmap; > + GLboolean glx_1_3 = GL_FALSE; > > i = 0; > if (attrib_list) { > @@ -492,6 +509,8 @@ CreatePbuffer(Display * dpy, struct glx_config *config, >xGLXCreatePbufferReq *req; >unsigned int extra = (size_in_attribs) ? 0 : 2; > > + glx_1_3 = GL_TRUE; > + >GetReqExtra(GLXCreatePbuffer, (8 * (i + extra)), req); >data = (CARD32 *) (req + 1); > > @@ -536,7 +555,12 @@ CreatePbuffer(Display * dpy, struct glx_config *config, > pixmap = XCreatePixmap(dpy, RootWindow(dpy, config->screen), > width, height, config->rgbBits); > > - CreateDRIDrawable(dpy, config, pixmap, id, attrib_list, i); > + if (!CreateDRIDrawable(dpy, config, pixmap, id, attrib_list, i)) { > + CARD32 o = glx_1_3 ? X_GLXDestroyPbuffer : > X_GLXvop_DestroyGLXPbufferSGIX; > + XFreePixmap(dpy, pixmap); > + protocolDestroyDrawable(dpy, id, o); > + id = None; > + } Ditto. > > return id; > } Attached is a patch to fix. >From f210b48ed7ae8d0286676ed94c38c5a6ca4338b4 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 26 Feb 2013 15:47:44 + Subject: [PATCH] glXCreateWindow() always fails when built without GLX_DIRECT_RENDERING defined glXCreateWindow() and glXCreatePbuffer() always fail when built without GLX_DIRECT_RENDERING defined since commit 4833104718677caad0027d5e7539ca9bba389392 Signed-off-by: Jon TURNEY --- src/glx/glx_pbuffer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index e4b2c86..f11305a 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -241,7 +241,7 @@ CreateDRIDrawable(Display *dpy, const struct glx_config * fbconfig, XID drawable, XID glxdrawable, const int *attrib_list, size_t num_attribs) { -return GL_FALSE; +return GL_TRUE; } static void -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] Fixes for glapi/test/check_table test
Now that the make target is supported, I've turned on 'make check' for mesa in my tinderbox, but it fails [1] The logic behind patch [3/3] is sufficently convoluted that I'm not sure I've got it right. However, I'm pretty sure that the code is wrong as it stands, as it's checking for a #define which is never made. [1] http://tinderbox.freedesktop.org/builds/2013-02-27-0010/logs/libGL/#check Jon TURNEY (3): Fix out-of-tree build of 'make check' in src/mapi/glapi/tests/ Fix glapi/tests/check_table.cpp for standardized OpenGL function names Properly check GLX_INDIRECT_RENDERING in glapi/tests/check_table src/mapi/glapi/tests/Makefile.am |7 +- src/mapi/glapi/tests/check_table.cpp | 530 +- 2 files changed, 269 insertions(+), 268 deletions(-) -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] Fix out-of-tree build of 'make check' in src/mapi/glapi/tests/
Signed-off-by: Jon TURNEY --- src/mapi/glapi/tests/Makefile.am |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mapi/glapi/tests/Makefile.am b/src/mapi/glapi/tests/Makefile.am index a23eef2..3553b99 100644 --- a/src/mapi/glapi/tests/Makefile.am +++ b/src/mapi/glapi/tests/Makefile.am @@ -1,9 +1,9 @@ if !HAVE_SHARED_GLAPI AM_CFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS = \ - -I$(top_builddir)/src/gtest/include \ - -I$(top_builddir)/src/mapi \ - -I$(top_builddir)/include + -I$(top_srcdir)/src/gtest/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/include TESTS = glapi-test check_PROGRAMS = glapi-test -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] Fix glapi/tests/check_table.cpp for standardized OpenGL function names
It looks like this has been broken since commit 1a1db1746db82efc7f0643508886dfc78a15eb71 "Standardize names of OpenGL functions." Signed-off-by: Jon TURNEY --- src/mapi/glapi/tests/check_table.cpp | 528 +- 1 files changed, 264 insertions(+), 264 deletions(-) diff --git a/src/mapi/glapi/tests/check_table.cpp b/src/mapi/glapi/tests/check_table.cpp index 807d3c3..dffec83 100644 --- a/src/mapi/glapi/tests/check_table.cpp +++ b/src/mapi/glapi/tests/check_table.cpp @@ -523,40 +523,40 @@ const struct name_offset linux_gl_abi[] = { { "glTexImage3D", 371 }, { "glTexSubImage3D", 372 }, { "glCopyTexSubImage3D", 373 }, - { "glActiveTextureARB", 374 }, - { "glClientActiveTextureARB", 375 }, - { "glMultiTexCoord1dARB", 376 }, - { "glMultiTexCoord1dvARB", 377 }, + { "glActiveTexture", 374 }, + { "glClientActiveTexture", 375 }, + { "glMultiTexCoord1d", 376 }, + { "glMultiTexCoord1dv", 377 }, { "glMultiTexCoord1fARB", 378 }, { "glMultiTexCoord1fvARB", 379 }, - { "glMultiTexCoord1iARB", 380 }, - { "glMultiTexCoord1ivARB", 381 }, - { "glMultiTexCoord1sARB", 382 }, - { "glMultiTexCoord1svARB", 383 }, - { "glMultiTexCoord2dARB", 384 }, - { "glMultiTexCoord2dvARB", 385 }, + { "glMultiTexCoord1i", 380 }, + { "glMultiTexCoord1iv", 381 }, + { "glMultiTexCoord1s", 382 }, + { "glMultiTexCoord1sv", 383 }, + { "glMultiTexCoord2d", 384 }, + { "glMultiTexCoord2dv", 385 }, { "glMultiTexCoord2fARB", 386 }, { "glMultiTexCoord2fvARB", 387 }, - { "glMultiTexCoord2iARB", 388 }, - { "glMultiTexCoord2ivARB", 389 }, - { "glMultiTexCoord2sARB", 390 }, - { "glMultiTexCoord2svARB", 391 }, - { "glMultiTexCoord3dARB", 392 }, - { "glMultiTexCoord3dvARB", 393 }, + { "glMultiTexCoord2i", 388 }, + { "glMultiTexCoord2iv", 389 }, + { "glMultiTexCoord2s", 390 }, + { "glMultiTexCoord2sv", 391 }, + { "glMultiTexCoord3d", 392 }, + { "glMultiTexCoord3dv", 393 }, { "glMultiTexCoord3fARB", 394 }, { "glMultiTexCoord3fvARB", 395 }, - { "glMultiTexCoord3iARB", 396 }, - { "glMultiTexCoord3ivARB", 397 }, - { "glMultiTexCoord3sARB", 398 }, - { "glMultiTexCoord3svARB", 399 }, - { "glMultiTexCoord4dARB", 400 }, - { "glMultiTexCoord4dvARB", 401 }, + { "glMultiTexCoord3i", 396 }, + { "glMultiTexCoord3iv", 397 }, + { "glMultiTexCoord3s", 398 }, + { "glMultiTexCoord3sv", 399 }, + { "glMultiTexCoord4d", 400 }, + { "glMultiTexCoord4dv", 401 }, { "glMultiTexCoord4fARB", 402 }, { "glMultiTexCoord4fvARB", 403 }, - { "glMultiTexCoord4iARB", 404 }, - { "glMultiTexCoord4ivARB", 405 }, - { "glMultiTexCoord4sARB", 406 }, - { "glMultiTexCoord4svARB", 407 }, + { "glMultiTexCoord4i", 404 }, + { "glMultiTexCoord4iv", 405 }, + { "glMultiTexCoord4s", 406 }, + { "glMultiTexCoord4sv", 407 }, { NULL, 0 } }; @@ -937,40 +937,40 @@ const struct name_offset known_dispatch[] = { { "glTexImage3D", _O(TexImage3D) }, { "glTexSubImage3D", _O(TexSubImage3D) }, { "glCopyTexSubImage3D", _O(CopyTexSubImage3D) }, - { "glActiveTextureARB", _O(ActiveTextureARB) }, - { "glClientActiveTextureARB", _O(ClientActiveTextureARB) }, - { "glMultiTexCoord1dARB", _O(MultiTexCoord1dARB) }, - { "glMultiTexCoord1dvARB", _O(MultiTexCoord1dvARB) }, + { "glActiveTexture", _O(ActiveTexture) }, + { "glClientActiveTexture", _O(ClientActiveTexture) }, + { "glMultiTexCoord1d", _O(MultiTexCoord1d) }, + { "glMultiTexCoord1dv", _O(MultiTexCoord1dv) }, { "glMultiTexCoord1fARB", _O(MultiTexCoord1fARB) }, { "glMultiTexCoord1fvARB", _O(MultiTexCoord1fvARB) }, - { "glMultiTexCoord1iARB", _O(MultiTexCoord1iARB) }, - { "glMultiTexCoord1ivARB", _O(MultiTexCoord1ivARB) }, - { "glMultiTexCoord1sARB", _O(MultiTexCoord1sARB) }, - { "glMultiTexCoord1svARB", _O(MultiTexCoord1svARB) }, - { "glMultiTexCoord2dARB", _O(MultiTexCoord2dARB) }, - { "glMultiTexCoord2dvARB", _O(MultiTexCoord2dvARB) }, + { "glMultiTexCoord1i", _O(MultiTexCoord1i) }, + { "glMultiTexCoord1iv", _O(MultiTexCoord1iv) }, + { "glMultiTexCoord1s", _O(MultiTexCoord1s) },
[Mesa-dev] [PATCH 3/3] Properly check GLX_INDIRECT_RENDERING in glapi/tests/check_table
Actually use $DEFINES, so we can see if GLX_INDIRECT_RENDERING is defined If GLX_INDIRECT_RENDERING is defined, _GLAPI_SKIP_PROTO_ENTRY_POINTS will be defined, and libglapi won't contain the 'protocol entry points', so we should provide stubs in check_table.cpp Signed-off-by: Jon TURNEY --- src/mapi/glapi/tests/Makefile.am |1 + src/mapi/glapi/tests/check_table.cpp |2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/mapi/glapi/tests/Makefile.am b/src/mapi/glapi/tests/Makefile.am index 3553b99..f375e9b 100644 --- a/src/mapi/glapi/tests/Makefile.am +++ b/src/mapi/glapi/tests/Makefile.am @@ -1,6 +1,7 @@ if !HAVE_SHARED_GLAPI AM_CFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS = \ +$(DEFINES) \ -I$(top_srcdir)/src/gtest/include \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/include diff --git a/src/mapi/glapi/tests/check_table.cpp b/src/mapi/glapi/tests/check_table.cpp index dffec83..375645b 100644 --- a/src/mapi/glapi/tests/check_table.cpp +++ b/src/mapi/glapi/tests/check_table.cpp @@ -1511,7 +1511,7 @@ const struct name_offset known_dispatch[] = { { NULL, 0 } }; -#ifndef GLX_INDIRECT_RENDERING +#ifdef GLX_INDIRECT_RENDERING extern "C" { GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Fix out-of-tree build of 'make check' in src/mesa/main/tests
Signed-off-by: Jon TURNEY --- src/mesa/main/tests/Makefile.am |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am index 012b353..4acc815 100644 --- a/src/mesa/main/tests/Makefile.am +++ b/src/mesa/main/tests/Makefile.am @@ -4,10 +4,10 @@ AM_CFLAGS = \ $(X11_CFLAGS) \ $(PTHREAD_CFLAGS) AM_CPPFLAGS = \ - -I$(top_builddir)/src/gtest/include \ - -I$(top_builddir)/src/mapi \ - -I$(top_builddir)/src/mesa \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/src/gtest/include \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_srcdir)/include \ $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) TESTS = main-test -- 1.7.9 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Mesa (master): Don't bother making compatibilty symlinks
On 12/03/2013 03:12, Stéphane Marchesin wrote: > It looks like this commit (and the other ones in the series) aren't > present in the mesa git tree. It also looks like the last commit was > pushed twice, and is present with the hash from the second time. Last week, I pushed a bunch of wrong commits by accident, then reset master back to the correct commit. Something like that commit is probably appropriate now, but the comment should make clear that's a cygwin-specific patch which should never have escaped. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Fix build when configured --with-gallium-drivers=swrast --disable-driglx-direct on platforms which don't have LIBDRM
As elsewhere, place code which relies on including xf86drm.h that has been added since the last time this was fixed under #ifdef GLX_DIRECT_RENDERING. Future work: It should be possible to build when configured --with-gallium-drivers=swrast --enable-driglx-direct without LIBDRM to build a libGL which can load just swrast, since there is no functional dependency, but work is needed to untangle the build dependency. Signed-off-by: Jon TURNEY --- src/glx/dri2_query_renderer.c| 5 + src/glx/tests/query_renderer_implementation_unittest.cpp | 4 2 files changed, 9 insertions(+) diff --git a/src/glx/dri2_query_renderer.c b/src/glx/dri2_query_renderer.c index b50a202..3bc90c7 100644 --- a/src/glx/dri2_query_renderer.c +++ b/src/glx/dri2_query_renderer.c @@ -20,6 +20,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ + +#ifdef GLX_DIRECT_RENDERING + #include "glxclient.h" #include "glx_error.h" #include "xf86drm.h" @@ -95,3 +98,5 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute, return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value); } + +#endif /* GLX_DIRECT_RENDERING */ diff --git a/src/glx/tests/query_renderer_implementation_unittest.cpp b/src/glx/tests/query_renderer_implementation_unittest.cpp index 4749089..3d8dc2a 100644 --- a/src/glx/tests/query_renderer_implementation_unittest.cpp +++ b/src/glx/tests/query_renderer_implementation_unittest.cpp @@ -24,6 +24,8 @@ #include #include +#ifdef GLX_DIRECT_RENDERING + extern "C" { #include "glxclient.h" #include "glx_error.h" @@ -308,3 +310,5 @@ TEST_F(dri2_query_renderer_integer_test, valid_attribute_mapping) EXPECT_FALSE(got_sigsegv); } } + +#endif -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa/mesa] Hardcode the DRI driver extension as .so to match it's current uses.
On 06/04/2014 17:45, Emil Velikov wrote: > Sorry about this breakage. I assumed that the library extensions are handled > consistently across mesa. Seems like I was wrong. > > Guessing that you meant to send this to the mesa-dev ? Yes, sorry about that. > On 06/04/14 15:59, Jon TURNEY wrote: >> A similar fix is probably also needed for gallium DRI drivers. >> > Currently the only gallium related part is the "compatibility symlinks" > script, that is enabled only for linux. Thanks for the heads up :) That's the only place in gallium that LIB_EXT is used, but a '-shrext .so' is needed somewhere (in GALLIUM_DRI_LINKER_FLAGS?) so that the gallium DRI drivers are built with names matching those hardcoded into the loader. >> (Consider that if we were starting from scratch, perhaps we would use a >> custom >> extension like .dri instead) >> > IMHO if we're starting from scratch we should use the platform specific > extensions consistently but neither suggestion matter in this case :'( Can you explain your reasoning? This seems to me to be a foolish consistency. For libraries which are only ever used with dlopen() and are not intended to be linked with (i.e. have some sort of plug-in style interface), there is no advantage to using the platform's default shared library extension, and it introduces extra platform dependent code to determine the library name when the library is used. > With that said the patch is > Reviewed-by: Emil Velikov Thanks. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa/mesa] Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT
On 09/04/2014 14:53, Jonathan Gray wrote: > On Sun, Apr 06, 2014 at 03:30:43PM +0100, Jon TURNEY wrote: >> Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but >> can't >> provide dladdr(), so add a check for dladdr() >> >> --- >> configure.ac | 6 ++ >> src/mesa/drivers/dri/common/megadriver_stub.c | 7 +++ >> 2 files changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/configure.ac b/configure.ac >> index 878b24a..bbbed79 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -480,6 +480,12 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES >> -DHAVE_DLOPEN"], >> [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])]) >> AC_SUBST([DLOPEN_LIBS]) >> >> +dnl Check if that library also has dladdr >> +SAVE_LDFLAGS="$LDFLAGS" > > The case here is wrong and won't work as intended unless changed to > save_LDFLAGS. Good catch. > Otherwise the patch seems fine, though it will break the scons build till > those files are updated? Updated patch attached with what I think are the appropriate scons runes added (and sent to the right mailing list this time! :-) ). >From e0cd88529e0851aa7b3da59c8c74a3954ff93e7c Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 5 Apr 2014 17:11:45 +0100 Subject: [PATCH] Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but can't provide dladdr(), so add a check for dladdr() Since I don't think scons is ever used to build for Cygwin, just set HAVE_DLADDR in SConscript, assuming that if we have RTLD_DEFAULT, we have dladdr(). Cc: Jonathan Gray Signed-off-by: Jon TURNEY Reviewed-by: Eric Anholt --- configure.ac | 6 ++ src/mesa/drivers/dri/common/SConscript| 1 + src/mesa/drivers/dri/common/megadriver_stub.c | 7 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 5c01038..17cc2d1 100644 --- a/configure.ac +++ b/configure.ac @@ -480,6 +480,12 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"], [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])]) AC_SUBST([DLOPEN_LIBS]) +dnl Check if that library also has dladdr +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $DLOPEN_LIBS" +AC_CHECK_FUNCS([dladdr]) +LDFLAGS="$save_LDFLAGS" + case "$host_os" in darwin*|mingw*) ;; diff --git a/src/mesa/drivers/dri/common/SConscript b/src/mesa/drivers/dri/common/SConscript index 8b15532..41f6356 100644 --- a/src/mesa/drivers/dri/common/SConscript +++ b/src/mesa/drivers/dri/common/SConscript @@ -30,6 +30,7 @@ drienv.Replace(CPPPATH = [ driswenv = drienv.Clone() driswenv.Append(CPPDEFINES = [ '__NOT_HAVE_DRM_H', +'HAVE_DLADDR', ]) drienv.PkgUseModules('DRM') diff --git a/src/mesa/drivers/dri/common/megadriver_stub.c b/src/mesa/drivers/dri/common/megadriver_stub.c index 7b6d134..d085080 100644 --- a/src/mesa/drivers/dri/common/megadriver_stub.c +++ b/src/mesa/drivers/dri/common/megadriver_stub.c @@ -28,10 +28,9 @@ /* We need GNU extensions to dlfcn.h in order to provide backward * compatibility for the older DRI driver loader mechanism. (dladdr, - * Dl_info, and RTLD_DEFAULT are only defined when _GNU_SOURCE is - * defined.) + * Dl_info, and RTLD_DEFAULT) */ -#ifdef RTLD_DEFAULT +#if defined(RTLD_DEFAULT) && defined(HAVE_DLADDR) #define MEGADRIVER_STUB_MAX_EXTENSIONS 10 #define LIB_PATH_SUFFIX "_dri.so" @@ -148,7 +147,7 @@ megadriver_stub_init(void) } } -#endif /* RTLD_DEFAULT */ +#endif /* RTLD_DEFAULT && HAVE_DLADDR */ static const __DRIconfig **stub_error_init_screen(__DRIscreen *psp) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] Fix build for darwin
Fix build for darwin, when ./configured --disable-driglx-direct - darwin ld doesn't support -Bsymbolic or --version-script, so check if ld supports those options before using them - define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak symbols isn't supported - default to -with-dri-drivers=swrast Signed-off-by: Jon TURNEY --- configure.ac | 36 src/egl/main/Makefile.am | 2 +- src/gallium/Automake.inc | 8 src/glx/Makefile.am | 2 +- src/mesa/drivers/dri/Makefile.am | 2 +- 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 99a761a..f571af1 100644 --- a/configure.ac +++ b/configure.ac @@ -316,6 +316,22 @@ if test "x$enable_debug" = xyes; then fi dnl +dnl Check if linker supports -Bsymbolic +dnl +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,-Bsymbolic" +AC_MSG_CHECKING([if ld supports -Bsymbolic]) +AC_LINK_IFELSE( +[AC_LANG_SOURCE([int main() { return 0;}])], +[AC_MSG_RESULT([yes]) +BSYMBOLIC="-Bsymbolic";], +[AC_MSG_RESULT([no]) +BSYMBOLIC="";]) +LDFLAGS=$save_LDFLAGS + +AC_SUBST([BSYMBOLIC]) + +dnl dnl Check if linker supports garbage collection dnl save_LDFLAGS=$LDFLAGS @@ -332,6 +348,20 @@ LDFLAGS=$save_LDFLAGS AC_SUBST([GC_SECTIONS]) dnl +dnl Check if linker supports version scripts +dnl +AC_MSG_CHECKING([if libraries can be versioned]) +GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +if test "$GLD"; then +have_ld_version_script=yes +AC_MSG_RESULT(yes) +else +have_ld_version_script=no +AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") + +dnl dnl compatibility symlinks dnl case "$host_os" in @@ -1030,6 +1060,12 @@ if test "x$enable_dri" = xyes; then with_dri_drivers="swrast" fi ;; +darwin*) +DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DGLX_ALIAS_UNSUPPORTED" +if test "x$with_dri_drivers" = "xyes"; then +with_dri_drivers="swrast" +fi +;; esac # default drivers diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am index 2858913..8b73c8b 100644 --- a/src/egl/main/Makefile.am +++ b/src/egl/main/Makefile.am @@ -75,7 +75,7 @@ libEGL_la_LIBADD = \ libEGL_la_LDFLAGS = \ -no-undefined \ -version-number 1:0 \ - -Wl,-Bsymbolic \ + $(BSYMBOLIC) \ $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc index 4519c16..70921ec 100644 --- a/src/gallium/Automake.inc +++ b/src/gallium/Automake.inc @@ -56,7 +56,9 @@ GALLIUM_DRI_LINKER_FLAGS = \ -shrext .so \ -module \ -avoid-version \ +if HAVE_LD_VERSION_SCRIPT -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym \ +endif $(GC_SECTIONS) GALLIUM_VDPAU_LINKER_FLAGS = \ @@ -64,7 +66,9 @@ GALLIUM_VDPAU_LINKER_FLAGS = \ -module \ -no-undefined \ -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \ +if HAVE_LD_VERSION_SCRIPT -Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym \ +endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) @@ -73,7 +77,9 @@ GALLIUM_XVMC_LINKER_FLAGS = \ -module \ -no-undefined \ -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \ +if HAVE_LD_VERSION_SCRIPT -Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym \ +endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) @@ -82,7 +88,9 @@ GALLIUM_OMX_LINKER_FLAGS = \ -module \ -no-undefined \ -avoid-version \ +if HAVE_LD_VERSION_SCRIPT -Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym \ +endif $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index 482d952..0cf65e5 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -111,7 +111,7 @@ GL_LIBS = \ GL_LDFLAGS = \ -no-undefined \ -version-number 1:2 \ - -Wl,-Bsymbolic \ + $(BSYMBOLIC) \ $(GC_SECTIONS) \ $(LD_NO_UNDEFINED) diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am index e807612..70039f9 100644 --- a/src/mesa/drivers/dri/Makefile.am +++ b/src/mesa/drivers/dri/Makefile.am @@ -52,7 +52,7 @@ nodist_EXTRA_mesa_dri_drivers_la_SOURCES = dummy.cpp mesa_dri_drivers_la_SOURCES = mesa_dri_drivers_la_LDFLAGS = \ -module -avoid-version -shared -shrext .so \ --Wl,-Bsymbolic \ +$(BSYMBOLIC) \ $(GC_SECTIONS) \ $() mesa_dri_drivers_la_LIBADD = \ -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] Fix Apple-DRI GLX
On 16/02/2014 02:00, Jeremy Huddleston Sequoia wrote: > Mesa master hasn't built for OSX for over a year now, unfortunately, > but I agree excluding in Makefile.am is preferable to cpp-guards. > Hopefully "someone" will have the time and patience to get it working > again in the near future. On 18/02/2014 01:35, Jeremy Huddleston Sequoia wrote: > Apple-DRI is something completely different. It uses > OpenGL.framework and is not backed by gallium or swrast. It was done > over a decade ago as a branch of XFree86 that was never accepted and > merged back in. Code diverged and about 7 years ago, we started > trying to get XQuartz' merged into freedesktop.org. That process was > pretty much fully completed by about 4 years ago except for mesa. > Mesa only supports AppleDRI in a separate build configuration which > makes it impossible to have a libGL that supports indirect GLX when > the server is remote and Apple-DRI when it is local. Since in it's current state this code is a bit of a roadblock for some work I want to do to add something similar for Cygwin, I've had a go at fixing this up. The nomenclature in [2/3] isn't very satisfactory, but I couldn't come up with anything better. Jon TURNEY (3): Fix build for darwin Make DRI dependencies and build depend on the target Fix build of appleglx configure.ac | 96 + src/egl/main/Makefile.am | 2 +- src/gallium/Automake.inc | 8 ++ src/gallium/state_trackers/Makefile.am | 2 +- src/gallium/state_trackers/dri/Makefile.am | 6 +- src/gallium/targets/Makefile.am| 18 ++-- src/gallium/targets/gbm/Makefile.am| 2 +- src/gallium/targets/opencl/Makefile.am | 2 +- src/gallium/targets/xa/Makefile.am | 2 +- src/gallium/tests/trivial/Makefile.am | 2 +- src/gallium/winsys/Makefile.am | 2 +- src/gbm/Makefile.am| 2 +- src/glx/Makefile.am| 31 +-- src/glx/apple/Makefile | 131 src/glx/apple/Makefile.am | 31 +++ src/glx/apple/apple_glapi.c| 1 + src/glx/apple/apple_glx.c | 2 - src/glx/apple/apple_glx.h | 1 - src/glx/apple/apple_xgl_api_read.c | 1 + src/glx/apple/apple_xgl_api_stereo.c | 7 +- src/glx/apple/apple_xgl_api_viewport.c | 1 + src/glx/apple/glxreply.c | 134 - src/glx/applegl_glx.c | 6 +- src/glx/glx_pbuffer.c | 2 +- src/glx/glxcmds.c | 4 +- src/glx/glxcurrent.c | 6 -- src/glx/glxext.c | 4 +- src/glx/indirect_glx.c | 4 + src/glx/render2.c | 4 + src/glx/vertarr.c | 3 + src/mapi/glapi/Makefile.am | 4 +- src/mapi/glapi/Makefile.sources| 4 +- src/mapi/glapi/gen/glX_proto_send.py | 3 + src/mesa/Makefile.am | 2 +- src/mesa/drivers/dri/Makefile.am | 2 +- 35 files changed, 201 insertions(+), 331 deletions(-) delete mode 100644 src/glx/apple/Makefile create mode 100644 src/glx/apple/Makefile.am delete mode 100644 src/glx/apple/glxreply.c -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] Make DRI dependencies and build depend on the target
- Don't require xcb-dri[23] etc. if we aren't building for a target with DRM, as we won't be using dri[23] - Enable a more fine-grained control of what DRI code is built, so that a libGL using direct swrast can be built on targets which don't have DRM. The HAVE_DRI automake conditional is retired in favour of a number of other conditionals: HAVE_DRI2 enables building of code using the DRI2 interface (and possibly DRI3 with HAVE_DRI3) HAVE_DRISW enables building of DRI swrast HAVE_DRICOMMON enables building of target-independent DRI code, and also enables some makefile cases where a more detailled decision is made at a lower level. HAVE_APPLEDRI enables building of an Apple-specific direct rendering interface, still which requires additional fixing up to build properly. Signed-off-by: Jon TURNEY --- configure.ac | 55 +- src/gallium/state_trackers/Makefile.am | 2 +- src/gallium/state_trackers/dri/Makefile.am | 6 +++- src/gallium/targets/Makefile.am| 18 +- src/gallium/targets/gbm/Makefile.am| 2 +- src/gallium/targets/opencl/Makefile.am | 2 +- src/gallium/targets/xa/Makefile.am | 2 +- src/gallium/tests/trivial/Makefile.am | 2 +- src/gallium/winsys/Makefile.am | 2 +- src/gbm/Makefile.am| 2 +- src/glx/Makefile.am| 20 --- src/mesa/Makefile.am | 2 +- 12 files changed, 77 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index f571af1..6eeb2ea 100644 --- a/configure.ac +++ b/configure.ac @@ -765,8 +765,22 @@ fi AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \ "x$enable_dri" = xyes) -AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes) -AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes) + +# Select which platform-dependent DRI code gets built +case "$host_os" in +darwin*) +dri_platform='apple' ;; +gnu*|mingw*|cygwin*) +dri_platform='none' ;; +*) +dri_platform='drm' ;; +esac + +AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes ) +AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes ) +AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes && test "x$dri_platform" = xdrm ) +AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes && test "x$dri_platform" = xdrm ) +AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes && test "x$dri_platform" = xapple ) AC_ARG_ENABLE([shared-glapi], [AS_HELP_STRING([--enable-shared-glapi], @@ -891,23 +905,30 @@ xyesyes) xyesno) # DRI-based GLX PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) -if test x"$driglx_direct" = xyes; then -if test "x$have_libdrm" != xyes; then -AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) -fi -PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) -GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" -if test x"$enable_dri3" = xyes; then -PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) -PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) -fi -fi # find the DRI deps for libGL -dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED xcb-dri2 >= $XCBDRI2_REQUIRED" +dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED" -if test x"$enable_dri3" = xyes; then -dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" +if test x"$driglx_direct" = xyes; then +if test x"$dri_platform" = xdrm ; then +if test "x$have_libdrm" != xyes; then + AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) +fi + +PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) +GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" +if test x"$enable_dri3" = xyes; then + PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) + PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) +fi + +if test x"$enable_dri" = xyes; then + dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED" +fi + +if test x"$enable_dri3" = xyes; then + dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMF
[Mesa-dev] [PATCH 3/3] Fix build of appleglx
Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to use the applegl direct renderer Convert src/glx/apple/Makefile to automake Since the applegl libGL is now built by linking libappleglx into libGL, rather than by linking selected files into a special libGL: - Remove duplicate code in apple/glxreply.c and apple/apple_glx.c. This makes apple/glxreply.c empty, so remove it - Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we need to add those guards to indirect_glx.c, indirect_init.c (via it's generator), render2.c and vertarr.c so they don't generate anything Fix and update various includes glapi_gentable.c (which is only used on darwin), should be included in shared glapi as well, to provide _glapi_create_table_from_handle() Note that neither swrast nor indirect is supported in the APPLEGL path at the moment, which makes things more complex than they need to be. More untangling is needed to allow that Signed-off-by: Jon TURNEY --- configure.ac | 5 ++ src/glx/Makefile.am| 11 ++- src/glx/apple/Makefile | 131 src/glx/apple/Makefile.am | 31 src/glx/apple/apple_glapi.c| 1 + src/glx/apple/apple_glx.c | 2 - src/glx/apple/apple_glx.h | 1 - src/glx/apple/apple_xgl_api_read.c | 1 + src/glx/apple/apple_xgl_api_stereo.c | 7 +- src/glx/apple/apple_xgl_api_viewport.c | 1 + src/glx/apple/glxreply.c | 134 - src/glx/applegl_glx.c | 6 +- src/glx/glx_pbuffer.c | 2 +- src/glx/glxcmds.c | 4 +- src/glx/glxcurrent.c | 6 -- src/glx/glxext.c | 4 +- src/glx/indirect_glx.c | 4 + src/glx/render2.c | 4 + src/glx/vertarr.c | 3 + src/mapi/glapi/Makefile.am | 4 +- src/mapi/glapi/Makefile.sources| 4 +- src/mapi/glapi/gen/glX_proto_send.py | 3 + 22 files changed, 78 insertions(+), 291 deletions(-) delete mode 100644 src/glx/apple/Makefile create mode 100644 src/glx/apple/Makefile.am delete mode 100644 src/glx/apple/glxreply.c diff --git a/configure.ac b/configure.ac index 6eeb2ea..1427b19 100644 --- a/configure.ac +++ b/configure.ac @@ -929,6 +929,10 @@ xyesno) if test x"$enable_dri3" = xyes; then dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" fi +fi +if test x"$dri_platform" = xapple ; then +DEFINES="$DEFINES -DGLX_USE_APPLEGL" +fi fi # add xf86vidmode if available @@ -2205,6 +2209,7 @@ AC_CONFIG_FILES([Makefile src/gbm/main/gbm.pc src/glsl/Makefile src/glx/Makefile + src/glx/apple/Makefile src/glx/tests/Makefile src/gtest/Makefile src/loader/Makefile diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index eee7c2c..c18d1c5 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -24,7 +24,7 @@ SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la endif -SUBDIRS=. tests +SUBDIRS= if HAVE_XF86VIDMODE EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE @@ -88,6 +88,8 @@ libglx_la_SOURCES = \ drisw_glx.c \ glxhash.c +libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la + if HAVE_DRICOMMON libglx_la_SOURCES += \ dri_common.c @@ -110,9 +112,10 @@ endif if HAVE_APPLEDRI libglx_la_SOURCES += \ applegl_glx.c -endif -libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la +SUBDIRS += apple +libglx_la_LIBADD += $(builddir)/apple/libappleglx.la +endif GL_LIBS = \ libglx.la \ @@ -131,4 +134,6 @@ lib@GL_LIB@_la_SOURCES = lib@GL_LIB@_la_LIBADD = $(GL_LIBS) lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS) +SUBDIRS+=. tests + include $(top_srcdir)/install-lib-links.mk diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile deleted file mode 100644 index 91a7218..000 --- a/src/glx/apple/Makefile +++ /dev/null @@ -1,131 +0,0 @@ -TOP = ../../.. -top_builddir = $(TOP) -# This can be a filthy lie. But it doesn't currently build out-of-tree -# anyway, so it's no worse than what we've got now. -top_srcdir = $(TOP) - -include $(TOP)/configs/current - -#CC=gcc -#GL_CFLAGS=-Wall -ggdb3 -Os -DHAVE_PTHREAD -D_REENTRANT $(RC_CFLAGS) $(CFLAGS) -#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module - -TCLSH=tclsh8.5 -MKDIR=mkdir -INSTALL=install -LN=ln -RM=rm - -#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include - -#COMPILE=$(CC) $(INCLUDE) $(GL_CFL
Re: [Mesa-dev] [PATCH 3/3] Fix build of appleglx
On 20/05/2014 09:57, Jeremy Huddleston Sequoia wrote: Reviewed-by: Jeremy Huddleston Sequoia with one minor change (see below): Thanks very much for taking the time to review these. On May 13, 2014, at 05:15, Jon TURNEY wrote: +SUBDIRS+=. tests + include $(top_srcdir)/install-lib-links.mk Because SUBDIRS is set conditionally, you should add: DIST_SUBDIRS = tests apple to handle what I assume is an eventual goal of supporting 'make dist' I don't think that is needed in this case, as automake should be smart enough to work it out correctly. To quote the automake manual [1]: "If SUBDIRS is defined conditionally using Automake conditionals, Automake will define DIST_SUBDIRS automatically from the possible values of SUBDIRS in all conditions. If SUBDIRS contains AC_SUBST variables, DIST_SUBDIRS will not be defined correctly because Automake does not know the possible values of these variables. In this case DIST_SUBDIRS needs to be defined manually." [1] http://www.gnu.org/software/automake/manual/html_node/SUBDIRS-vs-DIST_005fSUBDIRS.html ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] Fix Apple-DRI GLX (v2)
This updates this patch set for master and makes the following minor chages: Use -Wl,-Bsymbolic, as before, not -Bsymbolic Test that ld --version-script works, rather than just looking for it in ld --help darwin's ld doesn't support -Wl,--no-undefined, so don't use it on darwin Put a 'make check' test which requires DRI2 under HAVE_DRI2 Fix the new apple/Makefile.am for srcdir != builddir Jon TURNEY (3): Fix build for darwin Make DRI dependencies and build depend on the target Fix build of appleglx configure.ac | 106 +++ src/egl/main/Makefile.am | 2 +- src/gallium/Automake.inc | 8 ++ src/gallium/state_trackers/Makefile.am | 2 +- src/gallium/state_trackers/dri/Makefile.am | 6 +- src/gallium/targets/Makefile.am| 18 ++-- src/gallium/targets/gbm/Makefile.am| 2 +- src/gallium/targets/opencl/Makefile.am | 2 +- src/gallium/targets/xa/Makefile.am | 2 +- src/gallium/tests/trivial/Makefile.am | 2 +- src/gallium/winsys/Makefile.am | 2 +- src/gbm/Makefile.am| 2 +- src/glx/Makefile.am| 39 +++-- src/glx/apple/Makefile | 131 src/glx/apple/Makefile.am | 33 +++ src/glx/apple/apple_glapi.c| 1 + src/glx/apple/apple_glx.c | 2 - src/glx/apple/apple_glx.h | 1 - src/glx/apple/apple_xgl_api_read.c | 1 + src/glx/apple/apple_xgl_api_stereo.c | 7 +- src/glx/apple/apple_xgl_api_viewport.c | 1 + src/glx/apple/glxreply.c | 134 - src/glx/applegl_glx.c | 6 +- src/glx/glx_pbuffer.c | 2 +- src/glx/glxcmds.c | 4 +- src/glx/glxcurrent.c | 6 -- src/glx/glxext.c | 4 +- src/glx/indirect_glx.c | 4 + src/glx/render2.c | 4 + src/glx/tests/Makefile.am | 6 +- src/glx/vertarr.c | 3 + src/mapi/glapi/Makefile.am | 4 +- src/mapi/glapi/Makefile.sources| 4 +- src/mapi/glapi/gen/glX_proto_send.py | 3 + src/mesa/Makefile.am | 2 +- src/mesa/drivers/dri/Makefile.am | 2 +- 36 files changed, 223 insertions(+), 335 deletions(-) delete mode 100644 src/glx/apple/Makefile create mode 100644 src/glx/apple/Makefile.am delete mode 100644 src/glx/apple/glxreply.c -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] Fix build of appleglx
Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to use the applegl direct renderer Convert src/glx/apple/Makefile to automake Since the applegl libGL is now built by linking libappleglx into libGL, rather than by linking selected files into a special libGL: - Remove duplicate code in apple/glxreply.c and apple/apple_glx.c. This makes apple/glxreply.c empty, so remove it - Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we need to add those guards to indirect_glx.c, indirect_init.c (via it's generator), render2.c and vertarr.c so they don't generate anything Fix and update various includes glapi_gentable.c (which is only used on darwin), should be included in shared glapi as well, to provide _glapi_create_table_from_handle() Note that neither swrast nor indirect is supported in the APPLEGL path at the moment, which makes things more complex than they need to be. More untangling is needed to allow that v2: Correct apple/Makefile.am for srcdir != builddir Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia --- configure.ac | 5 ++ src/glx/Makefile.am| 11 ++- src/glx/apple/Makefile | 131 src/glx/apple/Makefile.am | 33 src/glx/apple/apple_glapi.c| 1 + src/glx/apple/apple_glx.c | 2 - src/glx/apple/apple_glx.h | 1 - src/glx/apple/apple_xgl_api_read.c | 1 + src/glx/apple/apple_xgl_api_stereo.c | 7 +- src/glx/apple/apple_xgl_api_viewport.c | 1 + src/glx/apple/glxreply.c | 134 - src/glx/applegl_glx.c | 6 +- src/glx/glx_pbuffer.c | 2 +- src/glx/glxcmds.c | 4 +- src/glx/glxcurrent.c | 6 -- src/glx/glxext.c | 4 +- src/glx/indirect_glx.c | 4 + src/glx/render2.c | 4 + src/glx/vertarr.c | 3 + src/mapi/glapi/Makefile.am | 4 +- src/mapi/glapi/Makefile.sources| 4 +- src/mapi/glapi/gen/glX_proto_send.py | 3 + 22 files changed, 80 insertions(+), 291 deletions(-) delete mode 100644 src/glx/apple/Makefile create mode 100644 src/glx/apple/Makefile.am delete mode 100644 src/glx/apple/glxreply.c diff --git a/configure.ac b/configure.ac index 4389e79..fbee627 100644 --- a/configure.ac +++ b/configure.ac @@ -950,6 +950,10 @@ xyesno) if test x"$enable_dri3" = xyes; then dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" fi +fi +if test x"$dri_platform" = xapple ; then +DEFINES="$DEFINES -DGLX_USE_APPLEGL" +fi fi # add xf86vidmode if available @@ -2234,6 +2238,7 @@ AC_CONFIG_FILES([Makefile src/gbm/main/gbm.pc src/glsl/Makefile src/glx/Makefile + src/glx/apple/Makefile src/glx/tests/Makefile src/gtest/Makefile src/loader/Makefile diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index 4553de0..0ca42de 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -24,7 +24,7 @@ SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la endif -SUBDIRS=. tests +SUBDIRS= if HAVE_XF86VIDMODE EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE @@ -86,6 +86,8 @@ libglx_la_SOURCES = \ glx_query.c \ glxhash.c +libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la + if HAVE_DRISW libglx_la_SOURCES += \ drisw_glx.c @@ -114,9 +116,10 @@ endif if HAVE_APPLEDRI libglx_la_SOURCES += \ applegl_glx.c -endif -libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la +SUBDIRS += apple +libglx_la_LIBADD += $(builddir)/apple/libappleglx.la +endif GL_LIBS = \ libglx.la \ @@ -135,4 +138,6 @@ lib@GL_LIB@_la_SOURCES = lib@GL_LIB@_la_LIBADD = $(GL_LIBS) lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS) +SUBDIRS+=. tests + include $(top_srcdir)/install-lib-links.mk diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile deleted file mode 100644 index 91a7218..000 --- a/src/glx/apple/Makefile +++ /dev/null @@ -1,131 +0,0 @@ -TOP = ../../.. -top_builddir = $(TOP) -# This can be a filthy lie. But it doesn't currently build out-of-tree -# anyway, so it's no worse than what we've got now. -top_srcdir = $(TOP) - -include $(TOP)/configs/current - -#CC=gcc -#GL_CFLAGS=-Wall -ggdb3 -Os -DHAVE_PTHREAD -D_REENTRANT $(RC_CFLAGS) $(CFLAGS) -#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module - -TCLSH=tclsh8.5 -MKDIR=mkdir -INSTALL=install -LN=ln -RM=rm - -#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPO
[Mesa-dev] [PATCH 1/3] Fix build for darwin
Fix build for darwin, when ./configured --disable-driglx-direct - darwin ld doesn't support -Bsymbolic or --version-script, so check if ld supports those options before using them - define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak symbols isn't supported - default to -with-dri-drivers=swrast v2: Use -Wl,-Bsymbolic, as before, not -Bsymbolic Test that ld --version-script works, rather than just looking for it in ld --help Don't use -Wl,--no-undefined on darwin, either Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia --- configure.ac | 46 +++- src/egl/main/Makefile.am | 2 +- src/gallium/Automake.inc | 8 +++ src/glx/Makefile.am | 2 +- src/mesa/drivers/dri/Makefile.am | 2 +- 5 files changed, 56 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 4e4d761..bc3a654 100644 --- a/configure.ac +++ b/configure.ac @@ -316,6 +316,22 @@ if test "x$enable_debug" = xyes; then fi dnl +dnl Check if linker supports -Bsymbolic +dnl +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,-Bsymbolic" +AC_MSG_CHECKING([if ld supports -Bsymbolic]) +AC_LINK_IFELSE( +[AC_LANG_SOURCE([int main() { return 0;}])], +[AC_MSG_RESULT([yes]) +BSYMBOLIC="-Wl,-Bsymbolic";], +[AC_MSG_RESULT([no]) +BSYMBOLIC="";]) +LDFLAGS=$save_LDFLAGS + +AC_SUBST([BSYMBOLIC]) + +dnl dnl Check if linker supports garbage collection dnl save_LDFLAGS=$LDFLAGS @@ -336,7 +352,7 @@ dnl OpenBSD does not have DT_NEEDED entries for libc by design dnl so when these flags are passed to ld via libtool the checks will fail dnl case "$host_os" in -openbsd*) +openbsd*|darwin*) LD_NO_UNDEFINED="" ;; *) LD_NO_UNDEFINED="-Wl,--no-undefined" ;; @@ -345,6 +361,28 @@ esac AC_SUBST([LD_NO_UNDEFINED]) dnl +dnl Check if linker supports version scripts +dnl +AC_MSG_CHECKING([if libraries can be versioned]) +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" +cat > conftest.map <http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] Make DRI dependencies and build depend on the target
- Don't require xcb-dri[23] etc. if we aren't building for a target with DRM, as we won't be using dri[23] - Enable a more fine-grained control of what DRI code is built, so that a libGL using direct swrast can be built on targets which don't have DRM. The HAVE_DRI automake conditional is retired in favour of a number of other conditionals: HAVE_DRI2 enables building of code using the DRI2 interface (and possibly DRI3 with HAVE_DRI3) HAVE_DRISW enables building of DRI swrast HAVE_DRICOMMON enables building of target-independent DRI code, and also enables some makefile cases where a more detailled decision is made at a lower level. HAVE_APPLEDRI enables building of an Apple-specific direct rendering interface, still which requires additional fixing up to build properly. v2: Place xfont.c and drisw_glx.c into correct categories. Update 'make check' as well Signed-off-by: Jon TURNEY Reviewed-by: Jeremy Huddleston Sequoia --- configure.ac | 55 +- src/gallium/state_trackers/Makefile.am | 2 +- src/gallium/state_trackers/dri/Makefile.am | 6 +++- src/gallium/targets/Makefile.am| 18 +- src/gallium/targets/gbm/Makefile.am| 2 +- src/gallium/targets/opencl/Makefile.am | 2 +- src/gallium/targets/xa/Makefile.am | 2 +- src/gallium/tests/trivial/Makefile.am | 2 +- src/gallium/winsys/Makefile.am | 2 +- src/gbm/Makefile.am| 2 +- src/glx/Makefile.am| 28 +++ src/glx/tests/Makefile.am | 6 +++- src/mesa/Makefile.am | 2 +- 13 files changed, 88 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index bc3a654..4389e79 100644 --- a/configure.ac +++ b/configure.ac @@ -786,8 +786,22 @@ fi AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \ "x$enable_dri" = xyes) -AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes) -AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes) + +# Select which platform-dependent DRI code gets built +case "$host_os" in +darwin*) +dri_platform='apple' ;; +gnu*|mingw*|cygwin*) +dri_platform='none' ;; +*) +dri_platform='drm' ;; +esac + +AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes ) +AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes ) +AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes && test "x$dri_platform" = xdrm ) +AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes && test "x$dri_platform" = xdrm ) +AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes && test "x$dri_platform" = xapple ) AC_ARG_ENABLE([shared-glapi], [AS_HELP_STRING([--enable-shared-glapi], @@ -912,23 +926,30 @@ xyesyes) xyesno) # DRI-based GLX PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) -if test x"$driglx_direct" = xyes; then -if test "x$have_libdrm" != xyes; then -AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) -fi -PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) -GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" -if test x"$enable_dri3" = xyes; then -PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) -PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) -fi -fi # find the DRI deps for libGL -dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED xcb-dri2 >= $XCBDRI2_REQUIRED" +dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED" -if test x"$enable_dri3" = xyes; then -dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" +if test x"$driglx_direct" = xyes; then +if test x"$dri_platform" = xdrm ; then +if test "x$have_libdrm" != xyes; then + AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) +fi + +PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) +GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" +if test x"$enable_dri3" = xyes; then + PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) + PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) +fi + +if test x"$enable_dri" = xyes; then + dri_modules="$dri_modules xcb-dri2 >
Re: [Mesa-dev] [PATCH] automake: correctly append the version-script
On 25/05/2014 17:47, Emil Velikov wrote: Turns out that the AC conditional did not include the the version-scripts as expected. Rather it truncated the remaining linker flags. Oh dear, that doesn't work as intended at all :-( Thanks for fixing this. Reviewed-by: Jon TURNEY I was under the silly impression that the original approach is correct, and naively did not check the symbols in the binaries. The libraries work, but automake did not produce any warnings :( ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/2] Build a driswrast-using libGL on non-DRM targets
As a follow-up to my "Fix Apple-DRI GLX" patchset, allow building of a libGL capable of using driswrast on targets without libdrm, and make that the default configuration. The --disable-driglx-direct option only appears to exist for the benefit of such targets, so it could probably be removed in future. Jon TURNEY (2): glx: Fix build in GLX_DIRECT_RENDERING !GLX_USE_APPLEGL !GLX_USE_DRM case configure: Always default to --enable-driglx-direct configure.ac | 17 ++--- src/glx/glxcmds.c | 2 +- src/glx/glxext.c | 17 - 3 files changed, 15 insertions(+), 21 deletions(-) -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] glx: Fix build in GLX_DIRECT_RENDERING !GLX_USE_APPLEGL !GLX_USE_DRM case
Some untangling to fix building in the dri_platform=none, --enable-driglx-direct case, where only driswast can be used. Turn the test for including the glXGetScreenDriver()/glXGetScreenDriver() interface used by xdriinfo from !GLX_USE_APPLEGL into a positive form, as it is only useful when dri_platform=drm Add additional GLX_USE_DRM tests so DRI[123] renderers are only used when dri_platform=drm Note that swrast and indirect must still be disabled in the APPLEGL case at the moment, which makes things more complex than they need to be. More untangling is needed to allow that Signed-off-by: Jon TURNEY --- configure.ac | 1 + src/glx/glxcmds.c | 2 +- src/glx/glxext.c | 17 - 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 9c64400..d2adb15 100644 --- a/configure.ac +++ b/configure.ac @@ -939,6 +939,7 @@ xyesno) if test x"$driglx_direct" = xyes; then if test x"$dri_platform" = xdrm ; then +DEFINES="$DEFINES -DGLX_USE_DRM" if test "x$have_libdrm" != xyes; then AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) fi diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index c8de792..04d8db1 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -2581,7 +2581,7 @@ static const struct name_address_pair GLX_functions[] = { GLX_FUNCTION2(glXReleaseTexImageEXT, __glXReleaseTexImageEXT), #endif -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) +#if defined(GLX_DIRECT_RENDERING) && defined(GLX_USE_DRM) /*** DRI configuration ***/ GLX_FUNCTION(glXGetScreenDriver), GLX_FUNCTION(glXGetDriverConfig), diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 8528e88..94582f6 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -242,6 +242,7 @@ glx_display_free(struct glx_display *priv) (*priv->driswDisplay->destroyDisplay) (priv->driswDisplay); priv->driswDisplay = NULL; +#if defined (GLX_USE_DRM) if (priv->driDisplay) (*priv->driDisplay->destroyDisplay) (priv->driDisplay); priv->driDisplay = NULL; @@ -253,7 +254,8 @@ glx_display_free(struct glx_display *priv) if (priv->dri3Display) (*priv->dri3Display->destroyDisplay) (priv->dri3Display); priv->dri3Display = NULL; -#endif +#endif /* GLX_USE_DRM */ +#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */ free((char *) priv); } @@ -779,17 +781,20 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) for (i = 0; i < screens; i++, psc++) { psc = NULL; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) +#if defined(GLX_USE_DRM) #if defined(HAVE_DRI3) if (priv->dri3Display) psc = (*priv->dri3Display->createScreen) (i, priv); -#endif +#endif /* HAVE_DRI3 */ if (psc == NULL && priv->dri2Display) psc = (*priv->dri2Display->createScreen) (i, priv); if (psc == NULL && priv->driDisplay) psc = (*priv->driDisplay->createScreen) (i, priv); +#endif /* GLX_USE_DRM */ if (psc == NULL && priv->driswDisplay) psc = (*priv->driswDisplay->createScreen) (i, priv); -#endif +#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */ + #if defined(GLX_USE_APPLEGL) if (psc == NULL) psc = applegl_create_screen(i, priv); @@ -873,17 +878,19 @@ __glXInitialize(Display * dpy) ** Note: This _must_ be done before calling any other DRI routines ** (e.g., those called in AllocAndFetchScreenConfigs). */ +#if defined(GLX_USE_DRM) if (glx_direct && glx_accel) { #if defined(HAVE_DRI3) if (!getenv("LIBGL_DRI3_DISABLE")) dpyPriv->dri3Display = dri3_create_display(dpy); -#endif +#endif /* HAVE_DRI3 */ dpyPriv->dri2Display = dri2CreateDisplay(dpy); dpyPriv->driDisplay = driCreateDisplay(dpy); } +#endif /* GLX_USE_DRM */ if (glx_direct) dpyPriv->driswDisplay = driswCreateDisplay(dpy); -#endif +#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */ #ifdef GLX_USE_APPLEGL if (!applegl_create_display(dpyPriv)) { -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] configure: Always default to --enable-driglx-direct
Always default to --enable-driglx-direct, now that will build driswrast, but won't try to use dri[123] on platforms which don't have that. Signed-off-by: Jon TURNEY --- configure.ac | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index d2adb15..af081b5 100644 --- a/configure.ac +++ b/configure.ac @@ -896,26 +896,12 @@ if test "x$enable_dri" = xyes; then fi fi -dnl Direct rendering or just indirect rendering -case "$host_os" in -gnu*) -dnl Disable by default on GNU/Hurd -driglx_direct_default="no" -;; -cygwin*) -dnl Disable by default on cygwin -driglx_direct_default="no" -;; -*) -driglx_direct_default="yes" -;; -esac AC_ARG_ENABLE([driglx-direct], [AS_HELP_STRING([--disable-driglx-direct], [disable direct rendering in GLX and EGL for DRI \ @<:@default=auto@:>@])], [driglx_direct="$enableval"], -[driglx_direct="$driglx_direct_default"]) +[driglx_direct="yes"]) dnl dnl libGL configuration per driver -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] glx: Fix build in GLX_DIRECT_RENDERING !GLX_USE_APPLEGL !GLX_USE_DRM case
On 03/06/2014 15:19, Aaron Watry wrote: On Tue, Jun 3, 2014 at 8:14 AM, Jon TURNEY wrote: Some untangling to fix building in the dri_platform=none, --enable-driglx-direct case, where only driswast can be used. Turn the test for including the glXGetScreenDriver()/glXGetScreenDriver() interface used by xdriinfo from !GLX_USE_APPLEGL into a positive form, as it is only useful when dri_platform=drm Add additional GLX_USE_DRM tests so DRI[123] renderers are only used when dri_platform=drm Note that swrast and indirect must still be disabled in the APPLEGL case at the moment, which makes things more complex than they need to be. More untangling is needed to allow that --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -242,6 +242,7 @@ glx_display_free(struct glx_display *priv) (*priv->driswDisplay->destroyDisplay) (priv->driswDisplay); priv->driswDisplay = NULL; +#if defined (GLX_USE_DRM) if (priv->driDisplay) (*priv->driDisplay->destroyDisplay) (priv->driDisplay); priv->driDisplay = NULL; @@ -253,7 +254,8 @@ glx_display_free(struct glx_display *priv) if (priv->dri3Display) (*priv->dri3Display->destroyDisplay) (priv->dri3Display); priv->dri3Display = NULL; -#endif +#endif /* GLX_USE_DRM */ +#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */ I'm assuming that you meant GLX_DIRECT_RENDERING && GLX_USE_DRM, right? The other #endif comment changes in the patch look correct, but this one seems wrong. I think this endif comment matches the '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' at line 237. It would perhaps be more logical if that was just '#ifdef GLX_DIRECT_RENDERING', but the applegl renderer can't be used with any of the others, at the moment. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/4] configure: error out when building xa only with swrast
On 28/02/2014 21:38, Emil Velikov wrote: > Here is a very nice example of what I'm trying to prevent: > > Jon Turney has a tinderbox setup [1] at fd.org. > > For his needs he builds gallium swrast+llvm on top of a indirect > rendered libGL. For unknown reason he has --enable-xa, which was causing > build problems which he got around with a very gross hack[2]. Thanks for pointing this out, as I'd completely failed to notice that this configuration option was being turned on. The 'unknown reason' turns out to be that it's been turned on by [1]. Obviously this doesn't meet my needs so I'll override that. [1] http://cgit.freedesktop.org/xorg/util/modular/commit/?id=1e8e8d950bebfa3c9f5a8195d5a6f940b58226f1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 12/20] drivers/dri: link megadriver with -no-undefined
On 04/03/2014 21:12, Emil Velikov wrote: > From: Jon TURNEY > > v2: (Emil) > - Do not link agaist libglapi. > > Signed-off-by: Jon TURNEY > Signed-off-by: Emil Velikov > --- > src/mesa/drivers/dri/Makefile.am | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/Makefile.am > b/src/mesa/drivers/dri/Makefile.am > index 18f880a..eea1939 100644 > --- a/src/mesa/drivers/dri/Makefile.am > +++ b/src/mesa/drivers/dri/Makefile.am > @@ -51,7 +51,7 @@ driinclude_HEADERS = > $(top_srcdir)/include/GL/internal/dri_interface.h > nodist_EXTRA_mesa_dri_drivers_la_SOURCES = dummy.cpp > mesa_dri_drivers_la_SOURCES = > mesa_dri_drivers_la_LDFLAGS = \ > --module -avoid-version -shared \ > +-module -avoid-version -shared -no-undefined \ > -Wl,-Bsymbolic \ > $() > mesa_dri_drivers_la_LIBADD = \ > I don't think this patch should be committed. If you are not linking with libglapi, so mesa_dri_drivers has undefined symbols, you shouldn't use -no-undefined. (-no-undefined does nothing on linux at the moment, for what appears to be no particularly good reason, but that could possibly change in the future) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 00/20] Automake cleanups and Cygwin fixes
On 04/03/2014 21:12, Emil Velikov wrote: > Hi all, > > An interesting cleanup series inspired by Jon Turney's tinderbox. > > Highlights: > - Cleanup unused configure.ac variables dating from the static makefile days. > - Use platform specific library extension for links generation. > - Move all the link generation in three files. > - Make check fix when building without direct rendering. > - A few cosmetic configure.ac fixes. > - And last but not least, always build mesa shared. Most of the build system > assumed that already, so update the warning messages, and cleanup configure. > > An interesting point brought my Jon, is that Cygwin needs to link all the dri > drivers agaist libglapi, which mesa explicitly does not do. AFAICS the idea > is that the correct glapi should be loaded (statically or dl_open'ed) by the > GL provider prior to managing the dri. > > Does anyone know the reason behind this ? Note that xserver 1.14 and prior have their own glapi implementation, which a loaded driver would be using. > The series can be found in the cygwin-fixes branch in my repo at > https://github.com/evelikov/Mesa/ > > Review and comments are greatly appreciated. except for my NAK for 12/20, Reviewed-by: Jon TURNEY ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH mesa-demos] glxgears: Smooth animation with AIGLX
Since commit 0b19fb0a5c6299baf28e26625e39773846f815b2 "improved animation rate" glxgears computes the amount to turn the gears each frame by multipling the angular velocity of the gears by the time since the last frame, rather than at a constant amount per frame. This gives a smooth animation with direct rendering, but is very bad for accelerated indirect rendering, since glXSwapBuffers does not block and we can queue many frames rapidly (i.e. with close to zero time between frames, and hence no noticeable rotation) until we block on something else (perhaps the socket buffer being full), but the server is still limited to swapping at the vsync frequency. (This is not an issue with indirect software rendering as there is no vsync) One way to deal with this seems to be to check for indirect rendering and force blocking until the swap is complete using glFinish(). This perhaps prevents glxgears from reporting the largest possible number for fps when using indirect software rending, but since glxgears is not a benchmark, perhaps that is not as big a problem as running glxgears and seeing an apparently still image. It's probable that other mesa demos suffer from the same issue, but I haven't yet investigated that. Signed-off-by: Jon TURNEY --- src/xdemos/glxgears.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xdemos/glxgears.c b/src/xdemos/glxgears.c index 7a3b567..fdd6179 100644 --- a/src/xdemos/glxgears.c +++ b/src/xdemos/glxgears.c @@ -315,7 +315,7 @@ draw_gears(void) /** Draw single frame, do SwapBuffers, compute FPS */ static void -draw_frame(Display *dpy, Window win) +draw_frame(Display *dpy, Window win, GLXContext ctx) { static int frames = 0; static double tRot0 = -1.0, tRate0 = -1.0; @@ -336,6 +336,9 @@ draw_frame(Display *dpy, Window win) draw_gears(); glXSwapBuffers(dpy, win); + if (!glXIsDirect(dpy, ctx)) + glFinish(); /* if indirect, block until swap is complete */ + frames++; if (tRate0 < 0.0) @@ -680,7 +683,7 @@ handle_event(Display *dpy, Window win, XEvent *event) static void -event_loop(Display *dpy, Window win) +event_loop(Display *dpy, Window win, GLXContext ctx) { while (1) { int op; @@ -694,7 +697,7 @@ event_loop(Display *dpy, Window win) break; } - draw_frame(dpy, win); + draw_frame(dpy, win, ctx); } } @@ -787,7 +790,7 @@ main(int argc, char *argv[]) */ reshape(winWidth, winHeight); - event_loop(dpy, win); + event_loop(dpy, win, ctx); glDeleteLists(gear1, 1); glDeleteLists(gear2, 1); -- 1.8.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] Use X11_INCLUDES instead of X11_CFLAGS
X11_CFLAGS is undefined, so these tests will fail to build if x11proto is installed in a non-standard location. (See also commits 35189d76, bc93c3798, 54b028ba, d901d7e08, etc.) Signed-off-by: Jon TURNEY --- src/glx/tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glx/tests/Makefile.am b/src/glx/tests/Makefile.am index b02a9e3..bdc78c0 100644 --- a/src/glx/tests/Makefile.am +++ b/src/glx/tests/Makefile.am @@ -10,7 +10,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include/GL/internal \ $(DEFINES) \ $(LIBDRM_CFLAGS) \ - $(X11_CFLAGS) + $(X11_INCLUDES) TESTS = glx-test check_PROGRAMS = glx-test -- 2.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] Remove unneeded X11_CFLAGS
X11_CFLAGS is never defined. Path to X11 headers is not needed here, so just remove. Future work: Using AM_CFLAGS here looks wrong, as this Makefile only builds C++ files Signed-off-by: Jon TURNEY --- src/mesa/main/tests/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am index 9467f3b..bd7ab73 100644 --- a/src/mesa/main/tests/Makefile.am +++ b/src/mesa/main/tests/Makefile.am @@ -1,5 +1,4 @@ AM_CFLAGS = \ - $(X11_CFLAGS) \ $(PTHREAD_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir)/src/gtest/include \ -- 2.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/2] Fix remaining uses of X11_CFLAGS
X11_CFLAGS isn't defined by configure.ac since commmit 35189d76 removed PKG_CHECK_MODULES([X11],[x11]) Fix the remaining uses of X11_CFLAGS. There are no uses of X11_LIBS Jon TURNEY (2): Use X11_INCLUDES instead of X11_CFLAGS Remove unneeded X11_CFLAGS src/glx/tests/Makefile.am | 2 +- src/mesa/main/tests/Makefile.am | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) -- 2.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Use IMP_LIB_EXT when checking for LLVM shared libraries
When checking for LLVM shared libraries, use IMP_LIB_EXT for the extension for shared libraries appropriate to the target, rather than hardcoding '.so' Also add some comments to explain why we have this circus of pain. Signed-off-by: Jon TURNEY --- configure.ac | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 90ba4fe..9960dd0 100644 --- a/configure.ac +++ b/configure.ac @@ -533,15 +533,32 @@ AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes) dnl dnl library names dnl +dnl Unfortunately we need to do a few things that libtool can't help us with, +dnl so we need some knowledge of shared library filenames: +dnl +dnl LIB_EXT is the extension used when creating symlinks for alternate +dnl filenames for a shared library which will be dynamically loaded +dnl +dnl IMP_LIB_EXT is the extension used when checking for the presence of a +dnl the file for a shared library we wish to link with +dnl case "$host_os" in darwin* ) -LIB_EXT='dylib' ;; +LIB_EXT='dylib' +IMP_LIB_EXT=$LIB_EXT +;; cygwin* ) -LIB_EXT='dll' ;; +LIB_EXT='dll' +IMP_LIB_EXT='dll.a' +;; aix* ) -LIB_EXT='a' ;; +LIB_EXT='a' +IMP_LIB_EXT=$LIB_EXT +;; * ) -LIB_EXT='so' ;; +LIB_EXT='so' +IMP_LIB_EXT=$LIB_EXT +;; esac AC_SUBST([LIB_EXT]) @@ -2163,10 +2180,14 @@ if test "x$MESA_LLVM" != x0; then LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`" +dnl llvm-config may not give the right answer when llvm is a built as a +dnl single shared library, so we must work the library name out for +dnl ourselves. +dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823) if test "x$enable_llvm_shared_libs" = xyes; then dnl We can't use $LLVM_VERSION because it has 'svn' stripped out, LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version` -AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes]) +AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes]) if test "x$llvm_have_one_so" = xyes; then dnl LLVM was built using auto*, so there is only one shared object. @@ -2174,7 +2195,7 @@ if test "x$MESA_LLVM" != x0; then else dnl If LLVM was built with CMake, there will be one shared object per dnl component. -AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"], +AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.$IMP_LIB_EXT"], [AC_MSG_ERROR([Could not find llvm shared libraries: Please make sure you have built llvm with the --enable-shared option and that your llvm libraries are installed in $LLVM_LIBDIR -- 2.5.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] applegl: Provide requirements of _SET_DrawBuffers
On 03/07/2015 16:34, Emil Velikov wrote: On 02/07/15 16:32, Jon TURNEY wrote: On 02/07/2015 13:42, Emil Velikov wrote: On 27 June 2015 at 12:21, Jon TURNEY wrote: This smells to me like there's something not quite right about the partitioning of stuff between libmesa and libglapi, but I don't have any insight into what exactly the problem is. Quite likely. Although it would be better to resolve it, as (if my understanding is correct) libGL should not know anything about mesa's internals. It ought to interact with DRI and glapi alone. Mildly related: Jon what happened to the applegl-vtable branches ? I really liked the direction that they were going. I'd quite forgotten about those. Currently, there is a build-time choice between using apple-dri, or indirect and swrast. This is not ideal (I believe it makes remote clients under OSX useless), so they should all be runtime alternatives. Those branches are really just experiments of mine to try to understand what that might look like before I did a similar implementation for Windows. You had some nice work that removed a ton of the ifdef(erry) and populated the relevant vtables. All in all it almost pushed appledri up to a first class citizen (no offense meant). Yes, it would be nice to finish that off and get it upstreamed. But it's not something I'm ever going to use for real work, so I'm not sure I am the right person to do that. But I think I came to the conclusion that it was less work to use the existing __GLXDRIdisplay implementations as a model, rather than convert appple-dri to that interface and then use it as a model for my windows-dri implementation (see [1]) Was meaning to ask: how well is it working, does it require any changes in xserver ? It seems to work pretty well, which is somewhat surprising. Yes, there is a corresponding xserver change to add a windowsdri extension which provides an interface to get native handles for windows etc. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/5] applegl: Provide requirements of _SET_DrawBuffers
On 13/07/2015 16:32, Emil Velikov wrote: P.S. Why is there no appledriproto package, similar to xf86driproto and friends ? Having appledri{,str}.h duplicated seems fragile and ill-advised. I think this all pre-dates X.org modularization It would probably make sense to have it as a separate package, or at least have mesa install the headers so xserver can use them. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 00/11] Generated GLX dispatch updates
On 24/03/2016 18:09, Adam Jackson wrote: This long-overdue series synchronizes the GLX dispatch scripts with the state of the world in xserver. We no longer use the CALL_* pattern instead emitting gl* calls directly (or thunking through GetProcAddress if needed). We also use overflow-paranoid math when computing request lengths, and add a few more error checks. Nice to get this landed :) The last two patches silence a warning and mark the byteswapped dispatch as cold, which saves a small amount of text size. After this series, regenerating the xserver glx dispatch code isn't _quite_ zero lines of diff. But the differences are all either being Even More Paranoid about size math (in places where we know overflow can't happen anyway), or prototype headers getting their decls shuffled around. In a brief examination, I think the two generator patches in the thread [1], that is [2] and [3] still apply on top of this? [1] https://lists.x.org/archives/xorg-devel/2013-December/039450.html [2] https://lists.x.org/archives/xorg-devel/2014-April/041597.html [3] https://lists.x.org/archives/xorg-devel/2014-April/041919.html ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] egl: Remove skeleton implementation of EGL_MESA_screen_surface
On 01/05/2015 16:35, Adam Jackson wrote: No backend wires this up to anything, and the extension spec has been marked obsolete for 4+ years. Signed-off-by: Adam Jackson [...] -/* EGL_MESA_screen extension >>> PRELIMINARY <<< */ -#ifndef EGL_MESA_screen_surface -#define EGL_MESA_screen_surface 1 There seems to be some stuff in mesa-demos src/egl/ which tries to make use of this extension (e.g. [1]) and now doesn't build. I'm not sure if it is salvageable or just should also be removed. [1] http://cgit.freedesktop.org/mesa/demos/tree/src/egl/eglut/eglut_screen.c#n106 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH:mesa] swrast: Build fix for Solaris
On 16/05/2015 05:12, Alan Coopersmith wrote: Ah yes, I see Jons patch now in https://bugs.freedesktop.org/show_bug.cgi?id=90147#c9 That looks like it should work for Solaris too, so whichever the Mesa developers prefer... Alan's patch is clearly superior, so please apply. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] rtasm,translate: Re-enable SSE on Mingw64.
On 19/11/2014 15:25, Jose Fonseca wrote: No idea. But the impression I generally have is MinGW has come a long way since then (3 years ago.) I think there was at least one bug in mesa which prevented this from working, see commit cedfd79b ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] glcpp: Implicitly resolve version after the first non-space/hash token.
On 05/03/2016 03:33, Kenneth Graunke wrote: We resolved the implicit version directive when processing control lines, such as #ifdef, to ensure any built-in macros exist. However, we failed to resolve it when handling ordinary text. [...] diff --git a/src/compiler/glsl/glcpp/tests/146-version-first-hash.c.expected b/src/compiler/glsl/glcpp/tests/146-version-first-hash.c.expected new file mode 100644 index 000..2872090 --- /dev/null +++ b/src/compiler/glsl/glcpp/tests/146-version-first-hash.c.expected @@ -0,0 +1,3 @@ +0:1(3): preprocessor error: #version must appear on the first line + + This last test fails in glcpp-test-cr-lf for me (See attached). Can you just confirm that it passes for you, before I start looking into why it might fail just for me...? = Testing with \\r line terminators (old Mac format) = == Testing for correctness == [...] 147/147 tests returned correct results PASS = Testing with \\r\\n line terminators (DOS format) = == Testing for correctness == [...] Testing subtest-cr-lf/146-version-first-hash.c... > /jhbuild/x86_64-pc-cygwin/build/mesa/mesa/src/compiler/glsl/glcpp/tests/subtest-cr-lf/146-version-first-hash.c.out (subtest-cr-lf/146-version-first-hash.c.expected) FAIL --- subtest-cr-lf/146-version-first-hash.c.expected 2016-03-09 13:39:45.679154000 + +++ /jhbuild/x86_64-pc-cygwin/build/mesa/mesa/src/compiler/glsl/glcpp/tests/subtest-cr-lf/146-version-first-hash.c.out 2016-03-09 13:40:15.043069600 + @@ -1,3 +1,3 @@ -0:1(3): preprocessor error: #version must appear on the first line +0:1(4): preprocessor error: #version must appear on the first line 146/147 tests returned correct results FAIL = Testing with \\n\\r (bizarre, but allowed by GLSL spec.) = == Testing for correctness == [...] Testing subtest-lf-cr/146-version-first-hash.c... > /jhbuild/x86_64-pc-cygwin/build/mesa/mesa/src/compiler/glsl/glcpp/tests/subtest-lf-cr/146-version-first-hash.c.out (subtest-lf-cr/146-version-first-hash.c.expected) FAIL --- subtest-lf-cr/146-version-first-hash.c.expected 2016-03-09 13:40:32.955390600 + +++ /jhbuild/x86_64-pc-cygwin/build/mesa/mesa/src/compiler/glsl/glcpp/tests/subtest-lf-cr/146-version-first-hash.c.out 2016-03-09 13:41:04.620827800 + @@ -1,3 +1,3 @@ -0:1(3): preprocessor error: #version must appear on the first line +0:1(4): preprocessor error: #version must appear on the first line 146/147 tests returned correct results FAIL 1/3 tests returned correct results ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/4] glcpp: Implicitly resolve version after the first non-space/hash token.
On 10/03/2016 19:26, Kenneth Graunke wrote: On Wednesday, March 9, 2016 3:18:50 PM PST Jon Turney wrote: On 05/03/2016 03:33, Kenneth Graunke wrote: We resolved the implicit version directive when processing control lines, such as #ifdef, to ensure any built-in macros exist. However, we failed to resolve it when handling ordinary text. [...] diff --git a/src/compiler/glsl/glcpp/tests/146-version-first- hash.c.expected b/src/compiler/glsl/glcpp/tests/146-version-first- hash.c.expected new file mode 100644 index 000..2872090 --- /dev/null +++ b/src/compiler/glsl/glcpp/tests/146-version-first-hash.c.expected @@ -0,0 +1,3 @@ +0:1(3): preprocessor error: #version must appear on the first line + + This last test fails in glcpp-test-cr-lf for me (See attached). Can you just confirm that it passes for you, before I start looking into why it might fail just for me...? Sorry about that. I had just run glcpp-test, but not glcpp-test-cr-lf. It turns out that our handling of hash followed by newline was not counting lines correctly, so it was returning either line 3 or line 4 based on the line terminator characters. 0:1(3) in the test was wrong; it should have actually been 0:2(1). Iago just reviewed my patch to fix this, so I've pushed it. Hopefully master should work for you now. Yes, that's fixed. Thanks! ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/4] Disable use of weak in threads_posix.h on Cygwin
Weak doesn't work the same on PE/COFF as on ELF, they are only weak references. Specifically, since nothing else pulls in the object which contains pthread_mutexattr_init() (and coming from the C library, that is the only thing that object contains), means that it ends up as 0 Signed-off-by: Jon Turney --- include/c11/threads_posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h index 61b7fab..43e803e 100644 --- a/include/c11/threads_posix.h +++ b/include/c11/threads_posix.h @@ -184,7 +184,7 @@ mtx_destroy(mtx_t *mtx) * Thus the linker will be happy and things don't clash when building * with -O1 or greater. */ -#ifdef HAVE_FUNC_ATTRIBUTE_WEAK +#if defined(HAVE_FUNC_ATTRIBUTE_WEAK) && !defined(__CYGWIN__) __attribute__((weak)) int pthread_mutexattr_init(pthread_mutexattr_t *attr); -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/4] Various Cygwin fixes
Jon Turney (2): configure: Don't require pthread-stubs on Cygwin Disable use of weak in threads_posix.h on Cygwin Yaakov Selkowitz (2): configure: Define _GNU_SOURCE for Cygwin as well Use correct names for dlopen()ed files on Cygwin configure.ac | 23 --- include/c11/threads_posix.h| 2 +- src/egl/drivers/dri2/egl_dri2.c| 2 ++ src/gallium/auxiliary/util/u_format_s3tc.c | 2 ++ src/glx/dri_common.c | 3 +++ src/mesa/main/texcompress_s3tc.c | 2 ++ 6 files changed, 26 insertions(+), 8 deletions(-) -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/4] configure: Don't require pthread-stubs on Cygwin
Commit 1f4869a2 unconditionally requires pthread-stubs. Unfortunately, the cleverness that pthread-stubs is doesn't work with PE/COFF, and historically Cygwin doesn't have a pthread-stubs.pc. Don't require pthread-stubs on Cygwin. Signed-off-by: Jon Turney --- configure.ac | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4967c56..8c40446 100644 --- a/configure.ac +++ b/configure.ac @@ -822,9 +822,21 @@ dnl to -pthread, which causes problems if we need -lpthread to appear in dnl pkgconfig files. test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread" -PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs) -AC_SUBST(PTHREADSTUBS_CFLAGS) -AC_SUBST(PTHREADSTUBS_LIBS) +dnl pthread-stubs is mandatory on targets where it exists +case "$host_os" in +cygwin* ) +pthread_stubs_possible="no" +;; +* ) +pthread_stubs_possible="yes" +;; +esac + +if test "x$pthread_stubs_possible" = xyes; then +PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs) +AC_SUBST(PTHREADSTUBS_CFLAGS) +AC_SUBST(PTHREADSTUBS_LIBS) +fi dnl SELinux awareness. AC_ARG_ENABLE([selinux], -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/4] configure: Define _GNU_SOURCE for Cygwin as well
From: Yaakov Selkowitz Cygwin headers are now a bit more correct in handling feature test macros, so use _GNU_SOURCE when building for Cygwin, as well. (Notwithstanding f381c27c, we should probably have always been using _GNU_SOURCE, since asprintf() is used by mesa in places) Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon Turney --- configure.ac | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 33d1fef..4967c56 100644 --- a/configure.ac +++ b/configure.ac @@ -254,15 +254,12 @@ case "$host_os" in *-android) android=yes ;; -linux*|*-gnu*|gnu*) +linux*|*-gnu*|gnu*|cygwin*) DEFINES="$DEFINES -D_GNU_SOURCE" ;; solaris*) DEFINES="$DEFINES -DSVR4" ;; -cygwin*) -DEFINES="$DEFINES -D_XOPEN_SOURCE=700" -;; esac AM_CONDITIONAL(HAVE_ANDROID, test "x$android" = xyes) -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/4] Use correct names for dlopen()ed files on Cygwin
From: Yaakov Selkowitz Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon Turney --- src/egl/drivers/dri2/egl_dri2.c| 2 ++ src/gallium/auxiliary/util/u_format_s3tc.c | 2 ++ src/glx/dri_common.c | 3 +++ src/mesa/main/texcompress_s3tc.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index bfde640..ac2be86 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2733,6 +2733,8 @@ dri2_load(_EGLDriver *drv) const char *libname = "libglapi.so"; #elif defined(__APPLE__) const char *libname = "libglapi.0.dylib"; +#elif defined(__CYGWIN__) + const char *libname = "cygglapi-0.dll"; #else const char *libname = "libglapi.so.0"; #endif diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c b/src/gallium/auxiliary/util/u_format_s3tc.c index cd3e165..8c4f215 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.c +++ b/src/gallium/auxiliary/util/u_format_s3tc.c @@ -32,6 +32,8 @@ #if defined(_WIN32) || defined(WIN32) #define DXTN_LIBNAME "dxtn.dll" +#elif defined(__CYGWIN__) +#define DXTN_LIBNAME "cygtxc_dxtn.dll" #elif defined(__APPLE__) #define DXTN_LIBNAME "libtxc_dxtn.dylib" #else diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 6728d38..9cd320b 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -73,6 +73,9 @@ dri_message(int level, const char *f, ...) } } +#ifdef __CYGWIN__ +#define GL_LIB_NAME "cygGL-1.dll" +#endif #ifndef GL_LIB_NAME #define GL_LIB_NAME "libGL.so.1" #endif diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 7ddb0ed..992ad05 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -46,6 +46,8 @@ #define DXTN_LIBNAME "dxtn.dll" #define RTLD_LAZY 0 #define RTLD_GLOBAL 0 +#elif defined(__CYGWIN__) +#define DXTN_LIBNAME "cygtxc_dxtn.dll" #else #define DXTN_LIBNAME "libtxc_dxtn.so" #endif -- 2.8.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 29/40] {st, targets}/dri: use static/dynamic pipe-loader
On 20/11/2015 20:11, Emil Velikov wrote: Covert DRI to use only the pipe-loader interface. With drisw_create_screen and kms_swrast_create_screen replaced by their pipe-loader equivalent, we can now drop them. [...] --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -64,7 +64,7 @@ EXTRA_DIST = \ TARGET_DRIVERS = TARGET_CPPFLAGS = -TARGET_LIB_DEPS = $(top_builddir)/src/loader/libloader.la +TARGET_LIB_DEPS = include $(top_srcdir)/src/gallium/drivers/i915/Automake.inc This change causes building gallium_dri.so to fail for me when building for Cygwin, due to unresolved symbols from libxmlconfig, which were being included via libloader. (See [1] for build log) Perhaps something like the attached is needed? [1] http://ec2-52-16-27-13.eu-west-1.compute.amazonaws.com:8010/builders/mesa-mesa/builds/643 From 4d92c73daa08abe0a10a5b73565f3a42805090a9 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 21 Nov 2015 16:32:26 + Subject: [PATCH] Fix Cygwin build since 23fb1145 by linking gallium_dri with libxmlconfig --- src/gallium/targets/dri/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index 5d0fe47..1b2da63 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -71,7 +71,7 @@ EXTRA_DIST = \ TARGET_DRIVERS = TARGET_CPPFLAGS = -TARGET_LIB_DEPS = +TARGET_LIB_DEPS = $(top_builddir)/src/mesa/drivers/dri/common/libxmlconfig.la include $(top_srcdir)/src/gallium/drivers/i915/Automake.inc -- 2.5.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB
On 08/08/2014 18:58, Ilia Mirkin wrote: The problem is that AC_CHECK_FUNCS would stick the LDFLAGS before the conftest.c arg while AC_CHECK_LIB sticks the -ldl after conftest.c. This apparently matters with newer gcc's. There's probably some The key difference seems to be that lto was enabled, which I guess means we can't get away with listing objects in a random order :-) correct autoconf way of dealing with it, but... this works :) I think I have used LDFLAGS here where I should have used LIBS. So the more correct way is something like: diff --git a/configure.ac b/configure.ac index 96a67a3..bba64a0 100644 --- a/configure.ac +++ b/configure.ac @@ -535,9 +535,10 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"], AC_SUBST([DLOPEN_LIBS]) dnl Check if that library also has dladdr -AC_CHECK_FUNC([dladdr], [DEFINES="$DEFINES -DHAVE_DLADDR"], -[AC_CHECK_LIB([dl], [dladdr], - [DEFINES="$DEFINES -DHAVE_DLADDR"])]) +save_LIBS="$LIBS" +LIBS="$LIBS $DLOPEN_LIBS" +AC_CHECK_FUNCS([dladdr]) +LIBS="$save_LIBS" case "$host_os" in darwin*|mingw*) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] glx/drisw: add support for DRI2rendererQueryExtension
On 14/08/2014 23:18, Emil Velikov wrote: The extension is used by GLX_MESA_query_renderer, which can be provided for by hardware and software drivers. v2: Use designated initializers. v3: Move drisw_query_renderer_*() to dri2_query_renderer.c This breaks my build (see [1]) I guess something like the attached is needed. Possibly dri2_query_renderer.c needs to be renamed, since it's contents now are used for more than dri[23]. [1] http://tinderbox.x.org/builds/2014-08-16-0006/logs/mesa-mesa/#build From ee9b2d044ebb089bc3daf93fc6b71e167c47841f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 17 Aug 2014 17:22:22 +0100 Subject: [PATCH] Fix build since 679c2ef "glx/drisw: add support for DRI2rendererQueryExtension", when only building drisw renderer. Signed-off-by: Jon TURNEY --- src/glx/Makefile.am | 6 +++--- src/glx/dri2_query_renderer.c | 4 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index cdd898e..23cb794 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -96,7 +96,8 @@ endif if HAVE_DRICOMMON libglx_la_SOURCES += \ xfont.c \ - dri_common.c + dri_common.c \ + dri2_query_renderer.c endif if HAVE_DRI2 @@ -104,8 +105,7 @@ libglx_la_SOURCES += \ dri_glx.c \ XF86dri.c \ dri2_glx.c \ - dri2.c \ - dri2_query_renderer.c + dri2.c endif if HAVE_DRI3 diff --git a/src/glx/dri2_query_renderer.c b/src/glx/dri2_query_renderer.c index 247ec1c..6ccd710 100644 --- a/src/glx/dri2_query_renderer.c +++ b/src/glx/dri2_query_renderer.c @@ -25,7 +25,9 @@ #include "glxclient.h" #include "glx_error.h" +#ifdef HAVE_LIBDRM #include "dri2.h" +#endif #include "dri_interface.h" #include "dri2_priv.h" #if defined(HAVE_DRI3) @@ -66,6 +68,7 @@ dri2_convert_glx_query_renderer_attribs(int attribute) return -1; } +#ifdef HAVE_LIBDRM _X_HIDDEN int dri2_query_renderer_integer(struct glx_screen *base, int attribute, unsigned int *value) @@ -103,6 +106,7 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute, return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value); } +#endif #if defined(HAVE_DRI3) _X_HIDDEN int -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 10/19] auxiliary/os: introduce os_get_total_physical_memory helper function
On 14/08/2014 23:18, Emil Velikov wrote: Cc: Alexander von Gluck IV Signed-off-by: Emil Velikov --- src/gallium/auxiliary/os/os_misc.c | 64 ++ src/gallium/auxiliary/os/os_misc.h | 7 + 2 files changed, 71 insertions(+) Since this #errors on unknown platforms, teach it about the existence of Cygwin. From 03e0df4455810e255c22a0532b9e66dcc3d60a1d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 17 Aug 2014 17:21:27 +0100 Subject: [PATCH] Teach os_get_physical_memory about Cygwin Signed-off-by: Jon TURNEY --- src/gallium/auxiliary/os/os_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/os/os_misc.c b/src/gallium/auxiliary/os/os_misc.c index 3846a9a..ef84c79 100644 --- a/src/gallium/auxiliary/os/os_misc.c +++ b/src/gallium/auxiliary/os/os_misc.c @@ -47,7 +47,7 @@ #endif -#if defined(PIPE_OS_LINUX) +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) # include #elif defined(PIPE_OS_APPLE) || defined(PIPE_OS_BSD) # include @@ -111,7 +111,7 @@ os_get_option(const char *name) bool os_get_total_physical_memory(uint64_t *size) { -#if defined(PIPE_OS_LINUX) +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_CYGWIN) const long phys_pages = sysconf(_SC_PHYS_PAGES); const long page_size = sysconf(_SC_PAGE_SIZE); -- 1.8.5.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] glx/drisw: add support for DRI2rendererQueryExtension
On 18/08/2014 13:08, Emil Velikov wrote: On 18/08/14 12:47, Jon TURNEY wrote: On 14/08/2014 23:18, Emil Velikov wrote: The extension is used by GLX_MESA_query_renderer, which can be provided for by hardware and software drivers. v2: Use designated initializers. v3: Move drisw_query_renderer_*() to dri2_query_renderer.c This breaks my build (see [1]) Ouch, I've completely forgot about your recent-ish changes in here. Sorry for the breakage. I guess something like the attached is needed. Possibly dri2_query_renderer.c needs to be renamed, since it's contents now are used for more than dri[23]. My initial plan was to move the functions to dri_common.c, although that caused 'make check' to explode so I've kept them here as per Ian's suggestion. Renaming the file makes sense imho. With a couple of small changes, I believe that you should be safe with dropping the above header and the HAVE_LIBDRM guards below. The small changes: - dri*_query_renderer_* into their respective dri*_priv.h I had a go at writing the patch like that, which seems to work. Revised patch attached. - Perhaps move a struct from dri2.h to dri2_priv.h I don't know which struct you mean here. I didn't find one I needed to move to make things build. The dri2_convert_glx_query_renderer_attribs() helper function could possibly stand to be given a more generic name. From 1f06833a856b98b6c5248f0f001bf5b3a74ae010 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 17 Aug 2014 17:22:22 +0100 Subject: [PATCH] Fix build since 679c2ef "glx/drisw: add support for DRI2rendererQueryExtension", when only building drisw renderer. v2: - Move dri*_query_renderer_* into their respective dri*_priv.h headers - Drop then unnneeded include of dri2.h from dri2_query_renderer.c - Rename dri2_query_renderer.c as dri_common_query_renderer.c, as it's contents now are used for more than dri[23] Signed-off-by: Jon TURNEY --- src/glx/Makefile.am | 6 +++--- src/glx/dri2.h | 16 src/glx/dri2_priv.h | 8 src/glx/dri3_priv.h | 9 + ...dri2_query_renderer.c => dri_common_query_renderer.c} | 1 - 5 files changed, 20 insertions(+), 20 deletions(-) rename src/glx/{dri2_query_renderer.c => dri_common_query_renderer.c} (99%) diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index cdd898e..4515312 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -96,7 +96,8 @@ endif if HAVE_DRICOMMON libglx_la_SOURCES += \ xfont.c \ - dri_common.c + dri_common.c \ + dri_common_query_renderer.c endif if HAVE_DRI2 @@ -104,8 +105,7 @@ libglx_la_SOURCES += \ dri_glx.c \ XF86dri.c \ dri2_glx.c \ - dri2.c \ - dri2_query_renderer.c + dri2.c endif if HAVE_DRI3 diff --git a/src/glx/dri2.h b/src/glx/dri2.h index d07b296..4be5bf8 100644 --- a/src/glx/dri2.h +++ b/src/glx/dri2.h @@ -88,20 +88,4 @@ DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region, CARD32 dest, CARD32 src); -_X_HIDDEN int -dri2_query_renderer_integer(struct glx_screen *base, int attribute, -unsigned int *value); - -_X_HIDDEN int -dri2_query_renderer_string(struct glx_screen *base, int attribute, - const char **value); - -_X_HIDDEN int -dri3_query_renderer_integer(struct glx_screen *base, int attribute, -unsigned int *value); - -_X_HIDDEN int -dri3_query_renderer_string(struct glx_screen *base, int attribute, - const char **value); - #endif diff --git a/src/glx/dri2_priv.h b/src/glx/dri2_priv.h index c21eee5..b93d158 100644 --- a/src/glx/dri2_priv.h +++ b/src/glx/dri2_priv.h @@ -50,3 +50,11 @@ struct dri2_screen { int show_fps_interval; }; + +_X_HIDDEN int +dri2_query_renderer_integer(struct glx_screen *base, int attribute, +unsigned int *value); + +_X_HIDDEN int +dri2_query_renderer_string(struct glx_screen *base, int attribute, + const char **value); diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index c0e35ee..248fa28 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -195,3 +195,12 @@ struct dri3_drawable { xcb_gcontext_t gc; xcb_special_event_t *special_event; }; + + +_X_HIDDEN int +dri3_query_renderer_integer(struct glx_screen *base, int attribute, +unsigned int *value); + +_X_HIDDEN int +dri3_query_renderer_string(struct glx_screen *base, int attribute, + const char **value); diff --git a/src/glx/dri2_query_renderer.c b/src/glx/dri_common_query_renderer.c similarity index 99% rename from src/glx/dri2_query_renderer.c rename to src/glx/dr
Re: [Mesa-dev] [PATCH v2 01/26] util: move os_time.[ch] to src/util
On 06/11/2017 10:23, Nicolai Hähnle wrote: diff --git a/src/gallium/auxiliary/os/os_time.h b/src/util/os_time.h similarity index 89% rename from src/gallium/auxiliary/os/os_time.h rename to src/util/os_time.h index ca0bdd5a0c4..049ab118db2 100644 --- a/src/gallium/auxiliary/os/os_time.h +++ b/src/util/os_time.h @@ -28,34 +28,29 @@ /** * @file * OS independent time-manipulation functions. * * @author Jose Fonseca */ #ifndef _OS_TIME_H_ #define _OS_TIME_H_ - -#include "pipe/p_config.h" - -#if defined(PIPE_OS_UNIX) -# include /* usleep */ -#endif - -#include "pipe/p_compiler.h" - +#include +#include #ifdef __cplusplus extern "C" { #endif This patch seems to drop the include of unistd.h, which may be needed for usleep() prototype. (See http://dronecode.duckdns.org:8010/builders/mesa-mesa/builds/5790) Patch attached. From a186f46272c9677f9c33764cbd9d8dc9d442b473 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 10 Nov 2017 11:41:13 + Subject: [PATCH] util: include unistd.h, which may be required for usleep prototype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This seems to be dropped in 222a2fb9 "util: move os_time.[ch] to src/util" ../../../src/util/os_time.c: In function ‘os_time_sleep’: ../../../src/util/os_time.c:104:4: error: implicit declaration of function ‘usleep’ [-Werror=implicit-function-declaration] Signed-off-by: Jon Turney --- src/util/os_time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/os_time.c b/src/util/os_time.c index 8d8291ff173..72dc7e49c0e 100644 --- a/src/util/os_time.c +++ b/src/util/os_time.c @@ -40,6 +40,7 @@ #include "util/u_atomic.h" #if defined(PIPE_OS_UNIX) +# include /* usleep */ # include /* timeval */ # include /* timeval */ # include /* sched_yield */ -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage
On 09/11/2017 21:41, Nicolai Hähnle wrote: Sorry for the mess. I'm going to suggest that the fallback declaration of timespec_get() also needs to be provided for POSIX systems which don't have it. Not noticed previously as it (or xtime_get()) doesn't seem to have had any users, prior to this series. Patch attached. From e04c7cfa3a3a560476d361a828070f7785da8bf0 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 10 Nov 2017 12:22:25 + Subject: [PATCH] Also provide timespec_get fallback if a POSIX platform doesn't have it ... not just on Windows Signed-off-by: Jon Turney --- include/c11/threads_posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h index 7bf6a0f6ef6..45cb6075e6e 100644 --- a/include/c11/threads_posix.h +++ b/include/c11/threads_posix.h @@ -382,7 +382,7 @@ tss_set(tss_t key, void *val) /* 7.25.7 Time functions */ // 7.25.6.1 -#if 0 +#ifndef HAVE_TIMESPEC_GET static inline int timespec_get(struct timespec *ts, int base) { -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glx/windows: Fix building libwindowsdri when libX11 headers are installed in a non-standard location
Signed-off-by: Jon Turney --- src/glx/windows/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glx/windows/Makefile.am b/src/glx/windows/Makefile.am index f84288b935c..f4f8e9664d7 100644 --- a/src/glx/windows/Makefile.am +++ b/src/glx/windows/Makefile.am @@ -10,6 +10,9 @@ pkgconfig_DATA = windowsdriproto.pc # library for using the Windows-DRI server extension libwindowsdri_la_SOURCES = xwindowsdri.c xwindowsdri.h +libwindowsdri_la_CFLAGS = \ +$(X11_INCLUDES) + # native rendering GL for windows libwindowsglx_la_SOURCES = \ windowsgl.c \ -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage
On 10/11/2017 15:42, Nicolai Hähnle wrote: On 10.11.2017 14:00, Jon Turney wrote: On 09/11/2017 21:41, Nicolai Hähnle wrote: Sorry for the mess. I'm going to suggest that the fallback declaration of timespec_get() also needs to be provided for POSIX systems which don't have it. Not noticed previously as it (or xtime_get()) doesn't seem to have had any users, prior to this series. Patch attached. Do you have a system where this is actually needed? Currently HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more detection logic somewhere would be required if this actually turns out to be an issue. Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an autoconf check, but it isn't. Cygwin doesn't (currently) have timespec_get(). I'm thinking the correct solution here is actually to unconditionally declare timespec_get(), just like all the other C11 thread functions (and as the unused xtime_get() was, prior to f1a364878431c8c5f4fd38b40b9766449e49f552)? Revised patch attached. From f71d15ccab81af7dfb7393ed947827f02d333733 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 10 Nov 2017 12:22:25 + Subject: [PATCH] Provide timespec_get() in C11 thread.h emulation on POSIX also Signed-off-by: Jon Turney --- include/c11/threads_posix.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h index 7bf6a0f6ef6..25076f1b6e5 100644 --- a/include/c11/threads_posix.h +++ b/include/c11/threads_posix.h @@ -382,7 +382,6 @@ tss_set(tss_t key, void *val) /* 7.25.7 Time functions */ // 7.25.6.1 -#if 0 static inline int timespec_get(struct timespec *ts, int base) { @@ -393,4 +392,3 @@ timespec_get(struct timespec *ts, int base) } return 0; } -#endif -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] meson: if dep_dl is an empty list, it's not a dependency object
It's ok to use an empty list for dependencies:, but it's not ok to try to use the found() method of it. See also https://github.com/mesonbuild/meson/issues/2324 Signed-off-by: Jon Turney --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0cbaefb7882..9b0e495a58c 100644 --- a/meson.build +++ b/meson.build @@ -925,7 +925,7 @@ endif if dep_m.found() gl_priv_libs += '-lm' endif -if dep_dl.found() +if dep_dl != [] and dep_dl.found() gl_priv_libs += '-ldl' endif -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] meson: if dep_dl is an empty list, it's not a dependency object
On 13/11/2017 17:41, Dylan Baker wrote: I thought I'd fixed this already, Reviewed-by: Dylan Baker This workaround is already in place for dep_xxf86vm. I took a brief look, and didn't see anywhere the same problem could occur with any of the other uses of [] for a dependency. Quoting Jon Turney (2017-11-13 02:28:27) It's ok to use an empty list for dependencies:, but it's not ok to try to use the found() method of it. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] meson: Don't define HAVE_PTHREAD only on linux
I'm not sure of the reason for this. I don't see anything like this in configure.ac In include/c11/threads.h the cases are: 1) building for Windows -> threads_win32.h 2) HAVE_PTHREAD -> threads_posix.h 3) Not supported on this platform So not defining HAVE_PTHREAD for anything not Windows just means we can't build at all. When we are building for Windows, I'm not sure if dependency('threads') would ever find anything, or defining HAVE_PTHREAD has any effect, but avoid defining it there, just in case. Signed-off-by: Jon Turney --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 84c0e102737..a0dd02b1f64 100644 --- a/meson.build +++ b/meson.build @@ -668,7 +668,7 @@ endif # TODO: some of these may be conditional dep_zlib = dependency('zlib', version : '>= 1.2.3') dep_thread = dependency('threads') -if dep_thread.found() and host_machine.system() == 'linux' +if dep_thread.found() and host_machine.system() != 'windows' pre_args += '-DHAVE_PTHREAD' endif dep_elf = dependency('libelf', required : false) -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage
On 15/11/2017 11:21, Nicolai Hähnle wrote: On 13.11.2017 23:55, Rob Herring wrote: On Fri, Nov 10, 2017 at 12:39 PM, Jon Turney wrote: On 10/11/2017 15:42, Nicolai Hähnle wrote: On 10.11.2017 14:00, Jon Turney wrote: On 09/11/2017 21:41, Nicolai Hähnle wrote: Sorry for the mess. I'm going to suggest that the fallback declaration of timespec_get() also needs to be provided for POSIX systems which don't have it. Not noticed previously as it (or xtime_get()) doesn't seem to have had any users, prior to this series. Patch attached. Do you have a system where this is actually needed? Currently HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more detection logic somewhere would be required if this actually turns out to be an issue. Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an autoconf check, but it isn't. Cygwin doesn't (currently) have timespec_get(). I'm thinking the correct solution here is actually to unconditionally declare timespec_get(), just like all the other C11 thread functions (and as the unused xtime_get() was, prior to f1a364878431c8c5f4fd38b40b9766449e49f552)? Revised patch attached. That should fix Android builds. Acked-by: Rob Herring The issue with this is that it makes the compiler unhappy when timespec_get *is* available. I'm looking at adding a configure check. Ah, and this doesn't effect the other C11 emulation functions in this header because we don't include threads.h, but we do include time.h? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2] threads, configure.ac, meson.build: define and use HAVE_TIMESPEC_GET
On 15/11/2017 14:35, Nicolai Hähnle wrote: From: Nicolai Hähnle v2: add HAVE_TIMESPEC_GET for non-Windows Scons builds Cc: Jon Turney Cc: Rob Herring Cc: Alexander von Gluck IV Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103674 Fixes: f1a364878431 ("threads: update for late C11 changes") --- SConstruct | 7 +++ configure.ac| 1 + include/c11/threads_posix.h | 2 +- meson.build | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) Reviewed-by: Jon Turney Thanks! ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] mapi: Teach es{1, 2}api/ABI-check shared library names on Cygwin
Ideally we'd be able to get the library filename from libtool, but that doesn't seem to be a feature... Use of ${uname} is presumably ok here as we won't be running 'make check' if we are cross-compiling Signed-off-by: Jon Turney --- src/mapi/es1api/ABI-check | 13 + src/mapi/es2api/ABI-check | 13 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mapi/es1api/ABI-check b/src/mapi/es1api/ABI-check index 0a867343c79..396ca74bbcb 100755 --- a/src/mapi/es1api/ABI-check +++ b/src/mapi/es1api/ABI-check @@ -9,12 +9,17 @@ set -eu # or in extensions that are part of the ES 1.1 extension pack. # (see http://www.khronos.org/registry/gles/specs/1.1/opengles_spec_1_1_extension_pack.pdf) -if [ $(uname) == "Darwin" ] -then +case $(uname) in +"Darwin") LIB=${1-es1api/.libs/libGLESv1_CM.dylib} -else + ;; +"CYGWIN"*) + LIB=${1-es1api/.libs/cygGLESv1_CM-1.dll} + ;; +*) LIB=${1-es1api/.libs/libGLESv1_CM.so.1} -fi + ;; +esac if ! [ -f "$LIB" ] then diff --git a/src/mapi/es2api/ABI-check b/src/mapi/es2api/ABI-check index 716e6679a49..9d95e823814 100755 --- a/src/mapi/es2api/ABI-check +++ b/src/mapi/es2api/ABI-check @@ -6,12 +6,17 @@ set -eu # GL_EXT_multi_draw_arrays # GL_OES_EGL_image -if [ $(uname) == "Darwin" ] -then +case $(uname) in +"Darwin") LIB=${1-es2api/.libs/libGLESv2.dylib} -else + ;; +"CYGWIN"*) + LIB=${1-es2api/.libs/cygGLESv2-2.dll} + ;; +*) LIB=${1-es2api/.libs/libGLESv2.so.2} -fi + ;; +esac if ! [ -f "$LIB" ] then -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/6] meson: add logic to select apple and windows dri
On 21/11/2017 00:50, Dylan Baker wrote: This is still not fully correct (haiku and BSD are probably not correct), but Linux is not regressed and this should be correct for macOS and Windows. Signed-off-by: Dylan Baker --- meson.build | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 52f2c1cb0d0..e7d2afb3d0a 100644 --- a/meson.build +++ b/meson.build @@ -187,8 +187,19 @@ if with_dri_i915 dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75') endif -# TODO: other OSes -with_dri_platform = 'drm' +# TODO: gnu +if host_machine.system() == 'darwin' + with_dri_platform = 'apple' +elif host_machine.system() == 'windows' This should be: elif ['windows', 'cygwin'].contains(host_machine.system()) + with_dri_platform = 'windows' +elif host_machine.system() == 'linux' + # FIXME: This should include BSD and possibly other systems + with_dri_platform = 'drm' +else + # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should + # assert here that one of those cases has been met. + with_dri_platform = 'none' +endif with_platform_android = false with_platform_wayland = false ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] util: Fix SHA1 implementation on big endian
On 25/11/2017 04:24, Matt Turner wrote: diff --git a/src/util/u_endian.h b/src/util/u_endian.h index 7bbd7dc215..3d5c006f35 100644 --- a/src/util/u_endian.h +++ b/src/util/u_endian.h @@ -67,4 +67,7 @@ #endif +#warn Unknown Endianness for this platform. Assuming little endian +#define PIPE_ARCH_LITTLE_ENDIAN + #endif I'm wondering what compiler this issues a warning on. gcc only seems to support #warning, not #warn, but that's not portable to msvc... ./util/u_endian.h:70:2: error: invalid preprocessing directive #warn #warn Unknown Endianness for this platform. Assuming little endian ^ ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] util: Fix SHA1 implementation on big endian
On 26/11/2017 00:46, Matt Turner wrote: I've committed what I hope is the final fix. After this series, if we are building on a target unknown to u_endian.h, so it can't determine the endianess, sha1.c now builds for big-endian. This choice is made silently, but fortunately mesa-sha1_test fails when built for the wrong endianess, so there is some hope to notice this... From e5c6197bdb4dec926ab31534b8533dd1bf14dfa1 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Mon, 27 Nov 2017 13:32:53 + Subject: [PATCH] Also include endian.h on cygwin If u_endian.h can't determine the endianess, the default behaviour in sha1.c is to build for big-endian Signed-off-by: Jon Turney --- src/util/u_endian.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/u_endian.h b/src/util/u_endian.h index 50f94c578ed..22d011ec008 100644 --- a/src/util/u_endian.h +++ b/src/util/u_endian.h @@ -27,7 +27,7 @@ #ifndef U_ENDIAN_H #define U_ENDIAN_H -#if defined(__GLIBC__) || defined(ANDROID) +#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__) #include #if __BYTE_ORDER == __LITTLE_ENDIAN -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 5/7] meson: build src/glx/windows
--- src/glx/meson.build | 25 +-- src/glx/windows/meson.build | 48 + 2 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 src/glx/windows/meson.build diff --git a/src/glx/meson.build b/src/glx/meson.build index deef3ed2235..a7eb48a0069 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -18,8 +18,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# TODO: -#subdir('windows') +subdir('windows') files_libglx = files( 'clientattrib.c', @@ -63,6 +62,8 @@ files_libglx = files( ) extra_libs_libglx = [] +extra_deps_libgl = [] +extra_ld_args_libgl = [] if with_dri files_libglx += files( @@ -99,11 +100,15 @@ if with_dri_platform == 'apple' files_libglx += files('applegl_glx.c') elif with_dri_platform == 'windows' files_libglx += files('driwindows_glx.c') - # TODO - #extra_libs_libglx += [ -#libwindowsdri, -#libwindowsglx, - #] + extra_libs_libglx += [ +libwindowsdri, +libwindowsglx, + ] + extra_deps_libgl = [ +meson.get_compiler('c').find_library('gdi32'), +meson.get_compiler('c').find_library('opengl32') + ] + extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup' endif dri_driver_dir = join_paths(get_option('prefix'), dri_drivers_path) @@ -139,7 +144,7 @@ libglx = static_library( ], c_args : [c_vis_args, gl_lib_cargs, '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0])], - link_with : [libloader, libloader_dri3_helper, libmesa_util, libxmlconfig], + link_with : [libloader, libloader_dri3_helper, libmesa_util, libxmlconfig, extra_libs_libglx], dependencies : [dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd], build_by_default : false, ) @@ -161,9 +166,9 @@ if with_glx == 'dri' ], link_with : [libglapi_static, libglapi], link_whole : libglx, -link_args : [ld_args_bsymbolic, ld_args_gc_sections], +link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], dependencies : [dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, -dep_xcb_dri2, dep_xcb_dri3], +dep_xcb_dri2, dep_xcb_dri3, extra_deps_libgl], version : gl_lib_version, install : true, ) diff --git a/src/glx/windows/meson.build b/src/glx/windows/meson.build new file mode 100644 index 000..1e66094b4ba --- /dev/null +++ b/src/glx/windows/meson.build @@ -0,0 +1,48 @@ +# protocol defines for the Windows-DRI server extension + +files_windowsdriproto = files( + 'windowsdriconst.h', + 'windowsdristr.h', + ) + +install_headers( + files_windowsdriproto, + subdir: 'X11/extensions', +) + +pkg.generate( + name : 'windowsdriproto', + description : 'Windows-DRI extension headers', + version : '1.0.0', +) + +# library for using the Windows-DRI server extension +files_libwindowsdri = files( + 'xwindowsdri.c', + 'xwindowsdri.h', +) + +libwindowsdri = static_library( + 'driwindows', + [ files_libwindowsdri, files_windowsdriproto], + dependencies: dep_xext, + build_by_default: false, +) + +# library for native GL on windows +files_libwindowsglx = files( + 'windowsgl.c', + 'windowsgl.h', + 'windowsgl_internal.h', + 'windows_drawable.c', + 'wgl.c', + 'wgl.h', +) + +libwindowsglx = static_library( + 'glxwindows', + [ files_libwindowsglx, files_windowsdriproto], + include_directories: [inc_include, inc_src, inc_glapi], + c_args : [c_vis_args], + build_by_default: false, +) -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/7] meson: fix generated source inclusion on macOS and Windows
From: Dylan Baker --- src/mapi/glapi/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build index 14ffa68ad0d..8856a95fb66 100644 --- a/src/mapi/glapi/meson.build +++ b/src/mapi/glapi/meson.build @@ -26,7 +26,7 @@ static_glapi_files = [] static_glapi_args = [] if ['apple', 'windows'].contains(with_dri_platform) - static_glapi_files += files('glapi_gentable.c') + static_glapi_files += [glapi_gentable_c, glapitable_h] endif if with_shared_glapi -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/7] meson: set _GNU_SOURCE on cygwin
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index d0618f97344..cf6e028746a 100644 --- a/meson.build +++ b/meson.build @@ -467,7 +467,7 @@ if cc.compiles('int foo(void) { return 0; } int bar(void) __attribute__((alias(" endif # TODO: this is very incomplete -if host_machine.system() == 'linux' +if ['linux', 'cygwin'].contains(host_machine.system()) pre_args += '-D_GNU_SOURCE' endif -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 7/7] meson: fix deps and underlinkage of libGL
--- meson.build | 6 -- src/glx/meson.build | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 68361fc4606..524a03eaa97 100644 --- a/meson.build +++ b/meson.build @@ -866,7 +866,7 @@ if with_platform_x11 dep_x11 = dependency('x11') dep_xext = dependency('xext') dep_xcb = dependency('xcb') - elif with_glx == 'dri' and with_dri_platform == 'drm' + elif with_glx == 'dri' dep_x11 = dependency('x11') dep_xext = dependency('xext') dep_xdamage = dependency('xdamage', version : '>= 1.1') @@ -874,9 +874,11 @@ if with_platform_x11 dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1') dep_xxf86vm = dependency('xxf86vm', required : false) endif - if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') + if with_any_vk or with_glx == 'dri' dep_xcb = dependency('xcb') dep_x11_xcb = dependency('x11-xcb') + endif + if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8') if with_dri3 diff --git a/src/glx/meson.build b/src/glx/meson.build index a7eb48a0069..2ffef4cf223 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -168,6 +168,7 @@ if with_glx == 'dri' link_whole : libglx, link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], dependencies : [dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, +dep_xcb_glx, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3, extra_deps_libgl], version : gl_lib_version, install : true, -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 6/7] meson: don't require dri2proto for darwin or windows
--- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cf6e028746a..68361fc4606 100644 --- a/meson.build +++ b/meson.build @@ -888,7 +888,9 @@ if with_platform_x11 endif endif if with_glx == 'dri' -dep_dri2proto = dependency('dri2proto', version : '>= 2.8') +if with_dri_platform == 'drm' + dep_dri2proto = dependency('dri2proto', version : '>= 2.8') +endif dep_glproto = dependency('glproto', version : '>= 1.4.14') endif if with_egl -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/7] meson: Don't build egl on macOS or Windows
From: Dylan Baker --- meson.build | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 53013e47ec4..c24225c0297 100644 --- a/meson.build +++ b/meson.build @@ -261,7 +261,10 @@ endif _egl = get_option('egl') if _egl == 'auto' - with_egl = with_dri and with_shared_glapi and egl_native_platform != '' + with_egl = ( +with_dri and with_shared_glapi and egl_native_platform != '' and not +['darwin', 'windows', 'cygwin'].contains(host_machine.system()) + ) elif _egl == 'true' if not with_dri error('EGL requires dri') -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/7] meson: set windows glx defines
--- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index c24225c0297..d0618f97344 100644 --- a/meson.build +++ b/meson.build @@ -378,6 +378,8 @@ if with_platform_x11 endif if with_dri_platform == 'drm' pre_args += '-DGLX_USE_DRM' + elif with_dri_platform == 'windows' + pre_args += '-DGLX_USE_WINDOWSGL' endif endif else -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/7] [RFC] meson: build src/glx/windows
This series lets me build a mesa for Cygwin configured with: -Ddri-drivers=swrast -Dgallium-drivers= -Dplatforms=x11,surfaceless -Dglx=dri -Dvulkan-drivers= I'm really not sure about (2/8), the autotools build does something totally different... Dylan Baker (2): meson: fix generated source inclusion on macOS and Windows meson: Don't build egl on macOS or Windows Jon Turney (5): meson: set windows glx defines meson: set _GNU_SOURCE on cygwin meson: build src/glx/windows meson: don't require dri2proto for darwin or windows meson: fix deps and underlinkage of libGL meson.build | 19 +- src/glx/meson.build | 26 ++-- src/glx/windows/meson.build | 48 + src/mapi/glapi/meson.build | 2 +- 4 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 src/glx/windows/meson.build -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 5/7] meson: build src/glx/windows
On 27/11/2017 18:35, Dylan Baker wrote: Quoting Jon Turney (2017-11-27 05:58:32) --- src/glx/meson.build | 25 +-- src/glx/windows/meson.build | 48 + 2 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 src/glx/windows/meson.build + extra_deps_libgl = [ +meson.get_compiler('c').find_library('gdi32'), +meson.get_compiler('c').find_library('opengl32') You should (though I haven't tested), be able to replace the last call with: dependency('opengl') (There is code for this in meson, but there's a lot of TODO's around it). I'm not sure that's a good idea. I did go back and forth a bit on just using '-lopengl32' here... It probably helps to bear in mind that this is building a big shim, where the GL calls from a GLX client are ultimately directed to the native Windows opengl32.dll (mainly this happens via a dispatch table populated using _glapi_create_table_from_handle() on a handle to opengl32.dll, but there are some direct calls, for probably not very good reasons) So, it's quite important that opengl32 is linked with here, not just any libGL (e.g. an installed version of what we are building...) diff --git a/src/glx/windows/meson.build b/src/glx/windows/meson.build new file mode 100644 index 000..1e66094b4ba --- /dev/null +++ b/src/glx/windows/meson.build @@ -0,0 +1,48 @@ Even if you don't care about the Copyright line, could you add the MIT text at the top? Done. +libwindowsdri = static_library( + 'driwindows', + [ files_libwindowsdri, files_windowsdriproto], ^ extra whitespace Fixed. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 7/7] meson: fix deps and underlinkage of libGL
On 28/11/2017 18:21, Dylan Baker wrote: Quoting Emil Velikov (2017-11-27 06:31:35) IIRC Windows mandates binaries with unresolved symbols. Other platforms allow such behaviour. I think we want to set b_lundef=true, to catch these issues as part of the build process. We already do so in the autotools, android and at least partially in scons. One would need a workaround for the sanitizers [1] analogous to our autotools and scons builds. Thanks for catching this Jon. -Emil [1] https://github.com/mesonbuild/meson/issues/764 See commits 8b5d477aa820e52ed622c329933550c561ab1c93 and fa46848e51a619aba5a748316fe8fe4c2e17d243 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev JFYI, b_lundef is true by default, and we don't override it. In this case (unless I'm completely misreading/remembering [I wrote a very similar patch in my macos branch]), the linkage is correct for Linux (possibly BSD too), but incorrect for macOS, Cygwin, and Windows. If this is the case, think this suggests that there's something systematically wrong here, and this isn't the right fix... I'll look into this a bit more. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 7/7] meson: fix deps and underlinkage of libGL
On 29/11/2017 17:34, Dylan Baker wrote: Quoting Jon Turney (2017-11-29 08:22:54) On 28/11/2017 18:21, Dylan Baker wrote: Quoting Emil Velikov (2017-11-27 06:31:35) IIRC Windows mandates binaries with unresolved symbols. Other platforms allow such behaviour. I think we want to set b_lundef=true, to catch these issues as part of the build process. We already do so in the autotools, android and at least partially in scons. One would need a workaround for the sanitizers [1] analogous to our autotools and scons builds. [...] JFYI, b_lundef is true by default, and we don't override it. In this case (unless I'm completely misreading/remembering [I wrote a very similar patch in my macos branch]), the linkage is correct for Linux (possibly BSD too), but incorrect for macOS, Cygwin, and Windows. If this is the case, think this suggests that there's something systematically wrong here, and this isn't the right fix... I'll look into this a bit more. I'm not sure there is anything wrong. with_dri_platfrom == 'drm' will always be true on Linux/BSD, so really on Linux this patch has no functional changes, but it will have functional changes in cases where with_dri_platform != 'drm', or am I missing something? Maybe it's me that's missing something... There are references to functions provided by these libraries (xcb_glx, xcb, x11_xcb) in common code. The linux build includes these libraries on the link line, and DT_NEEEDED tags are emitted for them (i.e. it is not underlinked, which is what I was assuming...) All other things being equal, there shouldn't be the need to take special steps to link with those libraries when with_dri_platfrom != 'drm' [time passes... Thorin sits down and starts singing about gold] So it seems, when building for linux, xcb_glx and x11_xcb arrive in the link line from libloader_dri3_helper via libloader. ... and indeed when built -Ddri3=false, libGL has unresolved symbols for these libraries. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev