summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-09-16Add a generator for a waffle dispatch.dispatchEric Anholt6-0/+635
The cmake bits are blind copy and paste from piglit.
2013-09-04Import khronos API registry from SVN commit 22908Eric Anholt4-0/+46548
2013-08-21cmake: Fix test for thread-local storageChad Versace1-2/+2
Commit 6fcbe52 "cmake: Refactor compiler flags into new module" exposed a bug in the test for thread-local storage, causing the test to always fail. If the regex "warning|error" appears in the compiler log, then the test fails. This causes false failures when the test invokes the compiler with '-Werror=missing-prototypes'. Fix the regex to more closely match gcc and clang error messages. Reported-by: Paul Berry <stereotype441@gmail.com> Tested-by: Paul Berry <stereotype441@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-20core: Zero-initialize wcore_info structPaul Berry1-1/+1
Without this, it's possible that the garbage memory returned by malloc will have wcore_info::is_init == true, causing wcore_tinfo_init() to skip initialization. That in turn causes a likely segfault the first time wcore_info::error is accessed. Fixes piglit crashes introduced by commit 6fcbe52 ("cmake: Refactor compiler flags into new module"). Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19Merge branch chadv/cmake-cleanupChad Versace17-484/+439
2013-08-19cmake: Refactor detection of operating systemChad Versace9-11/+44
Add new module WaffleDefineOS that defines booleans `waffle_on_linux` and `waffle_on_mac`. Replace each check on CMAKE_SYSTEM_NAME with a check on one of these new bools. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Fix some ugly formattingChad Versace1-5/+2
After all the recent cleanups, there exists some residual formatting that needs cleaning up. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor targets 'check', 'check-func'Chad Versace2-29/+19
They were defined in the toplevel CMakeLists.txt. Move them to `tests/CMakeLists.txt.` This change belongs to a series that cleans up the toplevel CMakeLists by decomposing it. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor installation of FindWaffle.cmakeChad Versace2-4/+4
The presence of file `cmake/CMakeLists.txt` feels very strange. I found no other project that had a CMakeLists there. Goodbye strange file. File `cmake/CMakeLists.txt` did exactly one thing: define the install rule for `FindWaffle.cmake`. Kill the file and move the install rule to the toplevel CMakeLists. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor the search for library depsChad Versace2-32/+55
Move the search for library dependencies into a new module WaffleFindDependencies. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Check that gbm is not enabled on MacChad Versace1-0/+3
Checks for GLX, EGL, and Wayland were present. GBM was the only check missing. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor option validationChad Versace2-50/+66
Move validation of options into a new module WaffleValidateOptions. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor definition of internal optionsChad Versace2-16/+12
Move definition of internal options into a new module WaffleDefineInternalOptions. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor compiler flags into new moduleChad Versace2-57/+72
Move definition of compiler flags into a new module WaffleDefineCompilerFlags. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Refactor configuration summaryChad Versace2-65/+91
Move the large block that prints the configuration summary into a new module WafflePrintConfigurationSummary. This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Remove project name hack for GNUInstallDirsChad Versace1-12/+1
Rename the project 'waffle' -> 'waffle1'. This coincides better with Waffle's library versioning. It also removes the need for the ugly hack Waffle uses to control where GNUInstallDirs installs documentation. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Define version numbers in new module WaffleVersionChad Versace2-26/+54
This change belongs to a series that cleans up the toplevel CMakeLists by decompositing it into modules. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Prefix module CheckThreadLocalStorage with WaffleChad Versace2-2/+2
That is, rename CheckThreadLocalStorage.cmake -> WaffleCheckThreadLocalStorage.cmake Let's be good code citizens. If a module is private to Waffle, then let's prefix its name with 'Waffle'. CMake, CPack, KDE3, and Qt4 also follows this convention. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Prefix 'check_thread_local_storage()' with 'waffle'Chad Versace2-3/+3
Let's be good code citizens and properly namespace our functions. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19doc: Remove building.txtChad Versace1-146/+0
This file did several things, each not worth doing. 1. Give a basic CMake tutorial. (It's not Waffle's responsibility to give a half-baked CMake tutorial.) 2. List all of Waffle's custom CMake options. (This is now covered by Options.cmake). 3. List some important make targets (This will quickly become out-of-date). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake,readme: Move Waffle's CMake options to new file Options.cmakeChad Versace3-34/+19
This makes it easy for users to find all the custom CMake options defined by Waffle. Update the README accordingly. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-19cmake: Remove 'third_party/khronos' from include pathsChad Versace1-1/+0
Oops. This should have been squashed with the previous commit (a607232). Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-18khronos: Remove imported headers from KhronosChad Versace8-1258/+0
This removes the imported headers: EGL/egl.h EGL/eglext.h EGL/eglplatform.h KHR/khrplatform.h I was unwise to use imported headers for a system library. If EGL were to change its ABI, and Waffle were linked against a libEGL that exports the new ABI, then Waffle would risk undefined behavior due to using EGL headers from the old ABI. Hopefully, Khronos would never introduce such a situation. But let's not rely on hope. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-18egl: Add header to import symbols from new EGL extensionsChad Versace6-0/+57
Waffle uses some EGL extensions that are fairly recent, so recent that some systems' EGL headers lack the extensions. This header imports the needed symbols from those extensions. The only extension imported by this commit is EGL_KHR_create_context. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-11egl: Emit error when eglGetDisplay or eglIntialize failsChad Versace1-2/+6
When these EGL functions failed, waffle_display_connect() returned false but waffle_error_get_code() returned WAFFLE_NO_ERROR. This patch emits WAFFLE_ERROR_UNKNOWN through wegl_emit_error(). For-Stable: Candidate for 1.2. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-26glx: Catch Xlib errors with function wrappersChad Versace6-38/+164
This patch defines a wrapper for each GLX function called by the glx directory. Each wrapper catches any Xlib error emitted by the wrapped function. The wrapper's signature matches the wrapped. All Xlib errors generated by Waffle must be caught by Waffle. Otherwise, the Xlib error handler installed by the user will catch the error and may handle it in a way Waffle doesn't like. Or, even worse, the default Xlib error handler will catch it, which exits the process. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-26x11: Catch Xlib errors with function wrappersChad Versace2-4/+84
This patch defines a wrapper for each Xlib function called by the x11 directory. Each wrapper catches any Xlib error emitted by the wrapped function. The wrapper's signature matches the wrapped. All Xlib errors generated by Waffle must be caught by Waffle. Otherwise, the Xlib error handler installed by the user will catch the error and may handle it in a way Waffle doesn't like. Or, even worse, the default Xlib error handler will catch it, which exits the process. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-19cgl: Add support for pre-10.6 Snow Leopard CGLNigel Stewart1-0/+8
Check for MAC_OS_X_VERSION_10_6 for core vs compatibility context handling. Fixes compilation for pre-10.6 versions, which don't define kCGLPFAOpenGLProfile. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-19Merge branch 'support-no-tls'Chad Versace2-19/+83
2013-07-19Revert "cmake: Require that compiler support keyword '__thread'"Chad Versace1-2/+2
This reverts commit e2cbb8648aeee9856b7897f9fa06bdd771c39ec0. The reverted patch, if you used clang, effectively made clang>=3.2 or non-ancient gcc a requirement. XCode 3.1 ships with an old version of gcc that does not support TLS. There are Waffle users that require support for XCode 3.1. Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel. Tested-by: Nigel Stewart <nigelstewart@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-19core: Support systems without thread-local storageChad Versace1-2/+29
XCode 3.1 ships with an old version of gcc that does not support TLS. There are Waffle users that require support for XCode 3.1. Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel. Tested-by: Nigel Stewart <nigelstewart@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-19core: Prevent leak at thread exitChad Versace1-2/+38
When the thread exits, teardown the thread-local data in wcore_tinfo. Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel. Tested-by: Nigel Stewart <nigelstewart@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-19core: Refactor wcore_tinfo.cChad Versace1-14/+15
The refactor prepares for supporting environments without TLS and introduces no behavioral change. Tested on Mac OS with XCode 3.1 gcc and XCode 4.6.2 clang by Nigel. Tested-by: Nigel Stewart <nigelstewart@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-12cmake: Use libudev.pc, not non-existent udev.pcChad Versace2-3/+3
CMake called pkg-config on a non-existent pkgname, udev. Fixes build with clang-3.3 if GBM is enabled. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-10cgl: Bring CGL window to front of window stack at startupNigel Stewart1-0/+1
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-10xcode: cleanup headers groupJeff Bland1-44/+4
2013-07-10xcode: add missing wcore_attrib_list to projectJeff Bland1-0/+8
2013-07-01api, android: Add window resize call and implementation for AndroidJuha-Pekka Heikkila8-0/+100
Added waffle_window_resize(self, width, heigh) API call. Currently implemented only on Android, other platforms return WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM. Signed-off-by: Juha-Pekka Heikkila <juha-pekka.heikkila@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-07-01android: Add missing file to Android.mkJuha-Pekka Heikkila1-0/+1
Recent changes required wcore_attrib_list.c to be part of compilation, this was missing from Android.mk Signed-off-by: Juha-Pekka Heikkila <juha-pekka.heikkila@linux.intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-06-06Revert "glx: Query proper extension string for ARB_create_context etc."Chad Versace1-1/+2
This reverts commit 8f778e4c6f28598ad3fc628d34bd0b96a1617f2a. This patch broke detection of GL_ARB_create_context (and siblings) for systems where the GLX client extension string included the extension string but the GLX server extensions string. In this case, Waffle incorrectly believed that the system supported GL_ARB_create_context. This broke Piglit on such systems. This patch was totally bogus because Paul and I failed to understand the distinction between the GLX server extension string, the GLX client extension string, and merged GLX extension string. This patch fixed the use of GLX_ARB_create_context on Paul's system because his system had a bogus GLX installed. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-06-03glx: Query proper extension string for ARB_create_context etc.Paul Berry1-2/+1
Previously we were using glXQueryExtensionsString() to see whether the implementation supported ARB_create_context, ARB_create_context_profile, and EXT_create_context_es_profile. This is the wrong query--those extensions show up in the *client* extension string, so we need to use glXGetClientString(). This allows us to create core contexts using GLX. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09core: Stop internally calling public attrib_list APIChad Versace1-14/+15
In wcore_config_attrs.c, replace all calls to public waffle_attrib_list functions with internal wcore_attrib_list functions. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09core: Update unittests for wcore_attrib_listChad Versace3-67/+68
Update waffle_attrib_list unittests to become wcore_attrib_list unittests. If possible, we should avoid unittesting public API. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09core: Add internal version of waffle_attrib_list funcsChad Versace4-46/+163
For each function waffle_attrib_list_VERB, add function wcore_attrib_list_VERB and implement the first with the second. The prepares us to remove internal calls to public API. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09cmake: Use real name of CMake vars when printing summaryChad Versace1-4/+4
When printing the configuration summary, use the real names of the CMake variables. For example, print "CMAKE_C_FLAGS_DEBUG" instead of "CFLAGS_debug". This eliminates some confusion caused by the fake names. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-05-09core: Rewrite code for thread local storageChad Versace2-99/+18
The original code in wcore_tinfo.c for handling thread local info was a mess. It was my first time writing thread local code in a non-classroom setting. This patch rewrites wcore_tinfo.c, reducing the lines of code from ~130 to ~50. The rewrite does the following: - Require that the compiler support thread local storage through the keyword '__thread'. This allows us to remove use of pthread_key_t. - Remove all mutexes. There is no need to protect thread-local storage with mutexes. Tested with `make check-func` on GLX, XEGL, and Wayland. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-04-22cmake: Require that compiler support keyword '__thread'Chad Versace1-2/+2
GCC has supported thread local storage through the keyword '__thread' for a long time. Clang has supported it since 3.2. If you use clang, this patch effectively makes clang>=3.2 a requirement. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-03-06examples/gl_basic: Fix example in usage messageJeff Bland1-1/+1
Version and profile were swapped.
2013-03-06examples/gl_basic: Pass "cgl gl" params from XcodeJeff Bland1-0/+92
2013-03-06.gitignore: Ignore libwaffle_test.dylib build artifactJeff Bland1-0/+1