diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-08-09 16:16:33 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-08-09 16:46:51 +0200 |
commit | 78891deb16064e840e63209fcbf480b6e6924fae (patch) | |
tree | 358583fe9acdd882d721f3b06e6273b5074cdb4b | |
parent | 14fcf61d4074a2499d6ebf2380ebda0d02a55a9e (diff) |
egl: Log (debug) native platform typeegl-autodetect
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r-- | src/egl/main/egldisplay.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 5421f5fe9a..27399c3b84 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -60,6 +60,17 @@ #include <sys/stat.h> #endif +/* map --with-egl-platforms names to platform types */ +static const struct { + _EGLPlatformType platform; + const char *name; +} egl_platforms[_EGL_NUM_PLATFORMS] = { + { _EGL_PLATFORM_WINDOWS, "gdi" }, + { _EGL_PLATFORM_X11, "x11" }, + { _EGL_PLATFORM_WAYLAND, "wayland" }, + { _EGL_PLATFORM_DRM, "drm" }, + { _EGL_PLATFORM_FBDEV, "fbdev" } +}; /** * Return the native platform by parsing EGL_PLATFORM. @@ -67,17 +78,6 @@ static _EGLPlatformType _eglGetNativePlatformFromEnv(void) { - /* map --with-egl-platforms names to platform types */ - static const struct { - _EGLPlatformType platform; - const char *name; - } egl_platforms[_EGL_NUM_PLATFORMS] = { - { _EGL_PLATFORM_WINDOWS, "gdi" }, - { _EGL_PLATFORM_X11, "x11" }, - { _EGL_PLATFORM_WAYLAND, "wayland" }, - { _EGL_PLATFORM_DRM, "drm" }, - { _EGL_PLATFORM_FBDEV, "fbdev" } - }; _EGLPlatformType plat = _EGL_INVALID_PLATFORM; const char *plat_name; EGLint i; @@ -176,15 +176,22 @@ _EGLPlatformType _eglGetNativePlatform(EGLNativeDisplayType nativeDisplay) { _EGLPlatformType native_platform; + char *detection_method; native_platform = _eglGetNativePlatformFromEnv(); + detection_method = "environment overwrite"; if (native_platform == _EGL_INVALID_PLATFORM) { native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay); + detection_method = "autodetected"; if (native_platform == _EGL_INVALID_PLATFORM) { native_platform = _EGL_NATIVE_PLATFORM; + detection_method = "build-time configuration"; } } + _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)", + egl_platforms[native_platform].name, detection_method); + return native_platform; } |