[Mesa-dev] [PATCH 1/4] common: Check for extensions before resolving symbols

Daniel Stone daniel at fooishbar.org
Tue May 2 18:11:23 UTC 2017


Hi Eric,

On 2 May 2017 at 16:05, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> On Tuesday, 2017-05-02 11:52:06 +0100, Daniel Stone wrote:
>> --- a/common.c
>> +++ b/common.c
>> @@ -1,5 +1,6 @@
>>  /*
>>   * Copyright (c) 2017 Rob Clark <rclark at redhat.com>
>> + * Copyright © 2013 Intel Corporation
>
> 2013? Is that for the has_ext() code from libepoxy?

Yeah, exactly. I could trace that entire chunk of code back to one of
the very first commits in 2013, so it was quite easy.

>> @@ -122,6 +149,14 @@ int init_egl(struct egl *egl, const struct gbm *gbm)
>>               return -1;
>>       }
>>
>> +     egl_exts_dpy = eglQueryString(egl->display, EGL_EXTENSIONS);
>> +     get_proc_dpy(eglCreateImageKHR, "EGL_KHR_image_base");
>> +     get_proc_dpy(eglDestroyImageKHR, "EGL_KHR_image_base");
>> +     get_proc_dpy(eglCreateSyncKHR, "EGL_KHR_fence_sync");
>> +     get_proc_dpy(eglDestroySyncKHR, "EGL_KHR_fence_sync");
>> +     get_proc_dpy(eglWaitSyncKHR, "EGL_KHR_fence_sync");
>> +     get_proc_dpy(eglDupNativeFenceFDANDROID, "EGL_ANDROID_native_fence_sync");
>
> Moving the extension name as a first param makes it more readable IMO,
> as does dropping the quotes (using `#` in the macro):

Making strings pretend not to be strings does make me pretty itchy,
but not enough to not push it. So I've pushed this, 2/2 (CPU-side
sync), and the reuse-loop bit to master. Thanks for the review!

Cheers,
Daniel


More information about the mesa-dev mailing list