[Mesa-dev] [PATCH demos 3/4] eglinfo: Factor out a "probe one display" function

Eric Anholt eric at anholt.net
Wed Apr 20 20:51:19 UTC 2016


Adam Jackson <ajax at redhat.com> writes:

> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  src/egl/opengl/eglinfo.c | 29 ++++++++++++++++++-----------
>  1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
> index b044eaa..875e407 100644
> --- a/src/egl/opengl/eglinfo.c
> +++ b/src/egl/opengl/eglinfo.c
> @@ -155,19 +155,15 @@ PrintExtensions(EGLDisplay d)
>        printf("\n");
>  }
>  
> -int
> -main(int argc, char *argv[])
> +static int
> +doOneDisplay(EGLDisplay d, const char *name)
>  {
>     int maj, min;
> -   EGLDisplay d;
> -
> -   PrintExtensions(EGL_NO_DISPLAY);
> -
> -   d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
>  
> +   printf("%s:\n", name);
>     if (!eglInitialize(d, &maj, &min)) {
>        printf("eglinfo: eglInitialize failed\n");
> -      exit(1);
> +      return 1;
>     }
>  
>     printf("EGL API version: %d.%d\n", maj, min);
> @@ -180,8 +176,19 @@ main(int argc, char *argv[])
>     PrintExtensions(d);
>  
>     PrintConfigs(d);
> -
> -   eglTerminate(d);
> -
> +   printf("\n");
>     return 0;
>  }

eglTerminate(d) disappeared entirely.  Looks like that wasn't
intentional?

Other than that, this series is:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160420/97d13a95/attachment.sig>


More information about the mesa-dev mailing list