[Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Release previous context's display

2016-08-09 Thread Nicolas Boichat
non-NULL. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97214 Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Reported-by: Alexandr Zelinsky Tested-by: Alexandr Zelinsky Signed-off-by: Nicolas Boichat --- src/egl/drivers/dri2/egl_dri2.c | 6

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Release previous context's display

2016-08-10 Thread Nicolas Boichat
On Wed, Aug 10, 2016 at 9:44 AM, Michel Dänzer wrote: > On 10/08/16 03:00 PM, Nicolas Boichat wrote: >> eglMakeCurrent can also be used to change the active display. In that >> case, we need to decrement ref_count of the previous display (possibly >> destroying it), and inc

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Release previous context's display

2016-08-11 Thread Nicolas Boichat
On Thu, Aug 11, 2016 at 12:10 AM, Nicolas Boichat wrote: > On Wed, Aug 10, 2016 at 9:44 AM, Michel Dänzer wrote: >> On 10/08/16 03:00 PM, Nicolas Boichat wrote: >>> eglMakeCurrent can also be used to change the active display. In that >>> case, we need to decremen

[Mesa-dev] [PATCH v2] egl/dri2: dri2_make_current: Release previous context's display

2016-08-11 Thread Nicolas Boichat
non-NULL. v2: Save the old display before destroying the context. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97214 Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Reported-by: Alexandr Zelinsky Tested-by: Alexandr Zelinsky Signed-off-b

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_initialize: Do not reference-count TestOnly display

2016-08-21 Thread Nicolas Boichat
Hi Emil, On Tue, Aug 16, 2016 at 1:17 AM, Emil Velikov wrote: > Hi Nicolas, > > On 4 August 2016 at 02:51, Nicolas Boichat wrote: >> On Thu, Aug 4, 2016 at 9:38 AM, Michel Dänzer wrote: >>> On 04.08.2016 09:53, Nicolas Boichat wrote: >>>> On Thu, A

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_initialize: Do not reference-count TestOnly display

2016-08-24 Thread Nicolas Boichat
On Tue, Aug 23, 2016 at 9:26 PM, Emil Velikov wrote: > On 22 August 2016 at 07:10, Nicolas Boichat wrote: >> Hi Emil, >> >> On Tue, Aug 16, 2016 at 1:17 AM, Emil Velikov >> wrote: >>> Hi Nicolas, >>> >>> On 4 August 2016 at 02:51, Nicol

[Mesa-dev] [PATCH] gallium/dri: Add shared glapi to LIBADD on Android

2016-07-12 Thread Nicolas Boichat
.so", RTLD_LAZY | RTLD_GLOBAL); dlopen("dri/_dri.so", RTLD_NOW | RTLD_GLOBAL); However, bionic does not respect the RTLD_GLOBAL flag, and the dri library cannot find symbols in libglapi.so, so we need to link to libglapi.so explicitly. Android.mk already does this. Signed-off-by: Tomas

[Mesa-dev] [PATCH] egl/android: Remove unused variables

2016-07-12 Thread Nicolas Boichat
From: Tomasz Figa There are some unused variables left after previous clean-ups triggering compiler warnings. Let's remove them. Signed-off-by: Tomasz Figa --- src/egl/drivers/dri2/platform_android.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/egl/drivers/dri2/platform_android.c

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-07-13 Thread Nicolas Boichat
Gentle ping, any concern about the patch below? On Tue, Jun 7, 2016 at 6:14 PM, Nicolas Boichat wrote: > Without this, if a configuration is, say, available only on GLES2/3, but > not on GLES1, eglMakeCurrent fails with error "EGL_SUCCESS". > > In this patch, we set error t

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-07-13 Thread Nicolas Boichat
Hi, On Wed, Jul 13, 2016 at 11:21 PM, Emil Velikov wrote: > On 7 June 2016 at 11:14, Nicolas Boichat wrote: >> Without this, if a configuration is, say, available only on GLES2/3, but >> not on GLES1, eglMakeCurrent fails with error "EGL_SUCCESS". >> &g

[Mesa-dev] [PATCH v2] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-07-13 Thread Nicolas Boichat
From: Nicolas Boichat Without this, if a configuration is, say, available only on GLES2/3, but not on GLES1, and is rejected by the dri module's bindContext call, eglMakeCurrent fails with error "EGL_SUCCESS". In this patch, we set error to EGL_BAD_MATCH, which is wha

Re: [Mesa-dev] [PATCH v2] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-07-15 Thread Nicolas Boichat
Please ignore this patch, I'll resend along with some slightly improved/annotated EGL error handling. On Thu, Jul 14, 2016 at 12:22 PM, Nicolas Boichat wrote: > From: Nicolas Boichat > > Without this, if a configuration is, say, available only on GLES2/3, but > not on GLES1, a

[Mesa-dev] [PATCH v3] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-07-15 Thread Nicolas Boichat
From: Nicolas Boichat Without this, if a configuration is, say, available only on GLES2/3, but not on GLES1, and is rejected by the dri module's bindContext call, eglMakeCurrent fails with error "EGL_SUCCESS". In this patch, we set error to EGL_BAD_MATCH, which is wha

[Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Make sure display is initialized before using it

2016-07-15 Thread Nicolas Boichat
urf/rsurf are not all NULL. 2. Does not call glFlush/unBindContext is there is no display. 3. However, it still goes through the normal path as drv->API.DestroyContext decrements the reference count on the context, and frees the structure. Cc: "11.2 12.0" Signed-off-by:

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Make sure display is initialized before using it

2016-07-17 Thread Nicolas Boichat
On Fri, Jul 15, 2016 at 9:03 PM, Emil Velikov wrote: > On 15 July 2016 at 09:28, Nicolas Boichat wrote: >> android.opengl.cts.WrapperTest#testGetIntegerv1 CTS test calls >> eglTerminate, followed by eglReleaseThread. In that case, the >> display will not be initialized

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Make sure display is initialized before using it

2016-07-19 Thread Nicolas Boichat
On Mon, Jul 18, 2016 at 4:37 PM, Emil Velikov wrote: > On 18 July 2016 at 04:19, Nicolas Boichat wrote: >> On Fri, Jul 15, 2016 at 9:03 PM, Emil Velikov >> wrote: >>> On 15 July 2016 at 09:28, Nicolas Boichat wrote: >>>> android.opengl.cts.Wrapper

[Mesa-dev] [PATCH] egl/dri2: Add reference count for dri2_egl_display

2016-07-20 Thread Nicolas Boichat
we still need the display vtbl (and possibly an active dri dpy connection). Therefore, we add some reference counter to dri2_egl_display, to make sure the structure is kept allocated as long as it is required. Signed-off-by: Nicolas Boichat --- Replaces https://patchwork.freedesktop.org/patch/9887

Re: [Mesa-dev] [PATCH] egl/dri2: Add reference count for dri2_egl_display

2016-07-20 Thread Nicolas Boichat
On Wed, Jul 20, 2016 at 11:52 PM, Emil Velikov wrote: > On 20 July 2016 at 15:42, Emil Velikov wrote: >> On 20 July 2016 at 09:26, Nicolas Boichat wrote: >>> android.opengl.cts.WrapperTest#testGetIntegerv1 CTS test calls >>> eglTerminate, followed by eglRelea

[Mesa-dev] [PATCH v2] egl/dri2: Add reference count for dri2_egl_display

2016-07-21 Thread Nicolas Boichat
eglTerminate was called with a current context), however, this seems to meet the EGL spec quite well, and does not permanently leak any context/display even for incorrectly written apps. Signed-off-by: Nicolas Boichat Reviewed-by: Eric Engestrom --- src/egl/drivers/dri2/egl

Re: [Mesa-dev] [PATCH] egl/dri2: Add reference count for dri2_egl_display

2016-07-21 Thread Nicolas Boichat
On Thu, Jul 21, 2016 at 10:51 PM, Emil Velikov wrote: > On 21 July 2016 at 01:44, Nicolas Boichat wrote: >> On Wed, Jul 20, 2016 at 11:52 PM, Emil Velikov >> wrote: >>> On 20 July 2016 at 15:42, Emil Velikov wrote: >>>> On 20 July 2

[Mesa-dev] [PATCH] egl/dri2: dri2_initialize: Do not reference-count TestOnly display

2016-08-03 Thread Nicolas Boichat
@egl_khr_fence_sync@conformance. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Reported-by: Michel Dänzer Signed-off-by: Nicolas Boichat --- Compile-tested only, please give it a spin, thanks! src/egl/drivers/dri2/egl_d

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_initialize: Do not reference-count TestOnly display

2016-08-03 Thread Nicolas Boichat
On Thu, Aug 4, 2016 at 12:22 AM, Martin Peres wrote: > > > On 03/08/16 16:54, Nicolas Boichat wrote: >> >> In the case where dri2_initialize is called with a TestOnly display, >> the display is not actually initialized, so dri2_egl_display always >> fails, and we

Re: [Mesa-dev] [PATCH] egl/dri2: dri2_initialize: Do not reference-count TestOnly display

2016-08-03 Thread Nicolas Boichat
On Thu, Aug 4, 2016 at 9:38 AM, Michel Dänzer wrote: > On 04.08.2016 09:53, Nicolas Boichat wrote: >> On Thu, Aug 4, 2016 at 12:22 AM, Martin Peres >> wrote: >>> On 03/08/16 16:54, Nicolas Boichat wrote: >>>> >>>> In the case where dri2_initia

[Mesa-dev] [PATCH 0/4] egl/*: Set disp->DriverData to NULL on error

2016-08-03 Thread Nicolas Boichat
eas to untangle this are welcome. In the mean time, this patch series should fix crashes and a piglit test. Nicolas Boichat (4): egl/wayland: Set disp->DriverData to NULL on error egl/surfaceless: Set disp->DriverData to NULL on error egl/drm: Set disp->DriverData to NULL on error egl/a

[Mesa-dev] [PATCH 4/4] egl/android: Set dpy->DriverData to NULL on error

2016-08-03 Thread Nicolas Boichat
Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Signed-off-by: Nicolas Boichat --- src/egl/drivers/dri2/platform_android.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/egl/drivers/dri2/platform_android.c

[Mesa-dev] [PATCH 3/4] egl/drm: Set disp->DriverData to NULL on error

2016-08-03 Thread Nicolas Boichat
Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Signed-off-by: Nicolas Boichat --- src/egl/drivers/dri2/platform_drm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/e

[Mesa-dev] [PATCH 1/4] egl/wayland: Set disp->DriverData to NULL on error

2016-08-03 Thread Nicolas Boichat
Avoid use-after-free, fix spec@egl_khr_fence_sync@conformance. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Reported-by: Michel Dänzer Signed-off-by: Nicolas Boichat --- src/egl/drivers/dri2/platform_wayland.c | 2 ++ 1 file changed, 2 insertion

[Mesa-dev] [PATCH 2/4] egl/surfaceless: Set disp->DriverData to NULL on error

2016-08-03 Thread Nicolas Boichat
Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Signed-off-by: Nicolas Boichat --- src/egl/drivers/dri2/platform_surfaceless.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/egl/drivers/dri2/platform_surfaceles

Re: [Mesa-dev] [PATCH] egl/x11: avoid using freed memory if dri2 init fails

2016-08-03 Thread Nicolas Boichat
=4841==by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2) > ==4841==by 0x402E59: main > > Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0...@gmail.com> Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Reviewe

Re: [Mesa-dev] [PATCH 0/4] egl/*: Set disp->DriverData to NULL on error

2016-08-04 Thread Nicolas Boichat
On Thu, Aug 4, 2016 at 5:52 PM, Martin Peres wrote: > On 04/08/16 05:07, Nicolas Boichat wrote: >> >> egl/x11 fixup has already be sent here: >> https://patchwork.freedesktop.org/patch/101934/ >> >> Compile-tested only (on android only). >> >> I was

Re: [Mesa-dev] [PATCH 0/4] egl/*: Set disp->DriverData to NULL on error

2016-08-04 Thread Nicolas Boichat
On Thu, Aug 4, 2016 at 7:17 PM, Martin Peres wrote: > > > On 04/08/16 13:08, Nicolas Boichat wrote: >> >> On Thu, Aug 4, 2016 at 5:52 PM, Martin Peres >> wrote: >>> >>> On 04/08/16 05:07, Nicolas Boichat wrote: >>>> >

Re: [Mesa-dev] [PATCH 0/4] egl/*: Set disp->DriverData to NULL on error

2016-08-04 Thread Nicolas Boichat
On Thu, Aug 4, 2016 at 10:43 PM, Martin Peres wrote: > > > On 04/08/16 15:17, Nicolas Boichat wrote: >> >> On Thu, Aug 4, 2016 at 7:17 PM, Martin Peres >> wrote: >>> >>> >>> >>> On 04/08/16 13:08, Nicolas Boichat wrote: >>

Re: [Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

2016-05-27 Thread Nicolas Boichat
Hi Emil, Took us some time to clean things up, but we got an ebuild and repo to share with you. On Tue, May 24, 2016 at 10:52 PM, Emil Velikov wrote: [snip] >> We also set PKGCONFIG="false", because, well, we do not have .pc files >> for Android libs. We _could_ create them manually, though, > A

[Mesa-dev] [PATCH] egl/dri2: dri2_make_current: Set EGL error if bindContext fails

2016-06-07 Thread Nicolas Boichat
Without this, if a configuration is, say, available only on GLES2/3, but not on GLES1, eglMakeCurrent fails with error "EGL_SUCCESS". In this patch, we set error to EGL_BAD_MATCH, which is what CTS/dEQP dEQP-EGL.functional.surfaceless_context expect. Signed-off-by: Nicolas Boichat --

Re: [Mesa-dev] [PATCH 3/4] configure.ac: remove unused Android specifics

2017-06-08 Thread Nicolas Boichat
ne gone we >> no longer need the host detection. >> >> Cc: Chad Versace >> Cc: Nicolas Boichat >> Signed-off-by: Emil Velikov >> --- >> configure.ac | 6 -- >> 1 file changed, 6 deletions(-) > > Since it's not used, then kill it.

[Mesa-dev] [PATCH] configure.ac: Also match -androideabi tuple

2017-05-04 Thread Nicolas Boichat
From: Nicolas Boichat On ARM Android platforms, the host_os tuple should be linux-androideabi, so let's match both -android and -androideabi (or any other -android* tuple) to determine if we should do an Android build. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [Mesa-dev] [PATCH 2/3] egl/android: Cancel any outstanding ANativeBuffer in surface destructor

2017-05-04 Thread Nicolas Boichat
rom SurfaceFlinger > (ANativeWindow::dequeueBuffer) but before EGL has released it > (ANativeWindow::enqueueBuffer). > > This patch is part of a series for fixing > android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface > on Chrome OS x86 devices. > > Cc: Tomasz

[Mesa-dev] [PATCH] egl/android: Set EGLSurface.Lost to EGL_TRUE/EGL_FALSE

2017-05-04 Thread Nicolas Boichat
Lost is an EGLBoolean, so we should assign it to EGL_TRUE/EGL_FALSE, not true/false. Fixes: e5eace58684 ("egl/android: Mark surface as lost when dequeueBuffer fails") Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor") --- src/egl/drivers/dri2/platform

Re: [Mesa-dev] [PATCH] configure.ac: Also match -androideabi tuple

2017-05-08 Thread Nicolas Boichat
On Mon, May 8, 2017 at 9:19 PM, Emil Velikov wrote: > On 5 May 2017 at 23:40, Chad Versace wrote: >> On Fri 05 May 2017, Nicolas Boichat wrote: >>> From: Nicolas Boichat >>> >>> On ARM Android platforms, the host_os tuple should be linux-androideabi,

[Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

2016-04-28 Thread Nicolas Boichat
Add support for EGL android platform. Also, detect when --host finishes with -android. In that case, we do not set _GNU_SOURCE, and define autoconf symbol HAVE_ANDROID, so that Android-specific workarounds can be applied. Signed-off-by: Nicolas Boichat --- configure.ac| 10

[Mesa-dev] [PATCH 2/2] mesa: dri: Add shared glapi to LIBADD on Android

2016-04-28 Thread Nicolas Boichat
D_LAZY | RTLD_GLOBAL); dlopen("dri/_dri.so", RTLD_NOW | RTLD_GLOBAL); However, bionic does not respect the RTLD_GLOBAL flag, and the dri library cannot find symbols in libglapi.so, so we need to link to libglapi.so explicitly. Android.mk already does this. Signed-off-by: Nicolas Boic

Re: [Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

2016-05-22 Thread Nicolas Boichat
at 10:36 PM, Emil Velikov wrote: > Hi Nicolas, > > On 28 April 2016 at 11:41, Nicolas Boichat wrote: >> Add support for EGL android platform. >> >> Also, detect when --host finishes with -android. In that case, we >> do not set _GNU_SOURCE, and define autoconf s

Re: [Mesa-dev] [PATCH 2/2] mesa: dri: Add shared glapi to LIBADD on Android

2016-05-22 Thread Nicolas Boichat
On Thu, Apr 28, 2016 at 10:41 PM, Emil Velikov wrote: > On 28 April 2016 at 11:41, Nicolas Boichat wrote: >> /system/vendor/lib/dri/*_dri.so actually depend on libglapi: without >> this, loading the so file fails with: >> cannot locate symbol "__emutls_v._glapi_tls_Con

Re: [Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

2016-05-23 Thread Nicolas Boichat
On Mon, May 23, 2016 at 5:49 PM, Emil Velikov wrote: > [...] >>> Do you guys have X related libraries on the host_os ? Or you >>> explicitly disable those mesa features that depend on it ? >> >> AFAIK, no X libraries, neither on Chrome OS or Android side. >> > Just realised that Android requires a

Re: [Mesa-dev] [PATCH 1/2] configure.ac: Add support for Android builds

2016-05-23 Thread Nicolas Boichat
On Mon, May 23, 2016 at 8:20 PM, Emil Velikov wrote: > On 23 May 2016 at 12:17, Nicolas Boichat wrote: >> On Mon, May 23, 2016 at 5:49 PM, Emil Velikov >> wrote: >>> [...] >>>>> Do you guys have X related libraries on the host_os ? Or you >>&g

[Mesa-dev] [PATCH] automake: egl: Android: Add libEGL dependencies

2016-05-23 Thread Nicolas Boichat
platform_android.c needs to link with cutils, hardware, and sync libraries, as well as drm_gralloc libs. Also add appropriate tests in configure.ac. Signed-off-by: Nicolas Boichat --- configure.ac| 6 ++ src/egl/Makefile.am | 3 +++ 2 files changed, 9 insertions(+) diff --git a

[Mesa-dev] [PATCH] docs/egl: Android platform can also be build using autotools

2016-05-23 Thread Nicolas Boichat
We added support for Android build using autotools (configure), update the documentation to reflect that. Signed-off-by: Nicolas Boichat --- docs/egl.html | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/egl.html b/docs/egl.html index bc21c6c..fb94f8c 100644

[Mesa-dev] [PATCH] configure.ac: Fix -latomic test

2018-03-29 Thread Nicolas Boichat
From: Nicolas Boichat When compiling with LLVM 6.0, the test fails to detect that -latomic is actually required, as the atomic call is inlined. In the code itself (src/util/disk_cache.c), we see this pattern: p_atomic_add(cache->size, - (uint64_t)size); where cache->size is an uint64_t

Re: [Mesa-dev] [PATCH] configure.ac: Fix -latomic test

2018-03-29 Thread Nicolas Boichat
Scrap this, I guess I should update meson.build, too. Will send v2 in a few minutes. On Thu, Mar 29, 2018 at 4:26 PM, Nicolas Boichat wrote: > From: Nicolas Boichat > > When compiling with LLVM 6.0, the test fails to detect that > -latomic is actually required, as the atomic cal

[Mesa-dev] [PATCH, v2] CHROMIUM: configure.ac/meson.build: Fix -latomic test

2018-03-29 Thread Nicolas Boichat
From: Nicolas Boichat When compiling with LLVM 6.0, the test fails to detect that -latomic is actually required, as the atomic call is inlined. In the code itself (src/util/disk_cache.c), we see this pattern: p_atomic_add(cache->size, - (uint64_t)size); where cache->size is an uint64_t

Re: [Mesa-dev] [PATCH, v2] CHROMIUM: configure.ac/meson.build: Fix -latomic test

2018-03-29 Thread Nicolas Boichat
And now I left the CHROMIUM tag, sorry ,-( On Thu, Mar 29, 2018 at 4:31 PM, Nicolas Boichat wrote: > From: Nicolas Boichat > > When compiling with LLVM 6.0, the test fails to detect that > -latomic is actually required, as the atomic call is inlined. > > In the cod

Re: [Mesa-dev] [PATCH, v2] CHROMIUM: configure.ac/meson.build: Fix -latomic test

2018-03-29 Thread Nicolas Boichat
On Fri, Mar 30, 2018 at 2:26 AM, Matt Turner wrote: > On Thu, Mar 29, 2018 at 1:31 AM, Nicolas Boichat > wrote: >> From: Nicolas Boichat >> >> When compiling with LLVM 6.0, the test fails to detect that >> -latomic is actually required, as the atomic call is inl

[Mesa-dev] [PATCH,v3] configure.ac/meson.build: Fix -latomic test

2018-04-04 Thread Nicolas Boichat
nt64_t *, and results in the following link time error without -latomic: src/util/disk_cache.c:628: error: undefined reference to '__atomic_fetch_add_8' Fix the configure/meson test to replicate this pattern, which then correctly realizes the need for -latomic. Signed-off-by: Nicolas Boich