[Mesa-dev] [PATCH 2/3] meson: Use the same version for all libdrm checks

Dylan Baker dylan at pnwbakers.com
Thu Mar 15 17:05:00 UTC 2018


Quoting Eric Engestrom (2018-03-15 04:52:41)
> On Tuesday, 2018-03-13 11:52:48 -0700, Dylan Baker wrote:
> > Currently each driver specifies it's own version, and core libdrm
> > specifies a version. In the most common case this is fine, since there
> > will be exactly one libdrm installed on a system, but if there are more
> > than one it's possible that mesa will be linked against different
> > versions of libdrm. There is also the possibility that the current
> > approach makes the pkg-config files we generate incorrect, since there
> > could be #defines that use newer features if they're available.
> > 
> > This patch corrects all of that. All of the versions are still set by
> > driver (along with a default core version). Then all of the drivers that
> > are enabled have their versions compared and the highest version is
> > selected, then all libdrm checks are made with that version.
> > 
> > Signed-off-by: Dylan Baker <dylan.c.baker at intel.com>
> 
> Makes sense, and looks cleaner than my earlier variant :)
> 
> Series is:
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> 
> (small nit below)
> 
> > ---
> >  meson.build | 67 +++++++++++++++++++++++++++++++++++++-----------------
> >  1 file changed, 46 insertions(+), 21 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index e747d99..6019008 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -1015,35 +1015,60 @@ dep_expat = dependency('expat')
> >  # its not linux and and wont
> >  dep_m = cc.find_library('m', required : false)
> >  
> > +# Check for libdrm. various drivers have different libdrm version requirements,
> > +# but we always want to use the same version for all libdrm modules. That means
> > +# even if driver foo requires 2.4.0 and driver bar requires 2.4.3, if foo and
> > +# bar are both on use 2.4.3 for both of them
> >  dep_libdrm_amdgpu = []
> >  dep_libdrm_radeon = []
> >  dep_libdrm_nouveau = []
> >  dep_libdrm_etnaviv = []
> >  dep_libdrm_freedreno = []
> >  dep_libdrm_intel = []
> > -if with_dri_i915 or with_gallium_i915
> > -  dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
> > -endif
> > -if with_amd_vk or with_gallium_radeonsi
> > -  dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.90')
> > -endif
> > -if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
> > -    with_gallium_r300 or with_gallium_r600)
> > -  dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
> > -endif
> > -if with_gallium_nouveau or with_dri_nouveau
> > -  dep_libdrm_nouveau = dependency('libdrm_nouveau', version : '>= 2.4.66')
> > -endif
> > -if with_gallium_etnaviv
> > -  dep_libdrm_etnaviv = dependency('libdrm_etnaviv', version : '>= 2.4.82')
> > -endif
> > -if with_gallium_freedreno
> > -  dep_libdrm_freedreno = dependency('libdrm_freedreno', version : '>= 2.4.91')
> > -endif
> > +
> > +_drm_amdgpu_ver = '2.4.90'
> > +_drm_radeon_ver = '2.4.71'
> > +_drm_nouveau_ver = '2.4.66'
> > +_drm_etnaviv_ver = '2.4.82'
> > +_drm_freedreno_ver = '2.4.91'
> > +_drm_intel_ver = '2.4.75'
> > +_drm_ver = '2.4.75'
> > +
> > +_libdrm_checks = [
> > +  [with_dri_i915 or with_gallium_i915, 'intel'],
> > +  [with_amd_vk or with_gallium_radeonsi, 'amdgpu'],
> > +  [(with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
> > +   with_gallium_r300 or with_gallium_r600),
> > +   'radeon'],
> > +  [(with_gallium_nouveau or with_dri_nouveau), 'nouveau'],
> > +  [with_gallium_etnaviv, 'etnaviv'],
> > +  [with_gallium_freedreno, 'freedreno'],
> 
> I think this list would be easier to read if the driver name came first.

Yeah, I think you're right. I'll change that.

> 
> > +]
> > +
> > +# Loop over the enables versions and get the highest libdrm requirement for all
> > +# active drivers.
> > +foreach d : _libdrm_checks
> > +  ver = get_variable('_drm_ at 0@_ver'.format(d[1]))
> > +  if d[0] and ver.version_compare('>' + _drm_ver)
> > +    _drm_ver = ver
> > +  endif
> > +endforeach
> > +
> > +# Then get each libdrm module
> > +foreach d : _libdrm_checks
> > +  if d[0]
> > +    set_variable(
> > +      'dep_libdrm_' + d[1],
> > +      dependency('libdrm_' + d[1], version : '>=' + _drm_ver)
> > +    )
> > +  endif
> > +endforeach
> >  
> >  with_gallium_drisw_kms = false
> > -dep_libdrm = dependency('libdrm', version : '>= 2.4.75',
> > -                        required : with_dri2 or with_dri3)
> > +dep_libdrm = dependency(
> > +  'libdrm', version : '>=' + _drm_ver,
> > +  required : with_dri2 or with_dri3
> > +)
> >  if dep_libdrm.found()
> >    pre_args += '-DHAVE_LIBDRM'
> >    if with_dri_platform == 'drm' and with_dri
> > -- 
> > git-series 0.9.1
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180315/8a87d26f/attachment.sig>


More information about the mesa-dev mailing list