From fd58fb07cf4fcc0553d0608f5688fc03e41ea15c Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Sat, 6 Apr 2013 16:47:32 -0500 Subject: mesa-demos: fix build errors When commit 6d17c9b ('emgd-driver-bin: add pkgconfig files') was added for libva, it exposed some missing EMGD functionality, which it turns out has been fixed by patches submitted or accepted upstream (see the individual patches for details). This adds those patches to get around the build problems when building with EMGD 1.16. Fixes [YOCTO #3469] for meta-intel (EMGD). Signed-off-by: Tom Zanussi --- ...glgears-Make-EGL_KHR_image-usage-portable.patch | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 common/recipes-graphics/mesa/mesa-demos/0001-xeglgears-Make-EGL_KHR_image-usage-portable.patch (limited to 'common/recipes-graphics/mesa/mesa-demos/0001-xeglgears-Make-EGL_KHR_image-usage-portable.patch') diff --git a/common/recipes-graphics/mesa/mesa-demos/0001-xeglgears-Make-EGL_KHR_image-usage-portable.patch b/common/recipes-graphics/mesa/mesa-demos/0001-xeglgears-Make-EGL_KHR_image-usage-portable.patch new file mode 100644 index 00000000..43d4fb1d --- /dev/null +++ b/common/recipes-graphics/mesa/mesa-demos/0001-xeglgears-Make-EGL_KHR_image-usage-portable.patch @@ -0,0 +1,95 @@ +From 43c2122af1caa750531f29bf734c03d1f50801d1 Mon Sep 17 00:00:00 2001 +Message-Id: <43c2122af1caa750531f29bf734c03d1f50801d1.1365283761.git.tom.zanussi@linux.intel.com> +From: Frank Binns +Date: Fri, 29 Jun 2012 14:06:27 +0100 +Subject: [PATCH] xeglgears: Make EGL_KHR_image usage portable + +EGL extension functions don't have to be exported which means +xeglgears was failing to link against implementations that +support EGL_KHR_image but were not exporting its related functions. + +This has been fixed by using eglGetProcAddress to get a function +pointer instead of using the functions prototype. This is portable. + +Signed-off-by: Frank Binns + +Integrated-by: Tom Zanussi + +Upstream-Status: Backport +--- + src/egl/opengl/xeglgears.c | 37 +++++++++++++++++++++++++++++++------ + 1 file changed, 31 insertions(+), 6 deletions(-) + +diff --git a/src/egl/opengl/xeglgears.c b/src/egl/opengl/xeglgears.c +index 513c587..866b89a 100644 +--- a/src/egl/opengl/xeglgears.c ++++ b/src/egl/opengl/xeglgears.c +@@ -51,6 +51,10 @@ + static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES_func; + #endif + ++#ifdef EGL_KHR_image ++static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR_func; ++#endif ++ + + #define BENCHMARK + +@@ -405,6 +409,17 @@ egl_manager_new(EGLNativeDisplayType xdpy, const EGLint *attrib_list, + eglGetProcAddress("glEGLImageTargetTexture2DOES"); + #endif + ++#ifdef EGL_KHR_image ++ eglCreateImageKHR_func = (PFNEGLCREATEIMAGEKHRPROC) ++ eglGetProcAddress("eglCreateImageKHR"); ++ if (eglCreateImageKHR_func == NULL) { ++ printf("failed to get eglCreateImageKHR\n"); ++ eglTerminate(eman->dpy); ++ free(eman); ++ return NULL; ++ } ++#endif ++ + return eman; + } + +@@ -850,10 +865,16 @@ main(int argc, char *argv[]) + case GEARS_PIXMAP: + case GEARS_PIXMAP_TEXTURE: + ret = egl_manager_create_pixmap(eman, eman->xwin, EGL_TRUE, NULL); ++ ++#ifdef EGL_KHR_image + if (surface_type == GEARS_PIXMAP_TEXTURE) +- eman->image = eglCreateImageKHR (eman->dpy, eman->ctx, +- EGL_NATIVE_PIXMAP_KHR, +- (EGLClientBuffer) eman->xpix, NULL); ++ eman->image = eglCreateImageKHR_func(eman->dpy, eman->ctx, ++ EGL_NATIVE_PIXMAP_KHR, ++ (EGLClientBuffer) eman->xpix, NULL); ++#else ++ fprintf(stderr, "EGL_KHR_image not found at compile time.\n"); ++#endif ++ + if (ret) + ret = eglMakeCurrent(eman->dpy, eman->pix, eman->pix, eman->ctx); + break; +@@ -892,9 +913,13 @@ main(int argc, char *argv[]) + GL_RENDERBUFFER_EXT, + color_rb); + +- eman->image = eglCreateImageKHR(eman->dpy, eman->ctx, +- EGL_GL_RENDERBUFFER_KHR, +- (EGLClientBuffer) color_rb, NULL); ++#ifdef EGL_KHR_image ++ eman->image = eglCreateImageKHR_func(eman->dpy, eman->ctx, ++ EGL_GL_RENDERBUFFER_KHR, ++ (EGLClientBuffer) color_rb, NULL); ++#else ++ fprintf(stderr, "EGL_KHR_image not found at compile time.\n"); ++#endif + + glGenRenderbuffers(1, &depth_rb); + glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_rb); +-- +1.7.11.4 + -- cgit v1.2.3-54-g00ecf