[waffle] [PATCH 04/12] core: add JSON library

2016-01-06 Thread Frank Henigman
A small library for building JSON strings. Signed-off-by: Frank Henigman --- src/waffle/CMakeLists.txt | 1 + src/waffle/core/json.c| 235 ++ src/waffle/core/json.h| 93 ++ 3 files changed, 329 insertions(+) create mode 1006

[waffle] [PATCH 07/12] waffle: support platform-specific information

2016-01-06 Thread Frank Henigman
Add a platform hook so platform-specific information can be included by waffle_display_info_json(). Signed-off-by: Frank Henigman --- src/waffle/api/waffle_display.c | 10 +- src/waffle/core/wcore_platform.h | 4 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/w

[waffle] [PATCH 10/12] egl: implement platform-specific information

2016-01-06 Thread Frank Henigman
Implement the platform hook of waffle_display_info_json() so it can pick up egl-specific information. Signed-off-by: Frank Henigman --- src/waffle/egl/wegl_display.c | 32 ++-- src/waffle/egl/wegl_display.h | 4 src/waffle/egl/wegl_platform.h | 3 +++ 3 files

[waffle] [PATCH 08/12] wflinfo: add flag for platform-specific info

2016-01-06 Thread Frank Henigman
When given a "-s" flag wflinfo will now also print some platform-specific information. This affects only JSON output, not other formats. Signed-off-by: Frank Henigman --- src/utils/wflinfo.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/utils/wflinfo.c

[waffle] [PATCH 06/12] wflinfo: add option for JSON output

2016-01-06 Thread Frank Henigman
With "-f json" wflinfo will now print the result of waffle_display_info_json(). Signed-off-by: Frank Henigman --- src/utils/wflinfo.c | 40 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 268d

[waffle] [PATCH 09/12] glx: implement platform-specific information

2016-01-06 Thread Frank Henigman
Implement the platform hook of waffle_display_info_json() so it can pick up glx-specific information. Signed-off-by: Frank Henigman --- src/waffle/glx/glx_display.c | 41 + src/waffle/glx/glx_display.h | 4 src/waffle/glx/glx_platform.c | 4

[waffle] [PATCH 01/12] core: store platform type in wcore_platform

2016-01-06 Thread Frank Henigman
Facilitates platform-specific code in core functions, like the forthcoming wflinfo-like function. Signed-off-by: Frank Henigman --- src/waffle/api/waffle_init.c | 32 +--- src/waffle/core/wcore_platform.h | 1 + 2 files changed, 22 insertions(+), 11 deletions(-)

[waffle] [PATCH 12/12] x11_egl: implement platform-specific information

2016-01-06 Thread Frank Henigman
Implement the platform hook of waffle_display_info_json() so it can pick up x11_egl-specific information. So far only egl information is provided, nothing specific to x11. Signed-off-by: Frank Henigman --- src/waffle/xegl/xegl_platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/w

[waffle] [PATCH 11/12] gbm: implement platform-specific information

2016-01-06 Thread Frank Henigman
Implement the platform hook of waffle_display_info_json() so it can pick up gbm-specific information. So far only egl information is provided, nothing specific to gbm. Signed-off-by: Frank Henigman --- src/waffle/gbm/wgbm_platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/waffle

[waffle] [PATCH 00/12] JSON and platform-specific wflinfo

2016-01-06 Thread Frank Henigman
This patch set does two main things, the second of which could just as well be a separate patch set. 1-6: Move wflinfo functionality into the api, info returned as a json string. 7-12: Extend the functionality to include platform-specific info, such as provided by glxinfo. After 1-6 wflinfo

[waffle] [PATCH 02/12] core: store context API in wcore_context

2016-01-06 Thread Frank Henigman
Facilitates api-specific code in core functions, like the forthcoming wflinfo-like function. Signed-off-by: Frank Henigman --- src/waffle/core/wcore_context.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/waffle/core/wcore_context.h b/src/waffle/core/wcore_context.h index 3800113..45

[waffle] [PATCH 05/12] waffle: add waffle_display_info_json()

2016-01-06 Thread Frank Henigman
Duplicate wflinfo functionality in the API, with the difference that the information is returned in JSON form. The function has a parameter for including platform-specific information, but it is ignored for now. Signed-off-by: Frank Henigman --- include/waffle/waffle.h | 5 + man/waffl

[waffle] [PATCH 03/12] core: store current context in wcore_display

2016-01-06 Thread Frank Henigman
For core functions that need to know the current context, like the forthcoming wflinfo-like function. Signed-off-by: Frank Henigman --- src/waffle/api/waffle_gl_misc.c | 11 +++ src/waffle/core/wcore_display.c | 1 + src/waffle/core/wcore_display.h | 2 ++ 3 files changed, 10 insertion

[waffle] [PATCH 00/29] Rework the functionality test(s)

2016-01-06 Thread Emil Velikov
Hi all, Recently I had the chance to finish a lenghty series started some months ago. Namely - rework gl_basic_tests and kick waffle_test out the door. It starts with a couple of symbol fixes (maint material afaict), caught while experimenting with Travis-CI. Patch 3 adds a trivial --platform

[waffle] [PATCH 08/29] tests/gl_basic: add test_glXX_fwdcompat() macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 66 ++-- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index a14ce32..9ccf822 100644 --- a/tests/functional/

[waffle] [PATCH 05/29] tests/gl_basic: use actual/expect arrays for the pixel storage

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index c95ae39..55d078d 100644 --- a/tests/functional/gl_basic_test

[waffle] [PATCH 07/29] tests/gl_basic: add test_glXX() macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 192 +++ 1 file changed, 73 insertions(+), 119 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 03c4a0b..a14ce32 100644 --- a/tests/functional

[waffle] [PATCH 03/29] tests/gl_basic: introduce --platform param

2016-01-06 Thread Emil Velikov
From: Emil Velikov This will allow us to selectively run the tests we want, and even run the sets in parallel. Fixes #33: https://github.com/waffle-gl/waffle/issues/33 Signed-off-by: Emil Velikov --- tests/functional/CMakeLists.txt | 51 +-- tests/functional/gl_basic_test.c | 193 +++

[waffle] [PATCH 09/29] tests/gl_basic: add test_glXX_core() test macro

2016-01-06 Thread Emil Velikov
... and use it to minimise the duplication across the file. Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 168 --- 1 file changed, 52 insertions(+), 116 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basi

[waffle] [PATCH 06/29] tests/gl_basic: add test_XX_rgb{,a} macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 141 --- 1 file changed, 56 insertions(+), 85 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 55d078d..03c4a0b 100644 --- a/tests/functional/

[waffle] [PATCH 01/29] wayland: add wl_proxy_create wrapper

2016-01-06 Thread Emil Velikov
libwayland has broken its ABI by replacing wl_proxy_create + wl_proxy_marshal with wfl_wl_proxy_marshal_constructor with commit 853c24e6998(client: Introduce functions to allocate and marshal proxies atomically). Add the wrapper to keep compatibility with wayland 1.3.90 and earlier. Signed-off-by

[waffle] [PATCH 12/29] tests/gl_basic: add test_glesXX() macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 93 1 file changed, 36 insertions(+), 57 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index f753276..10b9c71 100644 --- a/tests/functional/

[waffle] [PATCH 13/29] tests/gl_basic: add test_XX_fwdcompat() macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 86 1 file changed, 34 insertions(+), 52 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 10b9c71..5e6b518 100644 --- a/tests/functional/

[waffle] [PATCH 11/29] tests/gl_basic: add test_glXX_compat() macro

2016-01-06 Thread Emil Velikov
... and use it to minimise the duplication across the file. Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 170 --- 1 file changed, 52 insertions(+), 118 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basi

[waffle] [PATCH 04/29] tests/gl_basic: fold ifndef _WIN32 blocks

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index d19b8ae..c95ae39 100644 --- a/tests/functional/gl_basic_test.c +++ b/tests/function

[waffle] [PATCH 14/29] tests/gl_basic: add test_gl_debug() macro

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 5e6b518..d151d44 100644 --- a/tests/functional/gl_bas

[waffle] [PATCH 16/29] cmocka: fix the build for the new version

2016-01-06 Thread Emil Velikov
XXX: should we squash this with the previous commit ? Signed-off-by: Emil Velikov --- cmake/Modules/WaffleCMocka.cmake | 15 ++- cmake/Modules/WaffleDefineCompilerFlags.cmake | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/WaffleCMoc

[waffle] [PATCH 20/29] tests/gl_basic: disable tests, convert to cmocka step 1

2016-01-06 Thread Emil Velikov
Use cmocka macros and rework gl_basic_{init,fini}, by keeping track of the state and tearing things down as needed. Nuke the (no longer to be used) run_testsuite(). Signed-off-by: Emil Velikov --- tests/functional/CMakeLists.txt | 2 +- tests/functional/gl_basic_test.c | 336

[waffle] [PATCH 10/29] tests/gl_basic: add test_glXX_core_fwdcompat() test macro

2016-01-06 Thread Emil Velikov
... and use it to minimise the duplication across the file. Add the equivalent CGL test while we're here :) Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tests/functional/gl_

[waffle] [PATCH 02/29] gbm: don't fetch gbm_bo_* symbols from libgbm

2016-01-06 Thread Emil Velikov
Neither one of these is (or has been) used. Remove them for now and introduce back when needed. Presently this causes run-time issues whenever someone attempts to use an old version of libgbm (mesa circa 9.2) as the gbm_bo_get_fd symbol is missing. Due to the multiple gbm provides and their incon

[waffle] [PATCH 17/29] UPSTREAM: cmocka: include strings.h for strcasecmp

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- third_party/cmocka/src/cmocka.c | 4 1 file changed, 4 insertions(+) diff --git a/third_party/cmocka/src/cmocka.c b/third_party/cmocka/src/cmocka.c index fc83b57..2a63f82 100644 --- a/third_party/cmocka/src/cmocka.c +++ b/third_party/cmocka/src/cmocka.c @@ -3

[waffle] [PATCH 18/29] core: convert unittests to new cmocka API

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/core/wcore_attrib_list_unittest.c | 40 +-- src/waffle/core/wcore_config_attrs_unittest.c | 18 src/waffle/core/wcore_error_unittest.c| 26 - 3 files changed, 45 insertions(+), 39 deletions(-)

[waffle] [PATCH 27/29] tests/gl_basic: enable cgl

2016-01-06 Thread Emil Velikov
From: Emil Velikov With this patch in place, all the existing tests are fully converted to cmocka. With this in place, one can get a 'clean bill of health' according to valgrind. The odd remaining memory leak(s) are likely due to the driver. Fixes #35: https://github.com/waffle-gl/waffle/issues

[waffle] [PATCH 24/29] tests/gl_basic: enable x11_egl

2016-01-06 Thread Emil Velikov
From: Emil Velikov Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 66 1 file changed, 6 insertions(+), 60 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index c4faa11..9a2bfff 100644 ---

[waffle] [PATCH 29/29] tests/gl_basic: call waffle_error_get_code() less often

2016-01-06 Thread Emil Velikov
From: Emil Velikov There is no need to (potentially) call the function twice in a roll, as there are no waffle calls inbetween that can trigger a change. Use a switch (as opposed to if-else 'spaghetti'), which has the benefit of slightly improved readability. While we're here, fix the copy/past

[waffle] [PATCH 25/29] tests/gl_basic: enable wgl

2016-01-06 Thread Emil Velikov
From: Emil Velikov Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 67 +++- 1 file changed, 5 insertions(+), 62 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 9a2bfff..970f299 100644 ---

[waffle] [PATCH 28/29] tests/gl_basic: add support for GBM platform

2016-01-06 Thread Emil Velikov
From: Emil Velikov This way we can also run waffle's tests through headless CI ;-) Fixes #34: https://github.com/waffle-gl/waffle/issues/34 Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git

[waffle] [PATCH 22/29] tests/gl_basic: setup CREATE_TESTSUITE macro and enable glx

2016-01-06 Thread Emil Velikov
From: Emil Velikov Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 140 ++- 1 file changed, 80 insertions(+), 60 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 75d9c20..283489c 100644 --

[waffle] [PATCH 23/29] tests/gl_basic: enable wayland

2016-01-06 Thread Emil Velikov
From: Emil Velikov Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 67 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 283489c..c4faa11 100644 ---

[waffle] [PATCH 19/29] core: wcore_error_reset() after calloc()

2016-01-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/core/wcore_config_attrs_unittest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/waffle/core/wcore_config_attrs_unittest.c b/src/waffle/core/wcore_config_attrs_unittest.c index e6a2af0..14eec01 100644 --- a/src/waffle/core/

[waffle] [PATCH 26/29] tests/gl_basic: reshuffle the cgl tests

2016-01-06 Thread Emil Velikov
From: Emil Velikov During context setup we prioritise as follows 1. expected error (!= NO_ERROR), check it 2. otherwise (if call fails) check for a) UNSUPPORTED_ON_PLATFORM and b) ERROR_UNKNOWN (winsys implementation has rejected the request) and skip the test. If other error is returned, f

[waffle] [PATCH 21/29] waffle_test: bye bye

2016-01-06 Thread Emil Velikov
No longer used/needed. Signed-off-by: Emil Velikov --- .gitignore | 1 - include/waffle_test/priv/wt_runner.h | 46 include/waffle_test/priv/wt_test.h | 52 - include/waffle_test/waffle_test.h| 76 - src/CMakeLists.txt

Re: [waffle] [PATCH v2 1/4] wflinfo.c: split out flags struct

2016-01-06 Thread Emil Velikov
On 5 January 2016 at 19:46, wrote: > From: Dylan Baker > > This is groundwork for adding a json interface to wflinfo. > > v2: - remove extra return statement (Frank) > - rename flags to context_flags (Chad) > --- > src/utils/wflinfo.c | 33 + > 1 file changed

Re: [waffle] [PATCH v2 3/4] wflinfo.c: split version, renderer, and vendor checks

2016-01-06 Thread Emil Velikov
On 5 January 2016 at 19:46, wrote: > From: Dylan Baker > > Pull these out into helper functions, this change will be used in a > following patch to add a JSON printer. > > Signed-off-by: Dylan Baker > > v2: - change "const char * name" to "const char *name" (Frank) > --- > src/utils/wflinfo.c

Re: [waffle] [PATCH 02/29] gbm: don't fetch gbm_bo_* symbols from libgbm

2016-01-06 Thread Frank Henigman
On Wed, Jan 6, 2016 at 4:27 PM, Emil Velikov wrote: > Neither one of these is (or has been) used. Remove them for now and > introduce back when needed. > > Presently this causes run-time issues whenever someone attempts to use an > old version of libgbm (mesa circa 9.2) as the gbm_bo_get_fd symbol

Re: [waffle] [PATCH v2 3/4] wflinfo.c: split version, renderer, and vendor checks

2016-01-06 Thread Dylan Baker
On Wed, Jan 6, 2016 at 1:30 PM, Emil Velikov wrote: > On 5 January 2016 at 19:46, wrote: > > From: Dylan Baker > > > > Pull these out into helper functions, this change will be used in a > > following patch to add a JSON printer. > > > > Signed-off-by: Dylan Baker > > > > v2: - change "const

Re: [waffle] [PATCH 00/12] JSON and platform-specific wflinfo

2016-01-06 Thread Dylan Baker
Hi Frank, It looks like your series is going to achieve the same result (for my use) as mine did, but yours is probably better. With that in mind I'll be withdrawing mine in favour of yours. Dylan On Wed, Jan 6, 2016 at 11:56 AM, Frank Henigman wrote: > This patch set does two main things, the

Re: [waffle] [PATCH 00/12] JSON and platform-specific wflinfo

2016-01-06 Thread Dylan Baker
Okay, I have some comments: When I run wflinfo -p gbm -a gl -f json | jsontidy (a small python script I have that formats JSON to be human readable) I get this: { "generic": { "waffle": { "api": "WAFFLE_CONTEXT_OPENGL", "platform": "WAFFLE_PLATFORM_GBM"

Re: [waffle] [PATCH 00/12] JSON and platform-specific wflinfo

2016-01-06 Thread Frank Henigman
On Wed, Jan 6, 2016 at 6:43 PM, Dylan Baker wrote: > Okay, I have some comments: > > When I run wflinfo -p gbm -a gl -f json | jsontidy (a small python script I > have that formats JSON to be human readable) > I get this: > { > "generic": { > "waffle": { > "api": "WAFFLE_CO

Re: [waffle] [PATCH 00/12] JSON and platform-specific wflinfo

2016-01-06 Thread Dylan Baker
On Wed, Jan 6, 2016 at 4:12 PM, Frank Henigman wrote: > On Wed, Jan 6, 2016 at 6:43 PM, Dylan Baker > wrote: > > Okay, I have some comments: > > > > When I run wflinfo -p gbm -a gl -f json | jsontidy (a small python > script I > > have that formats JSON to be human readable) > > I get this: > >