From 6b8accb36b541f77774109ea42533c02bb90bc68 Mon Sep 17 00:00:00 2001 From: Haixia Shi Date: Fri, 12 Jun 2015 10:10:58 -0700 Subject: egl/dri2: implement platform_surfaceless The surfaceless platform is for off-screen rendering only. Render node support is required. Only consider the render nodes. Do not use normal nodes as they require auth hooks. v3: change platform_null to platform_surfaceless v4: make libdrm required for surfaceless v5: remove modified include guards with defined(HAVE_SURFACELESS_PLATFORM) v6: use O_CLOEXEC for drm fd Signed-off-by: Haixia Shi Signed-off-by: Zach Reizner Reviewed-by: Emil Velikov Reviewed-by: Chad Versace --- src/egl/main/Makefile.am | 4 ++++ src/egl/main/egldisplay.c | 3 ++- src/egl/main/egldisplay.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/egl/main') diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am index b6617366c7e..9030d272b53 100644 --- a/src/egl/main/Makefile.am +++ b/src/egl/main/Makefile.am @@ -68,6 +68,10 @@ if HAVE_EGL_PLATFORM_NULL AM_CFLAGS += -DHAVE_NULL_PLATFORM endif +if HAVE_EGL_PLATFORM_SURFACELESS +AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM +endif + if HAVE_EGL_DRIVER_DRI2 AM_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 AM_CFLAGS += -DHAVE_XCB_DRI2 diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index a3ecba8c41e..24a0c7e61a7 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -71,7 +71,8 @@ static const struct { { _EGL_PLATFORM_DRM, "drm" }, { _EGL_PLATFORM_NULL, "null" }, { _EGL_PLATFORM_ANDROID, "android" }, - { _EGL_PLATFORM_HAIKU, "haiku" } + { _EGL_PLATFORM_HAIKU, "haiku" }, + { _EGL_PLATFORM_SURFACELESS, "surfaceless" }, }; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 84cfbe19f7e..0b50a36a098 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -51,6 +51,7 @@ enum _egl_platform_type { _EGL_PLATFORM_NULL, _EGL_PLATFORM_ANDROID, _EGL_PLATFORM_HAIKU, + _EGL_PLATFORM_SURFACELESS, _EGL_NUM_PLATFORMS, _EGL_INVALID_PLATFORM = -1 -- cgit v1.2.3