Currently we detect the module and if missing, the glXGetMsc* API is
effectively a stub, always returning false.
This is what effectively has been happening with our meson build :-(
Thus users have no chance of using it - they cannot even distinguish
if the failure is due to a misconfigured build.
There's no reason for keeping xf86vidmode optional - it has been
available in all distributions for years.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: a47c525f32 "meson: build glx"
tags/19.0-branchpoint
| fi | fi | ||||
| fi | fi | ||||
| # add xf86vidmode if available | |||||
| PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) | |||||
| if test "$HAVE_XF86VIDMODE" = yes ; then | |||||
| dri_modules="$dri_modules xxf86vm" | |||||
| fi | |||||
| dri_modules="$dri_modules xxf86vm" | |||||
| PKG_CHECK_MODULES([DRIGL], [$dri_modules]) | PKG_CHECK_MODULES([DRIGL], [$dri_modules]) | ||||
| GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" | ||||
| ;; | ;; | ||||
| esac | esac | ||||
| # This is outside the case (above) so that it is invoked even for non-GLX | |||||
| # builds. | |||||
| AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes) | |||||
| GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" | GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" | ||||
| GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS" | GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS" | ||||
| GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" | GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" | ||||
| AC_SUBST([GLESv2_LIB_DEPS]) | AC_SUBST([GLESv2_LIB_DEPS]) | ||||
| AC_SUBST([GLESv2_PC_LIB_PRIV]) | AC_SUBST([GLESv2_PC_LIB_PRIV]) | ||||
| AC_SUBST([HAVE_XF86VIDMODE]) | |||||
| dnl | dnl | ||||
| dnl More GLX setup | dnl More GLX setup | ||||
| dnl | dnl |
| dep_xdamage = dependency('xdamage', version : '>= 1.1') | dep_xdamage = dependency('xdamage', version : '>= 1.1') | ||||
| dep_xfixes = dependency('xfixes') | dep_xfixes = dependency('xfixes') | ||||
| dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1') | dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1') | ||||
| dep_xxf86vm = dependency('xxf86vm', required : false) | |||||
| dep_xxf86vm = dependency('xxf86vm') | |||||
| endif | endif | ||||
| if (with_any_vk or with_glx == 'dri' or | if (with_any_vk or with_glx == 'dri' or | ||||
| (with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or | (with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or | ||||
| if with_dri_platform == 'drm' | if with_dri_platform == 'drm' | ||||
| gl_priv_reqs += 'xcb-dri2 >= 1.8' | gl_priv_reqs += 'xcb-dri2 >= 1.8' | ||||
| endif | endif | ||||
| gl_priv_reqs += 'xxf86vm' | |||||
| endif | endif | ||||
| if dep_libdrm.found() | if dep_libdrm.found() | ||||
| gl_priv_reqs += 'libdrm >= 2.4.75' | gl_priv_reqs += 'libdrm >= 2.4.75' | ||||
| endif | endif | ||||
| if dep_xxf86vm.found() | |||||
| gl_priv_reqs += 'xxf86vm' | |||||
| endif | |||||
| gl_priv_libs = [] | gl_priv_libs = [] | ||||
| if dep_thread.found() | if dep_thread.found() |
| EXTRA_DIST = SConscript meson.build | EXTRA_DIST = SConscript meson.build | ||||
| if HAVE_XF86VIDMODE | |||||
| EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE | |||||
| endif | |||||
| AM_CFLAGS = \ | AM_CFLAGS = \ | ||||
| -I$(top_srcdir)/include \ | -I$(top_srcdir)/include \ | ||||
| -I$(top_srcdir)/include/GL/internal \ | -I$(top_srcdir)/include/GL/internal \ | ||||
| -I$(top_builddir)/src/mapi/glapi \ | -I$(top_builddir)/src/mapi/glapi \ | ||||
| -I$(top_srcdir)/src/mapi/glapi \ | -I$(top_srcdir)/src/mapi/glapi \ | ||||
| $(VISIBILITY_CFLAGS) \ | $(VISIBILITY_CFLAGS) \ | ||||
| $(EXTRA_DEFINES_XF86VIDMODE) \ | |||||
| -D_REENTRANT \ | -D_REENTRANT \ | ||||
| $(DEFINES) \ | $(DEFINES) \ | ||||
| $(LIBDRM_CFLAGS) \ | $(LIBDRM_CFLAGS) \ |
| env.PkgUseModules('X11') | env.PkgUseModules('X11') | ||||
| env.PkgUseModules('XCB') | env.PkgUseModules('XCB') | ||||
| env.PkgUseModules('DRM') | env.PkgUseModules('DRM') | ||||
| if env['HAVE_XF86VIDMODE']: | |||||
| env.Append(CPPDEFINES = ['XF86VIDMODE']) | |||||
| env.PkgUseModules('XF86VIDMODE') | |||||
| env.PkgUseModules('XF86VIDMODE') | |||||
| sources = [ | sources = [ | ||||
| 'clientattrib.c', | 'clientattrib.c', |
| #include "util/debug.h" | #include "util/debug.h" | ||||
| #else | #else | ||||
| #include <sys/time.h> | #include <sys/time.h> | ||||
| #ifdef XF86VIDMODE | |||||
| #include <X11/extensions/xf86vmode.h> | #include <X11/extensions/xf86vmode.h> | ||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| #endif | |||||
| #include <X11/Xlib-xcb.h> | #include <X11/Xlib-xcb.h> | ||||
| #include <xcb/xcb.h> | #include <xcb/xcb.h> | ||||
| __glxGetMscRate(struct glx_screen *psc, | __glxGetMscRate(struct glx_screen *psc, | ||||
| int32_t * numerator, int32_t * denominator) | int32_t * numerator, int32_t * denominator) | ||||
| { | { | ||||
| #ifdef XF86VIDMODE | |||||
| XF86VidModeModeLine mode_line; | XF86VidModeModeLine mode_line; | ||||
| int dot_clock; | int dot_clock; | ||||
| int i; | int i; | ||||
| return True; | return True; | ||||
| } | } | ||||
| else | |||||
| #endif | |||||
| return False; | return False; | ||||
| } | } | ||||
| __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, | __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, | ||||
| int32_t * numerator, int32_t * denominator) | int32_t * numerator, int32_t * denominator) | ||||
| { | { | ||||
| #if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE ) | |||||
| #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) | |||||
| __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable); | __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable); | ||||
| if (draw == NULL) | if (draw == NULL) |
| '-D_REENTRANT', | '-D_REENTRANT', | ||||
| ] | ] | ||||
| if dep_xxf86vm.found() | |||||
| gl_lib_cargs += '-DHAVE_XF86VIDMODE' | |||||
| endif | |||||
| libglx = static_library( | libglx = static_library( | ||||
| 'glx', | 'glx', | ||||
| [files_libglx, glx_generated], | [files_libglx, glx_generated], | ||||
| link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], | link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], | ||||
| dependencies : [ | dependencies : [ | ||||
| dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb, | dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb, | ||||
| dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, | |||||
| dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm, | |||||
| extra_deps_libgl, | extra_deps_libgl, | ||||
| ], | ], | ||||
| version : gl_lib_version, | version : gl_lib_version, |