From 3f9de6ff7dbfc417b50ac27be8461304f0134f91 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 14 May 2008 17:20:25 +0200 Subject: egl: Updated EGL samples to use new i915 EGL winsys --- progs/egl/demo3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'progs/egl/demo3.c') diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c index 9edf7c952b..e9d2180bf0 100644 --- a/progs/egl/demo3.c +++ b/progs/egl/demo3.c @@ -576,7 +576,7 @@ main(int argc, char *argv[]) /* EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); */ - EGLDisplay d = eglGetDisplay(":0"); + EGLDisplay d = eglGetDisplay("!EGL_i915"); assert(d); if (!eglInitialize(d, &maj, &min)) { -- cgit v1.2.3 From d8a693ee49ab2c5699a12f8595be8b8606971dbd Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 28 May 2008 01:16:06 +0200 Subject: egl: Make demo3 compile --- progs/egl/demo3.c | 1 + 1 file changed, 1 insertion(+) (limited to 'progs/egl/demo3.c') diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c index e9d2180bf0..6ea7578793 100644 --- a/progs/egl/demo3.c +++ b/progs/egl/demo3.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include -- cgit v1.2.3 From af540ef3692e2dd047c6355c67b3ba5a99a75395 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Jun 2008 10:11:25 -0600 Subject: egl: updated egl.h include paths --- progs/egl/demo1.c | 4 ++-- progs/egl/demo2.c | 4 ++-- progs/egl/demo3.c | 5 ++++- progs/egl/eglgears.c | 4 ++-- progs/egl/eglinfo.c | 2 +- progs/egl/xeglgears.c | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) (limited to 'progs/egl/demo3.c') diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c index 52673187c4..49b6624538 100644 --- a/progs/egl/demo1.c +++ b/progs/egl/demo1.c @@ -4,8 +4,8 @@ #define EGL_EGLEXT_PROTOTYPES -#include -#include +#include +#include #include #include #include diff --git a/progs/egl/demo2.c b/progs/egl/demo2.c index c95aaafa13..d7283e13bd 100644 --- a/progs/egl/demo2.c +++ b/progs/egl/demo2.c @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include /*#define FRONTBUFFER*/ diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c index 6ea7578793..a6096a257e 100644 --- a/progs/egl/demo3.c +++ b/progs/egl/demo3.c @@ -2,7 +2,10 @@ * Exercise EGL API functions */ -#include +#define EGL_EGLEXT_PROTOTYPES + +#include +#include #include #include #include diff --git a/progs/egl/eglgears.c b/progs/egl/eglgears.c index a004cb7e86..20f6c1ff6e 100644 --- a/progs/egl/eglgears.c +++ b/progs/egl/eglgears.c @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #define MAX_CONFIGS 10 #define MAX_MODES 100 diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c index 442de5d63f..f0fd442990 100644 --- a/progs/egl/eglinfo.c +++ b/progs/egl/eglinfo.c @@ -25,7 +25,7 @@ */ -#include +#include #include #include #include diff --git a/progs/egl/xeglgears.c b/progs/egl/xeglgears.c index 519d4bb692..d5fbc03410 100644 --- a/progs/egl/xeglgears.c +++ b/progs/egl/xeglgears.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #define BENCHMARK -- cgit v1.2.3 From e3734e46850c3cf9a80df32bacae92593a416c14 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 14 Aug 2009 18:05:19 +0800 Subject: egl: Make lookup functions static inline. progs/egl/demo3.c is also changed since it uses an internal function. Signed-off-by: Chia-I Wu --- progs/egl/demo3.c | 2 +- src/egl/main/egldisplay.c | 66 --------------------------- src/egl/main/egldisplay.h | 112 ++++++++++++++++++++++++++++++++-------------- 3 files changed, 79 insertions(+), 101 deletions(-) (limited to 'progs/egl/demo3.c') diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c index a6096a257e..daab62d173 100644 --- a/progs/egl/demo3.c +++ b/progs/egl/demo3.c @@ -551,7 +551,7 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height) } } -#include "../src/egl/main/egldisplay.h" +#include "../../src/egl/main/egldisplay.h" typedef struct fb_display { diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 000db6c69a..7f1c53abf8 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -113,28 +113,6 @@ _eglUnlinkDisplay(_EGLDisplay *dpy) } -/** - * Return the handle of a linked display, or EGL_NO_DISPLAY. - */ -EGLDisplay -_eglGetDisplayHandle(_EGLDisplay *dpy) -{ - return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY); -} - - -/** - * Lookup a handle to find the linked display. - * Return NULL if the handle has no corresponding linked display. - */ -_EGLDisplay * -_eglLookupDisplay(EGLDisplay display) -{ - _EGLDisplay *dpy = (_EGLDisplay *) display; - return dpy; -} - - /** * Find the display corresponding to the specified native display id in all * linked displays. @@ -256,28 +234,6 @@ _eglUnlinkContext(_EGLContext *ctx) } -/** - * Return the handle of a linked context, or EGL_NO_CONTEXT. - */ -EGLContext -_eglGetContextHandle(_EGLContext *ctx) -{ - return (EGLContext) ((ctx && ctx->Display) ? ctx : EGL_NO_CONTEXT); -} - - -/** - * Lookup a handle to find the linked context. - * Return NULL if the handle has no corresponding linked context. - */ -_EGLContext * -_eglLookupContext(EGLContext ctx, _EGLDisplay *dpy) -{ - _EGLContext *context = (_EGLContext *) ctx; - return (context && context->Display) ? context : NULL; -} - - /** * Link a surface to a display and return the handle of the link. * The handle can be passed to client directly. @@ -319,25 +275,3 @@ _eglUnlinkSurface(_EGLSurface *surf) surf->Next = NULL; surf->Display = NULL; } - - -/** - * Return the handle of a linked surface, or EGL_NO_SURFACE. - */ -EGLSurface -_eglGetSurfaceHandle(_EGLSurface *surf) -{ - return (EGLSurface) ((surf && surf->Display) ? surf : EGL_NO_SURFACE); -} - - -/** - * Lookup a handle to find the linked surface. - * Return NULL if the handle has no corresponding linked surface. - */ -_EGLSurface * -_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy) -{ - _EGLSurface *surf = (_EGLSurface *) surface; - return (surf && surf->Display) ? surf : NULL; -} diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 19a4d4e542..e8a3d49d96 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -6,8 +6,9 @@ #endif #include "egltypedefs.h" -#include "eglhash.h" #include "egldefines.h" +#include "eglcontext.h" +#include "eglsurface.h" /** @@ -76,24 +77,6 @@ extern void _eglUnlinkDisplay(_EGLDisplay *dpy); -extern EGLDisplay -_eglGetDisplayHandle(_EGLDisplay *display); - - -extern _EGLDisplay * -_eglLookupDisplay(EGLDisplay dpy); - - -/** - * Return true if the display is linked. - */ -static INLINE EGLBoolean -_eglIsDisplayLinked(_EGLDisplay *dpy) -{ - return (EGLBoolean) (_eglGetDisplayHandle(dpy) != EGL_NO_DISPLAY); -} - - extern _EGLDisplay * _eglFindDisplay(NativeDisplayType nativeDisplay); @@ -114,37 +97,98 @@ extern void _eglUnlinkContext(_EGLContext *ctx); -extern EGLContext -_eglGetContextHandle(_EGLContext *ctx); +extern EGLSurface +_eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy); -extern _EGLContext * -_eglLookupContext(EGLContext ctx, _EGLDisplay *dpy); +extern void +_eglUnlinkSurface(_EGLSurface *surf); /** - * Return true if the context is linked to a display. + * Lookup a handle to find the linked display. + * Return NULL if the handle has no corresponding linked display. + */ +static INLINE _EGLDisplay * +_eglLookupDisplay(EGLDisplay display) +{ + _EGLDisplay *dpy = (_EGLDisplay *) display; + return dpy; +} + + +/** + * Return the handle of a linked display, or EGL_NO_DISPLAY. + */ +static INLINE EGLDisplay +_eglGetDisplayHandle(_EGLDisplay *dpy) +{ + return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY); +} + + +/** + * Return true if the display is linked. */ static INLINE EGLBoolean -_eglIsContextLinked(_EGLContext *ctx) +_eglIsDisplayLinked(_EGLDisplay *dpy) { - return (EGLBoolean) (_eglGetContextHandle(ctx) != EGL_NO_CONTEXT); + return (EGLBoolean) (_eglGetDisplayHandle(dpy) != EGL_NO_DISPLAY); } -extern EGLSurface -_eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy); +/** + * Lookup a handle to find the linked context. + * Return NULL if the handle has no corresponding linked context. + */ +static INLINE _EGLContext * +_eglLookupContext(EGLContext context, _EGLDisplay *dpy) +{ + _EGLContext *ctx = (_EGLContext *) context; + return (ctx && ctx->Display) ? ctx : NULL; +} -extern void -_eglUnlinkSurface(_EGLSurface *surf); +/** + * Return the handle of a linked context, or EGL_NO_CONTEXT. + */ +static INLINE EGLContext +_eglGetContextHandle(_EGLContext *ctx) +{ + return (EGLContext) ((ctx && ctx->Display) ? ctx : EGL_NO_CONTEXT); +} -extern EGLSurface -_eglGetSurfaceHandle(_EGLSurface *); + +/** + * Return true if the context is linked to a display. + */ +static INLINE EGLBoolean +_eglIsContextLinked(_EGLContext *ctx) +{ + return (EGLBoolean) (_eglGetContextHandle(ctx) != EGL_NO_CONTEXT); +} -extern _EGLSurface * -_eglLookupSurface(EGLSurface surf, _EGLDisplay *dpy); +/** + * Lookup a handle to find the linked surface. + * Return NULL if the handle has no corresponding linked surface. + */ +static INLINE _EGLSurface * +_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy) +{ + _EGLSurface *surf = (_EGLSurface *) surface; + return (surf && surf->Display) ? surf : NULL; +} + + +/** + * Return the handle of a linked surface, or EGL_NO_SURFACE. + */ +static INLINE EGLSurface +_eglGetSurfaceHandle(_EGLSurface *surf) +{ + return (EGLSurface) ((surf && surf->Display) ? surf : EGL_NO_SURFACE); +} /** -- cgit v1.2.3