[waffle] [PATCH 10/12] egl: implement platform-specific information

Emil Velikov emil.l.velikov at gmail.com
Sat Apr 23 18:51:49 UTC 2016


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

Was talking about adding the following at the top:

#ifndef EGL_VERSION_1_2
#define EGL_CLIENT_APIS XXX
#endif

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.
I would just drop the guard.

Regards
Emil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/waffle/attachments/20160423/1d0d0e7b/attachment.html>


More information about the waffle mailing list