[Mesa-dev] [PATCH v2] glx: mandate xf86vidmode only for "drm" dri platforms

Eric Engestrom eric.engestrom at intel.com
Tue Dec 11 18:59:13 UTC 2018


On Tuesday, 2018-12-11 17:22:03 +0000, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Currently we have the three dri "platforms" - drm, apple and windows.
> 
> Since xf86vidmode is a thing only for the drm one, adjust the
> preprocessor guards and correctly check for the dependency.
> 
> v2: terminate the GLX_USE_WINDOWSGL hunk
> 
> Cc: Jon TURNEY <jon.turney at dronecode.org.uk>
> Cc: Dylan Baker <dylan at pnwbakers.com>
> Cc: Eric Engestrom <eric.engestrom at intel.com>
> Fixes: 5bc509363b6 ("glx: make xf86vidmode mandatory for direct rendering")
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> This time it's actually tested ;-)
> ---
>  configure.ac      | 4 ++--
>  meson.build       | 4 ++--
>  src/glx/glxcmds.c | 6 ++++--
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 5d3da4b7c48..9b437a252cc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1716,6 +1716,8 @@ xdri)
>              if test x"$enable_dri" = xyes; then
>                 dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED"
>              fi
> +
> +            dri_modules="$dri_modules xxf86vm"
>          fi
>          if test x"$dri_platform" = xapple ; then
>              DEFINES="$DEFINES -DGLX_USE_APPLEGL"
> @@ -1725,8 +1727,6 @@ xdri)
>          fi
>      fi
>  
> -    dri_modules="$dri_modules xxf86vm"
> -
>      PKG_CHECK_MODULES([DRIGL], [$dri_modules])
>      GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
>      X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
> diff --git a/meson.build b/meson.build
> index 4f6176b8d96..fe647f682c1 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1349,7 +1349,6 @@ if with_platform_x11
>      dep_xdamage = dependency('xdamage', version : '>= 1.1')
>      dep_xfixes = dependency('xfixes')
>      dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
> -    dep_xxf86vm = dependency('xxf86vm')
>    endif
>    if (with_any_vk or with_glx == 'dri' or
>         (with_gallium_vdpau or with_gallium_xvmc or with_gallium_va or
> @@ -1376,6 +1375,7 @@ if with_platform_x11
>    if with_glx == 'dri'
>      if with_dri_platform == 'drm'
>        dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
> +      dep_xxf86vm = dependency('xxf86vm')
>      endif
>      dep_glproto = dependency('glproto', version : '>= 1.4.14')
>    endif
> @@ -1426,8 +1426,8 @@ elif with_glx == 'dri'
>      'xcb-glx >= 1.8.1']
>    if with_dri_platform == 'drm'
>      gl_priv_reqs += 'xcb-dri2 >= 1.8'
> +    gl_priv_reqs += 'xxf86vm'
>    endif
> -  gl_priv_reqs += 'xxf86vm'
>  endif
>  if dep_libdrm.found()
>    gl_priv_reqs += 'libdrm >= 2.4.75'
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index b940c8ebdbe..d00c0d4816d 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -45,8 +45,10 @@
>  #include "apple/apple_glx.h"
>  #include "util/debug.h"
>  #else
> +#ifndef GLX_USE_WINDOWSGL
>  #include <sys/time.h>
>  #include <X11/extensions/xf86vmode.h>
> +#endif /* GLX_USE_WINDOWSGL */

Actually `#elif !defined(...)` would've been nicer, but it doesn't
really matter; this looks all reasonable to me, so:
Acked-by: Eric Engestrom <eric.engestrom at intel.com>

>  #endif
>  #endif
>  
> @@ -2081,7 +2083,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
>     return False;
>  }
>  
> -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) && !defined(GLX_USE_WINDOWSGL)
>  _X_HIDDEN GLboolean
>  __glxGetMscRate(struct glx_screen *psc,
>  		int32_t * numerator, int32_t * denominator)
> @@ -2157,7 +2159,7 @@ _X_HIDDEN GLboolean
>  __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
>                     int32_t * numerator, int32_t * denominator)
>  {
> -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) && !defined(GLX_USE_WINDOWSGL)
>     __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable);
>  
>     if (draw == NULL)
> -- 
> 2.19.2
> 


More information about the mesa-dev mailing list