meson, egl: Support building for the Windows platform

Add a stub EGL driver for Windows
Fix compiler issues in egl/main
Ensure Windows build produces libEGL.dll
Default EGL to enabled for Windows when building a Gallium driver

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
This commit is contained in:
Jesse Natalie
2021-09-01 08:54:13 -07:00
committed by Marge Bot
parent b8a23fa893
commit e76db0f165
8 changed files with 59 additions and 8 deletions

View File

@@ -33,6 +33,7 @@
#include "c99_compat.h"
#include "c11/threads.h"
#include "util/u_thread.h"
#include "util/u_string.h"
#include "egllog.h"
#include "eglcurrent.h"

View File

@@ -35,7 +35,11 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include <fcntl.h>
#include "c11/threads.h"
#include "util/macros.h"
@@ -77,6 +81,7 @@ static const struct {
{ _EGL_PLATFORM_HAIKU, "haiku" },
{ _EGL_PLATFORM_SURFACELESS, "surfaceless" },
{ _EGL_PLATFORM_DEVICE, "device" },
{ _EGL_PLATFORM_WINDOWS, "windows" },
};

View File

@@ -52,6 +52,7 @@ enum _egl_platform_type {
_EGL_PLATFORM_HAIKU,
_EGL_PLATFORM_SURFACELESS,
_EGL_PLATFORM_DEVICE,
_EGL_PLATFORM_WINDOWS,
_EGL_NUM_PLATFORMS,
_EGL_INVALID_PLATFORM = -1

View File

@@ -39,6 +39,7 @@
#include "egldisplay.h"
#include "util/macros.h"
#include "util/os_misc.h"
#ifdef HAVE_MINCORE
#include <unistd.h>
@@ -137,7 +138,8 @@ EGLBoolean
_eglPointerIsDereferencable(void *p)
{
uintptr_t addr = (uintptr_t) p;
const long page_size = getpagesize();
uint64_t page_size = 0;
os_get_page_size(&page_size);
#ifdef HAVE_MINCORE
unsigned char valid = 0;

View File

@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "c11/threads.h"
#include "util/macros.h"
#include "util/u_string.h"