diff options
author | Steve Arnold <stephen.arnold42@gmail.com> | 2015-07-27 12:03:53 -0700 |
---|---|---|
committer | Steve Arnold <stephen.arnold42@gmail.com> | 2015-07-27 12:03:53 -0700 |
commit | 4fd33938a41ad61ad0232458b287d1e2b5d31195 (patch) | |
tree | 2a90ceaa984d99bffa173c56d60b97810d575e89 /x11-apps | |
parent | updated armsoc ebuilds with alternate open source upstream (diff) | |
download | arm-4fd33938a41ad61ad0232458b287d1e2b5d31195.tar.gz arm-4fd33938a41ad61ad0232458b287d1e2b5d31195.tar.bz2 arm-4fd33938a41ad61ad0232458b287d1e2b5d31195.zip |
added EGL patch for mesa-progs
Diffstat (limited to 'x11-apps')
-rw-r--r-- | x11-apps/mesa-progs/files/mesa-progs-9999-EGL_MESA_screen_surface-demos.patch | 282 | ||||
-rw-r--r-- | x11-apps/mesa-progs/mesa-progs-9999.ebuild | 94 |
2 files changed, 376 insertions, 0 deletions
diff --git a/x11-apps/mesa-progs/files/mesa-progs-9999-EGL_MESA_screen_surface-demos.patch b/x11-apps/mesa-progs/files/mesa-progs-9999-EGL_MESA_screen_surface-demos.patch new file mode 100644 index 0000000..6f99bc1 --- /dev/null +++ b/x11-apps/mesa-progs/files/mesa-progs-9999-EGL_MESA_screen_surface-demos.patch @@ -0,0 +1,282 @@ +diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c +index 2ee6f15..f6a2ad4 100644 +--- a/src/egl/eglut/eglut.c ++++ b/src/egl/eglut/eglut.c +@@ -76,8 +76,9 @@ _eglutNow(void) + static void + _eglutDestroyWindow(struct eglut_window *win) + { +- if (_eglut->surface_type != EGL_PBUFFER_BIT && +- _eglut->surface_type != EGL_SCREEN_BIT_MESA) ++ ++ if (_eglut->surface_type == EGL_WINDOW_BIT || ++ _eglut->surface_type == EGL_PIXMAP_BIT) + eglDestroySurface(_eglut->dpy, win->surface); + + _eglutNativeFiniWindow(win); +@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h) + win->config, win->native.u.pixmap, NULL); + break; + case EGL_PBUFFER_BIT: ++#ifdef EGL_MESA_screen_surface + case EGL_SCREEN_BIT_MESA: ++#endif + win->surface = win->native.u.surface; + break; + default: +@@ -289,8 +292,10 @@ eglutDestroyWindow(int win) + if (window->index != win) + return; + ++#ifdef EGL_MESA_screen_surface + /* XXX it causes some bug in st/egl KMS backend */ + if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA) ++#endif + eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + + _eglutDestroyWindow(_eglut->current); +diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c +index 021a8f1..094a4e2 100644 +--- a/src/egl/eglut/eglut_screen.c ++++ b/src/egl/eglut/eglut_screen.c +@@ -35,26 +35,33 @@ + + #define MAX_MODES 100 + ++#ifdef EGL_MESA_screen_surface + static EGLScreenMESA kms_screen; + static EGLModeMESA kms_mode; + static EGLint kms_width, kms_height; ++#endif + + void + _eglutNativeInitDisplay(void) + { ++#ifdef EGL_MESA_screen_surface + _eglut->native_dpy = EGL_DEFAULT_DISPLAY; + _eglut->surface_type = EGL_SCREEN_BIT_MESA; ++#endif + } + + void + _eglutNativeFiniDisplay(void) + { ++#ifdef EGL_MESA_screen_surface + kms_screen = 0; + kms_mode = 0; + kms_width = 0; + kms_height = 0; ++#endif + } + ++#ifdef EGL_MESA_screen_surface + static void + init_kms(void) + { +@@ -94,19 +101,23 @@ init_kms(void) + kms_width = width; + kms_height = height; + } ++#endif + + void + _eglutNativeInitWindow(struct eglut_window *win, const char *title, + int x, int y, int w, int h) + { ++#ifdef EGL_MESA_screen_surface + EGLint surf_attribs[16]; + EGLint i; ++#endif + const char *exts; + + exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS); + if (!exts || !strstr(exts, "EGL_MESA_screen_surface")) + _eglutFatal("EGL_MESA_screen_surface is not supported\n"); + ++#ifdef EGL_MESA_screen_surface + init_kms(); + + i = 0; +@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title, + + win->native.width = kms_width; + win->native.height = kms_height; ++#endif + } + + void + _eglutNativeFiniWindow(struct eglut_window *win) + { ++#ifdef EGL_MESA_screen_surface + eglShowScreenSurfaceMESA(_eglut->dpy, + kms_screen, EGL_NO_SURFACE, 0); + eglDestroySurface(_eglut->dpy, win->native.u.surface); ++#endif + } + + void +diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c +index d892734..3a3564c 100644 +--- a/src/egl/opengl/demo1.c ++++ b/src/egl/opengl/demo1.c +@@ -18,6 +18,7 @@ + static void + TestScreens(EGLDisplay dpy) + { ++#ifdef EGL_MESA_screen_surface + #define MAX 8 + EGLScreenMESA screens[MAX]; + EGLint numScreens; +@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy) + for (i = 0; i < numScreens; i++) { + printf(" Screen %d handle: %d\n", i, (int) screens[i]); + } ++#endif + } + + /** +diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c +index 71a1a31..209cb4f 100644 +--- a/src/egl/opengl/demo2.c ++++ b/src/egl/opengl/demo2.c +@@ -16,6 +16,7 @@ + + /*#define FRONTBUFFER*/ + ++#ifdef EGL_MESA_screen_surface + static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, + GLfloat r, GLfloat g, GLfloat b) + { +@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy) + printf(" Screen %d handle: %d\n", i, (int) screens[i]); + } + } +- ++#endif + + int + main(int argc, char *argv[]) + { + int maj, min; ++#ifdef EGL_MESA_screen_surface + EGLContext ctx; + EGLSurface pbuffer, screen_surf; + EGLConfig configs[10]; +@@ -115,6 +117,7 @@ main(int argc, char *argv[]) + EGLModeMESA mode; + EGLScreenMESA screen; + EGLint count; ++#endif + + EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); + assert(d); +@@ -132,6 +135,7 @@ main(int argc, char *argv[]) + exit(1); + } + ++#ifdef EGL_MESA_screen_surface + eglGetConfigs(d, configs, 10, &numConfigs); + printf("Got %d EGL configs:\n", numConfigs); + for (i = 0; i < numConfigs; i++) { +@@ -211,6 +215,7 @@ main(int argc, char *argv[]) + eglDestroySurface(d, pbuffer); + eglDestroyContext(d, ctx); + eglTerminate(d); ++#endif + + return 0; + } +diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c +index f84ca23..31b5d8b 100644 +--- a/src/egl/opengl/demo3.c ++++ b/src/egl/opengl/demo3.c +@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = { + 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00, + }; + +- ++#ifdef EGL_MESA_screen_surface + static void Init(void) + { + +@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height) + fclose(f); + } + } ++#endif + + int + main(int argc, char *argv[]) + { + int maj, min; ++#ifdef EGL_MESA_screen_surface + EGLContext ctx; + EGLSurface screen_surf; + EGLConfig configs[10]; +@@ -566,6 +568,7 @@ main(int argc, char *argv[]) + const GLubyte *bitmap; + EGLint screenAttribs[32]; + EGLint i; ++#endif + + EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); + assert(d); +@@ -583,6 +586,7 @@ main(int argc, char *argv[]) + exit(1); + } + ++#ifdef EGL_MESA_screen_surface + eglGetConfigs(d, configs, 10, &numConfigs); + eglGetScreensMESA(d, &screen, 1, &count); + eglGetModesMESA(d, screen, &mode, 1, &count); +@@ -642,6 +646,7 @@ main(int argc, char *argv[]) + eglDestroySurface(d, screen_surf); + eglDestroyContext(d, ctx); + eglTerminate(d); ++#endif + + return 0; + } +diff --git a/src/egl/opengl/eglscreen.c b/src/egl/opengl/eglscreen.c +index ba91087..82bb2aa 100644 +--- a/src/egl/opengl/eglscreen.c ++++ b/src/egl/opengl/eglscreen.c +@@ -44,19 +44,20 @@ int + main(int argc, char *argv[]) + { + int maj, min; ++#ifdef EGL_MESA_screen_surface + EGLSurface screen_surf; + EGLConfig configs[MAX_CONFIGS]; + EGLint numConfigs, i; + EGLBoolean b; +- EGLDisplay d; + EGLint screenAttribs[10]; + EGLModeMESA mode[MAX_MODES]; + EGLScreenMESA screen; + EGLint count; + EGLint chosenMode = 0; + EGLint width = 0, height = 0; ++#endif + +- d = eglGetDisplay(EGL_DEFAULT_DISPLAY); ++ EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); + assert(d); + + if (!eglInitialize(d, &maj, &min)) { +@@ -67,6 +68,7 @@ main(int argc, char *argv[]) + printf("eglscreen: EGL version = %d.%d\n", maj, min); + printf("eglscreen: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); + ++#ifdef EGL_MESA_screen_surface + /* XXX use ChooseConfig */ + eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs); + eglGetScreensMESA(d, &screen, 1, &count); +@@ -115,6 +117,7 @@ main(int argc, char *argv[]) + + eglDestroySurface(d, screen_surf); + eglTerminate(d); ++#endif + + return 0; + } diff --git a/x11-apps/mesa-progs/mesa-progs-9999.ebuild b/x11-apps/mesa-progs/mesa-progs-9999.ebuild new file mode 100644 index 0000000..4c2c252 --- /dev/null +++ b/x11-apps/mesa-progs/mesa-progs-9999.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +MY_PN=${PN/progs/demos} +MY_P=${MY_PN}-${PV} +EGIT_REPO_URI="git://anongit.freedesktop.org/${MY_PN/-//}" + +if [[ ${PV} = 9999* ]]; then + GIT_ECLASS="git-r3" + EXPERIMENTAL="true" +fi + +inherit base autotools toolchain-funcs ${GIT_ECLASS} + +DESCRIPTION="Mesa's OpenGL utility and demo programs (glxgears and glxinfo)" +HOMEPAGE="http://mesa3d.sourceforge.net/" +if [[ ${PV} == 9999* ]]; then + SRC_URI="" +else + SRC_URI="ftp://ftp.freedesktop.org/pub/${MY_PN/-//}/${PV}/${MY_P}.tar.bz2" +fi + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux" +IUSE="egl gles1 gles2" + +RDEPEND=" + media-libs/freeglut + media-libs/glew + media-libs/mesa[egl?,gles1?,gles2?] + virtual/opengl + x11-libs/libX11" +DEPEND="${RDEPEND} + virtual/glu + x11-proto/xproto" + +S=${WORKDIR}/${MY_P} +EGIT_CHECKOUT_DIR=${S} + +src_unpack() { + default + [[ $PV = 9999* ]] && git-r3_src_unpack +} + +src_prepare() { + base_src_prepare + + # fix for mesa demos to compile after EGL changes + # Remove when patched upstream (freedesktop.org bug #91020) + epatch "${FILESDIR}"/${P}-EGL_MESA_screen_surface-demos.patch + + eautoreconf +} + +src_compile() { + emake -C src/xdemos glxgears glxinfo + + if use egl; then + emake LDLIBS="-lEGL" -C src/egl/opengl/ eglinfo + emake -C src/egl/eglut/ libeglut_screen.la libeglut_x11.la + emake LDLIBS="-lGL -lEGL -lX11 -lm" -C src/egl/opengl/ eglgears_x11 + emake LDLIBS="-lGL -lEGL -lm" -C src/egl/opengl/ eglgears_screen + + if use gles1; then + emake LDLIBS="-lGLESv1_CM -lEGL -lX11" -C src/egl/opengles1/ es1_info + emake LDLIBS="-lGLESv1_CM -lEGL -lX11 -lm" -C src/egl/opengles1/ gears_x11 + emake LDLIBS="-lGLESv1_CM -lEGL -lm" -C src/egl/opengles1/ gears_screen + fi + if use gles2; then + emake LDLIBS="-lGLESv2 -lEGL -lX11" -C src/egl/opengles2/ es2_info + emake LDLIBS="-lGLESv2 -lEGL -lX11 -lm" -C src/egl/opengles2/ es2gears_x11 + emake LDLIBS="-lGLESv2 -lEGL -lm" -C src/egl/opengles2/ es2gears_screen + fi + fi +} + +src_install() { + dobin src/xdemos/{glxgears,glxinfo} + if use egl; then + dobin src/egl/opengl/egl{info,gears_{screen,x11}} + + if use gles1; then + dobin src/egl/opengles1/es1_info + newbin src/egl/opengles1/gears_screen es1gears_screen + newbin src/egl/opengles1/gears_x11 es1gears_x11 + fi + + use gles2 && dobin src/egl/opengles2/es2{_info,gears_{screen,x11}} + fi +} |