diff options
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/docs/EGL_MESA_screen_surface | 28 | ||||
-rw-r--r-- | src/egl/main/egllog.c | 41 |
2 files changed, 46 insertions, 23 deletions
diff --git a/src/egl/docs/EGL_MESA_screen_surface b/src/egl/docs/EGL_MESA_screen_surface index 3a11da7ac9..6beb4ce88e 100644 --- a/src/egl/docs/EGL_MESA_screen_surface +++ b/src/egl/docs/EGL_MESA_screen_surface @@ -18,7 +18,7 @@ Status Version - 10 (10 August 2005) + 11 (27 January 2006) Number @@ -127,22 +127,8 @@ Issues isn't always reliable (consider video projectors) but can still be used to determine the pixel aspect ratio. - Arguments for: - - X supports a similar query with DisplayWidthMM(), DisplayHeightMM(). - If this information can be easily queried with EDID, why not - make it available to the user? - - Arguments against: - - Historically, these values aren't always accurate. Also, they're - not always applicable to the display device. - - Other options: - - Perhaps just a pixel aspect ratio should be supported. [M. Danzer] - - Postpone for a future extension, if needed. [A. Jackson] + Resolution: Omit. The EGL 1.2 specification includes queries for + the display resolution and pixel aspect ratio. 6. Should detailed mode timing information be exposed by this API? @@ -222,7 +208,7 @@ Issues 14. What if the physical screen size can't be determined? Should a query of EGL_PHYSICAL_SIZE_MESA return [0,0]? - TBD. + Obsolete: EGL_PHYSICAL_SIZE_MESA not used. 15. Suppose the device's number of RAMDACs is different from the @@ -317,7 +303,6 @@ New Tokens EGL_SCREEN_COUNT_MESA EGL_SCREEN_POSITION_MESA - EGL_PHYSICAL_SIZE_MESA EGL_SCREEN_BIT_MESA EGL_SCREEN_POSITION_GRANULARITY_MESA @@ -488,8 +473,6 @@ Additions to Chapter X of the EGL 1.1 Specification EGL_SCREEN_POSITION_GRANULARITY_MESA Returns the granularity, in pixels, for which the screen position is constrained. - EGL_PHYSICAL_SIZE_MESA Physical width and height of the screen - in millimeters Any other token will generate the error EGL_BAD_ATTRIBUTE. @@ -576,3 +559,6 @@ Version History 10. 10 August 2005 - BrianP Added EGL_SCREEN_POSITION_GRANULARITY_MESA. + 11. 27 January 2006 - BrianP + EGL_PHYSICAL_SIZE_MESA removed since EGL 1.2 has a similar feature. + diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index 59b1d2684e..dc1daaa996 100644 --- a/src/egl/main/egllog.c +++ b/src/egl/main/egllog.c @@ -6,13 +6,44 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "egllog.h" #define MAXSTRING 1000 +#define FALLBACK_LOG_LEVEL _EGL_DEBUG +#define FALLBACK_LOG_LEVEL_STR "debug" +static EGLint ReportingLevel = -1; -/* XXX init this with an env var or something */ -static EGLint ReportingLevel = _EGL_DEBUG; + +static void +log_level_initialize (void) +{ + char *log_env = getenv ("EGL_LOG_LEVEL"); + + if (log_env == NULL) { + ReportingLevel = FALLBACK_LOG_LEVEL; + } + else if (strcasecmp (log_env, "fatal") == 0) { + ReportingLevel = _EGL_FATAL; + } + else if (strcasecmp (log_env, "warning") == 0) { + ReportingLevel = _EGL_WARNING; + } + else if (strcasecmp (log_env, "info") == 0) { + ReportingLevel = _EGL_INFO; + } + else if (strcasecmp (log_env, "debug") == 0) { + ReportingLevel = _EGL_DEBUG; + } + else { + fprintf (stderr, "Unrecognized EGL_LOG_LEVEL environment variable value. " + "Expected one of \"fatal\", \"warning\", \"info\", \"debug\". " + "Got \"%s\". Falling back to \"%s\".\n", + log_env, FALLBACK_LOG_LEVEL_STR); + ReportingLevel = FALLBACK_LOG_LEVEL; + } +} /** @@ -25,6 +56,12 @@ _eglLog(EGLint level, const char *fmtStr, ...) va_list args; char msg[MAXSTRING]; const char *levelStr; + static int log_level_initialized = 0; + + if (!log_level_initialized) { + log_level_initialize (); + log_level_initialized = 1; + } if (level <= ReportingLevel) { switch (level) { |