[Mesa-dev] [PATCH] egl: don't exit process on initialization failure

Kristian Høgsberg krh at bitplanet.net
Sat Aug 16 13:44:40 PDT 2014


On Thu, Aug 14, 2014 at 8:39 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Wed, Aug 13, 2014 at 10:10 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>
> Perhaps I might have mentioned more about this... the situation is
> that nouveau_vieux doesn't support EGL (it doesn't have DRIimage or
> something along those lines). So the EGL init fails. Which makes
> piglit tests that should skip fail with a exit(1) instead, since
> that's what _eglLog does when it gets a EGL_FATAL message. It appears
> that the error gets returned as expected with this.
>
> An alternative is to not make EGL_FATAL messages exit the program --
> that's a pretty nasty thing for a library to do. But there are also
> not a lot of uses of it.

Just changing it to _EGL_WARNING is fine.  Not having the extension is
supposed to fail initialization, but it was never the intention to
exit immediately.  The only way the dri2_bind_extension can return
EGL_FALSE is after calling _eglLog with _EGL_FATAL, so I clearly
didn't realize _EGL_FATAL calls exit when I wrote it.

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   -ilia
>
>>  src/egl/drivers/dri2/egl_dri2.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
>> index 5602ec3..dda13a3 100644
>> --- a/src/egl/drivers/dri2/egl_dri2.c
>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>> @@ -358,7 +358,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
>>     for (j = 0; matches[j].name; j++) {
>>        field = ((char *) dri2_dpy + matches[j].offset);
>>        if (*(const __DRIextension **) field == NULL) {
>> -        _eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
>> +        _eglLog(_EGL_WARNING, "DRI2: did not find extension %s version %d",
>>                  matches[j].name, matches[j].version);
>>          ret = EGL_FALSE;
>>        }
>> --
>> 1.8.5.5
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list