diff options
author | Daniel Díaz <daniel.diaz@linaro.org> | 2017-05-18 13:22:37 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-30 10:15:19 +0100 |
commit | 0c40be9088f2fa2f02d6916a140967c80943fffd (patch) | |
tree | efe3902959e88fde3df55f1854a580cac6e95145 /meta/recipes-graphics | |
parent | 58ca310b625a55dc56980112e51535f29addabb5 (diff) | |
download | poky-0c40be9088f2fa2f02d6916a140967c80943fffd.tar.gz |
piglit: add patches for unbuildable surfaceless Mesa test
Some EGL implementations do not actually ship all Khronos-
extensions. As it turns out, the Mali 450 driver does not
include any of the following symbols, used by the
egl_mesa_platform_surfaceless.c spec test:
* eglGetPlatformDisplay
* eglCreatePlatformPixmapSurface
* eglCreatePlatformWindowSurface
The Right Thing To Do was to obtain the implementation of
these functions (via eglGetProcAddress), as is provided
by their EXT counterparts. These are guaranteed to exist
since they are required by EGL_EXT_platform_base.
Upstream-Status: Submitted [piglit@lists.freedesktop.org]
(From OE-Core rev: 4f85500cfc76407fb4950bbb0df216577aea6bd7)
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
3 files changed, 153 insertions, 0 deletions
diff --git a/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch b/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch new file mode 100644 index 0000000000..734de2bc75 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0002-util-egl-Honour-Surfaceless-MESA-in-get_default_disp.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From aa6728cc4941a87e3933c2aa770ab8ae3080b870 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> | ||
3 | Date: Tue, 16 May 2017 12:37:07 -0500 | ||
4 | Subject: [PATCH 2/4] util/egl: Honour Surfaceless MESA in get_default_display | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> | ||
10 | --- | ||
11 | tests/util/piglit-util-egl.c | 7 +++++++ | ||
12 | 1 file changed, 7 insertions(+) | ||
13 | |||
14 | diff --git a/tests/util/piglit-util-egl.c b/tests/util/piglit-util-egl.c | ||
15 | index 106c735..389fe12 100644 | ||
16 | --- a/tests/util/piglit-util-egl.c | ||
17 | +++ b/tests/util/piglit-util-egl.c | ||
18 | @@ -85,6 +85,7 @@ piglit_egl_get_default_display(EGLenum platform) | ||
19 | static bool has_x11 = false; | ||
20 | static bool has_wayland = false; | ||
21 | static bool has_gbm = false; | ||
22 | + static bool has_surfaceless_mesa = false; | ||
23 | |||
24 | static EGLDisplay (*peglGetPlatformDisplayEXT)(EGLenum platform, void *native_display, const EGLint *attrib_list); | ||
25 | |||
26 | @@ -99,6 +100,7 @@ piglit_egl_get_default_display(EGLenum platform) | ||
27 | has_x11 = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_x11"); | ||
28 | has_wayland = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland"); | ||
29 | has_gbm = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_gbm"); | ||
30 | + has_surfaceless_mesa = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless"); | ||
31 | |||
32 | peglGetPlatformDisplayEXT = (void*) eglGetProcAddress("eglGetPlatformDisplayEXT"); | ||
33 | } | ||
34 | @@ -123,6 +125,11 @@ piglit_egl_get_default_display(EGLenum platform) | ||
35 | return EGL_NO_DISPLAY; | ||
36 | } | ||
37 | break; | ||
38 | + case EGL_PLATFORM_SURFACELESS_MESA: | ||
39 | + if (!has_surfaceless_mesa) { | ||
40 | + return EGL_NO_DISPLAY; | ||
41 | + } | ||
42 | + break; | ||
43 | default: | ||
44 | fprintf(stderr, "%s: unrecognized platform %#x\n", __func__, platform); | ||
45 | return EGL_NO_DISPLAY; | ||
46 | -- | ||
47 | 1.9.1 | ||
48 | |||
diff --git a/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch b/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch new file mode 100644 index 0000000000..7ec71dd91d --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0003-egl_mesa_platform_surfaceless-Don-t-use-eglGetPlatfo.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From b02bdbfdba3464ce47f87c04bcd1d35a8fef3f54 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> | ||
3 | Date: Wed, 17 May 2017 17:53:10 -0500 | ||
4 | Subject: [PATCH 3/4] egl_mesa_platform_surfaceless: Don't use | ||
5 | eglGetPlatformDisplay directly | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> | ||
11 | --- | ||
12 | .../spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
16 | index 3bbd6aa..81a3919 100644 | ||
17 | --- a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
18 | +++ b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
19 | @@ -31,7 +31,7 @@ test_setup(EGLDisplay *dpy) | ||
20 | |||
21 | piglit_require_egl_extension(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless"); | ||
22 | |||
23 | - *dpy = eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, NULL, NULL); | ||
24 | + *dpy = piglit_egl_get_default_display(EGL_PLATFORM_SURFACELESS_MESA); | ||
25 | if (*dpy == EGL_NO_DISPLAY) { | ||
26 | printf("failed to get EGLDisplay\n"); | ||
27 | piglit_report_result(PIGLIT_SKIP); | ||
28 | -- | ||
29 | 1.9.1 | ||
30 | |||
diff --git a/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch b/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch new file mode 100644 index 0000000000..b3931ddf99 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0004-egl_mesa_platform_surfaceless-Use-EXT-functions-for-.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From f3bb10947a87cc3a59619847f53d47708e10fbb7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> | ||
3 | Date: Wed, 17 May 2017 10:51:48 -0500 | ||
4 | Subject: [PATCH 4/4] egl_mesa_platform_surfaceless: Use EXT functions for | ||
5 | surfaces | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | These EXT symbols are guaranteed to exist since they require | ||
11 | EGL_EXT_platform_base. | ||
12 | |||
13 | Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> | ||
14 | --- | ||
15 | .../egl_mesa_platform_surfaceless.c | 23 ++++++++++++++++++++-- | ||
16 | 1 file changed, 21 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
19 | index 81a3919..264ed71 100644 | ||
20 | --- a/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
21 | +++ b/tests/egl/spec/egl_mesa_platform_surfaceless/egl_mesa_platform_surfaceless.c | ||
22 | @@ -24,6 +24,24 @@ | ||
23 | #include "piglit-util.h" | ||
24 | #include "piglit-util-egl.h" | ||
25 | |||
26 | +/* Extension function pointers. | ||
27 | + * | ||
28 | + * Use prefix 'pegl' (piglit egl) instead of 'egl' to avoid collisions with | ||
29 | + * prototypes in eglext.h. */ | ||
30 | +EGLSurface (*peglCreatePlatformPixmapSurfaceEXT)(EGLDisplay display, EGLConfig config, | ||
31 | + NativePixmapType native_pixmap, const EGLint *attrib_list); | ||
32 | +EGLSurface (*peglCreatePlatformWindowSurfaceEXT)(EGLDisplay display, EGLConfig config, | ||
33 | + NativeWindowType native_window, const EGLint *attrib_list); | ||
34 | + | ||
35 | +static void | ||
36 | +init_egl_extension_funcs(void) | ||
37 | +{ | ||
38 | + peglCreatePlatformPixmapSurfaceEXT = (void*) | ||
39 | + eglGetProcAddress("eglCreatePlatformPixmapSurfaceEXT"); | ||
40 | + peglCreatePlatformWindowSurfaceEXT = (void*) | ||
41 | + eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"); | ||
42 | +} | ||
43 | + | ||
44 | static void | ||
45 | test_setup(EGLDisplay *dpy) | ||
46 | { | ||
47 | @@ -72,7 +90,7 @@ test_create_window(void *test_data) | ||
48 | |||
49 | test_setup(&dpy); | ||
50 | |||
51 | - surf = eglCreatePlatformWindowSurface(dpy, EGL_NO_CONFIG_KHR, | ||
52 | + surf = peglCreatePlatformWindowSurfaceEXT(dpy, EGL_NO_CONFIG_KHR, | ||
53 | /*native_window*/ NULL, | ||
54 | /*attrib_list*/ NULL); | ||
55 | if (surf) { | ||
56 | @@ -103,7 +121,7 @@ test_create_pixmap(void *test_data) | ||
57 | |||
58 | test_setup(&dpy); | ||
59 | |||
60 | - surf = eglCreatePlatformPixmapSurface(dpy, EGL_NO_CONFIG_KHR, | ||
61 | + surf = peglCreatePlatformPixmapSurfaceEXT(dpy, EGL_NO_CONFIG_KHR, | ||
62 | /*native_window*/ NULL, | ||
63 | /*attrib_list*/ NULL); | ||
64 | if (surf) { | ||
65 | @@ -205,6 +223,7 @@ main(int argc, char **argv) | ||
66 | piglit_report_result(PIGLIT_FAIL); | ||
67 | } | ||
68 | |||
69 | + init_egl_extension_funcs(); | ||
70 | result = piglit_run_selected_subtests(subtests, selected_names, | ||
71 | num_selected, result); | ||
72 | piglit_report_result(result); | ||
73 | -- | ||
74 | 1.9.1 | ||
75 | |||