diff -Nru libglvnd-1.0.0/debian/changelog libglvnd-1.0.0/debian/changelog --- libglvnd-1.0.0/debian/changelog 2018-06-05 14:16:05.000000000 +0000 +++ libglvnd-1.0.0/debian/changelog 2018-08-15 06:20:42.000000000 +0000 @@ -1,3 +1,11 @@ +libglvnd (1.0.0-2ubuntu2.2) bionic; urgency=medium + + * rules, libgles2: Add GLESv1 support. (LP: #1782285) + * Always return an error from eglMakeCurrent if EGLDisplay is invalid. + (LP: #1780039) + + -- Timo Aaltonen Wed, 15 Aug 2018 09:20:42 +0300 + libglvnd (1.0.0-2ubuntu2.1) bionic; urgency=medium * control: Drop the alternate depends on lib{egl,glx}-vendor, the diff -Nru libglvnd-1.0.0/debian/control libglvnd-1.0.0/debian/control --- libglvnd-1.0.0/debian/control 2018-06-04 08:17:27.000000000 +0000 +++ libglvnd-1.0.0/debian/control 2018-08-14 14:40:57.000000000 +0000 @@ -23,6 +23,7 @@ libglvnd0 (= ${binary:Version}), libglvnd-core-dev (= ${binary:Version}), libegl1 (= ${binary:Version}), + libgles1 (= ${binary:Version}), libgles2 (= ${binary:Version}), libgl1 (= ${binary:Version}), libglx0 (= ${binary:Version}), @@ -31,10 +32,12 @@ Breaks: libegl1-mesa-dev (<< 18.0.5-0ubuntu0~18.04), libgl1-mesa-dev (<< 18.0.5-0ubuntu0~18.04), + libgles1-mesa-dev (<< 17.0.0~rc3-1), libgles2-mesa-dev (<< 18.0.5-0ubuntu0~18.04), Replaces: libegl1-mesa-dev (<< 18.0.5-0ubuntu0~18.04), libgl1-mesa-dev (<< 18.0.5-0ubuntu0~18.04), + libgles1-mesa-dev (<< 17.0.0~rc3-1), libgles2-mesa-dev (<< 18.0.5-0ubuntu0~18.04), Multi-Arch: same Description: Vendor neutral GL dispatch library -- development files @@ -96,6 +99,24 @@ . This package contains support for EGL. +Package: libgles1 +Architecture: any +Pre-Depends: ${misc:Pre-Depends}, +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + libglvnd0 (= ${binary:Version}), +Replaces: + libgles1-mesa (<< 17.0.0~rc3-1), +Breaks: + libgles1-mesa (<< 17.0.0~rc3-1), +Multi-Arch: same +Description: Vendor neutral GL dispatch library -- GLESv1 support + This is an implementation of the vendor-neutral dispatch layer for + arbitrating OpenGL API calls between multiple vendors on a per-screen basis. + . + This package contains support for GLESv1. + Package: libgles2 Architecture: any Pre-Depends: ${misc:Pre-Depends}, @@ -108,11 +129,11 @@ Breaks: libgles2-mesa (<< 18.0.5-0ubuntu0~18.04), Multi-Arch: same -Description: Vendor neutral GL dispatch library -- GLES support +Description: Vendor neutral GL dispatch library -- GLESv2 support This is an implementation of the vendor-neutral dispatch layer for arbitrating OpenGL API calls between multiple vendors on a per-screen basis. . - This package contains support for GLES. + This package contains support for GLESv2. Package: libgl1 Architecture: any diff -Nru libglvnd-1.0.0/debian/libgles1.install libglvnd-1.0.0/debian/libgles1.install --- libglvnd-1.0.0/debian/libgles1.install 1970-01-01 00:00:00.000000000 +0000 +++ libglvnd-1.0.0/debian/libgles1.install 2018-08-10 11:13:11.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/libGLESv1*.so.* diff -Nru libglvnd-1.0.0/debian/libgles2.install libglvnd-1.0.0/debian/libgles2.install --- libglvnd-1.0.0/debian/libgles2.install 2018-01-25 14:31:11.000000000 +0000 +++ libglvnd-1.0.0/debian/libgles2.install 2018-08-10 11:13:11.000000000 +0000 @@ -1 +1 @@ -usr/lib/*/libGLES*.so.* +usr/lib/*/libGLESv2*.so.* diff -Nru libglvnd-1.0.0/debian/patches/Always-return-an-error-from-eglMakeCurrent-if-the-EG.patch libglvnd-1.0.0/debian/patches/Always-return-an-error-from-eglMakeCurrent-if-the-EG.patch --- libglvnd-1.0.0/debian/patches/Always-return-an-error-from-eglMakeCurrent-if-the-EG.patch 1970-01-01 00:00:00.000000000 +0000 +++ libglvnd-1.0.0/debian/patches/Always-return-an-error-from-eglMakeCurrent-if-the-EG.patch 2018-08-14 14:21:19.000000000 +0000 @@ -0,0 +1,76 @@ +From 28e05b934903ac9ea104ddda3ef79e6103ca8456 Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Thu, 22 Feb 2018 11:33:43 -0700 +Subject: [PATCH] Always return an error from eglMakeCurrent if the EGLDispaly + is invalid + +In eglMakeCurrent, check to make sure the EGLDisplay is valid, even if the +context is NULL. + +Fixes https://github.com/NVIDIA/libglvnd/issues/151 +--- + src/EGL/libegl.c | 16 +++++++++------- + tests/testeglmakecurrent.c | 4 ++-- + 2 files changed, 11 insertions(+), 9 deletions(-) + +diff --git a/src/EGL/libegl.c b/src/EGL/libegl.c +index 6586ada..db595f6 100644 +--- a/src/EGL/libegl.c ++++ b/src/EGL/libegl.c +@@ -642,6 +642,15 @@ PUBLIC EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, + + __eglEntrypointCommon(); + ++ // According to the EGL spec, the display handle must be valid, even if ++ // the context is NULL. ++ newDpy = __eglLookupDisplay(dpy); ++ if (newDpy == NULL) { ++ __eglReportError(EGL_BAD_DISPLAY, "eglMakeCurrent", NULL, ++ "Invalid display %p", dpy); ++ return EGL_FALSE; ++ } ++ + if (context == EGL_NO_CONTEXT && (draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE)) { + __eglReportError(EGL_BAD_MATCH, "eglMakeCurrent", NULL, + "Got an EGLSurface but no EGLContext"); +@@ -691,15 +700,8 @@ PUBLIC EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, + } + + if (context != EGL_NO_CONTEXT) { +- newDpy = __eglLookupDisplay(dpy); +- if (newDpy == NULL) { +- __eglReportError(EGL_BAD_DISPLAY, "eglMakeCurrent", NULL, +- "Invalid display %p", dpy); +- return EGL_FALSE; +- } + newVendor = newDpy->vendor; + } else { +- newDpy = NULL; + newVendor = NULL; + } + +diff --git a/tests/testeglmakecurrent.c b/tests/testeglmakecurrent.c +index ec9937e..17169bc 100644 +--- a/tests/testeglmakecurrent.c ++++ b/tests/testeglmakecurrent.c +@@ -188,7 +188,7 @@ void checkIsCurrent(const TestContextInfo *ci) + + void testSwitchContext(const TestContextInfo *oldCi, const TestContextInfo *newCi) + { +- EGLDisplay newDpy = (newCi != NULL ? newCi->dpy : EGL_NO_DISPLAY); ++ EGLDisplay newDpy = (newCi != NULL ? newCi->dpy : oldCi->dpy); + EGLContext newCtx = (newCi != NULL ? newCi->ctx : EGL_NO_CONTEXT); + + if (!eglMakeCurrent(newDpy, EGL_NO_SURFACE, EGL_NO_SURFACE, newCtx)) { +@@ -212,7 +212,7 @@ void testSwitchContext(const TestContextInfo *oldCi, const TestContextInfo *newC + void testSwitchContextFail(const TestContextInfo *oldCi, + const TestContextInfo *newCi, const TestContextInfo *failCi) + { +- EGLDisplay newDpy = (newCi != NULL ? newCi->dpy : EGL_NO_DISPLAY); ++ EGLDisplay newDpy = (newCi != NULL ? newCi->dpy : oldCi->dpy); + EGLContext newCtx = (newCi != NULL ? newCi->ctx : EGL_NO_CONTEXT); + EGLint error; + +-- +2.17.1 + diff -Nru libglvnd-1.0.0/debian/patches/series libglvnd-1.0.0/debian/patches/series --- libglvnd-1.0.0/debian/patches/series 2018-06-04 07:56:39.000000000 +0000 +++ libglvnd-1.0.0/debian/patches/series 2018-08-14 14:21:19.000000000 +0000 @@ -1,2 +1,3 @@ fix-egl-platform-detection-crash.patch kfreebsd-hurd.patch +Always-return-an-error-from-eglMakeCurrent-if-the-EG.patch diff -Nru libglvnd-1.0.0/debian/rules libglvnd-1.0.0/debian/rules --- libglvnd-1.0.0/debian/rules 2018-06-04 07:56:39.000000000 +0000 +++ libglvnd-1.0.0/debian/rules 2018-08-14 14:21:19.000000000 +0000 @@ -7,9 +7,6 @@ dh_auto_install find debian/tmp -name '*.la' -delete - # drop GLESv1 - rm -f debian/tmp/usr/lib/*/libGLESv1* - override_dh_missing: dh_missing --fail-missing