On 21 April 2016 at 21:27, Frank Henigman <<a href="javascript:;" onclick="_e(event, 'cvml', 'fjhenigman@google.com')">fjhenigman@google.com</a>> wrote:<br>
> On Fri, Jan 8, 2016 at 7:50 AM, Emil Velikov <<a href="javascript:;" onclick="_e(event, 'cvml', 'emil.l.velikov@gmail.com')">emil.l.velikov@gmail.com</a>> wrote:<br>
>> On 6 January 2016 at 21:56, Frank Henigman <<a href="javascript:;" onclick="_e(event, 'cvml', 'fjhenigman@google.com')">fjhenigman@google.com</a>> wrote:<br>
>>> Implement the platform hook of waffle_display_info_json() so it can<br>
>>> pick up egl-specific information.<br>
>>><br>
>>> Signed-off-by: Frank Henigman <<a href="javascript:;" onclick="_e(event, 'cvml', 'fjhenigman@google.com')">fjhenigman@google.com</a>><br>
>>> ---<br>
>>>  src/waffle/egl/wegl_display.c  | 32 ++++++++++++++++++++++++++++++--<br>
>>>  src/waffle/egl/wegl_display.h  |  4 ++++<br>
>>>  src/waffle/egl/wegl_platform.h |  3 +++<br>
>>>  3 files changed, 37 insertions(+), 2 deletions(-)<br>
>>><br>
>>> diff --git a/src/waffle/egl/wegl_display.c b/src/waffle/egl/wegl_display.c<br>
>>> index 88fce7a..dcfe934 100644<br>
>>> --- a/src/waffle/egl/wegl_display.c<br>
>>> +++ b/src/waffle/egl/wegl_display.c<br>
>>> @@ -25,6 +25,8 @@<br>
>>><br>
>>>  #include <assert.h><br>
>>><br>
>>> +#include "json.h"<br>
>>> +<br>
>>>  #include "wcore_error.h"<br>
>>>  #include "wcore_platform.h"<br>
>>><br>
>>> @@ -63,7 +65,6 @@ wegl_display_init(struct wegl_display *dpy,<br>
>>>  {<br>
>>>      struct wegl_platform *plat = wegl_platform(wc_plat);<br>
>>>      bool ok;<br>
>>> -    EGLint major, minor;<br>
>>><br>
>>>      ok = wcore_display_init(&dpy->wcore, wc_plat);<br>
>>>      if (!ok)<br>
>>> @@ -75,7 +76,7 @@ wegl_display_init(struct wegl_display *dpy,<br>
>>>          goto fail;<br>
>>>      }<br>
>>><br>
>>> -    ok = plat->eglInitialize(dpy->egl, &major, &minor);<br>
>>> +    ok = plat->eglInitialize(dpy->egl, &plat->major, &plat->minor);<br>
>>>      if (!ok) {<br>
>>>          wegl_emit_error(plat, "eglInitialize");<br>
>>>          goto fail;<br>
>>> @@ -139,3 +140,30 @@ wegl_display_supports_context_api(struct wcore_display *wc_dpy,<br>
>>><br>
>>>      return wc_plat->vtbl->dl_can_open(wc_plat, waffle_dl);<br>
>>>  }<br>
>>> +<br>
>>> +void<br>
>>> +wegl_display_info_json(struct wcore_display *wc_dpy, struct json *jj)<br>
>>> +{<br>
>>> +    struct wegl_display *dpy = wegl_display(wc_dpy);<br>
>>> +    struct wegl_platform *plat = wegl_platform(dpy->wcore.platform);<br>
>>> +<br>
>>> +    const char *version = plat->eglQueryString(dpy->egl, EGL_VERSION);<br>
>>> +    const char *vendor = plat->eglQueryString(dpy->egl, EGL_VENDOR);<br>
>>> +#ifdef EGL_VERSION_1_2<br>
>>> +    const char *apis = plat->eglQueryString(dpy->egl, EGL_CLIENT_APIS);<br>
>>> +#endif<br>
>> I would suggesting adding the define on top ifndef EGL_VERSION_1_2,<br>
>> and dropping the checks here and below.<br>
><br>
> Sorry, not sure what you mean by this.  It sounds like skipping the<br>
> whole thing ifndef EGL_VERSION_1_2 ?  And that's ok because no one<br>
> uses <= 1.2 anymore?<br>
<br>
Was talking about adding the following at the top:<br>
<br>
#ifndef EGL_VERSION_1_2<br>
#define EGL_CLIENT_APIS XXX<br>
#endif<br>
<br>
Then again, I have to fully agree with you here. I doubt that there are (m)any pre 1.2 EGL implementations let alone testing those with waffle.<br>
I would just drop the guard.<br>
<br>
Regards<br>
Emil<br>