[Mesa-dev] [PATCH] mesa: Build EGL without X11 headers after interop patchset

Mark Janes mark.a.janes at intel.com
Sun May 22 19:28:46 UTC 2016


Tom Stellard <tom at stellard.net> writes:

> On Fri, May 20, 2016 at 04:29:07PM -0700, Mark Janes wrote:
>> Tom Stellard <tom at stellard.net> writes:
>> 
>> > On Wed, Apr 27, 2016 at 10:33:14PM +0000, Youry Metlitsky wrote:
>> >> ---
>> >>  include/GL/mesa_glinterop.h | 15 ++++++++++++++-
>> >>  1 file changed, 14 insertions(+), 1 deletion(-)
>> >> 
>> >
>> > Hi,
>> >
>> > This patch breaks the build for me:
>> >
>> > glxcmds.c:2699:1: error: no previous prototype for
>> > 'MesaGLInteropGLXQueryDeviceInfo' [-Werror=missing-prototypes]
>> >  MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
>> >   ^
>> > glxcmds.c:2723:1: error: no previous prototype for
>> > 'MesaGLInteropGLXExportObject' [-Werror=missing-prototypes]
>> >  MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
>> >   ^
>> >   cc1: some warnings being treated as errors
>> >
>> > These are my configure args:
>> >
>> >  ./autogen.sh --disable-dri3 --disable-xvmc
>> >  --with-gallium-drivers=swrast --disable-gallium-llvm
>> >  --with-egl-platforms=drm --with-dri-drivers=no --enable-texture-float
>> 
>> Sorry about that!  I pushed the patch at Marek's direction, but I did
>> test it on a several build configurations.
>> 
>> Adding " && !defined(MESA_EGL_NO_X11_HEADERS)" to the ifdef above the
>> failure seems to fix compilation for those options -- does it work for
>> you?
>> 
>
> Yes, the attached patch fixes my issue.
>
> -Tom

Reviewed-by: Mark Janes <mark.a.janes at intel.com>

>> >
>> >> diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
>> >> index 814064d..39822f2 100644
>> >> --- a/include/GL/mesa_glinterop.h
>> >> +++ b/include/GL/mesa_glinterop.h
>> >> @@ -50,7 +50,11 @@
>> >>  #ifndef MESA_GLINTEROP_H
>> >>  #define MESA_GLINTEROP_H
>> >>  
>> >> +#if defined(MESA_EGL_NO_X11_HEADERS)
>> >> +#include <GL/gl.h>
>> >> +#else
>> >>  #include <GL/glx.h>
>> >> +#endif
>> >>  #include <EGL/egl.h>
>> >>  
>> >>  #ifdef __cplusplus
>> >> @@ -219,6 +223,7 @@ typedef struct _mesa_glinterop_export_out {
>> >>  } mesa_glinterop_export_out;
>> >>  
>> >>  
>> >> +#if !defined(MESA_EGL_NO_X11_HEADERS)
>> >>  /**
>> >>   * Query device information.
>> >>   *
>> >> @@ -228,9 +233,11 @@ typedef struct _mesa_glinterop_export_out {
>> >>   *
>> >>   * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
>> >>   */
>> >> +
>> >>  GLAPI int GLAPIENTRY
>> >>  MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
>> >>                                  mesa_glinterop_device_info *out);
>> >> +#endif
>> >>  
>> >>  
>> >>  /**
>> >> @@ -242,6 +249,7 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
>> >>                                  mesa_glinterop_device_info *out);
>> >>  
>> >>  
>> >> +#if !defined(MESA_EGL_NO_X11_HEADERS)
>> >>  /**
>> >>   * Create and return a DMABUF handle corresponding to the given OpenGL
>> >>   * object, and return other parameters about the OpenGL object.
>> >> @@ -253,10 +261,12 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
>> >>   *
>> >>   * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
>> >>   */
>> >> +
>> >>  GLAPI int GLAPIENTRY
>> >>  MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
>> >>                               const mesa_glinterop_export_in *in,
>> >>                               mesa_glinterop_export_out *out);
>> >> +#endif
>> >>  
>> >>  
>> >>  /**
>> >> @@ -268,14 +278,17 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
>> >>                               const mesa_glinterop_export_in *in,
>> >>                               mesa_glinterop_export_out *out);
>> >>  
>> >> -
>> >> +#if !defined(MESA_EGL_NO_X11_HEADERS)
>> >>  typedef int (APIENTRYP PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, GLXContext context,
>> >>                                                                 mesa_glinterop_device_info *out);
>> >> +#endif
>> >>  typedef int (APIENTRYP PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
>> >>                                                                 mesa_glinterop_device_info *out);
>> >> +#if !defined(MESA_EGL_NO_X11_HEADERS)
>> >>  typedef int (APIENTRYP PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext context,
>> >>                                                              const mesa_glinterop_export_in *in,
>> >>                                                              mesa_glinterop_export_out *out);
>> >> +#endif
>> >>  typedef int (APIENTRYP PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
>> >>                                                              const mesa_glinterop_export_in *in,
>> >>                                                              mesa_glinterop_export_out *out);
>> >> -- 
>> >> 2.8.0
>> >> 
>> >> _______________________________________________
>> >> mesa-dev mailing list
>> >> mesa-dev at lists.freedesktop.org
>> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> From fa018ecd88c8145b3975bf867ac5049c4df230c3 Mon Sep 17 00:00:00 2001
> From: Tom Stellard <thomas.stellard at amd.com>
> Date: Fri, 20 May 2016 17:13:06 -0700
> Subject: [PATCH] glx: Fix build broken by
>  4e2c9a04354b6b133845b8b93c0c5d34261a91d0
>
> This commit caused a build failure with these configure args:
>
> ./autogen.sh --disable-dri3 --disable-xvmc
> --with-gallium-drivers=swrast --disable-gallium-llvm
>  --with-egl-platforms=drm --with-dri-drivers=no --enable-texture-float
> ---
>  src/glx/glxcmds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 63f4921..4881ddb 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -2693,7 +2693,7 @@ __glXGetUST(int64_t * ust)
>  }
>  #endif /* GLX_DIRECT_RENDERING */
>  
> -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) && !defined(MESA_EGL_NO_X11_HEADERS)
>  
>  GLAPI int GLAPIENTRY
>  MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
> -- 
> 2.1.0


More information about the mesa-dev mailing list