egl: drop confusing mincore() error message
[mesa.git] / src / egl / main / eglglobals.c
index 71d1fccf75fb879f960696990563298b69985b0c..8a8c03c924fd0f036f52901ce2ceee5fbdc8257c 100644 (file)
@@ -38,7 +38,6 @@
 #include "egldevice.h"
 #include "egldisplay.h"
 #include "egldriver.h"
-#include "egllog.h"
 
 #include "util/macros.h"
 
@@ -70,8 +69,7 @@ struct _egl_global _eglGlobal =
    " EGL_EXT_device_query"
    " EGL_EXT_platform_base"
    " EGL_KHR_client_get_all_proc_addresses"
-   " EGL_KHR_debug"
-   " EGL_MESA_config_select_group",
+   " EGL_KHR_debug",
 
    .PlatformExtensionString =
 #ifdef HAVE_WAYLAND_PLATFORM
@@ -162,10 +160,10 @@ _eglGetClientExtensionString(void)
 EGLBoolean
 _eglPointerIsDereferencable(void *p)
 {
-#ifdef HAVE_MINCORE
    uintptr_t addr = (uintptr_t) p;
-   unsigned char valid = 0;
    const long page_size = getpagesize();
+#ifdef HAVE_MINCORE
+   unsigned char valid = 0;
 
    if (p == NULL)
       return EGL_FALSE;
@@ -174,7 +172,6 @@ _eglPointerIsDereferencable(void *p)
    addr &= ~(page_size - 1);
 
    if (mincore((void *) addr, page_size, &valid) < 0) {
-      _eglLog(_EGL_DEBUG, "mincore failed: %m");
       return EGL_FALSE;
    }
 
@@ -191,6 +188,7 @@ _eglPointerIsDereferencable(void *p)
     */
    return EGL_TRUE;
 #else
-   return p != NULL;
+   // Without mincore(), we just assume that the first page is unmapped.
+   return addr >= page_size;
 #endif
 }