Re: [Mesa-dev] [PATCH 0/3] Meson build system

2018-01-10 Thread Dylan Baker
I forgot to CC you on this like you asked,

Dylan

Quoting Dylan Baker (2018-01-05 12:00:57)
> This is a fifth iteration of the meson build system for libdrm. This
> version is significantly cleaned up from the last version and uses a
> style more like the build system in mesa.
> 
> It builds all of the drivers and tests, and the tests can be run via
> `ninja test`.
> 
> It has support for being used as a wrapped dependency with ext_foo
> variables (I have a branch of mesa that will build this code as a wrap,
> which has also been useful for testing). This means it can be used to
> build a mesa that requires a newer libdrm than the system provides
> (which can be especially useful if you can't install packages on that
> system), or to build libdrm support that your distro doesn't ship (like
> arm only drivers on x86), cross compiling, and for testing.
> 
> This has been build tested and mesa has been compiled against it, but
> only minimal functional testing has been done, since I only have i965
> machines, and i965 only uses libdrm lightly.
> 
> Some reviewers of the previous versions have done some additional
> testing.
> 
> Changes since v3:
>   - Fix freedreno kgsl check
>   - Fix kgls -> kgsl typo
>   - standardize meson options to use only `-` and not `_`
>   - fix typo radoen -> radeon
>   - add help messages to options
>   - fix typo in kms-universal-planes binary
>   - build and install modetest (this was missed in the first version for
> some reason)
>   - install amdgpu.ids as 644 instead of 444
> 
> Changes since v4:
>   - Fix minor nits in options descriptions (Igor)
>   - Fix editorconfig settings
>   - Fix amdgpu.ids searh path
>   - Style nits for Eric E.
>   - Remove more tabs
>   - Ensure that 1/0 defines are always defined, instead of only when
> their value is 1
>   - Don't add header files into file lists. (Meson figures out header
> dependencies automatically using graphs that the compiler generates
> during compilation)
>   - Don't assign file lists to variables when possible. In a few cases
> files need to be conditionally added, but if we're not in one of
> those cases just put the lists directly in the exectuable or library
> declaration.
> 
> Dylan Baker (3):
>   Add meson build system
>   autotools: Include meson.build files in tarball
>   README: Add note about meson
> 
>  .editorconfig   |   4 +-
>  Makefile.am |  30 ++-
>  README  |  24 +-
>  amdgpu/.editorconfig|   4 +-
>  amdgpu/meson.build  |  65 +++-
>  data/meson.build|  27 +++-
>  etnaviv/meson.build |  59 ++-
>  exynos/meson.build  |  53 +-
>  freedreno/meson.build   |  76 -
>  intel/meson.build   | 105 +++-
>  libkms/meson.build  |  74 -
>  man/meson.build |  67 +++-
>  meson.build | 364 +-
>  meson_options.txt   | 143 +++-
>  nouveau/meson.build |  58 ++-
>  omap/meson.build|  53 +-
>  radeon/meson.build  |  63 ++-
>  tegra/meson.build   |  52 +-
>  tests/amdgpu/meson.build|  34 +++-
>  tests/etnaviv/meson.build   |  45 +-
>  tests/exynos/meson.build|  54 +-
>  tests/kms/meson.build   |  49 +-
>  tests/kmstest/meson.build   |  30 +++-
>  tests/meson.build   |  86 +-
>  tests/modeprint/meson.build |  29 +++-
>  tests/modetest/meson.build  |  29 +++-
>  tests/nouveau/meson.build   |  30 +++-
>  tests/proptest/meson.build  |  28 +++-
>  tests/radeon/meson.build|  27 +++-
>  tests/tegra/meson.build |  27 +++-
>  tests/util/meson.build  |  28 +++-
>  tests/vbltest/meson.build   |  28 +++-
>  vc4/meson.build |  28 +++-
>  33 files changed, 1869 insertions(+), 4 deletions(-)
>  create mode 100644 amdgpu/meson.build
>  create mode 100644 data/meson.build
>  create mode 100644 etnaviv/meson.build
>  create mode 100644 exynos/meson.build
>  create mode 100644 freedreno/meson.build
>  create mode 100644 intel/meson.build
>  create mode 100644 libkms/meson.build
>  create mode 100644 man/meson.build
>  create mode 100644 meson.build
>  create mode 100644 meson_options.txt
>  create mode 100644 nouveau/meson.build
>  create mode 100644 omap/meson.build
>  create mode 100644 radeon/meson.build
>  create mode 100644 tegra/meson.build
>  create mode 100644 tests/amdgpu/meson.build
>  create mode 100644 tests/etnaviv/meson.build
>  create mode 100644 tests/exynos/meson.build
>  create mode 100644 tests/kms/meson.build
>  create mode 100

Re: [Mesa-dev] [PATCH 09/14] meson: do not redeclare pkg-config dependencies (yet)

2018-01-05 Thread Dylan Baker
We absolutely can't merge this as-is, it will break all of the these since
they'll end up linking the backend and frontend, which we're not supposed to do.

The bug you linked to has nothing to do with the problem you describe either,
that issue is that `dependency("threads")` is special in meson, and then evolved
into a larger issue about the pkg-config generator.

The actual problem here is real, but quite different. You can't use
get_pkgconfig_variable to get the cflags. The actual workaround is to do
something like:

prog_pkgconfig = find_program('pkg-config')
dep_vdpau = declare_dependency(
  compile_args : run_command(prog_pkgconfig, ['vdpau', 
'--cflags']).stdout().split(),
)
...

And we'll need a new meson feature for doing this without calling pkg-config
directly. I'll write that feature.

Quoting Greg V (2017-12-31 08:55:23)
> get_pkgconfig_variable('cflags') always returns an empty list. This only
> worked on Linux because the libraries were in the standard include path.
> ---
>  meson.build | 28 
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index af62baf437..23faad0a71 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -395,9 +395,10 @@ else
>with_gallium_vdpau = false
>  endif
>  if with_gallium_vdpau
> -  dep_vdpau = declare_dependency(
> -compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
> -  )
> +  # XXX: https://github.com/mesonbuild/meson/issues/2725
> +  # dep_vdpau = declare_dependency(
> +  #   compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
> +  # )
>  endif
>  
>  if with_gallium_vdpau
> @@ -436,9 +437,10 @@ else
>with_gallium_xvmc = false
>  endif
>  if with_gallium_xvmc
> -  dep_xvmc = declare_dependency(
> -compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
> -  )
> +  # XXX: https://github.com/mesonbuild/meson/issues/2725
> +  # dep_xvmc = declare_dependency(
> +  #   compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
> +  # )
>  endif
>  
>  xvmc_drivers_path = get_option('xvmc-libs-path')
> @@ -499,9 +501,10 @@ if with_gallium_omx
>endif
>  endif
>  if with_gallium_omx
> -  dep_omx = declare_dependency(
> -compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
> -  )
> +  # XXX: https://github.com/mesonbuild/meson/issues/2725
> +  # dep_omx = declare_dependency(
> +  #   compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
> +  # )
>  endif
>  
>  dep_va = []
> @@ -532,9 +535,10 @@ else
>with_gallium_va = false
>  endif
>  if with_gallium_va
> -  dep_va = declare_dependency(
> -compile_args : dep_va.get_pkgconfig_variable('cflags').split()
> -  )
> +  # XXX: https://github.com/mesonbuild/meson/issues/2725
> +  # dep_va = declare_dependency(
> +  #   compile_args : dep_va.get_pkgconfig_variable('cflags').split()
> +  # )
>  endif
>  
>  va_drivers_path = get_option('va-libs-path')
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 3/4] meson: build clover

2018-01-06 Thread Dylan Baker
Quoting Jan Vesely (2018-01-06 15:18:54)
> On Fri, 2018-01-05 at 15:26 -0800, Dylan Baker wrote:
> > Quoting Jan Vesely (2018-01-05 14:16:41)
> > > Hi,
> > > 
> > > 
> > > sorry for the delay. I was mostly traveling during the holidays.
> > 
> > No worries, I was also away over the holidays and didn't look at this until
> > today.
> > 
> > > 
> > > On Fri, 2017-12-15 at 10:54 -0800, Dylan Baker wrote:
> > > > This has only been compile tested.
> > > > 
> > > > v2: - Have a single option for opencl (Eric E)
> > > > - fix typo "tgis" -> "tgsi" (Curro)
> > > > - Don't add "lib" to pipe loader libraries, which matches the
> > > >   autotools behavior
> > > > v3: - Remove trailing whitespace
> > > > - Make PIPE_SEARCH_DIR an absolute path
> > > > 
> > > > cc: Curro Jerez <curroje...@riseup.net>
> > > > cc: Jan Vesely <jan.ves...@rutgers.edu>
> > > > cc: Aaron Watry <awa...@gmail.com>
> > > > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > > > ---
> > > >  include/meson.build   |  19 
> > > >  meson.build   |  29 +-
> > > >  meson_options.txt |   7 ++
> > > >  src/gallium/auxiliary/pipe-loader/meson.build |   3 +-
> > > >  src/gallium/meson.build   |  12 ++-
> > > >  src/gallium/state_trackers/clover/meson.build | 122 
> > > > ++
> > > >  src/gallium/targets/opencl/meson.build|  73 +++
> > > >  src/gallium/targets/pipe-loader/meson.build   |  77 
> > > >  8 files changed, 336 insertions(+), 6 deletions(-)
> > > >  create mode 100644 src/gallium/state_trackers/clover/meson.build
> > > >  create mode 100644 src/gallium/targets/opencl/meson.build
> > > >  create mode 100644 src/gallium/targets/pipe-loader/meson.build
> > > > 
> > > > diff --git a/include/meson.build b/include/meson.build
> > > > index e4dae91cede..a2e7ce6580e 100644
> > > > --- a/include/meson.build
> > > > +++ b/include/meson.build
> > > > @@ -78,3 +78,22 @@ if with_gallium_st_nine
> > > >  subdir : 'd3dadapter',
> > > >)
> > > >  endif
> > > > +
> > > > +# Only install the headers if we are building a stand alone 
> > > > implementation and
> > > > +# not an ICD enabled implementation
> > > > +if with_gallium_opencl and not with_opencl_icd
> > > > +  install_headers(
> > > > +'CL/cl.h',
> > > > +'CL/cl.hpp',
> > > > +'CL/cl_d3d10.h',
> > > > +'CL/cl_d3d11.h',
> > > > +'CL/cl_dx9_media_sharing.h',
> > > > +'CL/cl_egl.h',
> > > > +'CL/cl_ext.h',
> > > > +'CL/cl_gl.h',
> > > > +'CL/cl_gl_ext.h',
> > > > +'CL/cl_platform.h',
> > > > +'CL/opencl.h',
> > > > +subdir: 'CL'
> > > > +  )
> > > > +endif
> > > > diff --git a/meson.build b/meson.build
> > > > index 842d441199e..74b2d5c49dc 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -583,6 +583,22 @@ if with_gallium_st_nine
> > > >endif
> > > >  endif
> > > >  
> > > > +_opencl = get_option('gallium-opencl')
> > > > +if _opencl !=' disabled'
> > > > +  if not with_gallium
> > > > +error('OpenCL Clover implementation requires at least one gallium 
> > > > driver.')
> > > > +  endif
> > > > +
> > > > +  # TODO: alitvec?
> > > > +  dep_clc = dependency('libclc')
> > > > +  with_gallium_opencl = true
> > > > +  with_opencl_icd = _opencl == 'icd'
> > > > +else
> > > > +  dep_clc = []
> > > > +  with_gallium_opencl = false
> > > > +  with_gallium_icd = false
> > > > +endif
> > > > +
> > > >  gl_pkgconfig_c_flags = []
> > > >  if with_platform_x11
> > > >if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
> > > > @@ -930,7 +946,7 @@ dep_thread = dependency('threads')
> > > >  if dep_thread.found() and host_machine.system() != 'windo

Re: [Mesa-dev] [PATCH 5/7] report.py: Add option to only display measurements that have changes

2018-01-17 Thread Dylan Baker
Quoting Ian Romanick (2018-01-16 09:39:07)
> On 01/12/2018 12:23 PM, Dylan Baker wrote:
> > Quoting Ian Romanick (2018-01-12 12:06:59)
> >> From: Ian Romanick <ian.d.roman...@intel.com>
> >>
> >> This is useful for preparing data to go in a Mesa commit message.
> >>
> >> Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>
> >> ---
> >>  report.py | 53 +++--
> >>  1 file changed, 31 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/report.py b/report.py
> >> index e0068bc..72752c1 100755
> >> --- a/report.py
> >> +++ b/report.py
> >> @@ -62,6 +62,8 @@ def main():
> >>  help="comma-separated list of measurements to 
> >> report")
> >>  parser.add_argument("--summary-only", "-s", action="store_true", 
> >> default=False,
> >>  help="do not show the per-shader helped / hurt 
> >> data")
> >> +parser.add_argument("--changes-only", "-c", action="store_true", 
> >> default=False,
> >> +help="only show measurements that have changes")
> >>  parser.add_argument("before", type=get_results, help="the output of 
> >> the original code")
> >>  parser.add_argument("after", type=get_results, help="the output of 
> >> the new code")
> >>  args = parser.parse_args()
> >> @@ -116,14 +118,14 @@ def main():
> >>  if len(helped) > 0:
> >>  print("")
> >>  
> >> -hurt.sort(
> >> -key=lambda k: args.after[k][m] if args.before[k][m] 
> >> == 0 else float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> >> -for p in hurt:
> >> -namestr = p[0] + " " + p[1]
> >> -print(m + " HURT:   " + get_result_string(
> >> -namestr, args.before[p][m], args.after[p][m]))
> >> -if len(hurt) > 0:
> >> -print("")
> >> +hurt.sort(
> >> +key=lambda k: args.after[k][m] if args.before[k][m] == 0 
> >> else float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> >> +for p in hurt:
> >> +namestr = p[0] + " " + p[1]
> >> +print(m + " HURT:   " + get_result_string(
> >> +namestr, args.before[p][m], args.after[p][m]))
> >> +if len(hurt) > 0:
> >> +print("")
> >>  
> >>  num_helped[m] = len(helped)
> >>  num_hurt[m] = len(hurt)
> >> @@ -153,21 +155,28 @@ def main():
> >>  if len(gained) > 0:
> >>  print("")
> >>  
> >> +any_helped_or_hurt = False
> >>  for m in args.measurements:
> >> -print("total {0} in shared programs: {1}\n"
> >> -  "{0} in affected programs: {2}\n"
> >> -  "helped: {3}\n"
> >> -  "HURT: {4}\n".format(
> >> -   m,
> >> -   change(total_before[m], total_after[m]),
> >> -   change(affected_before[m], affected_after[m]),
> >> -   num_helped[m],
> >> -   num_hurt[m]))
> >> -
> >> -
> >> -print("LOST:   " + str(len(lost)))
> >> -print("GAINED: " + str(len(gained)))
> >> -
> >> +if num_helped[m] > 0 or num_hurt[m] > 0:
> >> +any_helped_or_hurt = True
> >> +
> >> +if num_helped[m] > 0 or num_hurt[m] > 0 or not args.changes_only:
> > 
> > Couldn't this be: `if any_helped_or_hurt or not args.changes_only:`
> 
> Yes.  I added any_helped_or_hurt long after writing this particular
> if-statement, and I didn't notice the easy refactor. :)
> 
> >> +print("total {0} in shared programs: {1}\n"
> >> +  "{0} in affected programs: {2}\n"
> >> +  "helped: {3}\n"
> >> +  "HURT: {4}\n".format(
> >> + m,
> &

Re: [Mesa-dev] [PATCH 1/2] meson: Fix configuring dri glx with only gallium drivers

2018-01-17 Thread Dylan Baker
Your attached patch looks good to me. You can add my r-b to it.

Quoting Jon Turney (2018-01-15 11:50:04)
> On 12/01/2018 17:33, Dylan Baker wrote:
> > Maybe this is correct, but it makes me nervous treating with_gallium as
> > equivalent to with_dri, since gallium drivers can be built dri-less
> > (gallium-xlib, and some other configurations on windows). I think something
> > like:
> > 
> >with_glx = get_option('glx')
> >if with_glx == 'auto'
> >  if with_dri
> >with_glx = 'dri'
> >  elif with_gallium
> ># Even when building just gallium drivers the user probably wants dri
> >with_glx = 'dri'
> >with_dri = true
> >  elif with_platform_x11 and with_any_opengl and not with_any_vk
> ># The automatic behavior should not be to turn on xlib based glx when
> ># building only vulkan drivers
> >with_glx = 'xlib'
> >  else
> >with_glx = 'disabled'
> >  endif
> > + elif with_glx == 'dri'
> > +   if with_gallium
> > + with_dri = true
> > +   endif
> >endif
> > 
> > 
> > Would achieve the correct result, be simpler, and avoid accidentally adding 
> > dri
> > sources when we shouldn't.
> 
> Ah, yes.  I'd completely failed to spot that in the 'auto' case above.
> 
> How about the attached?


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-17 Thread Dylan Baker
Just wanted to see how things were going on this, especially for the meson bits
as I'd like to get them merged before the 18.0 merge window closes.

Quoting Greg V (2017-12-31 08:55:14)
> Hello everyone and happy new year! :)
> 
> This set of patches makes the Meson build work on FreeBSD, including 
> RADV, ANV, wayland-egl, VAAPI, VDPAU.
> 
> I also managed to get SWR working, but I haven't included the CPU 
> topology detection code in here. CPU topology is exposed as XML on 
> FreeBSD, so my implementation uses TinyXML2, which is a new dependency.
> And I couldn't even figure out how to link to it with all the libtool
> stuff. Had to test it with LD_PRELOAD :D
> This will be much easier to do with Meson.
> 
> Greg V (14):
>   util: fix ElfW macro
>   vc4, vc5: add ETIME fallback define
>   radv: add ETIME fallback define
>   anv: add ETIME fallback define
>   anv: use POSIX sysconf to get memory info on non-glibc systems
>   anv: remove unused Linux-specific include
>   anv: FreeBSD support in the allocator
>   meson: fix BSD build
>   meson: do not redeclare pkg-config dependencies (yet)
>   meson: handle LLVM 'x.x.xgit-revision' versions
>   meson: fix missing dependencies
>   swr: build on FreeBSD/DragonFlyBSD
>   swr: fix clang 5 null cast warning
>   meson: glsl: add missing nir header dependency
> 
>  meson.build| 74 
> --
>  src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c  |  3 +
>  src/compiler/glsl/meson.build  |  2 +-
>  src/gallium/drivers/radeonsi/meson.build   |  2 +-
>  src/gallium/drivers/swr/rasterizer/common/os.h |  3 +-
>  .../drivers/swr/rasterizer/core/threads.cpp|  4 +-
>  .../swr/rasterizer/memory/TilingFunctions.h|  6 +-
>  src/gallium/drivers/swr/swr_fence.cpp  |  2 +
>  src/gallium/drivers/vc4/vc4_bufmgr.c   |  4 ++
>  src/gallium/drivers/vc5/vc5_bufmgr.c   |  4 ++
>  src/intel/vulkan/anv_allocator.c   | 56 
>  src/intel/vulkan/anv_device.c  | 11 
>  src/intel/vulkan/anv_gem.c |  4 ++
>  src/intel/vulkan/anv_queue.c   |  5 +-
>  src/mesa/meson.build   |  1 +
>  src/util/build_id.c|  6 +-
>  16 files changed, 144 insertions(+), 43 deletions(-)
> 
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] meson: Don't confuse the install and search paths for dri drivers

2018-01-17 Thread Dylan Baker
Currently there is not a separate option for setting the search path of
DRI drivers in meson, like there is in scons and autotools. This is an
oversight and needs to be fixed. This adds an extra option
`dri-search-path`, which will default to the value of
`dri-drivers-path`, like autotools does.

Reported-by: Ilia Mirkin <imir...@alum.mit.edu>
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build | 6 ++
 meson_options.txt   | 8 +++-
 src/egl/meson.build | 2 +-
 src/gbm/meson.build | 2 +-
 src/glx/meson.build | 3 ++-
 5 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index ae31cdd6571..8002668666b 100644
--- a/meson.build
+++ b/meson.build
@@ -57,6 +57,12 @@ dri_drivers_path = get_option('dri-drivers-path')
 if dri_drivers_path == ''
   dri_drivers_path = join_paths(get_option('libdir'), 'dri')
 endif
+_search = get_option('dri-search-path')
+if _search != ''
+  dri_search_path = ';'.join(_search)
+else
+  dri_search_path = dri_drivers_path
+endif
 
 with_gles1 = get_option('gles1')
 with_gles2 = get_option('gles2')
diff --git a/meson_options.txt b/meson_options.txt
index 894378985fd..e541659733f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -41,7 +41,13 @@ option(
   'dri-drivers-path',
   type : 'string',
   value : '',
-  description : 'Location of dri drivers. Default: $libdir/dri.'
+  description : 'Location to install dri drivers. Default: $libdir/dri.'
+)
+option(
+  'dri-search-path',
+  type : 'string',
+  value : '',
+  description : 'Locations to search for dri drivers, passed as comma 
separated list. Default: dri-drivers-path.'
 )
 option(
   'gallium-drivers',
diff --git a/src/egl/meson.build b/src/egl/meson.build
index df6e8b49dac..6cd04567b0d 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -160,7 +160,7 @@ libegl = shared_library(
   c_args : [
 c_vis_args,
 c_args_for_egl,
-'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 '-D_EGL_BUILT_IN_DRIVER_DRI2',
 
'-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
   ],
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 14b9e960360..2f5d1c6ddd7 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -38,7 +38,7 @@ incs_gbm = [
 if with_dri2
   files_gbm += files('backends/dri/gbm_dri.c', 'backends/dri/gbm_driint.h')
   deps_gbm += dep_libdrm # TODO: pthread-stubs
-  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir)
+  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path)
 endif
 if with_platform_wayland
   deps_gbm += dep_wayland_server
diff --git a/src/glx/meson.build b/src/glx/meson.build
index 04cd647ee49..508e7583ee5 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -128,7 +128,8 @@ else
 endif
 
 gl_lib_cargs = [
-  '-D_REENTRANT', '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+  '-D_REENTRANT',
+  '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 ]
 
 if dep_xxf86vm != [] and dep_xxf86vm.found()
-- 
2.15.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: add llvm dependency for swr build

2018-01-17 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting George Kyriazis (2018-01-16 13:25:45)
> cc: Dylan Baker <dy...@pnwbakers.com>
> ---
>  src/gallium/drivers/swr/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/drivers/swr/meson.build 
> b/src/gallium/drivers/swr/meson.build
> index c8c69b0..8dffb4c 100644
> --- a/src/gallium/drivers/swr/meson.build
> +++ b/src/gallium/drivers/swr/meson.build
> @@ -281,6 +281,7 @@ libmesaswr = static_library(
> gen_builder_hpp, gen_builder_x86_hpp],
>cpp_args : [cpp_vis_args, swr_cpp_args, swr_avx_args, swr_arch_defines],
>include_directories : [inc_common, swr_incs],
> +  dependencies : dep_llvm,
>  )
>  
>  driver_swr = declare_dependency(
> -- 
> 2.7.4
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define

2018-01-18 Thread Dylan Baker
I'm not sure how Emil feels about this (and the related patches) but I think it
might be better to handle this at the build system level, for meson it would
look something like (in the top level meson.build):

if cc.get_define('ETIME') == ''
  pre_args += '-DETIME=ETIMEDOUT'
endif

Which should be a permanent fix. Emil can probably provide an autotools
equivalent.

Quoting Greg V (2017-12-31 08:55:16)
> FreeBSD only has ETIMEDOUT, not ETIME
> ---
>  src/gallium/drivers/vc4/vc4_bufmgr.c | 4 
>  src/gallium/drivers/vc5/vc5_bufmgr.c | 4 
>  2 files changed, 8 insertions(+)
> 
> diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c 
> b/src/gallium/drivers/vc4/vc4_bufmgr.c
> index 274c4c3120..cbc1e1ae1b 100644
> --- a/src/gallium/drivers/vc4/vc4_bufmgr.c
> +++ b/src/gallium/drivers/vc4/vc4_bufmgr.c
> @@ -35,6 +35,10 @@
>  #include "vc4_context.h"
>  #include "vc4_screen.h"
>  
> +#ifndef ETIME
> +#define ETIME ETIMEDOUT
> +#endif
> +
>  #ifdef HAVE_VALGRIND
>  #include 
>  #include 
> diff --git a/src/gallium/drivers/vc5/vc5_bufmgr.c 
> b/src/gallium/drivers/vc5/vc5_bufmgr.c
> index c6c06dcfda..b676373689 100644
> --- a/src/gallium/drivers/vc5/vc5_bufmgr.c
> +++ b/src/gallium/drivers/vc5/vc5_bufmgr.c
> @@ -35,6 +35,10 @@
>  #include "vc5_context.h"
>  #include "vc5_screen.h"
>  
> +#ifndef ETIME
> +#define ETIME ETIMEDOUT
> +#endif
> +
>  #ifdef HAVE_VALGRIND
>  #include 
>  #include 
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: generate translations for driconf

2018-01-18 Thread Dylan Baker
Quoting Eric Anholt (2018-01-17 12:58:27)
> Dylan Baker <dy...@pnwbakers.com> writes:
> 
> > Currently meson implements the same logic as SCons for translations,
> > namely it doesn't do them. This patch changes meson to use logic more
> > like autotools, and generate translations. To do this we have to go
> > behind meson's back a bit, and wrap the whole thing up in a single
> > python script.
> >
> > Meson has a module for gettext translations, but it assumes that one
> > will have a pot file, and then .mo translations will be generated and
> > checked into the source repo (or generated by hand using custom ninja
> > targets before building), mesa assumes that the targets will be
> > regenerated on each invocation of make or ninja. I think this can be
> > fixed upstream, but in the mean time this adds support for using
> > translations.
> 
> Is there a reason you have a new python script, instead of having each
> msgfmt invcation generating a mo file in its own custom target, and then
> the custom target for the gen_xmlpool.py call depending on that?

Because generators and custom targets can't output into subfolders, so we can't
use a meson level constructs to create the structure that gettext requires. I'd
really like to just change the meson i18n stuff to be available at build time
instead of creating run-targets, since that would do exactly what we want, but I
haven't gotten there yet.

I forgot to add that to the commit message.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] autotools: include meson build files in tarball

2018-01-18 Thread Dylan Baker
This adds the meson.build, meson_options.txt, and a few scripts that are
used exclusively by the meson build.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 Makefile.am |  7 ++-
 src/Makefile.am |  2 +-
 src/amd/Makefile.am |  9 -
 src/amd/vulkan/Makefile.am  |  3 ++-
 src/broadcom/Makefile.am|  7 ++-
 src/compiler/Makefile.am|  9 -
 src/egl/Makefile.am |  3 ++-
 src/egl/wayland/wayland-drm/Makefile.am |  2 +-
 src/egl/wayland/wayland-egl/Makefile.am |  2 +-
 src/gallium/Makefile.am |  3 ++-
 src/gallium/auxiliary/Makefile.am   |  3 ++-
 src/gallium/auxiliary/pipe-loader/Makefile.am   |  2 +-
 src/gallium/drivers/ddebug/Makefile.am  |  2 ++
 src/gallium/drivers/etnaviv/Makefile.am |  2 ++
 src/gallium/drivers/freedreno/Makefile.am   |  2 ++
 src/gallium/drivers/i915/Makefile.am|  2 +-
 src/gallium/drivers/llvmpipe/Makefile.am|  2 +-
 src/gallium/drivers/noop/Makefile.am|  2 +-
 src/gallium/drivers/nouveau/Makefile.am |  2 +-
 src/gallium/drivers/r300/Makefile.am|  3 ++-
 src/gallium/drivers/r600/Makefile.am|  3 ++-
 src/gallium/drivers/radeon/Makefile.am  |  2 ++
 src/gallium/drivers/radeonsi/Makefile.am|  1 +
 src/gallium/drivers/rbug/Makefile.am|  2 +-
 src/gallium/drivers/softpipe/Makefile.am|  2 +-
 src/gallium/drivers/svga/Makefile.am|  3 ++-
 src/gallium/drivers/swr/Makefile.am |  9 ++---
 src/gallium/drivers/trace/Makefile.am   |  3 ++-
 src/gallium/drivers/vc4/Makefile.am |  2 +-
 src/gallium/drivers/vc5/Makefile.am |  2 ++
 src/gallium/drivers/virgl/Makefile.am   |  2 ++
 src/gallium/state_trackers/clover/Makefile.am   |  2 +-
 src/gallium/state_trackers/dri/Makefile.am  |  2 +-
 src/gallium/state_trackers/glx/xlib/Makefile.am |  2 +-
 src/gallium/state_trackers/nine/Makefile.am |  2 +-
 src/gallium/state_trackers/omx_bellagio/Makefile.am |  2 ++
 src/gallium/state_trackers/osmesa/Makefile.am   |  2 +-
 src/gallium/state_trackers/va/Makefile.am   |  2 ++
 src/gallium/state_trackers/vdpau/Makefile.am|  2 ++
 src/gallium/state_trackers/xa/Makefile.am   |  2 +-
 src/gallium/state_trackers/xvmc/Makefile.am |  2 ++
 src/gallium/targets/d3dadapter9/Makefile.am |  2 +-
 src/gallium/targets/dri/Makefile.am |  1 +
 src/gallium/targets/libgl-xlib/Makefile.am  |  2 +-
 src/gallium/targets/omx-bellagio/Makefile.am|  2 +-
 src/gallium/targets/opencl/Makefile.am  |  2 +-
 src/gallium/targets/osmesa/Makefile.am  |  3 ++-
 src/gallium/targets/pipe-loader/Makefile.am |  2 +-
 src/gallium/targets/va/Makefile.am  |  2 +-
 src/gallium/targets/vdpau/Makefile.am   |  3 ++-
 src/gallium/targets/xa/Makefile.am  |  2 +-
 src/gallium/targets/xvmc/Makefile.am|  2 +-
 src/gallium/winsys/amdgpu/drm/Makefile.am   |  2 ++
 src/gallium/winsys/etnaviv/drm/Makefile.am  |  2 ++
 src/gallium/winsys/freedreno/drm/Makefile.am|  2 ++
 src/gallium/winsys/i915/drm/Makefile.am |  2 ++
 src/gallium/winsys/imx/drm/Makefile.am  |  2 ++
 src/gallium/winsys/nouveau/drm/Makefile.am  |  2 ++
 src/gallium/winsys/pl111/drm/Makefile.am|  2 ++
 src/gallium/winsys/radeon/drm/Makefile.am   |  2 ++
 src/gallium/winsys/svga/drm/Makefile.am |  2 +-
 src/gallium/winsys/sw/dri/Makefile.am   |  2 +-
 src/gallium/winsys/sw/kms-dri/Makefile.am   |  2 ++
 src/gallium/winsys/sw/null/Makefile.am  |  2 +-
 src/gallium/winsys/sw/wrapper/Makefile.am   |  2 +-
 src/gallium/winsys/sw/xlib/Makefile.am  |  2 +-
 src/gallium/winsys/vc4/drm/Makefile.am  |  2 ++
 src/gallium/winsys/vc5/drm/Makefile.am  |  2 ++
 src/gallium/winsys/virgl/drm/Makefile.am|  2 ++
 src/gallium/winsys/virgl/vtest/Makefile.am  |  2 ++
 src/gbm/Makefile.am |  2 +-
 src/glx/Makefile.am |  2 +-
 src/glx/tests/Makefile.am   |  2 +-
 src/glx/windows/Makefile.am |  2 ++
 src/gtest/Makefile.am   |  3 ++-
 src/intel/Makefile.am   | 10 +-
 src/loader/Makefile.am  |  2 +-
 src/mapi/Makefile.am|  7 ++-
 src/mapi/gla

[Mesa-dev] [PATCH] meson: ensure that xmlpool_options.h is generated for targets that need it

2018-01-18 Thread Dylan Baker
Currently a couple of gallium targets race with xmlpool_options.h being
generated, don't do that.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/auxiliary/pipe-loader/meson.build |  4 ++--
 src/gallium/targets/d3dadapter9/meson.build   |  2 +-
 src/gallium/targets/pipe-loader/meson.build   | 18 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
b/src/gallium/auxiliary/pipe-loader/meson.build
index 869a2935149..32e8188c68b 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -37,7 +37,7 @@ endif
 
 libpipe_loader_static = static_library(
   'pipe_loader_static',
-  files_pipe_loader,
+  [files_pipe_loader, xmlpool_options_h],
   include_directories : [
 inc_util, inc_loader, inc_gallium, inc_include, inc_src, inc_gallium_aux,
 inc_gallium_winsys,
@@ -53,7 +53,7 @@ libpipe_loader_static = static_library(
 
 libpipe_loader_dynamic = static_library(
   'pipe_loader_dynamic',
-  files_pipe_loader,
+  [files_pipe_loader, xmlpool_options_h],
   include_directories : [
 inc_util, inc_loader, inc_gallium, inc_include, inc_src, inc_gallium_aux,
 inc_gallium_winsys,
diff --git a/src/gallium/targets/d3dadapter9/meson.build 
b/src/gallium/targets/d3dadapter9/meson.build
index 27a87972215..61bb5649ae5 100644
--- a/src/gallium/targets/d3dadapter9/meson.build
+++ b/src/gallium/targets/d3dadapter9/meson.build
@@ -47,7 +47,7 @@ endif
 
 libgallium_nine = shared_library(
   'd3dadapter9',
-  files('description.c', 'getproc.c', 'drm.c'),
+  [files('description.c', 'getproc.c', 'drm.c'), xmlpool_options_h],
   include_directories : [
 inc_include, inc_src, inc_loader, inc_mapi, inc_mesa, inc_util,
 inc_dri_common, inc_gallium, inc_gallium_aux, inc_gallium_winsys,
diff --git a/src/gallium/targets/pipe-loader/meson.build 
b/src/gallium/targets/pipe-loader/meson.build
index 6141d4374fe..25b26a34cac 100644
--- a/src/gallium/targets/pipe-loader/meson.build
+++ b/src/gallium/targets/pipe-loader/meson.build
@@ -47,21 +47,21 @@ endif
 pipe_loader_install_dir = join_paths(get_option('libdir'), 'gallium-pipe')
 
 pipe_loaders = [
-  [with_gallium_i915, 'i915', driver_i915, []],
-  [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
-  [with_gallium_r300, 'r300', driver_r300, []],
-  [with_gallium_r600, 'r600', driver_r600, []],
-  [with_gallium_radeonsi, 'radeonsi', driver_radeonsi, [libxmlconfig]],
-  [with_gallium_freedreno, 'msm', driver_freedreno, []],
-  [with_gallium_svga, 'vmwgfx', driver_svga, []],
-  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, 
libws_null]],
+  [with_gallium_i915, 'i915', driver_i915, [], []],
+  [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []],
+  [with_gallium_r300, 'r300', driver_r300, [], []],
+  [with_gallium_r600, 'r600', driver_r600, [], []],
+  [with_gallium_radeonsi, 'radeonsi', driver_radeonsi, [libxmlconfig], 
[xmlpool_options_h]],
+  [with_gallium_freedreno, 'msm', driver_freedreno, [], []],
+  [with_gallium_svga, 'vmwgfx', driver_svga, [], []],
+  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, 
libws_null], []],
 ]
 
 foreach x : pipe_loaders
   if x[0]
 shared_library(
   'pipe_@0@'.format(x[1]),
-  'pipe_@0@.c'.format(x[1]),
+  ['pipe_@0@.c'.format(x[1]), x[4]],
   c_args : [pipe_loader_comp_args, c_vis_args],
   cpp_args : [pipe_loader_comp_args, cpp_vis_args],
   link_args : pipe_loader_link_args,
-- 
2.15.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] meson: Don't confuse the install and search paths for dri drivers

2018-01-18 Thread Dylan Baker
Currently there is not a separate option for setting the search path of
DRI drivers in meson, like there is in scons and autotools. This is an
oversight and needs to be fixed. This adds an extra option
`dri-search-path`, which will default to the value of
`dri-drivers-path`, like autotools does.

v2: - Split input list before joining.

Reported-by: Ilia Mirkin <imir...@alum.mit.edu>
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build | 6 ++
 meson_options.txt   | 8 +++-
 src/egl/meson.build | 2 +-
 src/gbm/meson.build | 2 +-
 src/glx/meson.build | 3 ++-
 5 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index f3179c38062..8bab43681e9 100644
--- a/meson.build
+++ b/meson.build
@@ -57,6 +57,12 @@ dri_drivers_path = get_option('dri-drivers-path')
 if dri_drivers_path == ''
   dri_drivers_path = join_paths(get_option('libdir'), 'dri')
 endif
+_search = get_option('dri-search-path')
+if _search != ''
+  dri_search_path = ';'.join(_search.split(','))
+else
+  dri_search_path = dri_drivers_path
+endif
 
 with_gles1 = get_option('gles1')
 with_gles2 = get_option('gles2')
diff --git a/meson_options.txt b/meson_options.txt
index 894378985fd..e541659733f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -41,7 +41,13 @@ option(
   'dri-drivers-path',
   type : 'string',
   value : '',
-  description : 'Location of dri drivers. Default: $libdir/dri.'
+  description : 'Location to install dri drivers. Default: $libdir/dri.'
+)
+option(
+  'dri-search-path',
+  type : 'string',
+  value : '',
+  description : 'Locations to search for dri drivers, passed as comma 
separated list. Default: dri-drivers-path.'
 )
 option(
   'gallium-drivers',
diff --git a/src/egl/meson.build b/src/egl/meson.build
index df6e8b49dac..6cd04567b0d 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -160,7 +160,7 @@ libegl = shared_library(
   c_args : [
 c_vis_args,
 c_args_for_egl,
-'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 '-D_EGL_BUILT_IN_DRIVER_DRI2',
 
'-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
   ],
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 14b9e960360..2f5d1c6ddd7 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -38,7 +38,7 @@ incs_gbm = [
 if with_dri2
   files_gbm += files('backends/dri/gbm_dri.c', 'backends/dri/gbm_driint.h')
   deps_gbm += dep_libdrm # TODO: pthread-stubs
-  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir)
+  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path)
 endif
 if with_platform_wayland
   deps_gbm += dep_wayland_server
diff --git a/src/glx/meson.build b/src/glx/meson.build
index 04cd647ee49..508e7583ee5 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -128,7 +128,8 @@ else
 endif
 
 gl_lib_cargs = [
-  '-D_REENTRANT', '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+  '-D_REENTRANT',
+  '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 ]
 
 if dep_xxf86vm != [] and dep_xxf86vm.found()
-- 
2.15.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-18 Thread Dylan Baker
No worries, December is a busy time of year.

Quoting Greg V (2018-01-17 12:57:39)
> On 01/17/2018 00:59, Dylan Baker wrote:
> > Just wanted to see how things were going on this, especially for the meson 
> > bits
> > as I'd like to get them merged before the 18.0 merge window closes.
> Sorry for the delay, was distracted by other things :) Edited the meson 
> patches and re-sent them to the list.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 3/4] meson: fix getting cflags from pkg-config

2018-01-18 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Greg V (2018-01-17 12:54:17)
> get_pkgconfig_variable('cflags') always returns an empty list, it's a
> function for getting *custom* variables.
> 
> Meson does not yet support asking for cflags, so explicitly invoke
> pkg-config for now.
> ---
>  meson.build | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 2e7816b720..7dbc9d6518 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -373,6 +373,8 @@ if with_dri or with_gallium
>endif
>  endif
>  
> +prog_pkgconfig = find_program('pkg-config')
> +
>  dep_vdpau = []
>  _vdpau = get_option('gallium-vdpau')
>  if _vdpau == 'auto'
> @@ -404,7 +406,7 @@ else
>  endif
>  if with_gallium_vdpau
>dep_vdpau = declare_dependency(
> -compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['vdpau', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -445,7 +447,7 @@ else
>  endif
>  if with_gallium_xvmc
>dep_xvmc = declare_dependency(
> -compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['xvmc', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -508,7 +510,7 @@ if with_gallium_omx
>  endif
>  if with_gallium_omx
>dep_omx = declare_dependency(
> -compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['libomxil-bellagio', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -541,7 +543,7 @@ else
>  endif
>  if with_gallium_va
>dep_va = declare_dependency(
> -compile_args : dep_va.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['libva', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 4/4] meson: fix missing dependencies

2018-01-18 Thread Dylan Baker
Quoting Greg V (2018-01-17 12:54:18)
> ---
>  meson.build  | 4 
>  src/gallium/drivers/radeonsi/meson.build | 2 +-
>  src/mesa/meson.build | 2 +-
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 7dbc9d6518..a301a62f3c 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -949,6 +949,10 @@ if dep_libdrm.found()
>endif
>  endif
>  
> +dep_libdrm_headers = declare_dependency(
> +  compile_args : run_command(prog_pkgconfig, ['libdrm', 
> '--cflags']).stdout().split()
> +)
> +
>  # TODO: some of these may be conditional
>  dep_zlib = dependency('zlib', version : '>= 1.2.3')
>  pre_args += '-DHAVE_ZLIB'
> diff --git a/src/gallium/drivers/radeonsi/meson.build 
> b/src/gallium/drivers/radeonsi/meson.build
> index 97c7a41244..15417d22bf 100644
> --- a/src/gallium/drivers/radeonsi/meson.build
> +++ b/src/gallium/drivers/radeonsi/meson.build
> @@ -77,7 +77,7 @@ libradeonsi = static_library(
>],
>c_args : [c_vis_args],
>cpp_args : [cpp_vis_args],
> -  dependencies : [dep_llvm, idep_nir_headers],
> +  dependencies : [dep_llvm, dep_libdrm_headers, idep_nir_headers],
>  )

I'm not sure about the two hunks above. There are a number of places that we're
currently using the full libdrm dependency (including linking) apart from
radeonsi. I think I'd rather:
1) just use dep_libdrm here
2) convert all uses of libdrm that don't actually need linking to use
   dep_libdrm_headers all at once.

It's probably worth doing 2 at some point even if we don't do it now.

The rest of this looks good though.

Dylan

>  
>  driver_radeonsi = declare_dependency(
> diff --git a/src/mesa/meson.build b/src/mesa/meson.build
> index 998953d641..32eed5231b 100644
> --- a/src/mesa/meson.build
> +++ b/src/mesa/meson.build
> @@ -721,7 +721,7 @@ libmesa_gallium = static_library(
>cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
>include_directories : [inc_common, include_directories('main')],
>link_with : [libglsl, libmesa_sse41],
> -  dependencies : idep_nir_headers,
> +  dependencies : [idep_nir_headers, dep_vdpau],
>build_by_default : false,
>  )


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/6] meson: fix va-api target linkage

2018-01-18 Thread Dylan Baker
Quoting Marc Dietrich (2018-01-18 04:03:21)
> Am Mittwoch, 17. Januar 2018, 19:34:48 CET schrieb Dylan Baker:
> > The state tracker needs to be linked with whole-archive (like
> > autotools), and we need a few window system deps.
> > 
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > ---
> >  src/gallium/targets/va/meson.build | 14 ++
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> still breaks here because of __vaDriverInit_{version} confusion. I have 
> libva-2.0.0 installed. Autotools ask for "pkg-config --modversion libva", 
> which returns 1.0.0, this gets used for the function name 
> (__vaDriverInit_1_0). On the other hand, meson hard codes 2.3.0 for some 
> reason, resulting in __vaDriverInit_2.3.
> 
> Maybe meson should do the same as autotools, but I'm not sure.
> 
> Marc

It should. I don't know why 2.3 is hardcoded, probably some development code
that I forgot to remove :/

I'll send a v2 with that patch.

> 
>  
> > diff --git a/src/gallium/targets/va/meson.build
> > b/src/gallium/targets/va/meson.build index 0ea0cd1..e2785d0 100644
> > --- a/src/gallium/targets/va/meson.build
> > +++ b/src/gallium/targets/va/meson.build
> > @@ -25,14 +25,19 @@
> >  va_deps = []
> >  va_link_args = []
> >  va_link_depends = []
> > +va_link_with = []
> >  va_drivers = []
> > 
> >  if with_ld_version_script
> >va_link_args += ['-Wl,--version-script',
> > join_paths(meson.current_source_dir(), 'va.sym')] va_link_depends +=
> > files('va.sym')
> >  endif
> > -if with_platform_x11
> > -  va_deps += [dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3]
> > +
> > +if with_dri
> > +  va_link_with += libswdri
> > +endif
> > +if with_gallium_drisw_kms
> > +  va_link_with += libswkmsdri
> >  endif
> > 
> >  libva_gallium = shared_library(
> > @@ -44,9 +49,10 @@ libva_gallium = shared_library(
> >include_directories : [
> >  inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
> >],
> > +  link_whole : [libva_st],
> >link_with : [
> > -libva_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> > -libpipe_loader_static, libws_null, libwsw,
> > +libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> > +libpipe_loader_static, libws_null, libwsw, va_link_with,
> >],
> >dependencies : [
> >  dep_libdrm, dep_thread, va_deps, driver_r600, driver_radeonsi,
> > driver_nouveau,
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define

2018-01-18 Thread Dylan Baker
Forgot to CC Emil...

Quoting Dylan Baker (2018-01-18 09:13:13)
> I'm not sure how Emil feels about this (and the related patches) but I think 
> it
> might be better to handle this at the build system level, for meson it would
> look something like (in the top level meson.build):
> 
> if cc.get_define('ETIME') == ''
>   pre_args += '-DETIME=ETIMEDOUT'
> endif
> 
> Which should be a permanent fix. Emil can probably provide an autotools
> equivalent.
> 
> Quoting Greg V (2017-12-31 08:55:16)
> > FreeBSD only has ETIMEDOUT, not ETIME
> > ---
> >  src/gallium/drivers/vc4/vc4_bufmgr.c | 4 
> >  src/gallium/drivers/vc5/vc5_bufmgr.c | 4 
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c 
> > b/src/gallium/drivers/vc4/vc4_bufmgr.c
> > index 274c4c3120..cbc1e1ae1b 100644
> > --- a/src/gallium/drivers/vc4/vc4_bufmgr.c
> > +++ b/src/gallium/drivers/vc4/vc4_bufmgr.c
> > @@ -35,6 +35,10 @@
> >  #include "vc4_context.h"
> >  #include "vc4_screen.h"
> >  
> > +#ifndef ETIME
> > +#define ETIME ETIMEDOUT
> > +#endif
> > +
> >  #ifdef HAVE_VALGRIND
> >  #include 
> >  #include 
> > diff --git a/src/gallium/drivers/vc5/vc5_bufmgr.c 
> > b/src/gallium/drivers/vc5/vc5_bufmgr.c
> > index c6c06dcfda..b676373689 100644
> > --- a/src/gallium/drivers/vc5/vc5_bufmgr.c
> > +++ b/src/gallium/drivers/vc5/vc5_bufmgr.c
> > @@ -35,6 +35,10 @@
> >  #include "vc5_context.h"
> >  #include "vc5_screen.h"
> >  
> > +#ifndef ETIME
> > +#define ETIME ETIMEDOUT
> > +#endif
> > +
> >  #ifdef HAVE_VALGRIND
> >  #include 
> >  #include 
> > -- 
> > 2.15.1
> > 
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 7/6] meson: use va-api version reported by pkg-config

2018-01-18 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build   | 2 +-
 src/gallium/state_trackers/va/meson.build | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 1ec9e4c2221..c95c44641f9 100644
--- a/meson.build
+++ b/meson.build
@@ -528,7 +528,7 @@ else
   with_gallium_va = false
 endif
 if with_gallium_va
-  dep_va = declare_dependency(
+  dep_va_headers = declare_dependency(
 compile_args : dep_va.get_pkgconfig_variable('cflags').split()
   )
 endif
diff --git a/src/gallium/state_trackers/va/meson.build 
b/src/gallium/state_trackers/va/meson.build
index 56e68e9e28d..35da5ab532d 100644
--- a/src/gallium/state_trackers/va/meson.build
+++ b/src/gallium/state_trackers/va/meson.build
@@ -1,4 +1,4 @@
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -18,7 +18,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-libva_version = ['2', '3', '0']
+libva_version = dep_va.version().split('.')
 
 libva_st = static_library(
   'va_st',
@@ -35,5 +35,5 @@ libva_st = static_library(
 ),
   ],
   include_directories : [inc_common],
-  dependencies : [dep_va, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
+  dependencies : [dep_va_headers, dep_x11_xcb, dep_xcb, dep_xcb_dri2, 
dep_xcb_dri3],
 )
-- 
2.15.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/6] meson: fix va-api target linkage

2018-01-18 Thread Dylan Baker
Quoting Marc Dietrich (2018-01-18 04:03:21)
> Am Mittwoch, 17. Januar 2018, 19:34:48 CET schrieb Dylan Baker:
> > The state tracker needs to be linked with whole-archive (like
> > autotools), and we need a few window system deps.
> > 
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > ---
> >  src/gallium/targets/va/meson.build | 14 ++
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> still breaks here because of __vaDriverInit_{version} confusion. I have 
> libva-2.0.0 installed. Autotools ask for "pkg-config --modversion libva", 
> which returns 1.0.0, this gets used for the function name 
> (__vaDriverInit_1_0). On the other hand, meson hard codes 2.3.0 for some 
> reason, resulting in __vaDriverInit_2.3.
> 
> Maybe meson should do the same as autotools, but I'm not sure.
> 
> Marc

I've added a patch 7/6 to this series that should fix this, please let me know
if it does.

> 
>  
> > diff --git a/src/gallium/targets/va/meson.build
> > b/src/gallium/targets/va/meson.build index 0ea0cd1..e2785d0 100644
> > --- a/src/gallium/targets/va/meson.build
> > +++ b/src/gallium/targets/va/meson.build
> > @@ -25,14 +25,19 @@
> >  va_deps = []
> >  va_link_args = []
> >  va_link_depends = []
> > +va_link_with = []
> >  va_drivers = []
> > 
> >  if with_ld_version_script
> >va_link_args += ['-Wl,--version-script',
> > join_paths(meson.current_source_dir(), 'va.sym')] va_link_depends +=
> > files('va.sym')
> >  endif
> > -if with_platform_x11
> > -  va_deps += [dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3]
> > +
> > +if with_dri
> > +  va_link_with += libswdri
> > +endif
> > +if with_gallium_drisw_kms
> > +  va_link_with += libswkmsdri
> >  endif
> > 
> >  libva_gallium = shared_library(
> > @@ -44,9 +49,10 @@ libva_gallium = shared_library(
> >include_directories : [
> >  inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
> >],
> > +  link_whole : [libva_st],
> >link_with : [
> > -libva_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> > -libpipe_loader_static, libws_null, libwsw,
> > +libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> > +libpipe_loader_static, libws_null, libwsw, va_link_with,
> >],
> >dependencies : [
> >  dep_libdrm, dep_thread, va_deps, driver_r600, driver_radeonsi,
> > driver_nouveau,
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 2/4] meson: handle LLVM 'x.x.xgit-revision' versions

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 10:22:50)
> On 17 January 2018 at 20:54, Greg V  wrote:
> > When LLVM is built inside of a git repo (even way below, e.g. 
> > /usr/ports/.git
> > exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version
> > becomes something like 5.0.0git-f8ab206b2176.
> >
> > New meson versions already handle this, but we support older versions too.
> >
> Crazy idea:
> Using a grep-like solution analogous to autotools [1]. That will work
> with old/new Meson, svn, git, plus any other suffix as LLVM devs
> decide to change it.
> 
> -Emil
> 
> [1] llvm-config --version | egrep -o '^[0-9]+'
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

That is a much nicer idea. I've submitted a meson patch to do this instead of
specifically stripping svn.* and git.*


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix the install path of amdgpu.ids

2018-01-18 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

I'll go ahead and push this.

Quoting Christoph Haag (2018-01-18 10:01:55)
> ---
>  amdgpu/meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/amdgpu/meson.build b/amdgpu/meson.build
> index 55ab9d1d..8b045205 100644
> --- a/amdgpu/meson.build
> +++ b/amdgpu/meson.build
> @@ -19,7 +19,7 @@
>  # SOFTWARE.
>  
>  
> -datadir_amdgpu = join_paths(get_option('datadir'), 'libdrm', 'amdgpu.ids')
> +datadir_amdgpu = join_paths(get_option('prefix'), get_option('datadir'), 
> 'libdrm')
>  
>  libdrm_amdgpu = shared_library(
>'drm_amdgpu',
> @@ -33,7 +33,7 @@ libdrm_amdgpu = shared_library(
>],
>c_args : [
>  warn_c_args,
> -'-DAMDGPU_ASIC_ID_TABLE="@0@"'.format(datadir_amdgpu),
> +'-DAMDGPU_ASIC_ID_TABLE="@0@"'.format(join_paths(datadir_amdgpu, 
> 'amdgpu.ids')),
>],
>include_directories : [inc_root, inc_drm],
>link_with : libdrm,
> -- 
> 2.16.0
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] anv_icd.py: improve reproducible builds

2018-01-18 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting maxin.j...@gmail.com (2018-01-18 03:33:37)
> From: "Maxin B. John" <maxin.j...@intel.com>
> 
> Sort the output to ensure build reproducibility
> 
> Signed-off-by: Maxin B. John <maxin.j...@intel.com>
> ---
>  src/intel/vulkan/anv_icd.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/intel/vulkan/anv_icd.py b/src/intel/vulkan/anv_icd.py
> index 4ed01fa..31bb068 100644
> --- a/src/intel/vulkan/anv_icd.py
> +++ b/src/intel/vulkan/anv_icd.py
> @@ -44,4 +44,4 @@ if __name__ == '__main__':
>  }
>  
>  with open(args.out, 'w') as f:
> -json.dump(json_data, f, indent = 4)
> +json.dump(json_data, f, indent = 4, sort_keys=True)
> -- 
> 2.4.0
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/6] meson: fix gallium media target linkage

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 11:12:30)
> On 17 January 2018 at 18:34, Dylan Baker <dy...@pnwbakers.com> wrote:
> > The linkage of all of the gallium media targets is broken in various
> > ways in the meson build. This series should correct that by doing more
> > what the autotools build does.
> >
> Above all and slightly unrelated, can I ask you about the rather
> unusual gallium- prefix for vdpau and friends?
> Can we drop it, please?

Since vdpau, nine, va, etc depend on gallium it makes sense to me to give them
gallium based names. *shrug*

> 
> AFAICT there are a few corner cases, plus patches tends to do a few
> somewhat unrelated things.
> Can you please wait up until tomorrow (have to run for the final bus
> home in 5 mins) I'll share some tips making the build scripts shorter
> and more robust.
> 
> Obviously, the patches are suitable material after the branch point,
> so please don't rush to get everything merged by tomorrow.
> 
> Thanks
> Emil


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 3/4] meson: fix getting cflags from pkg-config

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 10:26:20)
> On 17 January 2018 at 20:54, Greg V  wrote:
> > get_pkgconfig_variable('cflags') always returns an empty list, it's a
> > function for getting *custom* variables.
> >
> > Meson does not yet support asking for cflags, so explicitly invoke
> > pkg-config for now.
> That sounds unfortunate ;-(

Indeed, I'm hoping this will be resolved in 0.45

> Is the proposed solution going to work correctly if one explicitly
> asks for gallium-vdpau, yet the vdpau package is missing?
> 
> -Emil

Yes, you'll have a hard error before that, since in the vdpau == 'true' case if
you don't have vdpau then you'll have a hard error.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 12/14] swr: build on FreeBSD/DragonFlyBSD

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 10:50:05)
> On 18 January 2018 at 18:09, Greg V  wrote:
> > On 01/18/2018 21:01, Emil Velikov wrote:
> >>
> >> On 31 December 2017 at 16:55, Greg V  wrote:
> >>>
> >>> (Needs CPU topology detection to actually work)
> >>
> >> IMHO it might be better to drop the patch, until its actually working.
> >> There's little point in building it if one cannot use it.
> >>
> >> What do you think?
> >
> > Yeah, I guess I only mentioned that in the cover letter or somewhere — I
> > have written that code and tested swr.
> >
> > Problem is, the topology is exposed as an XML string, so I used TinyXML2 to
> > parse it.
> > But I couldn't even figure out how to add that dependency to autotools, and
> > meson doesn't build swr yet.
> > Also not sure if that dependency is acceptable for Mesa.
> > (I guess it's technically possible to use Expat, which is already a
> > dependency, but ugh nope.)
> 
> My bad - I should have thoroughly read the cover letter first.
> Expat would be amazing (long term), although in the short term
> TinyXML2 would do.
> 
> Handling autotools is trivial
> 
> configure.ac:
> // go to the if building SWR hunk
> PKG_CHECK_MODULES([symbolic_name], [tinyxml2 >= $min_required version]
> 
> Then use symbolic_name_CFLAGS and symbolic_name_LIBS in the
> appropriate places...
> Without seeing the patch cannot tell you where exactly, since SWR is a
> bit funky and produces five binaries.

We do build swr in meson now, something like:
dep_tinyxml2 = dependency('tinyxml2', version : '>= $min_required')

And then add it to the `dependencies :` argument in the relevant libraries. It
would be nice to use expat, since we basically always require that.

> 
> -Emil
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 10:40:40)
> On 18 January 2018 at 17:13, Dylan Baker <dy...@pnwbakers.com> wrote:
> > I'm not sure how Emil feels about this (and the related patches) but I 
> > think it
> > might be better to handle this at the build system level, for meson it would
> > look something like (in the top level meson.build):
> >
> > if cc.get_define('ETIME') == ''
> >   pre_args += '-DETIME=ETIMEDOUT'
> > endif
> >
> > Which should be a permanent fix. Emil can probably provide an autotools
> > equivalent.
> >
> I'm not sure how the above works on meson - the define can come from
> multiple places.
> Surely meson does not check every header available on the system?

It doesn't, it checks for defines the preprocessor knows about, if you need to
check specific headers there's `has_header_symbol`.

Maybe this isn't feasible, but it really feels like having to define ETIME all
over the tree if it's not defined is fragile and ugly. I'm with you and Eric
that FreeBSD really should solve this themselves.

> 
> FWIW I've spent hours over the years looking at this ETIME workaround.
> Due to $reasons various projects define the macro, some even without
> checking if it's already set.
> Memory is fuzzy, but I believe I've seen projects installing headers
> with the redefine.
> 
> I sincerely hope that the FreeBSD devs can see waste of time this is
> causing them and consider a more pragmatic solution.
> 
> -Emil


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-19 Thread Dylan Baker
Quoting Emil Velikov (2018-01-19 08:26:41)
> On 18 January 2018 at 21:30, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2018-01-18 10:57:02)
> >> On 18 January 2018 at 18:29, Greg V <greg@unrelenting.technology> wrote:
> >> >
> >> > On 01/18/2018 21:18, Emil Velikov wrote:
> >> >>
> >> >> Hi Greg,
> >> >>
> >> >> On 31 December 2017 at 16:55, Greg V <greg@unrelenting.technology> 
> >> >> wrote:
> >> >>>
> >> >>> Hello everyone and happy new year! :)
> >> >>>
> >> >>> This set of patches makes the Meson build work on FreeBSD, including
> >> >>> RADV, ANV, wayland-egl, VAAPI, VDPAU.
> >> >>
> >> >> Huge thanks for beating these into shape and sending them.
> >> >>
> >> >> Based on the sysconf patch it seems like the series isn't based again
> >> >> master.
> >> >> Can you please rebase?
> >> >>
> >> >> I've made a few suggestions about moving stuff into helpers, although
> >> >> those are not a requirement.
> >> >> We can merge the current ones, as long as you promise to address fix
> >> >> them up as follow-up ;-)
> >> >
> >> > I'm working on the helpers, yeah.
> >> >
> >> > I've rebased and updated the meson patches, sent as v2.
> >> > I'll send everything else as v2 with the helpers stuff.
> >> >
> >> > Sorry if I'm doing something wrong with series and stuff, I'm still a bit
> >> > confused with this patch emailing thing, I'm used to GitHub and similar
> >> > services :)
> >> >
> >> No worries - every project is different ;-)
> >>
> >> The first google hit for "mesa submitting patches" is the correct one [1].
> >> Although in practise you've handled everything very well, already.
> >>
> >> [1] https://www.mesa3d.org/submittingpatches.html
> >>
> >> >> It would be amazing if FreeBSD used the ETIME fallback in their
> >> >> toolchain. Otherwise things break quite often, as you can see.
> >> >> That's more of a dream of mine, so don't read too much into it.
> >> >
> >> > Did you get Dylan's reply about defining ETIME in meson/autotools?
> >>
> >> AFAICT the approach is semi-magic, hence my day-dreaming on the topic.
> >> I'll try to cook up some magic, but it will be very fragile.
> >>
> >> -Emil
> >
> > I'm willing to defer to you on this, if you think that checking headers for
> > ETIME is too fragile then we can leave it (you definitely have more 
> > experience
> > in these things). I'm just concerned it's going to turn into an endless
> > whack-a-mole game.
> 
> I'll kindly ask Greg to open a bug with FreeBSD on the topic - they
> seemed positive on the Elf topic.
> Alternatively we can catch most of the fallout via a
> check_compile("#include \n main() {return ETIME;}")
> 
> Not sure of Meson has an equivalent though.
> Emil

cc.has_header_symbol('ETIME', 'errno.h') != ''

is probably pretty close, we could always code a compile check, but This should
be okay (it just checks that the symbol exists and doesn't care what the symbol
is).


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-19 Thread Dylan Baker
Quoting Daniel Stone (2018-01-19 08:50:17)
> Hi,
> 
> On 19 January 2018 at 16:26, Emil Velikov <emil.l.veli...@gmail.com> wrote:
> > On 18 January 2018 at 21:30, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> I'm willing to defer to you on this, if you think that checking headers for
> >> ETIME is too fragile then we can leave it (you definitely have more 
> >> experience
> >> in these things). I'm just concerned it's going to turn into an endless
> >> whack-a-mole game.
> >
> > I'll kindly ask Greg to open a bug with FreeBSD on the topic - they
> > seemed positive on the Elf topic.
> > Alternatively we can catch most of the fallout via a
> > check_compile("#include \n main() {return ETIME;}")
> >
> > Not sure of Meson has an equivalent though.
> 
> You can do cc.compiles('...') as you said, or as Dylan mentioned
> up-thread, the far more direct:
>   cc.has.header_symbol('errno.h', 'ETIME')
> 
> Cheers,
> Daniel

I should really read whole threads before I start responding...


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-18 Thread Dylan Baker
Quoting Emil Velikov (2018-01-18 10:57:02)
> On 18 January 2018 at 18:29, Greg V  wrote:
> >
> > On 01/18/2018 21:18, Emil Velikov wrote:
> >>
> >> Hi Greg,
> >>
> >> On 31 December 2017 at 16:55, Greg V  wrote:
> >>>
> >>> Hello everyone and happy new year! :)
> >>>
> >>> This set of patches makes the Meson build work on FreeBSD, including
> >>> RADV, ANV, wayland-egl, VAAPI, VDPAU.
> >>
> >> Huge thanks for beating these into shape and sending them.
> >>
> >> Based on the sysconf patch it seems like the series isn't based again
> >> master.
> >> Can you please rebase?
> >>
> >> I've made a few suggestions about moving stuff into helpers, although
> >> those are not a requirement.
> >> We can merge the current ones, as long as you promise to address fix
> >> them up as follow-up ;-)
> >
> > I'm working on the helpers, yeah.
> >
> > I've rebased and updated the meson patches, sent as v2.
> > I'll send everything else as v2 with the helpers stuff.
> >
> > Sorry if I'm doing something wrong with series and stuff, I'm still a bit
> > confused with this patch emailing thing, I'm used to GitHub and similar
> > services :)
> >
> No worries - every project is different ;-)
> 
> The first google hit for "mesa submitting patches" is the correct one [1].
> Although in practise you've handled everything very well, already.
> 
> [1] https://www.mesa3d.org/submittingpatches.html
> 
> >> It would be amazing if FreeBSD used the ETIME fallback in their
> >> toolchain. Otherwise things break quite often, as you can see.
> >> That's more of a dream of mine, so don't read too much into it.
> >
> > Did you get Dylan's reply about defining ETIME in meson/autotools?
> 
> AFAICT the approach is semi-magic, hence my day-dreaming on the topic.
> I'll try to cook up some magic, but it will be very fragile.
> 
> -Emil

I'm willing to defer to you on this, if you think that checking headers for
ETIME is too fragile then we can leave it (you definitely have more experience
in these things). I'm just concerned it's going to turn into an endless
whack-a-mole game.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] autotools: include meson build files in tarball

2018-01-18 Thread Dylan Baker
This adds the meson.build, meson_options.txt, and a few scripts that are
used exclusively by the meson build.

v2: - Remove accidentally included changes needed to test make dist with
  LLVM > 3.9

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
Acked-by: Eric Engestrom <e...@engestrom.ch>
---
 Makefile.am |  7 ++-
 src/Makefile.am |  2 +-
 src/amd/Makefile.am |  9 -
 src/amd/vulkan/Makefile.am  |  3 ++-
 src/broadcom/Makefile.am|  7 ++-
 src/compiler/Makefile.am|  9 -
 src/egl/Makefile.am |  3 ++-
 src/egl/wayland/wayland-drm/Makefile.am |  2 +-
 src/egl/wayland/wayland-egl/Makefile.am |  2 +-
 src/gallium/Makefile.am |  3 ++-
 src/gallium/auxiliary/Makefile.am   |  3 ++-
 src/gallium/auxiliary/pipe-loader/Makefile.am   |  2 +-
 src/gallium/drivers/ddebug/Makefile.am  |  2 ++
 src/gallium/drivers/etnaviv/Makefile.am |  2 ++
 src/gallium/drivers/freedreno/Makefile.am   |  2 ++
 src/gallium/drivers/i915/Makefile.am|  2 +-
 src/gallium/drivers/llvmpipe/Makefile.am|  2 +-
 src/gallium/drivers/noop/Makefile.am|  2 +-
 src/gallium/drivers/nouveau/Makefile.am |  2 +-
 src/gallium/drivers/r300/Makefile.am|  3 ++-
 src/gallium/drivers/r600/Makefile.am|  3 ++-
 src/gallium/drivers/radeon/Makefile.am  |  2 ++
 src/gallium/drivers/radeonsi/Makefile.am|  1 +
 src/gallium/drivers/rbug/Makefile.am|  2 +-
 src/gallium/drivers/softpipe/Makefile.am|  2 +-
 src/gallium/drivers/svga/Makefile.am|  3 ++-
 src/gallium/drivers/swr/Makefile.am |  2 ++
 src/gallium/drivers/trace/Makefile.am   |  3 ++-
 src/gallium/drivers/vc4/Makefile.am |  2 +-
 src/gallium/drivers/vc5/Makefile.am |  2 ++
 src/gallium/drivers/virgl/Makefile.am   |  2 ++
 src/gallium/state_trackers/clover/Makefile.am   |  2 +-
 src/gallium/state_trackers/dri/Makefile.am  |  2 +-
 src/gallium/state_trackers/glx/xlib/Makefile.am |  2 +-
 src/gallium/state_trackers/nine/Makefile.am |  2 +-
 src/gallium/state_trackers/omx_bellagio/Makefile.am |  2 ++
 src/gallium/state_trackers/osmesa/Makefile.am   |  2 +-
 src/gallium/state_trackers/va/Makefile.am   |  2 ++
 src/gallium/state_trackers/vdpau/Makefile.am|  2 ++
 src/gallium/state_trackers/xa/Makefile.am   |  2 +-
 src/gallium/state_trackers/xvmc/Makefile.am |  2 ++
 src/gallium/targets/d3dadapter9/Makefile.am |  2 +-
 src/gallium/targets/dri/Makefile.am |  1 +
 src/gallium/targets/libgl-xlib/Makefile.am  |  2 +-
 src/gallium/targets/omx-bellagio/Makefile.am|  2 +-
 src/gallium/targets/opencl/Makefile.am  |  2 +-
 src/gallium/targets/osmesa/Makefile.am  |  3 ++-
 src/gallium/targets/pipe-loader/Makefile.am |  2 +-
 src/gallium/targets/va/Makefile.am  |  2 +-
 src/gallium/targets/vdpau/Makefile.am   |  3 ++-
 src/gallium/targets/xa/Makefile.am  |  2 +-
 src/gallium/targets/xvmc/Makefile.am|  2 +-
 src/gallium/winsys/amdgpu/drm/Makefile.am   |  2 ++
 src/gallium/winsys/etnaviv/drm/Makefile.am  |  2 ++
 src/gallium/winsys/freedreno/drm/Makefile.am|  2 ++
 src/gallium/winsys/i915/drm/Makefile.am |  2 ++
 src/gallium/winsys/imx/drm/Makefile.am  |  2 ++
 src/gallium/winsys/nouveau/drm/Makefile.am  |  2 ++
 src/gallium/winsys/pl111/drm/Makefile.am|  2 ++
 src/gallium/winsys/radeon/drm/Makefile.am   |  2 ++
 src/gallium/winsys/svga/drm/Makefile.am |  2 +-
 src/gallium/winsys/sw/dri/Makefile.am   |  2 +-
 src/gallium/winsys/sw/kms-dri/Makefile.am   |  2 ++
 src/gallium/winsys/sw/null/Makefile.am  |  2 +-
 src/gallium/winsys/sw/wrapper/Makefile.am   |  2 +-
 src/gallium/winsys/sw/xlib/Makefile.am  |  2 +-
 src/gallium/winsys/vc4/drm/Makefile.am  |  2 ++
 src/gallium/winsys/vc5/drm/Makefile.am  |  2 ++
 src/gallium/winsys/virgl/drm/Makefile.am|  2 ++
 src/gallium/winsys/virgl/vtest/Makefile.am  |  2 ++
 src/gbm/Makefile.am |  2 +-
 src/glx/Makefile.am |  2 +-
 src/glx/tests/Makefile.am   |  2 +-
 src/glx/windows/Makefile.am |  2 ++
 src/gtest/Makefile.am   |  3 ++-
 src/intel/Makefile.am   | 10 +++

Re: [Mesa-dev] [PATCH] autotools: include meson build files in tarball

2018-01-18 Thread Dylan Baker
Quoting Eric Engestrom (2018-01-18 13:04:00)
> On Thursday, 2018-01-18 17:09:04 +0000, Dylan Baker wrote:
> > This adds the meson.build, meson_options.txt, and a few scripts that are
> > used exclusively by the meson build.
> > 
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> 
> I could've sworn we already some $(shell find -name meson.build) thing
> for this?
> 
> One note below (in src/gallium/drivers/swr/Makefile.am), but with that
> fixed:
> Acked-by: Eric Engestrom <e...@engestrom.ch>
> 
> > ---
> >  Makefile.am |  7 ++-
> >  src/Makefile.am |  2 +-
> >  src/amd/Makefile.am |  9 -
> >  src/amd/vulkan/Makefile.am  |  3 ++-
> >  src/broadcom/Makefile.am|  7 ++-
> >  src/compiler/Makefile.am|  9 -
> >  src/egl/Makefile.am |  3 ++-
> >  src/egl/wayland/wayland-drm/Makefile.am |  2 +-
> >  src/egl/wayland/wayland-egl/Makefile.am |  2 +-
> >  src/gallium/Makefile.am |  3 ++-
> >  src/gallium/auxiliary/Makefile.am   |  3 ++-
> >  src/gallium/auxiliary/pipe-loader/Makefile.am   |  2 +-
> >  src/gallium/drivers/ddebug/Makefile.am  |  2 ++
> >  src/gallium/drivers/etnaviv/Makefile.am |  2 ++
> >  src/gallium/drivers/freedreno/Makefile.am   |  2 ++
> >  src/gallium/drivers/i915/Makefile.am|  2 +-
> >  src/gallium/drivers/llvmpipe/Makefile.am|  2 +-
> >  src/gallium/drivers/noop/Makefile.am|  2 +-
> >  src/gallium/drivers/nouveau/Makefile.am |  2 +-
> >  src/gallium/drivers/r300/Makefile.am|  3 ++-
> >  src/gallium/drivers/r600/Makefile.am|  3 ++-
> >  src/gallium/drivers/radeon/Makefile.am  |  2 ++
> >  src/gallium/drivers/radeonsi/Makefile.am|  1 +
> >  src/gallium/drivers/rbug/Makefile.am|  2 +-
> >  src/gallium/drivers/softpipe/Makefile.am|  2 +-
> >  src/gallium/drivers/svga/Makefile.am|  3 ++-
> >  src/gallium/drivers/swr/Makefile.am |  9 ++---
> >  src/gallium/drivers/trace/Makefile.am   |  3 ++-
> >  src/gallium/drivers/vc4/Makefile.am |  2 +-
> >  src/gallium/drivers/vc5/Makefile.am |  2 ++
> >  src/gallium/drivers/virgl/Makefile.am   |  2 ++
> >  src/gallium/state_trackers/clover/Makefile.am   |  2 +-
> >  src/gallium/state_trackers/dri/Makefile.am  |  2 +-
> >  src/gallium/state_trackers/glx/xlib/Makefile.am |  2 +-
> >  src/gallium/state_trackers/nine/Makefile.am |  2 +-
> >  src/gallium/state_trackers/omx_bellagio/Makefile.am |  2 ++
> >  src/gallium/state_trackers/osmesa/Makefile.am   |  2 +-
> >  src/gallium/state_trackers/va/Makefile.am   |  2 ++
> >  src/gallium/state_trackers/vdpau/Makefile.am|  2 ++
> >  src/gallium/state_trackers/xa/Makefile.am   |  2 +-
> >  src/gallium/state_trackers/xvmc/Makefile.am |  2 ++
> >  src/gallium/targets/d3dadapter9/Makefile.am |  2 +-
> >  src/gallium/targets/dri/Makefile.am |  1 +
> >  src/gallium/targets/libgl-xlib/Makefile.am  |  2 +-
> >  src/gallium/targets/omx-bellagio/Makefile.am|  2 +-
> >  src/gallium/targets/opencl/Makefile.am  |  2 +-
> >  src/gallium/targets/osmesa/Makefile.am  |  3 ++-
> >  src/gallium/targets/pipe-loader/Makefile.am |  2 +-
> >  src/gallium/targets/va/Makefile.am  |  2 +-
> >  src/gallium/targets/vdpau/Makefile.am   |  3 ++-
> >  src/gallium/targets/xa/Makefile.am  |  2 +-
> >  src/gallium/targets/xvmc/Makefile.am|  2 +-
> >  src/gallium/winsys/amdgpu/drm/Makefile.am   |  2 ++
> >  src/gallium/winsys/etnaviv/drm/Makefile.am  |  2 ++
> >  src/gallium/winsys/freedreno/drm/Makefile.am|  2 ++
> >  src/gallium/winsys/i915/drm/Makefile.am |  2 ++
> >  src/gallium/winsys/imx/drm/Makefile.am  |  2 ++
> >  src/gallium/winsys/nouveau/drm/Makefile.am  |  2 ++
> >  src/gallium/winsys/pl111/drm/Makefile.am|  2 ++
> >  src/gallium/winsys/radeon/drm/Makefile.am   |  2 ++
> >  src/gallium/winsys/svga/drm/Makefile.am |  2 +-
> >  src/gallium/winsys/sw/dri

Re: [Mesa-dev] [PATCH] meson: fix some more defines meson.build

2018-01-24 Thread Dylan Baker
Quoting Marc Dietrich (2018-01-24 08:05:52)
> Second hunk of fixes found by manual comparison with autotools generated
> compiler flags.
> 
> Signed-off-by: Marc Dietrich 
> ---
>  - Why do we need two version macros?
>  - And why do we either define DEBUG or NDEBUG?
>  - Also autotools define some PACKAGE_ macros which are never used - maybe
>time for a cleanup...
> 
>  meson.build | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 9e3b98641f..62205aa250 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -37,7 +37,7 @@ pre_args = [
>'-D__STDC_FORMAT_MACROS',
>'-D__STDC_LIMIT_MACROS',
>'-DVERSION="@0@"'.format(meson.project_version()),
> -  '-DPACKAGE_VERSION=VERSION',
> +  '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
>
> '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
>  ]

This hunk is just stylistic, after the pre-processor runs they will be
identical, that said I don't have a problem merging this.

>  
> @@ -648,6 +648,8 @@ endif
>  # Define DEBUG for debug builds only (debugoptimized is not included on this 
> one)
>  if get_option('buildtype') == 'debug'
>pre_args += '-DDEBUG'
> +else
> +  pre_args += '-DNDEBUG'
>  endif

NAK on this hunk. meson has -Db_ndebug for controlling NDEBUG.

DEBUG is a mesa thing for turning expensive debug code on and off, NDEBUG is for
controlling asserts; for example, the NIR validator (which is pretty expensive)
is controlled by DEBUG.

>  
>  if get_option('shader-cache')
> @@ -762,7 +764,7 @@ foreach a : ['-Werror=pointer-arith', '-Werror=vla']
>  endforeach
>  
>  if host_machine.cpu_family().startswith('x86')
> -  pre_args += '-DHAVE_SSE41'
> +  pre_args += '-DUSE_SSE41'
>with_sse41 = true
>sse41_args = ['-msse4.1']

Fixes: 84486f64626a ("meson: Enable SSE4.1 optimizations")

>  
> @@ -1015,7 +1017,7 @@ if with_llvm
>  _llvm_patch = _llvm_patch.split('s')[0]
>endif
>pre_args += [
> -'-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], 
> _llvm_patch),
> +'-DHAVE_LLVM=0x0@0@0@1@'.format(_llvm_version[0], _llvm_version[1]),
>  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),

Fixes: e6418ab1566d ("meson: build "radv" vulkan driver for radeon hardware")

>]
>  elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
> -- 
> 2.16.0
> 

The rest of this looks good, but it needs to be split into several patches. Each
one of them fixes a bug (except the 1st which is just a stylistic change). I've
commented inline with the Fixes tag each patch needs in it's commit message so
they get pulled into the 18.0 release.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: correctly set SYSCONFDIR for loading dirrc

2018-01-24 Thread Dylan Baker
Quoting Emil Velikov (2018-01-24 03:53:35)
> On 24 January 2018 at 10:39, Marc Dietrich <marvi...@gmx.de> wrote:
> > Hi Dylan,
> >
> > Am Dienstag, 23. Januar 2018, 19:28:08 CET schrieb Dylan Baker:
> >> Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
> >> Reported-by: Marc Dietrich <marvi...@gmx.de>
> >> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> >> ---
> >>  src/util/meson.build | 8 ++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/util/meson.build b/src/util/meson.build
> >> index fa591c92e56..b23dba3a985 100644
> >> --- a/src/util/meson.build
> >> +++ b/src/util/meson.build
> >> @@ -112,8 +112,12 @@ libxmlconfig = static_library(
> >>files_xmlconfig,
> >>include_directories : inc_common,
> >>dependencies : [dep_expat, dep_m],
> >> -  c_args : [c_msvc_compat_args, c_vis_args,
> >> -'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
> >> +  c_args : [
> >> +c_msvc_compat_args, c_vis_args,
> >> +'-DSYSCONFDIR="@0@"'.format(
> >> +  join_paths(get_option('prefix'), get_option('sysconfdir'))
> >> +),
> >> +  ],
> >>build_by_default : false,
> >>  )
> >
> > this won't work as the prefix is often set to /usr, which results in
> > sysconfdir to be /usr/etc. As this is a special case, and "/etc" is the
> > default meson sysconfdir, we could just test for "prefix=/usr" and set
> > sysconfdir to prefix/sysconfdir if it is not.
> >
> > This works for me, but dosn't look meson-stylish:
> >
> > diff --git a/src/util/meson.build b/src/util/meson.build
> > index fa591c92e5..6294e188f2 100644
> > --- a/src/util/meson.build
> > +++ b/src/util/meson.build
> > @@ -83,8 +83,6 @@ files_mesa_util = files(
> >'u_vector.h',
> >  )
> >
> > -install_data('drirc', install_dir : get_option('sysconfdir'))
> > -
> >  files_xmlconfig = files(
> >'xmlconfig.c',
> >'xmlconfig.h',
> > @@ -107,13 +105,23 @@ libmesa_util = static_library(
> >build_by_default : false
> >  )
> >
> > +if get_option('prefix') != '/usr'
> > +   sysconfarg = join_paths(get_option('prefix'), get_option('sysconfdir'))
> > +else
> > +   sysconfarg = '/' + get_option('sysconfdir')
> > +endif
> > +
> Tweaking sysconfdir based on the value of prefix doesn't sound
> right.It's the build system to know and manage those.
> By default everything should be installed only in prefix - that's what
> cmake, autotools and others do. I think meson should say consistent do
> the same.
> 
> The reason being is that you don't want to overwrite existing [system]
> files, unless explicitly asked for. In this case by setting
> sysconfigdir to /etc.
> 
> Obviously sysconfdir/sysconfigdir is one example here, but the rule
> applies throughout.
> Emil

Emil,

Ken and I talked about this, I think the right thing to do is something like:
sysdir = get_option('sysconfdir')
if not sysdir.startswith('/')
sysdir = join_paths(get_option('prefix'), sysdir)
endif

So that if someone sets --sysconfdir=/etc and --prefix=/usr they get what they
want (libs in /usr/lib and drirc in /etc), but if say a BSD sets --syconfdir=etc
--prefux=/usr/local they get what they (libs in /usr/local/libs and drirc in
/usr/local/etc)

Does that seem right to you?

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: correctly set SYSCONFDIR for loading dirrc

2018-01-24 Thread Dylan Baker
Quoting Emil Velikov (2018-01-24 11:00:04)
> On 24 January 2018 at 18:19, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2018-01-24 03:53:35)
> >> On 24 January 2018 at 10:39, Marc Dietrich <marvi...@gmx.de> wrote:
> >> > Hi Dylan,
> >> >
> >> > Am Dienstag, 23. Januar 2018, 19:28:08 CET schrieb Dylan Baker:
> >> >> Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
> >> >> Reported-by: Marc Dietrich <marvi...@gmx.de>
> >> >> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> >> >> ---
> >> >>  src/util/meson.build | 8 ++--
> >> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/src/util/meson.build b/src/util/meson.build
> >> >> index fa591c92e56..b23dba3a985 100644
> >> >> --- a/src/util/meson.build
> >> >> +++ b/src/util/meson.build
> >> >> @@ -112,8 +112,12 @@ libxmlconfig = static_library(
> >> >>files_xmlconfig,
> >> >>include_directories : inc_common,
> >> >>dependencies : [dep_expat, dep_m],
> >> >> -  c_args : [c_msvc_compat_args, c_vis_args,
> >> >> -'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
> >> >> +  c_args : [
> >> >> +c_msvc_compat_args, c_vis_args,
> >> >> +'-DSYSCONFDIR="@0@"'.format(
> >> >> +  join_paths(get_option('prefix'), get_option('sysconfdir'))
> >> >> +),
> >> >> +  ],
> >> >>build_by_default : false,
> >> >>  )
> >> >
> >> > this won't work as the prefix is often set to /usr, which results in
> >> > sysconfdir to be /usr/etc. As this is a special case, and "/etc" is the
> >> > default meson sysconfdir, we could just test for "prefix=/usr" and set
> >> > sysconfdir to prefix/sysconfdir if it is not.
> >> >
> >> > This works for me, but dosn't look meson-stylish:
> >> >
> >> > diff --git a/src/util/meson.build b/src/util/meson.build
> >> > index fa591c92e5..6294e188f2 100644
> >> > --- a/src/util/meson.build
> >> > +++ b/src/util/meson.build
> >> > @@ -83,8 +83,6 @@ files_mesa_util = files(
> >> >'u_vector.h',
> >> >  )
> >> >
> >> > -install_data('drirc', install_dir : get_option('sysconfdir'))
> >> > -
> >> >  files_xmlconfig = files(
> >> >'xmlconfig.c',
> >> >'xmlconfig.h',
> >> > @@ -107,13 +105,23 @@ libmesa_util = static_library(
> >> >build_by_default : false
> >> >  )
> >> >
> >> > +if get_option('prefix') != '/usr'
> >> > +   sysconfarg = join_paths(get_option('prefix'), 
> >> > get_option('sysconfdir'))
> >> > +else
> >> > +   sysconfarg = '/' + get_option('sysconfdir')
> >> > +endif
> >> > +
> >> Tweaking sysconfdir based on the value of prefix doesn't sound
> >> right.It's the build system to know and manage those.
> >> By default everything should be installed only in prefix - that's what
> >> cmake, autotools and others do. I think meson should say consistent do
> >> the same.
> >>
> >> The reason being is that you don't want to overwrite existing [system]
> >> files, unless explicitly asked for. In this case by setting
> >> sysconfigdir to /etc.
> >>
> >> Obviously sysconfdir/sysconfigdir is one example here, but the rule
> >> applies throughout.
> >> Emil
> >
> > Emil,
> >
> > Ken and I talked about this, I think the right thing to do is something 
> > like:
> > sysdir = get_option('sysconfdir')
> > if not sysdir.startswith('/')
> > sysdir = join_paths(get_option('prefix'), sysdir)
> > endif
> >
> > So that if someone sets --sysconfdir=/etc and --prefix=/usr they get what 
> > they
> > want (libs in /usr/lib and drirc in /etc), but if say a BSD sets 
> > --syconfdir=etc
> > --prefux=/usr/local they get what they (libs in /usr/local/libs and drirc in
> > /usr/local/etc)
> >
> > Does that seem right to you?
> >
> if it were for my personal use, I'll just hack things around ;-)
> 
> It would be nice is meson complies with the existing standard.
> You can tweak the CI to prevent breakage, but for many others - their
> system files will be overwritten.
> 
> Feel free to proceed as you wish, I'm just sharing something that
> looks quite buggy.
> -Emil

Jon pointed out that join_paths('/usr', '/etc') will return '/etc' (since
'/etc') is absolute. Which means
join_paths(get_option('prefix'), get_option('sysconfidir')), will do the right
thing in both cases.

Just to be clear, the default for meson is --prefix=/usr/local --sysconfdir=etc,
so no one's files are going to be overwritten by default.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix some more defines meson.build

2018-01-24 Thread Dylan Baker
Quoting Eric Engestrom (2018-01-24 09:41:17)
> On Wednesday, 2018-01-24 17:05:52 +0100, Marc Dietrich wrote:
> > Second hunk of fixes found by manual comparison with autotools generated
> > compiler flags.
> > 
> > Signed-off-by: Marc Dietrich <marvi...@gmx.de>
> > ---
> >  - Why do we need two version macros?
> >  - And why do we either define DEBUG or NDEBUG?
> >  - Also autotools define some PACKAGE_ macros which are never used - maybe
> >time for a cleanup...
> > 
> >  meson.build | 8 +---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 9e3b98641f..62205aa250 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -37,7 +37,7 @@ pre_args = [
> >'-D__STDC_FORMAT_MACROS',
> >'-D__STDC_LIMIT_MACROS',
> >'-DVERSION="@0@"'.format(meson.project_version()),
> > -  '-DPACKAGE_VERSION=VERSION',
> > +  '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
> 
> Are you sure this is needed?
> I haven't tested it, but I would think this tells cpp that PACKAGE_VERSION
> has whatever value VERSION has, which is what we want.
> 
> >
> > '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
> >  ]
> >  
> > @@ -648,6 +648,8 @@ endif
> >  # Define DEBUG for debug builds only (debugoptimized is not included on 
> > this one)
> >  if get_option('buildtype') == 'debug'
> >pre_args += '-DDEBUG'
> > +else
> > +  pre_args += '-DNDEBUG'
> 
> NAK on this hunk.
> 
> In meson, asserts and other things depending on NDEBUG are controlled by
> `-D b_ndebug=true|false`, and shouldn't be overridden inside meson.build
> 
> 
> The two hunks below are correct though, thank you for finding these :)
> Could you re-send the patch with these tags?
> 
> Fixes: 84486f64626ad2b51291b "meson: Enable SSE4.1 optimizations"
> Fixes: 673dda8330769309a319d "meson: build "radv" vulkan driver for radeon 
> hardware"
> Cc: Dylan Baker <dylanx.c.ba...@intel.com>
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> (If you're feeling extra-motivated, you can even split these into two
> separate patches :P)
> 

Eric beat me to it :)

I'd be okay with a single patch as well, but splitting them would be preferred.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] meson: correctly set sysconfdir for drirc

2018-01-24 Thread Dylan Baker
Quoting Jon Turney (2018-01-24 12:26:47)
> On 24/01/2018 19:35, Dylan Baker wrote:
> > v2: - Also fix drirc install path
> > 
> > Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
> > Reported-by: Marc Dietrich <marvi...@gmx.de>
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (v1)
> > ---
> >   src/util/meson.build | 9 ++---
> >   1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/util/meson.build b/src/util/meson.build
> > index fa591c92e56..4d34d578a25 100644
> > --- a/src/util/meson.build
> > +++ b/src/util/meson.build
> > @@ -83,7 +83,9 @@ files_mesa_util = files(
> > 'u_vector.h',
> >   )
> >   
> > -install_data('drirc', install_dir : get_option('sysconfdir'))
> > +sysdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
> > +
> > +install_data('drirc', install_dir : sysdir)
> 
> Hmm.. I think this would be a meson bug if this is needed.  the path 
> given to install_dir: is relative to the prefix, unless absolute.
> 
> (see the last paragraph of 
> http://mesonbuild.com/Installing.html#installing, although this could 
> all be much better documented...)
> 

Gahh. This is the thing that tripped me up originally. I'll go back to the V1
and just push that.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: correctly set SYSCONFDIR for loading dirrc

2018-01-24 Thread Dylan Baker
Quoting Jon Turney (2018-01-24 10:29:03)
> On 24/01/2018 18:19, Dylan Baker wrote:
> > Quoting Emil Velikov (2018-01-24 03:53:35)
> >> On 24 January 2018 at 10:39, Marc Dietrich <marvi...@gmx.de> wrote:
> >>> Hi Dylan,
> >>>
> >>> Am Dienstag, 23. Januar 2018, 19:28:08 CET schrieb Dylan Baker:
> >>>> Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
> >>>> Reported-by: Marc Dietrich <marvi...@gmx.de>
> >>>> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> >>>> ---
> >>>>   src/util/meson.build | 8 ++--
> >>>>   1 file changed, 6 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/src/util/meson.build b/src/util/meson.build
> >>>> index fa591c92e56..b23dba3a985 100644
> >>>> --- a/src/util/meson.build
> >>>> +++ b/src/util/meson.build
> >>>> @@ -112,8 +112,12 @@ libxmlconfig = static_library(
> >>>> files_xmlconfig,
> >>>> include_directories : inc_common,
> >>>> dependencies : [dep_expat, dep_m],
> >>>> -  c_args : [c_msvc_compat_args, c_vis_args,
> >>>> -'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
> >>>> +  c_args : [
> >>>> +c_msvc_compat_args, c_vis_args,
> >>>> +'-DSYSCONFDIR="@0@"'.format(
> >>>> +  join_paths(get_option('prefix'), get_option('sysconfdir'))
> >>>> +),
> >>>> +  ],
> >>>> build_by_default : false,
> >>>>   )
> >>>
> >>> this won't work as the prefix is often set to /usr, which results in
> >>> sysconfdir to be /usr/etc. As this is a special case, and "/etc" is the
> 
> No. from the meson documentation on join_paths(): "If any one of the 
> individual segments is an absolute path, all segments before it are 
> dropped."
> 
> So I think this is right as written.
> 

Oh, nice! I missed that in the docs, so this is definately the right thing to
do, although I think we need to fix the drirc install path as well.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Fix define for USE_SSE41

2018-01-24 Thread Dylan Baker
Matt and I talked about whether we needed the compile check, he didn't think we
did because we required a GCC that has msse4.1 support, but the HAVE vs USE is
a real bug (someone else noticed that too).

CC'ing Matt in case I'm miss-remembering something.

Quoting Scott D Phillips (2018-01-24 10:28:53)
> Before we were adding -DHAVE_SSE41 which isn't what the code is
> looking for, so some uses of the sse4.1 code were always being
> skipped.
> 
> Fixes: 84486f6462 ("meson: Enable SSE4.1 optimizations")
> ---
>  meson.build | 20 +++-
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 97619f786b..3bbda53ccf 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -771,9 +771,9 @@ foreach a : ['-Werror=pointer-arith', '-Werror=vla']
>endif
>  endforeach
>  
> +with_sse41 = false
> +sse41_args = []
>  if host_machine.cpu_family().startswith('x86')
> -  pre_args += '-DHAVE_SSE41'
> -  with_sse41 = true
>sse41_args = ['-msse4.1']
>  
># GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
> @@ -781,9 +781,19 @@ if host_machine.cpu_family().startswith('x86')
>if host_machine.cpu_family() == 'x86'
>  sse41_args += '-mstackrealign'
>endif
> -else
> -  with_sse41 = false
> -  sse41_args = []
> +
> +  if cc.compiles('''#include 
> +int param;
> +int main () {
> +__m128i a = _mm_set1_epi32 (param), b = 
> _mm_set1_epi32 (param + 1), c;
> +c = _mm_max_epu32(a, b);
> +return _mm_cvtsi128_si32(c);
> +}''',
> + name : 'SSE4.1 intrinsics',
> + args : sse41_args)
> +with_sse41 = true
> +pre_args += '-DUSE_SSE41'
> +  endif
>  endif
>  
>  # Check for GCC style atomics
> -- 
> 2.14.3
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Fix define for USE_SSE41

2018-01-24 Thread Dylan Baker
Quoting Scott D Phillips (2018-01-24 11:13:14)
> Dylan Baker <dy...@pnwbakers.com> writes:
> 
> > Matt and I talked about whether we needed the compile check, he didn't 
> > think we
> > did because we required a GCC that has msse4.1 support, but the HAVE vs USE 
> > is
> > a real bug (someone else noticed that too).
> >
> > CC'ing Matt in case I'm miss-remembering something.
> 
> Ah right, -msse4.1 is new in 2008's gcc-4.3. I'll drop the check.

In that case (for the HAVE vs USE) issue, feel free to add:
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

> 
> > Quoting Scott D Phillips (2018-01-24 10:28:53)
> >> Before we were adding -DHAVE_SSE41 which isn't what the code is
> >> looking for, so some uses of the sse4.1 code were always being
> >> skipped.
> >> 
> >> Fixes: 84486f6462 ("meson: Enable SSE4.1 optimizations")
> >> ---
> >>  meson.build | 20 +++-
> >>  1 file changed, 15 insertions(+), 5 deletions(-)
> >> 
> >> diff --git a/meson.build b/meson.build
> >> index 97619f786b..3bbda53ccf 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -771,9 +771,9 @@ foreach a : ['-Werror=pointer-arith', '-Werror=vla']
> >>endif
> >>  endforeach
> >>  
> >> +with_sse41 = false
> >> +sse41_args = []
> >>  if host_machine.cpu_family().startswith('x86')
> >> -  pre_args += '-DHAVE_SSE41'
> >> -  with_sse41 = true
> >>sse41_args = ['-msse4.1']
> >>  
> >># GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, 
> >> but
> >> @@ -781,9 +781,19 @@ if host_machine.cpu_family().startswith('x86')
> >>if host_machine.cpu_family() == 'x86'
> >>  sse41_args += '-mstackrealign'
> >>endif
> >> -else
> >> -  with_sse41 = false
> >> -  sse41_args = []
> >> +
> >> +  if cc.compiles('''#include 
> >> +int param;
> >> +int main () {
> >> +__m128i a = _mm_set1_epi32 (param), b = 
> >> _mm_set1_epi32 (param + 1), c;
> >> +c = _mm_max_epu32(a, b);
> >> +return _mm_cvtsi128_si32(c);
> >> +}''',
> >> + name : 'SSE4.1 intrinsics',
> >> + args : sse41_args)
> >> +with_sse41 = true
> >> +pre_args += '-DUSE_SSE41'
> >> +  endif
> >>  endif
> >>  
> >>  # Check for GCC style atomics
> >> -- 
> >> 2.14.3
> >> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix some more defines meson.build

2018-01-24 Thread Dylan Baker
Quoting Marc Dietrich (2018-01-24 13:02:42)
> Hi,
> 
> Am Mittwoch, 24. Januar 2018, 18:41:17 CET schrieb Eric Engestrom:
> > On Wednesday, 2018-01-24 17:05:52 +0100, Marc Dietrich wrote:
> > > Second hunk of fixes found by manual comparison with autotools generated
> > > compiler flags.
> > > 
> > > Signed-off-by: Marc Dietrich <marvi...@gmx.de>
> > > ---
> > > 
> > >  - Why do we need two version macros?
> > >  - And why do we either define DEBUG or NDEBUG?
> > >  - Also autotools define some PACKAGE_ macros which are never used - maybe
> > >  
> > >time for a cleanup...
> > >  
> > >  meson.build | 8 +---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 9e3b98641f..62205aa250 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -37,7 +37,7 @@ pre_args = [
> > > 
> > >'-D__STDC_FORMAT_MACROS',
> > >'-D__STDC_LIMIT_MACROS',
> > >'-DVERSION="@0@"'.format(meson.project_version()),
> > > 
> > > -  '-DPACKAGE_VERSION=VERSION',
> > > +  '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
> > 
> > Are you sure this is needed?
> > I haven't tested it, but I would think this tells cpp that PACKAGE_VERSION
> > has whatever value VERSION has, which is what we want.
> 
> sorry, I didn't looked too deep into it but it seems your are right.
> 
> > >'-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?produc
> > >t=Mesa"',>  
> > >  ]
> > > 
> > > @@ -648,6 +648,8 @@ endif
> > > 
> > >  # Define DEBUG for debug builds only (debugoptimized is not included on
> > >  this one) if get_option('buildtype') == 'debug'
> > >  
> > >pre_args += '-DDEBUG'
> > > 
> > > +else
> > > +  pre_args += '-DNDEBUG'
> > 
> > NAK on this hunk.
> > 
> > In meson, asserts and other things depending on NDEBUG are controlled by
> > `-D b_ndebug=true|false`, and shouldn't be overridden inside meson.build
> 
> ok, this is new to me and somehow not obvious.

Yeah, no other build system I'm aware of does this, but it is documented in
docs/meson.html.

> 
> > The two hunks below are correct though, thank you for finding these :)
> > Could you re-send the patch with these tags?
> > 
> > Fixes: 84486f64626ad2b51291b "meson: Enable SSE4.1 optimizations"
> > Fixes: 673dda8330769309a319d "meson: build "radv" vulkan driver for radeon
> > hardware" Cc: Dylan Baker <dylanx.c.ba...@intel.com>
> > Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> > 
> > (If you're feeling extra-motivated, you can even split these into two
> > separate patches :P)
> > 
> > >  endif
> > >  
> > >  if get_option('shader-cache')
> > > 
> > > @@ -762,7 +764,7 @@ foreach a : ['-Werror=pointer-arith', '-Werror=vla']
> > > 
> > >  endforeach
> > >  
> > >  if host_machine.cpu_family().startswith('x86')
> > > 
> > > -  pre_args += '-DHAVE_SSE41'
> > > +  pre_args += '-DUSE_SSE41'
> > > 
> > >with_sse41 = true
> > >sse41_args = ['-msse4.1']
> > > 
> > > @@ -1015,7 +1017,7 @@ if with_llvm
> > > 
> > >  _llvm_patch = _llvm_patch.split('s')[0]
> > >
> > >endif
> > >pre_args += [
> > > 
> > > -'-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1],
> > > _llvm_patch), +'-DHAVE_LLVM=0x0@0@0@1@'.format(_llvm_version[0],
> > > _llvm_version[1]),> 
> > >  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
> > >
> > >]
> > >  
> > >  elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
> 
> I will resend the two hunks. Btw, there is still some strange problem in 
> PACKAGE_BUGREPORT as it includes a "$" in the url. I don't know where this 
> comes from.
> 
> Marc


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 01/12] meson: fix missing dependencies

2018-01-24 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Greg V (2018-01-24 10:02:39)
> Reviewed-by: Emil Velikov <emil.veli...@colalbora.com>
> ---
>  src/gallium/drivers/radeonsi/meson.build | 2 +-
>  src/mesa/meson.build | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/meson.build 
> b/src/gallium/drivers/radeonsi/meson.build
> index 97c7a41244..9a62d14308 100644
> --- a/src/gallium/drivers/radeonsi/meson.build
> +++ b/src/gallium/drivers/radeonsi/meson.build
> @@ -77,7 +77,7 @@ libradeonsi = static_library(
>],
>c_args : [c_vis_args],
>cpp_args : [cpp_vis_args],
> -  dependencies : [dep_llvm, idep_nir_headers],
> +  dependencies : [dep_llvm, dep_libdrm_radeon, idep_nir_headers],
>  )
>  
>  driver_radeonsi = declare_dependency(
> diff --git a/src/mesa/meson.build b/src/mesa/meson.build
> index 52289af248..66bdc931a5 100644
> --- a/src/mesa/meson.build
> +++ b/src/mesa/meson.build
> @@ -720,7 +720,7 @@ libmesa_gallium = static_library(
>cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
>include_directories : [inc_common, include_directories('main')],
>link_with : [libglsl, libmesa_sse41],
> -  dependencies : idep_nir_headers,
> +  dependencies : [idep_nir_headers, dep_vdpau],
>build_by_default : false,
>  )
>  
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] meson: correctly set sysconfdir for drirc

2018-01-24 Thread Dylan Baker
v2: - Also fix drirc install path

Fixes: d1992255bb29 ("meson: Add build Intel "anv" vulkan driver")
Reported-by: Marc Dietrich <marvi...@gmx.de>
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (v1)
---
 src/util/meson.build | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/util/meson.build b/src/util/meson.build
index fa591c92e56..4d34d578a25 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -83,7 +83,9 @@ files_mesa_util = files(
   'u_vector.h',
 )
 
-install_data('drirc', install_dir : get_option('sysconfdir'))
+sysdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
+
+install_data('drirc', install_dir : sysdir)
 
 files_xmlconfig = files(
   'xmlconfig.c',
@@ -112,8 +114,9 @@ libxmlconfig = static_library(
   files_xmlconfig,
   include_directories : inc_common,
   dependencies : [dep_expat, dep_m],
-  c_args : [c_msvc_compat_args, c_vis_args,
-'-DSYSCONFDIR="@0@"'.format(get_option('sysconfdir'))],
+  c_args : [
+c_msvc_compat_args, c_vis_args, '-DSYSCONFDIR="@0@"'.format(sysdir),
+  ],
   build_by_default : false,
 )
 
-- 
2.16.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] meson: fix HAVE_LLVM version define in meson build

2018-01-24 Thread Dylan Baker
Someone else merged a similar patch to the first one already, but I've pushed
this patch to master.

Thanks!

Quoting Marc Dietrich (2018-01-24 13:03:51)
> LLVM patch level is not included in HAVE_LLVM.
> 
> Fixes: e6418ab1566d ("meson: build "radv" vulkan driver for radeon hardware")
> Cc: Dylan Baker <dylanx.c.ba...@intel.com>
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> Signed-off-by: Marc Dietrich <marvi...@gmx.de>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index a4c3e49972..a76fd7749f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1015,7 +1015,7 @@ if with_llvm
>  _llvm_patch = _llvm_patch.split('s')[0]
>endif
>pre_args += [
> -'-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], 
> _llvm_patch),
> +'-DHAVE_LLVM=0x0@0@0@1@'.format(_llvm_version[0], _llvm_version[1]),
>  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
>]
>  elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
> -- 
> 2.16.0
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/2] Small fixes for the meson build

2018-01-24 Thread Dylan Baker
ping

Quoting Dylan Baker (2018-01-12 11:57:34)
> Here's a few things I've caught as I've started trying to add the meson
> build to our CI system.
> 
> Dylan Baker (2):
>   meson: set proper pkg-config version for libdrm_freedreno
>   meson: set the minimum version correctly
> 
>  freedreno/meson.build | 2 +-
>  meson.build   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> base-commit: fd9bcb73e9c5a01085069b37c2f5e04300a9b4d4
> -- 
> git-series 0.9.1


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 03/12] meson: glsl: add missing nir header dependency

2018-01-24 Thread Dylan Baker
I think this patch is no longer necessary, since libglsl has idep_nir, which
includes a dependency on nir_opcodes_h. Although I did notice it still has
inc_nir, which it doesn't need...

Quoting Greg V (2018-01-24 10:02:41)
> ---
>  src/compiler/glsl/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
> index b0c0de810a..36edcdc535 100644
> --- a/src/compiler/glsl/meson.build
> +++ b/src/compiler/glsl/meson.build
> @@ -202,7 +202,7 @@ files_libglsl_standalone = files(
>  libglsl = static_library(
>'glsl',
>[files_libglsl, glsl_parser, glsl_lexer_cpp, ir_expression_operation_h,
> -   ir_expression_operation_strings_h, ir_expression_operation_constant_h],
> +   ir_expression_operation_strings_h, ir_expression_operation_constant_h, 
> nir_opcodes_h],
>c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
>cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
>link_with : libglcpp,
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 04/12] meson: fix getting cflags from pkg-config

2018-01-24 Thread Dylan Baker
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Greg V (2018-01-24 10:02:42)
> get_pkgconfig_variable('cflags') always returns an empty list, it's a
> function for getting *custom* variables.
> 
> Meson does not yet support asking for cflags, so explicitly invoke
> pkg-config for now.
> ---
>  meson.build | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 33c1b5c91b..aef2573e2d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -373,6 +373,8 @@ if with_dri or with_gallium
>endif
>  endif
>  
> +prog_pkgconfig = find_program('pkg-config')
> +
>  dep_vdpau = []
>  _vdpau = get_option('gallium-vdpau')
>  if _vdpau == 'auto'
> @@ -404,7 +406,7 @@ else
>  endif
>  if with_gallium_vdpau
>dep_vdpau = declare_dependency(
> -compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['vdpau', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -445,7 +447,7 @@ else
>  endif
>  if with_gallium_xvmc
>dep_xvmc = declare_dependency(
> -compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['xvmc', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -508,7 +510,7 @@ if with_gallium_omx
>  endif
>  if with_gallium_omx
>dep_omx = declare_dependency(
> -compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['libomxil-bellagio', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> @@ -541,7 +543,7 @@ else
>  endif
>  if with_gallium_va
>dep_va = declare_dependency(
> -compile_args : dep_va.get_pkgconfig_variable('cflags').split()
> +compile_args : run_command(prog_pkgconfig, ['libva', 
> '--cflags']).stdout().split()
>)
>  endif
>  
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] autotools: Don't redefine EXTRA_DIST for freedreno

2018-01-26 Thread Dylan Baker
I just noticed this too, thanks for fixing it (both of you)

For whichever one,
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Emil Velikov (2018-01-25 03:14:45)
> On 25 January 2018 at 08:25, Daniel Stone <dani...@collabora.com> wrote:
> > The EXTRA_DIST of meson.build accidentally stomps another Freedreno file
> > which should be disted. Change = to +=.
> >
> > Signed-off-by: Daniel Stone <dani...@collabora.com>
> > Fixes: 436ed65d38d4 ("autotools: include meson build files in tarball")
> > Cc: Dylan Baker <dylan.c.ba...@intel.com>
> > Cc: Eric Engestrom <e...@engestrom.ch>
> > Cc: Emil Velikov <emil.veli...@collabora.com>
> > ---
> >  src/gallium/drivers/freedreno/Makefile.am | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> I've got slightly different version [1], any objections if we opt for that?
> Seems like I git branched a second too soon, omitting the fixes from
> master and 'detaching' 18.0-branchpoint.
> 
> Thanks
> Emil
> 
> [1] 
> https://cgit.freedesktop.org/mesa/mesa/commit/?h=18.0-branchpoint=a9db8ac93508701d5681a7273460084939386ed7


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4] meson: Don't confuse the install and search paths for dri drivers

2018-01-26 Thread Dylan Baker
Currently there is not a separate option for setting the search path of
DRI drivers in meson, like there is in scons and autotools. This is an
oversight and needs to be fixed. This adds an extra option
`dri-search-path`, which will default to the value of
`dri-drivers-path`, like autotools does.

v2: - Split input list before joining.
v3: - use : instead of ; as the delimiter. The autotools help string
  incorrectly says ; but the code uses :
v4: - Take list in pre : delimited form (Ilia)
- Ensure that the dri-search-path is absolute when using
  dri_drivers_path

Fixes: db9788420d4bc7b4 ("meson: Add support for configuring dri drivers 
directory.")
Reported-by: Ilia Mirkin <imir...@alum.mit.edu>
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
Reviewed-by: Eric Anholt <e...@anholt.net> (v2)
Reviewed-by: Eric Engestrom <e...@engestrom.ch> (v3)
---

I noticed that this patch has the same problem that has been noticed elsewhere,
that `get_option('libdir')` doesn't necessarily return an absolute path. I also
decided that Ilia was right, just taking the options as 'foo:bar' (like
autotools) and not splitting and joining is a better plan. Oh, and I removed an
extra dead variable that should have been removed already.

 meson.build | 4 
 meson_options.txt   | 8 +++-
 src/egl/meson.build | 2 +-
 src/gbm/meson.build | 2 +-
 src/glx/meson.build | 4 ++--
 5 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index bc5996992a3..dc51c4f70db 100644
--- a/meson.build
+++ b/meson.build
@@ -57,6 +57,10 @@ dri_drivers_path = get_option('dri-drivers-path')
 if dri_drivers_path == ''
   dri_drivers_path = join_paths(get_option('libdir'), 'dri')
 endif
+dri_search_path = get_option('dri-search-path')
+if dri_search_path == ''
+  dri_search_path = join_paths(get_option('prefix'), dri_drivers_path)
+endif
 
 with_gles1 = get_option('gles1')
 with_gles2 = get_option('gles2')
diff --git a/meson_options.txt b/meson_options.txt
index 894378985fd..fca06c4e61d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -41,7 +41,13 @@ option(
   'dri-drivers-path',
   type : 'string',
   value : '',
-  description : 'Location of dri drivers. Default: $libdir/dri.'
+  description : 'Location to install dri drivers. Default: $libdir/dri.'
+)
+option(
+  'dri-search-path',
+  type : 'string',
+  value : '',
+  description : 'Locations to search for dri drivers, passed as colon 
separated list. Default: dri-drivers-path.'
 )
 option(
   'gallium-drivers',
diff --git a/src/egl/meson.build b/src/egl/meson.build
index df6e8b49dac..6cd04567b0d 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -160,7 +160,7 @@ libegl = shared_library(
   c_args : [
 c_vis_args,
 c_args_for_egl,
-'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+'-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 '-D_EGL_BUILT_IN_DRIVER_DRI2',
 
'-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
   ],
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 14b9e960360..2f5d1c6ddd7 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -38,7 +38,7 @@ incs_gbm = [
 if with_dri2
   files_gbm += files('backends/dri/gbm_dri.c', 'backends/dri/gbm_driint.h')
   deps_gbm += dep_libdrm # TODO: pthread-stubs
-  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir)
+  args_gbm += '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path)
 endif
 if with_platform_wayland
   deps_gbm += dep_wayland_server
diff --git a/src/glx/meson.build b/src/glx/meson.build
index 04cd647ee49..e147aa3821e 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -111,7 +111,6 @@ elif with_dri_platform == 'windows'
   extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup'
 endif
 
-dri_driver_dir = join_paths(get_option('prefix'), dri_drivers_path)
 if not with_glvnd
   gl_lib_name = 'GL'
   gl_lib_version = '1.2.0'
@@ -128,7 +127,8 @@ else
 endif
 
 gl_lib_cargs = [
-  '-D_REENTRANT', '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_driver_dir),
+  '-D_REENTRANT',
+  '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
 ]
 
 if dep_xxf86vm != [] and dep_xxf86vm.found()
-- 
2.16.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] meson: generate translations for driconf

2018-01-26 Thread Dylan Baker
Currently meson implements the same logic as SCons for translations,
namely it doesn't do them. This patch changes meson to use logic more
like autotools, and generate translations. To do this we have to go
behind meson's back a bit, and wrap the whole thing up in a single
python script.

Meson has a module for gettext translations, but it assumes that one
will have a pot file, and then .mo translations will be generated and
checked into the source repo (or generated by hand using custom ninja
targets before building), mesa assumes that the targets will be
regenerated on each invocation of make or ninja. I think this can be
fixed upstream, but in the mean time this adds support for using
translations.

Fixes: 3218056e0eb3 ("meson: Build i965 and dri stack")
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---

I could have sworn that I've sent this out before, but I can't find it now.

 src/util/xmlpool/Makefile.am |  3 +-
 src/util/xmlpool/gen_translations.py | 91 
 src/util/xmlpool/meson.build | 31 
 3 files changed, 116 insertions(+), 9 deletions(-)
 create mode 100644 src/util/xmlpool/gen_translations.py

diff --git a/src/util/xmlpool/Makefile.am b/src/util/xmlpool/Makefile.am
index 0ef7a5462a1..e3ff38449b0 100644
--- a/src/util/xmlpool/Makefile.am
+++ b/src/util/xmlpool/Makefile.am
@@ -59,7 +59,8 @@ EXTRA_DIST = \
$(POS) \
$(MOS) \
SConscript \
-   meson.build
+   meson.build \
+   gen_translations.py
 
 BUILT_SOURCES = options.h
 CLEANFILES = \
diff --git a/src/util/xmlpool/gen_translations.py 
b/src/util/xmlpool/gen_translations.py
new file mode 100644
index 000..5d08590227d
--- /dev/null
+++ b/src/util/xmlpool/gen_translations.py
@@ -0,0 +1,91 @@
+# encoding=utf-8
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""Wraps gen_xmlpool.py and generates .mo files for use in meson.
+
+Currently meson and mesa have a mismatch in the way that they assume that
+translations should be generated. Meson assumes that translations are generated
+and checked into the tree, mesa assumes that they are generated at compile
+time. This script bridges that difference.
+"""
+
+from __future__ import print_function
+import argparse
+import os
+import subprocess
+import sys
+
+
+def arg_parser():
+parser = argparse.ArgumentParser()
+parser.add_argument('inputfile', help='The template file (t_options.h)')
+parser.add_argument('outputfile', help='The file to write.')
+parser.add_argument('gen_xmlpool', help='The gen_xmlpool.py script')
+parser.add_argument('sourcedir', help='The source directory')
+parser.add_argument('builddir', help='The build directory')
+parser.add_argument('python', help='The python binary to call 
gen_xmlpool.py with')
+parser.add_argument('langs', nargs='+', help='langs to generate.')
+return parser.parse_args()
+
+
+def gen_mo(lang, sourcedir, builddir):
+"""Generate an mo file from each po file using msgfmt."""
+# TODO: Python actually provides a tool that serves the same purpose as
+# msgfmt. It might make sense to fall back to that tool if msgfmt isn't
+# available (or just use it since our po files aren't that complicated) for
+# other oses (like macOS and Windows).
+
+outdir = os.path.join(builddir, lang, 'LC_MESSAGES')
+if not os.path.exists(outdir):
+os.makedirs(outdir)
+
+po_file = os.path.join(sourcedir, '{}.po'.format(lang))
+mo_file = os.path.join(outdir, 'options.mo')
+
+try:
+subprocess.check_call(['msgfmt', '-o', mo_file, po_file])
+except subprocess.CalledProcessError as e:
+print(e.output, file=sys.stderr)
+sys.exit(e.returncode)
+
+
+def main():
+args = arg_parser()
+
+for lang in args.langs:
+ge

[Mesa-dev] [PATCH libdrm] meson: fix libdrm_nouveau pkgconfig include directories

2018-01-26 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---

I have tested building every mesa driver against this (with and without udev!)
so I'm pretty sure that this is the last pkgbuild problem.

I'm sure I'll be sad in a day or two...

 nouveau/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nouveau/meson.build b/nouveau/meson.build
index bfecf84b..f031cd63 100644
--- a/nouveau/meson.build
+++ b/nouveau/meson.build
@@ -45,7 +45,7 @@ install_headers(
 pkg.generate(
   name : 'libdrm_nouveau',
   libraries : libdrm_nouveau,
-  subdirs : ['.', 'nouveau'],
+  subdirs : ['.', 'libdrm', 'libdrm/nouveau'],
   version : meson.project_version(),
   requires_private : 'libdrm',
   description : 'Userspace interface to nouveau kernel DRM services',
-- 
2.16.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: set proper pkg-config version for libdrm_freedreno

2018-01-26 Thread Dylan Baker
Quoting Emil Velikov (2018-01-25 02:30:10)
> Hi Dylan,
> 
> To make it easier to spot these, do set the git subject prefix to PATCH 
> libdrm.
> See autogen.sh for an example.
> 
> On 12 January 2018 at 19:57, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Copy and paste error from exynos.
> >
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > ---
> >  freedreno/meson.build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/freedreno/meson.build b/freedreno/meson.build
> > index b4035e1..de6a413 100644
> > --- a/freedreno/meson.build
> > +++ b/freedreno/meson.build
> > @@ -64,7 +64,7 @@ pkg.generate(
> >name : 'libdrm_freedreno',
> >libraries : libdrm_freedreno,
> >subdirs : ['.', 'libdrm', 'freedreno'],
> > -  version : '0.7',
> > +  version : meson.project_version(),
> 
> Ideally we'll have version file(s) to share across builds - both the
> shared libraries' --version-info and the pkg-config ones.
> Otherwise things will be out of sync far too often. But that can
> happen as a follow-up.

I guess thing to do for libdrm is decide how long we need both build systems.
libdrm is a much simpler build than mesa so, I would hope we can iron out any
remaining bugs pretty quickly. We can also cut releases whenever we want with
libdrm (unlike mesa where we use a 3 month cadence). If we think that we need to
have them co-exist for a long time then yes, we absolutely should do something
like add a VERSION file.

> The series is
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>

Thanks for looking at this!

> 
> -Emil

Odd, I have format.subjectPrefix set in my libdrm git repo. Maybe adding --to
changes that?

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: libdrm shouldn't appear in Requires.private: if it wasn't found

2018-01-26 Thread Dylan Baker
Please add this to the commit message:
Fixes: 3218056e0eb3 ("meson: Build i965 and dri stack")

Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Jon Turney (2018-01-26 04:42:50)
> Otherwise, using pkg-config to retrieve flags will fail, e.g.
> 
> $ pkg-config gl --cflags
> Package libdrm was not found in the pkg-config search path.
> Perhaps you should add the directory containing `libdrm.pc'
> to the PKG_CONFIG_PATH environment variable
> Package 'libdrm', required by 'gl', not found
> 
> Signed-off-by: Jon Turney <jon.tur...@dronecode.org.uk>
> ---
>  meson.build  | 6 --
>  src/mesa/drivers/dri/meson.build | 7 ++-
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index bc5996992a3..824e3c46bc5 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1213,8 +1213,10 @@ inc_include = include_directories('include')
>  
>  gl_priv_reqs = [
>'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
> -  'xcb-glx >= 1.8.1', 'libdrm >= 2.4.75',
> -]
> +  'xcb-glx >= 1.8.1']
> +if dep_libdrm.found()
> +  gl_priv_reqs += 'libdrm >= 2.4.75'
> +endif
>  if dep_xxf86vm != [] and dep_xxf86vm.found()
>gl_priv_reqs += 'xxf86vm'
>  endif
> diff --git a/src/mesa/drivers/dri/meson.build 
> b/src/mesa/drivers/dri/meson.build
> index 94798b0f5da..87021fba885 100644
> --- a/src/mesa/drivers/dri/meson.build
> +++ b/src/mesa/drivers/dri/meson.build
> @@ -67,12 +67,17 @@ endif
>  # This needs to be installed if any dri drivers (including gallium dri 
> drivers)
>  # are built.
>  if with_dri
> +  dri_req_private = []
> +  if dep_libdrm.found()
> +dri_req_private = ['libdrm >= 2.4.75']  # FIXME: don't hardcode this
> +  endif
> +
>pkg.generate(
>  name : 'dri',
>  filebase : 'dri',
>  description : 'Direct Rendering Infrastructure',
>  version : meson.project_version(),
>  variables : ['dridriverdir=${prefix}/' + dri_drivers_path],
> -requires_private : ['libdrm >= 2.4.75'],  # FIXME: don't hardcode this
> +requires_private : dri_req_private,
>)
>  endif
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 6/6] meson: fix xvmc target linkage

2018-01-18 Thread Dylan Baker
This needs to link the state tracker with whole-archive, it needs to
link with libxvmc, and it needs a few extra window system dependencies.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build  |  5 -
 src/gallium/targets/xvmc/meson.build | 18 --
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index bd4afdf..dae9794 100644
--- a/meson.build
+++ b/meson.build
@@ -437,11 +437,6 @@ elif _xvmc == 'true'
 else
   with_gallium_xvmc = false
 endif
-if with_gallium_xvmc
-  dep_xvmc = declare_dependency(
-compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
-  )
-endif
 
 xvmc_drivers_path = get_option('xvmc-libs-path')
 if xvmc_drivers_path == ''
diff --git a/src/gallium/targets/xvmc/meson.build 
b/src/gallium/targets/xvmc/meson.build
index 48759de..4889942 100644
--- a/src/gallium/targets/xvmc/meson.build
+++ b/src/gallium/targets/xvmc/meson.build
@@ -24,6 +24,7 @@
 
 xvmc_link_args = []
 xvmc_link_depends = []
+xvmc_link_with = []
 xvmc_drivers = []
 
 if with_ld_version_script
@@ -31,6 +32,13 @@ if with_ld_version_script
   xvmc_link_depends += files('xvmc.sym')
 endif
 
+if with_dri
+  xvmc_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  xvmc_link_with += libswkmsdri
+endif
+
 libxvmc_gallium = shared_library(
   'XvMCgallium',
   'target.c',
@@ -40,14 +48,12 @@ libxvmc_gallium = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libxvmc_st],
   link_with : [
-libxvmc_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
-  ],
-  dependencies : [
-dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_libdrm, dep_thread,
-driver_r600, driver_nouveau,
+libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
+libpipe_loader_static, libws_null, libwsw, xvmc_link_with,
   ],
+  dependencies : [dep_thread, driver_r600, driver_nouveau],
   link_depends : xvmc_link_depends,
 )
 
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/6] meson: link dri3 xcb libs into vlwinsys instead of into each target

2018-01-18 Thread Dylan Baker
This makes the dependencies easier to manage, since each media target
doesn't need to worry about linking to half a dozen libraries.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/auxiliary/meson.build | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 6f1542d..5908f9c 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -452,10 +452,15 @@ files_libgalliumvl = files(
   'vl/vl_zscan.h',
 )
 
+vlwinsys_deps = []
 files_libgalliumvlwinsys = files('vl/vl_winsys.h')
 if with_dri2
   files_libgalliumvlwinsys += files('vl/vl_winsys_dri.c')
   if with_dri3
+vlwinsys_deps += [
+  dep_xcb_sync, dep_xcb_present, dep_xshmfence, dep_xcb_xfixes,
+  dep_xcb_dri3, 
+]
 files_libgalliumvlwinsys += files('vl/vl_winsys_dri3.c')
   endif
 endif
@@ -526,6 +531,6 @@ libgalliumvlwinsys = static_library(
   'galliumvlwinsys',
   files_libgalliumvlwinsys,
   include_directories : [inc_gallium, inc_include, inc_loader, inc_src],
-  dependencies : [dep_libdrm],
+  dependencies : [dep_libdrm, vlwinsys_deps],
   build_by_default : false,
 )
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [Test Patch] Meson: ensure vdpau has proper symbols exposed

2018-01-18 Thread Dylan Baker
I dug into what autotools is doing. It's using -Wl,--whole-archive to link
everything, in this target, not just the state tracker. I think I'm okay with
this patch given that, so I'm going to apply the same change to the other media
state trackers and send it out as a series.

Quoting Dylan Baker (2018-01-11 09:24:42)
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> ---
>  src/gallium/targets/vdpau/meson.build | 16 +---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/targets/vdpau/meson.build 
> b/src/gallium/targets/vdpau/meson.build
> index 67f1469fb0f..432a32a7340 100644
> --- a/src/gallium/targets/vdpau/meson.build
> +++ b/src/gallium/targets/vdpau/meson.build
> @@ -23,6 +23,7 @@
>  # configure.ac)
>  
>  vdpau_link_args = []
> +vdpau_link_with = []
>  vdpau_link_depends = []
>  vdpau_drivers = []
>  
> @@ -35,6 +36,13 @@ if with_ld_dynamic_list
>vdpau_link_depends += files('../dri-vdpau.dyn')
>  endif
>  
> +if with_dri
> +  vdpau_link_with += libswdri
> +endif
> +if with_gallium_drisw_kms
> +  vdpau_link_with += libswkmsdri
> +endif
> +
>  libvdpau_gallium = shared_library(
>'vdpau_gallium',
>'target.c',
> @@ -44,12 +52,14 @@ libvdpau_gallium = shared_library(
>include_directories : [
>  inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
>],
> +  link_whole : [libvdpau_st],
>link_with : [
> -libvdpau_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> -libpipe_loader_static, libws_null, libwsw,
> +libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
> +libpipe_loader_static, libws_null, libwsw, vdpau_link_with,
>],
>dependencies : [
> -dep_thread, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_libdrm,
> +dep_thread, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3,
> +dep_xcb_present, dep_xshmfence, dep_xcb_xfixes, dep_xcb_sync, dep_libdrm,
>  driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
>],
>link_depends : vdpau_link_depends,
> -- 
> 2.15.1
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/6] meson: Fix omx-bellagio target linkage

2018-01-18 Thread Dylan Baker
There were a couple of problems, first we need to link the whole state
tracker in (like autotools does), then we need to link with bellagio
(like autotools does), then we need a few extra dependencies that were
being lost because the state tracker wasn't being properly linked.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build  |  5 -
 src/gallium/targets/omx-bellagio/meson.build | 18 --
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index ae31cdd..bd4afdf 100644
--- a/meson.build
+++ b/meson.build
@@ -500,11 +500,6 @@ if with_gallium_omx
 endif
   endif
 endif
-if with_gallium_omx
-  dep_omx = declare_dependency(
-compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
-  )
-endif
 
 dep_va = []
 _va = get_option('gallium-va')
diff --git a/src/gallium/targets/omx-bellagio/meson.build 
b/src/gallium/targets/omx-bellagio/meson.build
index a3fba3f..75f0f02 100644
--- a/src/gallium/targets/omx-bellagio/meson.build
+++ b/src/gallium/targets/omx-bellagio/meson.build
@@ -24,6 +24,14 @@
 
 omx_link_args = []
 omx_link_depends = []
+omx_link_with = []
+
+if with_dri
+  omx_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  omx_link_with += libswkmsdri
+endif
 
 if with_ld_version_script
   omx_link_args += ['-Wl,--version-script', 
join_paths(meson.current_source_dir(), 'omx.sym')]
@@ -39,15 +47,13 @@ libomx_gallium = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libomx_st],
   link_with : [
-libomx_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
+libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
+libpipe_loader_static, libws_null, libwsw, omx_link_with,
   ],
   link_depends : omx_link_depends,
-  dependencies : [
-dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_libdrm, dep_thread,
-driver_r600, driver_radeonsi, driver_nouveau,
-  ],
+  dependencies : [dep_thread, driver_r600, driver_radeonsi, driver_nouveau],
   install : true,
   install_dir : omx_drivers_path,
 )
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/6] meson: fix gallium media target linkage

2018-01-18 Thread Dylan Baker
The linkage of all of the gallium media targets is broken in various
ways in the meson build. This series should correct that by doing more
what the autotools build does.

Dylan Baker (6):
  meson: link dri3 xcb libs into vlwinsys instead of into each target
  meson: fix vdpau target linkage
  meson: fix va-api target linkage
  meson: Fix omx-bellagio target linkage
  meson: fix xa target linkage
  meson: fix xvmc target linkage

 meson.build  | 10 --
 src/gallium/auxiliary/meson.build|  7 ++-
 src/gallium/targets/omx-bellagio/meson.build | 18 --
 src/gallium/targets/va/meson.build   | 14 ++
 src/gallium/targets/vdpau/meson.build| 16 
 src/gallium/targets/xa/meson.build   | 16 
 src/gallium/targets/xvmc/meson.build | 18 --
 7 files changed, 64 insertions(+), 35 deletions(-)

base-commit: d1833b8cd894a7682c53a7bd6ca2dcfb97c7776e
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/6] meson: fix va-api target linkage

2018-01-18 Thread Dylan Baker
The state tracker needs to be linked with whole-archive (like
autotools), and we need a few window system deps.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/targets/va/meson.build | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/targets/va/meson.build 
b/src/gallium/targets/va/meson.build
index 0ea0cd1..e2785d0 100644
--- a/src/gallium/targets/va/meson.build
+++ b/src/gallium/targets/va/meson.build
@@ -25,14 +25,19 @@
 va_deps = []
 va_link_args = []
 va_link_depends = []
+va_link_with = []
 va_drivers = []
 
 if with_ld_version_script
   va_link_args += ['-Wl,--version-script', 
join_paths(meson.current_source_dir(), 'va.sym')]
   va_link_depends += files('va.sym')
 endif
-if with_platform_x11
-  va_deps += [dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3]
+
+if with_dri
+  va_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  va_link_with += libswkmsdri
 endif
 
 libva_gallium = shared_library(
@@ -44,9 +49,10 @@ libva_gallium = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libva_st],
   link_with : [
-libva_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
+libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
+libpipe_loader_static, libws_null, libwsw, va_link_with,
   ],
   dependencies : [
 dep_libdrm, dep_thread, va_deps, driver_r600, driver_radeonsi, 
driver_nouveau,
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: Don't confuse the install and search paths for dri drivers

2018-01-18 Thread Dylan Baker
Quoting Eric Anholt (2018-01-17 12:32:32)
> Dylan Baker <dy...@pnwbakers.com> writes:
> 
> > Currently there is not a separate option for setting the search path of
> > DRI drivers in meson, like there is in scons and autotools. This is an
> > oversight and needs to be fixed. This adds an extra option
> > `dri-search-path`, which will default to the value of
> > `dri-drivers-path`, like autotools does.
> >
> > Reported-by: Ilia Mirkin <imir...@alum.mit.edu>
> > Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> > ---
> >  meson.build | 6 ++
> >  meson_options.txt   | 8 +++-
> >  src/egl/meson.build | 2 +-
> >  src/gbm/meson.build | 2 +-
> >  src/glx/meson.build | 3 ++-
> >  5 files changed, 17 insertions(+), 4 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index ae31cdd6571..8002668666b 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -57,6 +57,12 @@ dri_drivers_path = get_option('dri-drivers-path')
> >  if dri_drivers_path == ''
> >dri_drivers_path = join_paths(get_option('libdir'), 'dri')
> >  endif
> > +_search = get_option('dri-search-path')
> > +if _search != ''
> > +  dri_search_path = ';'.join(_search)
> 
> If the user is passing a comma-separated string, don't you need to split
> on the commas before joining?
> 

Yes you do. I'll fix that and send a v2.


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 5/6] meson: fix xa target linkage

2018-01-18 Thread Dylan Baker
This needs to link the state-tracker with whole archive, and needs a few
extra window-system deps.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/targets/xa/meson.build | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gallium/targets/xa/meson.build 
b/src/gallium/targets/xa/meson.build
index 8ff6486..7417a27 100644
--- a/src/gallium/targets/xa/meson.build
+++ b/src/gallium/targets/xa/meson.build
@@ -24,12 +24,20 @@
 
 xa_link_args = []
 xa_link_depends = []
+xa_link_with = []
 
 if with_ld_version_script
   xa_link_args += ['-Wl,--version-script', 
join_paths(meson.current_source_dir(), 'xa.sym')]
   xa_link_depends += files('xa.sym')
 endif
 
+if with_dri
+  xa_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  xa_link_with += libswkmsdri
+endif
+
 libxatracker = shared_library(
   'xatracker',
   'target.c',
@@ -39,14 +47,14 @@ libxatracker = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libxa_st],
   link_with : [
-libxa_st, libgalliumvl_stub, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
+libgalliumvl_stub, libgallium, libmesa_util, libpipe_loader_static,
+libws_null, libwsw, xa_link_with,
   ],
   link_depends : xa_link_depends,
   dependencies : [
-dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_libdrm, dep_thread,
-driver_nouveau, driver_i915, driver_svga, driver_freedreno,
+dep_thread, driver_nouveau, driver_i915, driver_svga, driver_freedreno,
   ],
   install : true,
 )
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/6] meson: fix vdpau target linkage

2018-01-18 Thread Dylan Baker
The VDPAU state tracker needs to be linked with whole-archive (autotools
does this), and a few dependeies can be cleaned up

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/targets/vdpau/meson.build | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gallium/targets/vdpau/meson.build 
b/src/gallium/targets/vdpau/meson.build
index 67f1469..53af146 100644
--- a/src/gallium/targets/vdpau/meson.build
+++ b/src/gallium/targets/vdpau/meson.build
@@ -23,6 +23,7 @@
 # configure.ac)
 
 vdpau_link_args = []
+vdpau_link_with = []
 vdpau_link_depends = []
 vdpau_drivers = []
 
@@ -35,6 +36,13 @@ if with_ld_dynamic_list
   vdpau_link_depends += files('../dri-vdpau.dyn')
 endif
 
+if with_dri
+  vdpau_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  vdpau_link_with += libswkmsdri
+endif
+
 libvdpau_gallium = shared_library(
   'vdpau_gallium',
   'target.c',
@@ -44,13 +52,13 @@ libvdpau_gallium = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libvdpau_st],
   link_with : [
-libvdpau_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
+libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
+libpipe_loader_static, libws_null, libwsw, vdpau_link_with,
   ],
   dependencies : [
-dep_thread, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_libdrm,
-driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
+dep_thread, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
   ],
   link_depends : vdpau_link_depends,
 )
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/6] st/omx/tizonia: Add --enable-omx-tizonia flag and build files

2018-01-18 Thread Dylan Baker
The meson build for omx-bellagio has landed along with the other media state
trackers that are in tree. Currently there is a known bug with at least vdpau
and va-api (I suspect that the omx, va, and xvmc are affected as well) which
causes required symbols to not be exported, I'm still trying to resolve that.

For Tizonia, what I'd like to do is change the -Dgallium-omx argument to accept
['auto', 'bellagio', 'tizonia', 'disabled'] (this mirrors the glx option), with
auto trying to find bellagio and tizonia in some order and falling back to
disabled if neither is found.

The patches in this thread don't apply, there is some other work on you tree not
included maybe? Or I'd see about adding it (I don't think it would be too hard).
Do you have this series in a public git repo I could pull from?

Dylan

Quoting Leo Liu (2018-01-17 08:23:54)
> 
> 
> On 01/17/2018 11:19 AM, Gurkirpal Singh wrote:
> 
> 
> 
> On Wed, Jan 17, 2018 at 8:22 PM, Leo Liu  wrote:
> 
> Hi Gurkirpal,
> 
> Do we have patch 1 in the 6 patch set, or it hasn't arrived.
> 
> 
> We do have a patch 1 which has been held for moderation for being too
> large.
> 
> If there is no arrival tomorrow, please send it as attachment. Thanks.
> 
> 
> 
> Also I haven't seen the updates for Meson build in the current set.
> 
> 
> I wasn't sure if the changes needed to be added to this commit or add a 
> new
> commit.
> 
> 
> I think Dylan can give you advice on this for sure.
> 
> Thanks,
> Leo
> 
> 
>  
> 
> 
> @Dylan, if possible, could you give an update for the Meson build on
> the current set?
> 
> 
> Thanks,
> 
> Leo
> 
> 
> 
> 
> On 01/17/2018 08:54 AM, Gurkirpal Singh wrote:
> 
> Allow only bellagio or tizonia to be used at the same time.
> Detect tizonia package config file
> Generate libomx_mesa.so and install it to 
> libtizcore.pc::pluginsdir
> Only compile empty source (target.c) for now.
> 
> GSoC Project link: https://summerofcode.withgoogle.com/projects/#
> 4737166321123328
> 
> Acked-by: Leo Liu 
> Reviewed-by: Julien Isorce 
> ---
>   configure.ac                                       | 47
> +-
>   src/gallium/Makefile.am                            |  4 ++
>   src/gallium/state_trackers/omx/Makefile.am         | 13 ++
>   src/gallium/state_trackers/omx/tizonia/Makefile.am | 36
> +
>   .../state_trackers/omx/tizonia/Makefile.sources    |  1 +
>   src/gallium/targets/omx/Makefile.am                | 19 
> -
>   src/gallium/targets/omx/omx.sym                    |  1 +
>   7 files changed, 117 insertions(+), 4 deletions(-)
>   create mode 100644 src/gallium/state_trackers/omx/tizonia/
> Makefile.am
>   create mode 100644 src/gallium/state_trackers/omx/tizonia/
> Makefile.sources
> 
> diff --git a/configure.ac b/configure.ac
> index 7675a45..1f7b163 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -85,6 +85,7 @@ dnl Versions for external dependencies
>   DRI2PROTO_REQUIRED=2.8
>   GLPROTO_REQUIRED=1.4.14
>   LIBOMXIL_BELLAGIO_REQUIRED=0.0
> +LIBOMXIL_TIZONIA_REQUIRED=0.9.0
>   LIBVA_REQUIRED=0.38.0
>   VDPAU_REQUIRED=1.1
>   WAYLAND_REQUIRED=1.11
> @@ -1298,14 +1299,19 @@ AC_ARG_ENABLE([vdpau],
>      [enable_vdpau=auto])
>   AC_ARG_ENABLE([omx],
>      [AS_HELP_STRING([--enable-omx],
> -         [DEPRECATED: Use --enable-omx-bellagio instead @
> <:@default=auto@:>@])],
> -   [AC_MSG_ERROR([--enable-omx is deprecated. Use
> --enable-omx-bellagio instead.])],
> +         [DEPRECATED: Use --enable-omx-bellagio or
> --enable-omx-tizonia instead @<:@default=auto@:>@])],
> +   [AC_MSG_ERROR([--enable-omx is deprecated. Use
> --enable-omx-bellagio or --enable-omx-tizonia instead.])],
>      [])
>   AC_ARG_ENABLE([omx-bellagio],
>      [AS_HELP_STRING([--enable-omx-bellagio],
>            [enable OpenMAX Bellagio library 
> @<:@default=disabled@:>
> @])],
>      [enable_omx_bellagio="$enableval"],
>      [enable_omx_bellagio=no])
> +AC_ARG_ENABLE([omx-tizonia],
> +   [AS_HELP_STRING([--enable-omx-tizonia],
> +         [enable OpenMAX Tizonia library @<:@default=disabled@:>
> @])],
> +   [enable_omx_tizonia="$enableval"],
> +   

[Mesa-dev] [PATCH 1/2] meson: set proper pkg-config version for libdrm_freedreno

2018-01-13 Thread Dylan Baker
Copy and paste error from exynos.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 freedreno/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/freedreno/meson.build b/freedreno/meson.build
index b4035e1..de6a413 100644
--- a/freedreno/meson.build
+++ b/freedreno/meson.build
@@ -64,7 +64,7 @@ pkg.generate(
   name : 'libdrm_freedreno',
   libraries : libdrm_freedreno,
   subdirs : ['.', 'libdrm', 'freedreno'],
-  version : '0.7',
+  version : meson.project_version(),
   requires_private : 'libdrm',
   description : 'Userspace interface to freedreno kernel DRM services',
 )
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/7] report.py: Add option to only display the final summary

2018-01-13 Thread Dylan Baker
Quoting Ian Romanick (2018-01-12 12:06:58)
> From: Ian Romanick 
> 
> This is useful for preparing data to go in a Mesa commit message.
> 
> Signed-off-by: Ian Romanick 
> ---
>  report.py | 60 
>  1 file changed, 32 insertions(+), 28 deletions(-)
> 
> diff --git a/report.py b/report.py
> index 003a1ee..e0068bc 100755
> --- a/report.py
> +++ b/report.py
> @@ -60,6 +60,8 @@ def main():
>  parser.add_argument("--measurements", "-m", type=split_list,
>  default=["instructions", "cycles", "loops", 
> "spills", "fills"],
>  help="comma-separated list of measurements to 
> report")
> +parser.add_argument("--summary-only", "-s", action="store_true", 
> default=False,

It doesn't really matter, but you don't need the default here, store_true
defaults to false.

> +help="do not show the per-shader helped / hurt data")
>  parser.add_argument("before", type=get_results, help="the output of the 
> original code")
>  parser.add_argument("after", type=get_results, help="the output of the 
> new code")
>  args = parser.parse_args()
> @@ -104,23 +106,24 @@ def main():
>  else:
>  helped.append(p)
>  
> -helped.sort(
> -key=lambda k: args.after[k][m] if args.before[k][m] == 0 else 
> float(args.before[k][m] - args.after[k][m]) / args.before[k][m])
> -for p in helped:
> -namestr = p[0] + " " + p[1]
> -print(m + " helped:   " + get_result_string(
> -namestr, args.before[p][m], args.after[p][m]))
> -if len(helped) > 0:
> -print("")
> -
> -hurt.sort(
> -key=lambda k: args.after[k][m] if args.before[k][m] == 0 else 
> float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> -for p in hurt:
> -namestr = p[0] + " " + p[1]
> -print(m + " HURT:   " + get_result_string(
> -namestr, args.before[p][m], args.after[p][m]))
> -if len(hurt) > 0:
> -print("")
> +if not args.summary_only:
> +helped.sort(
> +key=lambda k: args.after[k][m] if args.before[k][m] == 0 
> else float(args.before[k][m] - args.after[k][m]) / args.before[k][m])
> +for p in helped:
> +namestr = p[0] + " " + p[1]
> +print(m + " helped:   " + get_result_string(
> +namestr, args.before[p][m], args.after[p][m]))
> +if len(helped) > 0:
> +print("")
> +
> +hurt.sort(
> +key=lambda k: args.after[k][m] if args.before[k][m] == 0 
> else float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> +for p in hurt:
> +namestr = p[0] + " " + p[1]
> +print(m + " HURT:   " + get_result_string(
> +namestr, args.before[p][m], args.after[p][m]))
> +if len(hurt) > 0:
> +print("")
>  
>  num_helped[m] = len(helped)
>  num_hurt[m] = len(hurt)
> @@ -137,17 +140,18 @@ def main():
>  if args.before.get(p) is None:
>  gained.append(p[0] + " " + p[1])
>  
> -lost.sort()
> -for p in lost:
> -print("LOST:   " + p)
> -if len(lost) > 0:
> -print("")
> -
> -gained.sort()
> -for p in gained:
> -print("GAINED: " + p)
> -if len(gained) > 0:
> -print("")
> +if not args.summary_only:
> +lost.sort()
> +for p in lost:
> +print("LOST:   " + p)
> +if len(lost) > 0:
> +print("")
> +
> +gained.sort()
> +for p in gained:
> +print("GAINED: " + p)
> +if len(gained) > 0:
> +print("")
>  
>  for m in args.measurements:
>  print("total {0} in shared programs: {1}\n"
> -- 
> 2.9.5
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 5/7] report.py: Add option to only display measurements that have changes

2018-01-13 Thread Dylan Baker
Quoting Ian Romanick (2018-01-12 12:06:59)
> From: Ian Romanick 
> 
> This is useful for preparing data to go in a Mesa commit message.
> 
> Signed-off-by: Ian Romanick 
> ---
>  report.py | 53 +++--
>  1 file changed, 31 insertions(+), 22 deletions(-)
> 
> diff --git a/report.py b/report.py
> index e0068bc..72752c1 100755
> --- a/report.py
> +++ b/report.py
> @@ -62,6 +62,8 @@ def main():
>  help="comma-separated list of measurements to 
> report")
>  parser.add_argument("--summary-only", "-s", action="store_true", 
> default=False,
>  help="do not show the per-shader helped / hurt data")
> +parser.add_argument("--changes-only", "-c", action="store_true", 
> default=False,
> +help="only show measurements that have changes")
>  parser.add_argument("before", type=get_results, help="the output of the 
> original code")
>  parser.add_argument("after", type=get_results, help="the output of the 
> new code")
>  args = parser.parse_args()
> @@ -116,14 +118,14 @@ def main():
>  if len(helped) > 0:
>  print("")
>  
> -hurt.sort(
> -key=lambda k: args.after[k][m] if args.before[k][m] == 0 
> else float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> -for p in hurt:
> -namestr = p[0] + " " + p[1]
> -print(m + " HURT:   " + get_result_string(
> -namestr, args.before[p][m], args.after[p][m]))
> -if len(hurt) > 0:
> -print("")
> +hurt.sort(
> +key=lambda k: args.after[k][m] if args.before[k][m] == 0 
> else float(args.after[k][m] - args.before[k][m]) / args.before[k][m])
> +for p in hurt:
> +namestr = p[0] + " " + p[1]
> +print(m + " HURT:   " + get_result_string(
> +namestr, args.before[p][m], args.after[p][m]))
> +if len(hurt) > 0:
> +print("")
>  
>  num_helped[m] = len(helped)
>  num_hurt[m] = len(hurt)
> @@ -153,21 +155,28 @@ def main():
>  if len(gained) > 0:
>  print("")
>  
> +any_helped_or_hurt = False
>  for m in args.measurements:
> -print("total {0} in shared programs: {1}\n"
> -  "{0} in affected programs: {2}\n"
> -  "helped: {3}\n"
> -  "HURT: {4}\n".format(
> -   m,
> -   change(total_before[m], total_after[m]),
> -   change(affected_before[m], affected_after[m]),
> -   num_helped[m],
> -   num_hurt[m]))
> -
> -
> -print("LOST:   " + str(len(lost)))
> -print("GAINED: " + str(len(gained)))
> -
> +if num_helped[m] > 0 or num_hurt[m] > 0:
> +any_helped_or_hurt = True
> +
> +if num_helped[m] > 0 or num_hurt[m] > 0 or not args.changes_only:

Couldn't this be: `if any_helped_or_hurt or not args.changes_only:`

> +print("total {0} in shared programs: {1}\n"
> +  "{0} in affected programs: {2}\n"
> +  "helped: {3}\n"
> +  "HURT: {4}\n".format(
> + m,
> + change(total_before[m], total_after[m]),
> + change(affected_before[m], affected_after[m]),
> + num_helped[m],
> + num_hurt[m]))
> +
> +if len(lost) > 0 or len(gained) > 0 or not args.changes_only:

Don't use len() for checking if a list has members:
`if lost or gained or not args.changes_only:`

> +print("LOST:   " + str(len(lost)))
> +print("GAINED: " + str(len(gained)))
> +
> +if args.changes_only and len(lost) == 0 and len(gained) == 0 and not 
> any_helped_or_hurt:

same here:
`if args.changes_only and not lost and not gained and not any_helped_or_hurt`:

> +print("No changes.")
>  
>  if __name__ == "__main__":
>  main()
> -- 
> 2.9.5
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/2] Small fixes for the meson build

2018-01-13 Thread Dylan Baker
Here's a few things I've caught as I've started trying to add the meson
build to our CI system.

Dylan Baker (2):
  meson: set proper pkg-config version for libdrm_freedreno
  meson: set the minimum version correctly

 freedreno/meson.build | 2 +-
 meson.build   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

base-commit: fd9bcb73e9c5a01085069b37c2f5e04300a9b4d4
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: Fix configuring dri glx with only gallium drivers

2018-01-13 Thread Dylan Baker
meson considers classic swrast to be a dri driver, I know it's not exactly
accurate, but, at least for me, it made the build system easier to reason about.

Quoting Adam Jackson (2018-01-12 09:06:37)
> On Fri, 2018-01-12 at 13:18 +, Jon Turney wrote:
> > 'meson -Ddri-drivers= -Dgallium-drivers=swrast -Dglx=dri' fails with 'dri
> > based GLX requires at least one DRI driver'
> > 
> > Signed-off-by: Jon Turney 
> > ---
> >  meson.build | 2 +-
> >  src/glx/meson.build | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 77e4e894b23..dd8e6145edb 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -323,7 +323,7 @@ if with_glx != 'disabled'
> >  if with_dri
> >error('xlib conflicts with any dri driver')
> >  endif
> > -  elif with_glx == 'dri' and not with_dri
> > +  elif with_glx == 'dri' and not (with_dri or with_gallium)
> >  error('dri based GLX requires at least one DRI driver')
> 
> We should just remove this check. libGL doesn't actually require a DRI
> driver, and at least on OSX there's no DRI driver you could possibly
> build.
> 
> - ajax
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] meson: Fix configuring dri glx with only gallium drivers

2018-01-13 Thread Dylan Baker
Maybe this is correct, but it makes me nervous treating with_gallium as
equivalent to with_dri, since gallium drivers can be built dri-less
(gallium-xlib, and some other configurations on windows). I think something
like:

  with_glx = get_option('glx')
  if with_glx == 'auto'
if with_dri
  with_glx = 'dri'
elif with_gallium
  # Even when building just gallium drivers the user probably wants dri
  with_glx = 'dri'
  with_dri = true
elif with_platform_x11 and with_any_opengl and not with_any_vk
  # The automatic behavior should not be to turn on xlib based glx when
  # building only vulkan drivers
  with_glx = 'xlib'
else
  with_glx = 'disabled'
endif
+ elif with_glx == 'dri'
+   if with_gallium
+ with_dri = true
+   endif
  endif


Would achieve the correct result, be simpler, and avoid accidentally adding dri
sources when we shouldn't.

Dylan

Quoting Jon Turney (2018-01-12 05:18:35)
> 'meson -Ddri-drivers= -Dgallium-drivers=swrast -Dglx=dri' fails with 'dri
> based GLX requires at least one DRI driver'
> 
> Signed-off-by: Jon Turney 
> ---
>  meson.build | 2 +-
>  src/glx/meson.build | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 77e4e894b23..dd8e6145edb 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -323,7 +323,7 @@ if with_glx != 'disabled'
>  if with_dri
>error('xlib conflicts with any dri driver')
>  endif
> -  elif with_glx == 'dri' and not with_dri
> +  elif with_glx == 'dri' and not (with_dri or with_gallium)
>  error('dri based GLX requires at least one DRI driver')
>endif
>  endif
> diff --git a/src/glx/meson.build b/src/glx/meson.build
> index cdb388e9837..ead6e6138f7 100644
> --- a/src/glx/meson.build
> +++ b/src/glx/meson.build
> @@ -65,7 +65,7 @@ extra_libs_libglx = []
>  extra_deps_libgl = []
>  extra_ld_args_libgl = []
>  
> -if with_dri
> +if with_dri or with_gallium
>files_libglx += files(
>  'dri_common.c',
>  'dri_common.h',
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] meson: set the minimum version correctly

2018-01-13 Thread Dylan Baker
Currently we ask for 0.42, but we actually require 0.43 because we pass
file objects as arguments to tests. If someone needs version 0.42 it
wouldn't be hard, just a lot of replacing files() with strings.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 0556608..d7a50cf 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ project(
   ['c'],
   version : '2.4.89',
   license : 'MIT',
-  meson_version : '>= 0.42',
+  meson_version : '>= 0.43',
   default_options : ['buildtype=debugoptimized', 'c_std=gnu99'],
 )
 
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glx: fix non-dri build

2018-01-14 Thread Dylan Baker
I don't know enough about glx to know if this is correct, but you'll need to 
add the c files to the meson.build as well

On January 13, 2018 3:36:30 AM PST, Samuel Thibault 
 wrote:
>glXGetDriverConfig parameters do not provide a context to dynamically
>check for the presence of the function, so the dispatcher directly
>calls
>glXGetDriverConfig, but in non-dri builds dri_glx.c didn't provide
>glXGetDriverConfig.
>
>This change makes it provide a NULL-returning stub in non-dri builds.
>
>Fixes: 84f764a7591 "glxglvnddispatch: Add missing dispatch for
>GetDriverConfig"
>
>---
>Compiling dri_glx.c in non-dri builds might be frowned upon. I'll be
>happy to move the glXGetDriverConfig to another file if somebody tells
>me which file would be the proper place.
>---
> src/glx/Makefile.am |  2 +-
> src/glx/dri_glx.c   | 11 ++-
> src/glx/glxclient.h |  4 ++--
> 3 files changed, 13 insertions(+), 4 deletions(-)
>
>diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
>index 5448a0907..0ae403403 100644
>--- a/src/glx/Makefile.am
>+++ b/src/glx/Makefile.am
>@@ -59,6 +59,7 @@ libglx_la_SOURCES = \
>   clientinfo.c \
>   compsize.c \
>   create_context.c \
>+  dri_glx.c \
>   eval.c \
>   glxclient.h \
>   glxcmds.c \
>@@ -123,7 +124,6 @@ libglx_la_SOURCES += \
>   dri2_glx.c \
>   dri2.h \
>   dri2_priv.h \
>-  dri_glx.c \
>   dri_sarea.h \
>   XF86dri.c \
>   xf86dri.h \
>diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
>index 5c4346cec..893cb4acd 100644
>--- a/src/glx/dri_glx.c
>+++ b/src/glx/dri_glx.c
>@@ -32,12 +32,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
>SOFTWARE.
>  *
>  */
> 
>+#include "glxclient.h"
>+
> #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> 
> #include 
> #include 
> #include 
>-#include "glxclient.h"
> #include "xf86dri.h"
> #include "dri2.h"
> #include "dri_sarea.h"
>@@ -1020,4 +1021,12 @@ driCreateDisplay(Display * dpy)
>return >base;
> }
> 
>+#else /* GLX_DIRECT_RENDERING */
>+
>+_GLX_PUBLIC const char *
>+glXGetDriverConfig(const char *driverName)
>+{
>+  return NULL;
>+}
>+
> #endif /* GLX_DIRECT_RENDERING */
>diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
>index f3a36cf10..a1925a5fe 100644
>--- a/src/glx/glxclient.h
>+++ b/src/glx/glxclient.h
>@@ -169,10 +169,10 @@ extern unsigned dri2GetSwapEventType(Display
>*dpy, XID drawable);
> */
> extern const char *glXGetScreenDriver(Display * dpy, int scrNum);
> 
>-extern const char *glXGetDriverConfig(const char *driverName);
>-
> #endif
> 
>+extern const char *glXGetDriverConfig(const char *driverName);
>+
>//
> 
> #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
>-- 
>2.15.1
>
>___
>mesa-dev mailing list
>mesa-dev@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 00/12] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-24 Thread Dylan Baker
I've gone ahead and added my rb to the remaining meson patches, added the
relevant Fixes tags, and pushed them to master (except the one that I don't
think is necessary now).

Thanks for working on this.

Dylan

Quoting Greg V (2018-01-24 10:02:38)
> meson: updated with suggestions from review.
> 
> anon_file: added a debug_name argument for anv, removed posix_fallocate 
> and retry loops that were copy-pasted from weston, etc.
> 
> SWR: since there's an environment variable KNOB_MAX_WORKER_THREADS that 
> lets it work without topology, it's fine to build on FreeBSD/DragonFly 
> as is (with this patch only).
> 
> ETIME discussion on FreeBSD bugzilla: 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225324
> 
> Greg V (12):
>   meson: fix missing dependencies
>   meson: fix BSD build
>   meson: glsl: add missing nir header dependency
>   meson: fix getting cflags from pkg-config
>   meson: handle LLVM 'x.x.xgit-revision' versions
>   util: add phys_memory.h for all memory measurements
>   util: add anon_file.h for all memfd/temp file usage
>   util: emulate futex on FreeBSD using umtx
>   anv: remove unused Linux-specific include
>   anv: add MAP_POPULATE fallback define for portability
>   swr: support FreeBSD/DragonFlyBSD
>   clover: fix build with LLVM 5
> 
>  configure.ac   |   2 +-
>  meson.build|  76 ++-
>  src/compiler/glsl/meson.build  |   2 +-
>  src/egl/drivers/dri2/platform_wayland.c| 118 +---
>  src/gallium/auxiliary/os/os_misc.c |  60 -
>  src/gallium/auxiliary/os/os_misc.h |   9 +-
>  src/gallium/drivers/radeonsi/meson.build   |   2 +-
>  src/gallium/drivers/swr/rasterizer/common/os.h |   3 +-
>  .../drivers/swr/rasterizer/core/threads.cpp|   4 +-
>  src/gallium/drivers/swr/swr_fence.cpp  |   2 +
>  .../state_trackers/clover/llvm/metadata.hpp|   2 +-
>  src/intel/vulkan/anv_allocator.c   |  25 ++--
>  src/intel/vulkan/anv_device.c  |  12 +-
>  src/intel/vulkan/anv_gem_stubs.c   |  15 +--
>  src/intel/vulkan/anv_queue.c   |   1 -
>  src/mesa/drivers/dri/i915/intel_screen.c   |   9 +-
>  src/mesa/drivers/dri/i965/intel_screen.c   |   9 +-
>  src/mesa/drivers/dri/swrast/swrast.c   |  23 +---
>  src/mesa/meson.build   |   2 +-
>  src/util/Makefile.sources  |   2 +
>  src/util/anon_file.h   | 150 
> +
>  src/util/futex.h   |  22 +++
>  src/util/meson.build   |   2 +
>  src/util/phys_memory.h |  81 +++
>  24 files changed, 339 insertions(+), 294 deletions(-)
>  create mode 100644 src/util/anon_file.h
>  create mode 100644 src/util/phys_memory.h
> 
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] meson: vdpau broken on r600

2018-01-12 Thread Dylan Baker
Thanks Ilia, I figured there must be some GL_DRIVERS_PATH equivalent but
couldn't find it with google, I never think to run strace. That's probably the
information I need to check on my nouveau machine.

Dylan

Quoting Ilia Mirkin (2018-01-11 15:30:23)
> It looks at the vdpau provider sent down down via the X DRI2 protocol.
> You can also force it to load any particular driver with
> VDPAU_DRIVER=foo, which would load
> $vdpau_dir_that_libvdpau_is_built_with/vdpau/libfoo_vdpau.so.1. You
> can also override the directory with VDPAU_DRIVER_PATH or
> VDPAU_DRIVERS_PATH (I can never remember). Running with 'strace -f'
> can help figure this stuff out.
> 
>   -ilia
> 
> On Thu, Jan 11, 2018 at 12:21 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > I couldn't reproduce with nouveau, vdpauinfo seems hardcoded to look for
> > vdpau_nvidia, and just ignores vdpau_nouveau.
> >
> > I have a patch that adds the symbol, but it feels ugly. I'm sending it and 
> > we
> > can test it, if it does fix it I guess we should figure out why we need to 
> > keep
> > adding --Wl,-whole-archive where autotools doesn't.
> >
> > Quoting Eric Engestrom (2018-01-11 08:58:32)
> >> On Tuesday, 2018-01-09 10:09:16 -0800, Dylan Baker wrote:
> >> > I'm not sure off the top of my head. I don't have an r600 anymore, but I 
> >> > have an
> >> > SI and a nouveau machine, so I'll see if I can reproduce the problem 
> >> > there and
> >> > fix it.
> >>
> >> I can confirm, the symbol is missing when building with meson:
> >>
> >> $ ninja src/gallium/targets/vdpau/libvdpau_gallium.so
> >> $ nm -D --defined-only src/gallium/targets/vdpau/libvdpau_gallium.so | 
> >> grep -c vdp_imp_device_create_x11
> >> 0
> >>
> >> I can't figure out why either, though.
> >>
> >> >
> >> > Dylan
> >> >
> >> > Quoting Marc Dietrich (2018-01-09 02:38:33)
> >> > > Hi Dylan,
> >> > >
> >> > > just found that vdpau does not work on r600 with meson build. Some 
> >> > > missing
> >> > > symbol, but I cannot figure out why:
> >> > >
> >> > > # vdpauinfo
> >> > > display: :0   screen: 0
> >> > > /usr/lib64/vdpau/libvdpau_r600.so.1: undefined symbol:
> >> > > vdp_imp_device_create_x11
> >> > > Error creating VDPAU device: 1
> >> > >
> >> > > The size of the library differs significant:
> >> > > autotools: 2417768 libvdpau_r600.so.1.0.0
> >> > > meson:  717368 libvdpau_r600.so.1.0.0
> >>
> >> With all the default options (except buildtype=release for meson),
> >> I'm getting these sizes:
> >> 5320936   meson/usr/lib/vdpau/libvdpau_r600.so.1.0.0
> >> 25190032  autotools/usr/lib/vdpau/libvdpau_r600.so.1.0.0
> >>
> >> but if I strip them, the autotools one shrinks to about a tenth of
> >> its size, and now the meson one actually looks bigger:
> >> 4722192   meson/usr/lib/vdpau/libvdpau_r600.so.1.0.0.stripped
> >> 2788936   autotools/usr/lib/vdpau/libvdpau_r600.so.1.0.0.stripped
> >>
> >> I'm not sure how much you can guess from the size of the binary though,
> >> too much is different between the two builds.
> >> Whether the symbols are exposed (see above) is a better metric IMO.
> >>
> >> > >
> >> > > Any idea?
> >> > >
> >> > > Marc
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 09/10] meson: Build gallium trivial tests

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build   |  2 +--
 src/gallium/meson.build   |  6 --
 src/gallium/tests/meson.build | 21 -
 src/gallium/tests/trivial/meson.build | 29 -
 4 files changed, 54 insertions(+), 4 deletions(-)
 create mode 100644 src/gallium/tests/meson.build
 create mode 100644 src/gallium/tests/trivial/meson.build

diff --git a/meson.build b/meson.build
index 77e4e89..b3f11b1 100644
--- a/meson.build
+++ b/meson.build
@@ -1178,8 +1178,6 @@ else
   dep_lmsensors = []
 endif
 
-# TODO: gallium tests
-
 # TODO: various libdirs
 
 # TODO: gallium driver dirs
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 6330c75..cc1aea8 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -1,5 +1,5 @@
 # Copyright © 2017 Dylan Baker
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -187,4 +187,6 @@ endif
 if with_gallium_st_nine
   subdir('targets/d3dadapter9')
 endif
-# TODO: tests
+if with_tests
+  subdir('tests')
+endif
diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
new file mode 100644
index 000..1779874
--- /dev/null
+++ b/src/gallium/tests/meson.build
@@ -0,0 +1,21 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+subdir('trivial')
diff --git a/src/gallium/tests/trivial/meson.build 
b/src/gallium/tests/trivial/meson.build
new file mode 100644
index 000..bbb2551
--- /dev/null
+++ b/src/gallium/tests/trivial/meson.build
@@ -0,0 +1,29 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+foreach t : ['compute', 'tri', 'quad-tex']
+  executable(
+t,
+'@0@.c'.format(t),
+include_directories : inc_common,
+link_with : [libmesa_util, libgallium, libpipe_loader_dynamic],
+install : false,
+  )
+endforeach
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 10/10] meson: build gallium unit tests

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/tests/meson.build  |  1 +-
 src/gallium/tests/unit/meson.build | 31 +++-
 2 files changed, 32 insertions(+)
 create mode 100644 src/gallium/tests/unit/meson.build

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 1779874..7e45d13 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -19,3 +19,4 @@
 # SOFTWARE.
 
 subdir('trivial')
+subdir('unit')
diff --git a/src/gallium/tests/unit/meson.build 
b/src/gallium/tests/unit/meson.build
new file mode 100644
index 000..f320c56
--- /dev/null
+++ b/src/gallium/tests/unit/meson.build
@@ -0,0 +1,31 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+foreach t : ['pipe_barrier_test', 'u_cache_test', 'u_half_test',
+ 'u_format_test', 'u_format_compatible_test', 'translate_test']
+  executable(
+t,
+'@0@.c'.format(t),
+include_directories : [inc_common, inc_gallium_drivers, 
inc_gallium_winsys],
+link_with : [libgallium, libmesa_util, libtrace, libws_null],
+dependencies : [driver_swrast, dep_thread],
+install : false,
+  )
+endforeach
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 02/10] meson: run glsl compiler warnings test

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/tests/meson.build | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index 27f3407..11fb4fb 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -72,5 +72,12 @@ test('cache_test', glsl_cache_test)
 test('general_ir_test', glsl_general_ir_test)
 test('uniform_initializer_test', glsl_uniform_initializer_test)
 test('sampler_types_test', glsl_sampler_types_test)
-
-# TODO: figure out how to get the shell based tests to work?
+test(
+  'glsl compiler warnings', find_program('warnings_test.py'),
+  args : [
+'--glsl-compiler', glsl_compiler,
+'--test-directory', join_paths(
+  meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
+),
+  ],
+)
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 08/10] meson: Remove TODO about mesa/main tests

2018-01-11 Thread Dylan Baker
They're already done.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/mesa/meson.build | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index ab6bc27..ce612fb 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -18,8 +18,6 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# TODO: main/tests
-
 subdir('program')
 subdir('main')
 
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] meson: vdpau broken on r600

2018-01-11 Thread Dylan Baker
I couldn't reproduce with nouveau, vdpauinfo seems hardcoded to look for
vdpau_nvidia, and just ignores vdpau_nouveau. 

I have a patch that adds the symbol, but it feels ugly. I'm sending it and we
can test it, if it does fix it I guess we should figure out why we need to keep
adding --Wl,-whole-archive where autotools doesn't.

Quoting Eric Engestrom (2018-01-11 08:58:32)
> On Tuesday, 2018-01-09 10:09:16 -0800, Dylan Baker wrote:
> > I'm not sure off the top of my head. I don't have an r600 anymore, but I 
> > have an
> > SI and a nouveau machine, so I'll see if I can reproduce the problem there 
> > and
> > fix it.
> 
> I can confirm, the symbol is missing when building with meson:
> 
> $ ninja src/gallium/targets/vdpau/libvdpau_gallium.so
> $ nm -D --defined-only src/gallium/targets/vdpau/libvdpau_gallium.so | grep 
> -c vdp_imp_device_create_x11
> 0
> 
> I can't figure out why either, though.
> 
> > 
> > Dylan
> > 
> > Quoting Marc Dietrich (2018-01-09 02:38:33)
> > > Hi Dylan,
> > > 
> > > just found that vdpau does not work on r600 with meson build. Some 
> > > missing 
> > > symbol, but I cannot figure out why:
> > > 
> > > # vdpauinfo
> > > display: :0   screen: 0
> > > /usr/lib64/vdpau/libvdpau_r600.so.1: undefined symbol: 
> > > vdp_imp_device_create_x11
> > > Error creating VDPAU device: 1
> > > 
> > > The size of the library differs significant:
> > > autotools: 2417768 libvdpau_r600.so.1.0.0
> > > meson:  717368 libvdpau_r600.so.1.0.0
> 
> With all the default options (except buildtype=release for meson),
> I'm getting these sizes:
> 5320936   meson/usr/lib/vdpau/libvdpau_r600.so.1.0.0
> 25190032  autotools/usr/lib/vdpau/libvdpau_r600.so.1.0.0
> 
> but if I strip them, the autotools one shrinks to about a tenth of
> its size, and now the meson one actually looks bigger:
> 4722192   meson/usr/lib/vdpau/libvdpau_r600.so.1.0.0.stripped
> 2788936   autotools/usr/lib/vdpau/libvdpau_r600.so.1.0.0.stripped
> 
> I'm not sure how much you can guess from the size of the binary though,
> too much is different between the two builds.
> Whether the symbols are exposed (see above) is a better metric IMO.
> 
> > > 
> > > Any idea?
> > > 
> > > Marc


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 05/10] glsl/tests: Remove unused compare_ir.py script

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/tests/compare_ir.py | 58 +
 1 file changed, 58 deletions(-)
 delete mode 100644 src/compiler/glsl/tests/compare_ir.py

diff --git a/src/compiler/glsl/tests/compare_ir.py 
b/src/compiler/glsl/tests/compare_ir.py
deleted file mode 100644
index ed99339..000
--- a/src/compiler/glsl/tests/compare_ir.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# coding=utf-8
-#
-# Copyright © 2011 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-# Compare two files containing IR code.  Ignore formatting differences
-# and declaration order.
-
-import os
-import os.path
-import subprocess
-import sys
-import tempfile
-
-from sexps import *
-
-if len(sys.argv) != 3:
-print 'Usage: python2 ./compare_ir.py  '
-exit(1)
-
-with open(sys.argv[1]) as f:
-ir1 = sort_decls(parse_sexp(f.read()))
-with open(sys.argv[2]) as f:
-ir2 = sort_decls(parse_sexp(f.read()))
-
-if ir1 == ir2:
-exit(0)
-else:
-file1, path1 = tempfile.mkstemp(os.path.basename(sys.argv[1]))
-file2, path2 = tempfile.mkstemp(os.path.basename(sys.argv[2]))
-try:
-os.write(file1, '{0}\n'.format(sexp_to_string(ir1)))
-os.close(file1)
-os.write(file2, '{0}\n'.format(sexp_to_string(ir2)))
-os.close(file2)
-subprocess.call(['diff', '-u', path1, path2])
-finally:
-os.remove(path1)
-os.remove(path2)
-exit(1)
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 03/10] glsl/tests: Convert optimization-test.sh to pure python

2018-01-11 Thread Dylan Baker
This patch converts optimization-test.sh to python, in this process it
removes external shell dependencies including diff. It replaces the
python script that generates shell scripts with a python library that
generates test cases and runs them using subprocess.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/tests/lower_jump_cases.py  | 643 -
 src/compiler/glsl/tests/lower_jumps/.gitignore   |   3 +-
 src/compiler/glsl/tests/lower_jumps/create_test_cases.py | 673 +
 src/compiler/glsl/tests/optimization-test.sh |  87 +-
 src/compiler/glsl/tests/optimization_test.py |  95 +-
 5 files changed, 739 insertions(+), 762 deletions(-)
 create mode 100644 src/compiler/glsl/tests/lower_jump_cases.py
 delete mode 100644 src/compiler/glsl/tests/lower_jumps/.gitignore
 delete mode 100644 src/compiler/glsl/tests/lower_jumps/create_test_cases.py
 create mode 100755 src/compiler/glsl/tests/optimization_test.py

diff --git a/src/compiler/glsl/tests/lower_jump_cases.py 
b/src/compiler/glsl/tests/lower_jump_cases.py
new file mode 100644
index 000..b50ab73
--- /dev/null
+++ b/src/compiler/glsl/tests/lower_jump_cases.py
@@ -0,0 +1,643 @@
+# coding=utf-8
+#
+# Copyright © 2011, 2018 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+from sexps import *
+
+def make_test_case(f_name, ret_type, body):
+"""Create a simple optimization test case consisting of a single
+function with the given name, return type, and body.
+
+Global declarations are automatically created for any undeclared
+variables that are referenced by the function.  All undeclared
+variables are assumed to be floats.
+"""
+check_sexp(body)
+declarations = {}
+def make_declarations(sexp, already_declared = ()):
+if isinstance(sexp, list):
+if len(sexp) == 2 and sexp[0] == 'var_ref':
+if sexp[1] not in already_declared:
+declarations[sexp[1]] = [
+'declare', ['in'], 'float', sexp[1]]
+elif len(sexp) == 4 and sexp[0] == 'assign':
+assert sexp[2][0] == 'var_ref'
+if sexp[2][1] not in already_declared:
+declarations[sexp[2][1]] = [
+'declare', ['out'], 'float', sexp[2][1]]
+make_declarations(sexp[3], already_declared)
+else:
+already_declared = set(already_declared)
+for s in sexp:
+if isinstance(s, list) and len(s) >= 4 and \
+s[0] == 'declare':
+already_declared.add(s[3])
+else:
+make_declarations(s, already_declared)
+make_declarations(body)
+return declarations.values() + \
+[['function', f_name, ['signature', ret_type, ['parameters'], body]]]
+
+
+# The following functions can be used to build expressions.
+
+def const_float(value):
+"""Create an expression representing the given floating point value."""
+return ['constant', 'float', ['{0:.6f}'.format(value)]]
+
+def const_bool(value):
+"""Create an expression representing the given boolean value.
+
+If value is not a boolean, it is converted to a boolean.  So, for
+instance, const_bool(1) is equivalent to const_bool(True).
+"""
+return ['constant', 'bool', ['{0}'.format(1 if value else 0)]]
+
+def gt_zero(var_name):
+"""Create Construct the expression var_name > 0"""
+return ['expression', 'bool', '<', const_float(0), ['var_ref', var_name]]
+
+
+# The following functions can be used to build complex control flow
+# statements.  All of these functions return statement list

[Mesa-dev] [PATCH 06/10] glcpp/tests: Convert shell scripts to a python script

2018-01-11 Thread Dylan Baker
This ports glcpp-test.sh and glcpp-test-cr-lf.sh to a python script that
accepts arguments for each line ending type. This should allow for
better reporting to users.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh | 148 +--
 src/compiler/glsl/glcpp/tests/glcpp-test.sh   | 121 +
 src/compiler/glsl/glcpp/tests/glcpp_test.py   | 221 +++-
 3 files changed, 223 insertions(+), 267 deletions(-)
 create mode 100755 src/compiler/glsl/glcpp/tests/glcpp_test.py

diff --git a/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh 
b/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh
index c1e3929..5b5335f 100755
--- a/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh
+++ b/src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh
@@ -1,149 +1,3 @@
 #!/bin/sh
 
-if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
-echo ""
-echo "Warning: you're invoking the script manually and things may fail."
-echo "Attempting to determine/set srcdir and abs_builddir variables."
-echo ""
-
-# Should point to `dirname Makefile.glsl.am`
-srcdir=./../../../
-cd `dirname "$0"`
-# Should point to `dirname Makefile` equivalent to the above.
-abs_builddir=`pwd`/../../../
-fi
-
-testdir="$srcdir/glsl/glcpp/tests"
-glcpp_test="$srcdir/glsl/glcpp/tests/glcpp-test.sh"
-
-total=0
-pass=0
-
-# This supports a pipe that doesn't destroy the exit status of first command
-#
-# 
http://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another
-stdintoexitstatus() {
-read exitstatus
-return $exitstatus
-}
-
-run_test ()
-{
-cmd="$1"
-
-total=$((total+1))
-
-if [ "$VERBOSE" = "yes" ]; then
-   if $cmd; then
-   echo "PASS"
-   pass=$((pass+1))
-   else
-   echo "FAIL"
-   fi
-else
-   # This is "$cmd | tail -2" but with the exit status of "$cmd" not "tail 
-2"
-   if $cmd; echo $? >&3) | tail -2 | head -1 >&4) 3>&1) | 
stdintoexitstatus) 4>&1; then
-   echo "PASS"
-   pass=$((pass+1))
-   else
-   echo "FAIL"
-   fi
-fi
-}
-
-usage ()
-{
-   cat <&2
-   echo >&2
-   usage
-   exit 1
-   ;;
-   esac
-done
-
-# All tests depend on the .out files being present. So first do a
-# normal run of the test suite, (silently) just to create the .out
-# files as a side effect.
-rm -rf ./subtest-lf
-mkdir subtest-lf
-for file in "$testdir"/*.c; do
-base=$(basename "$file")
-cp "$file" subtest-lf
-done
-
-${glcpp_test} --testdir=subtest-lf >/dev/null 2>&1
-
-echo "= Testing with r line terminators (old Mac format) ="
-
-# Prepare test files with '\r' instead of '\n'
-rm -rf ./subtest-cr
-mkdir subtest-cr
-for file in "$testdir"/*.c; do
-base=$(basename "$file")
-tr "\n" "\r" < "$file" > subtest-cr/"$base"
-cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out 
subtest-cr/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-cr"
-
-echo "= Testing with rn line terminators (DOS format) ="
-
-# Prepare test files with '\r\n' instead of '\n'
-rm -rf ./subtest-cr-lf
-mkdir subtest-cr-lf
-for file in "$testdir"/*.c; do
-base=$(basename "$file")
-sed -e 's/$/
/' < "$file" > subtest-cr-lf/"$base"
-cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out 
subtest-cr-lf/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-cr-lf"
-
-echo "= Testing with nr (bizarre, but allowed by GLSL spec.) ="
-
-# Prepare test files with '\n\r' instead of '\n'
-rm -rf ./subtest-lf-cr
-mkdir subtest-lf-cr
-for file in "$testdir"/*.c; do
-base=$(basename "$file")
-sed -e 's/$/
/' < "$file" | tr "\n\r" "\r\n" > subtest-lf-cr/"$base"
-cp $abs_builddir/glsl/glcpp/tests/subtest-lf/"$base".out 
subtest-lf-cr/"$base".expected
-done
-
-run_test "${glcpp_test} --testdir=subtest-lf-cr"
-
-if [ $total -eq 0 ]; then
-echo "Could not find any tests."
-exit 1
-fi
-
-echo ""
-echo "$pass/$total tests returned correct results"
-echo ""
-
-if [ "$pass" = "$total" ]; then
-exit 0
-else
-exit 1
-fi
+$srcdir/glsl/glcpp/tests/glcpp_test.py $abs_builddir/glsl/glcpp/glcpp 
$srcdir/glsl/glcpp/tests --windows --oldmac --bizarro
diff --git a/src/compiler/glsl/glcpp/tes

[Mesa-dev] [PATCH 01/10] glsl/tests: reimplement warnings-test in python

2018-01-11 Thread Dylan Baker
This reimplements the test in python with a shell script wrapper that
allows autotools to continue to run the test without realizing that
anything has changed.

Using python has two advantages, first it's portable so this test can be
run on windows as well as Linux since it just requires python, no more
diff, pwd or sh. It's also no longer tied to autotools implementation
details, like the environment variables $srcdir and $abs_builddir,
though the autotools shell wrapper still uses those, which makes it
possible to run the test in meson.

Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/tests/warnings-test.sh | 57 +---
 src/compiler/glsl/tests/warnings_test.py | 74 +-
 2 files changed, 75 insertions(+), 56 deletions(-)
 create mode 100755 src/compiler/glsl/tests/warnings_test.py

diff --git a/src/compiler/glsl/tests/warnings-test.sh 
b/src/compiler/glsl/tests/warnings-test.sh
index d5dc3b5..debd6fd 100755
--- a/src/compiler/glsl/tests/warnings-test.sh
+++ b/src/compiler/glsl/tests/warnings-test.sh
@@ -1,58 +1,3 @@
 #!/bin/sh
 
-if [ -z "$srcdir" -o -z "$abs_builddir" ]; then
-echo ""
-echo "Warning: you're invoking the script manually and things may fail."
-echo "Attempting to determine/set srcdir and abs_builddir variables."
-echo ""
-
-# Variable should point to the Makefile.glsl.am
-srcdir=./../../
-cd `dirname "$0"`
-# Variable should point to glsl_compiler
-abs_builddir=`pwd`/../../
-fi
-
-# Execute several shaders, and check that the InfoLog outcome is the expected.
-
-compiler=$abs_builddir/glsl_compiler
-total=0
-pass=0
-
-if [ ! -x "$compiler" ]; then
-echo "Could not find glsl_compiler. Ensure that it is build via make check"
-exit 1
-fi
-
-tests_relative_dir="glsl/tests/warnings"
-
-echo "== Testing compilation output =="
-for test in $srcdir/$tests_relative_dir/*.vert; do
-test_output="$abs_builddir/$tests_relative_dir/`basename $test`"
-mkdir -p $abs_builddir/$tests_relative_dir/
-echo -n "Testing `basename $test`..."
-$compiler --just-log --version 150 "$test" > "$test_output.out" 2>&1
-total=$((total+1))
-if diff "$test.expected" "$test_output.out" >/dev/null 2>&1; then
-echo "PASS"
-pass=$((pass+1))
-else
-echo "FAIL"
-diff "$test.expected" "$test_output.out"
-fi
-done
-
-if [ $total -eq 0 ]; then
-echo "Could not find any tests."
-exit 1
-fi
-
-echo ""
-echo "$pass/$total tests returned correct results"
-echo ""
-
-if [ $pass = $total ]; then
-exit 0
-else
-exit 1
-fi
+$srcdir/glsl/tests/warnings_test.py --glsl-compiler 
$abs_builddir/glsl_compiler --test-directory $srcdir/glsl/tests/warnings/
diff --git a/src/compiler/glsl/tests/warnings_test.py 
b/src/compiler/glsl/tests/warnings_test.py
new file mode 100755
index 000..2e0f231
--- /dev/null
+++ b/src/compiler/glsl/tests/warnings_test.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+# encoding=utf-8
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from __future__ import print_function
+import argparse
+import os
+import subprocess
+
+
+def arg_parser():
+parser = argparse.ArgumentParser()
+parser.add_argument(
+'--glsl-compiler',
+required=True,
+help='Path to the standalone glsl compiler')
+parser.add_argument(
+'--test-directory',
+required=True,
+help='Directory containing tests to run.')
+return parser.parse_args()
+
+
+def main():
+args = arg_parser()
+files = [f for f in os.listdir(args.test_directory) if f.endswith(

[Mesa-dev] [PATCH 04/10] meson: enable optimization-test

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/tests/meson.build | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index 11fb4fb..d5e6b5f 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -81,3 +81,8 @@ test(
 ),
   ],
 )
+test(
+  'glsl optimization',
+  find_program('optimization_test.py'),
+  args : ['--test-runner', glsl_test],
+)
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] r600: Allow egd_tables.py to run with python3 too

2018-01-11 Thread Dylan Baker
This is somewhat insufficient, it might run okay with python3, but the behavior
will be different between the two. Please add `from __future__ import
print_function`, so that the behavior will be the same, not just the syntax.

Also, the StringTable, InteTable, Field, and Reg classes is also an old-style
class in python2, but a new-style in python3, they should inherit from object to
be new-style in python2. There are some real problems with old-style classes,
which is why python3 dropped them.

Everything up to this point is changes I'm requesting, below I'm going to make a
case for not hybridzing code, because hybridizing is hard to do right:

Python2 is opening the files being parsed in bytes mode, while python3 is
opening them in text (unicode) mode, things might be okay, or they might break
in subtle ways. Unfortunately at the moment that's a hard thing to fix since
mesa supports python 2.6 right now and writing 2.6/3.x compatible code correctly
is insanely hard without a helper library like six. If we're going to add python
3 support, we need to bump our python 2 version to 2.7.

This may not be a popular opinion, but since we have meson (which requires
python 3) as a build system and presumably we're moving toward a future where we
drop scons and autotools, and python 2 is approaching End of Life, I'd be 
happier
to see generators that are not run by scons (which is python2 only) be converted
to pure python 3, and only those that need to be run by scons be hybridized. I
have written a lot of code that is hybrid python 2/3 and it's not a
straightforward thing to do, there are a lot of subtle differences that can bite
you in odd ways, it's much easier to write code that is correct python 3.

Dylan

Quoting Michal Srb (2018-01-11 07:14:07)
> diff --git a/src/gallium/drivers/r600/egd_tables.py 
> b/src/gallium/drivers/r600/egd_tables.py
> index d7b78c7fb1..7bda44ce83 100644
> --- a/src/gallium/drivers/r600/egd_tables.py
> +++ b/src/gallium/drivers/r600/egd_tables.py
> @@ -1,4 +1,4 @@
> -
> +#!/usr/bin/python3
>  CopyRight = '''
>  /*
>   * Copyright 2015 Advanced Micro Devices, Inc.
> @@ -60,7 +60,7 @@ class StringTable:
>  """
>  fragments = [
>  '"%s\\0" /* %s */' % (
> -te[0].encode('string_escape'),
> +te[0].encode('unicode_escape'),
>  ', '.join(str(idx) for idx in te[2])
>  )
>  for te in self.table
> @@ -217,10 +217,10 @@ def write_tables(regs, packets):
>  strings = StringTable()
>  strings_offsets = IntTable("int")
>  
> -print '/* This file is autogenerated by egd_tables.py from evergreend.h. 
> Do not edit directly. */'
> -print
> -print CopyRight.strip()
> -print '''
> +print('/* This file is autogenerated by egd_tables.py from evergreend.h. 
> Do not edit directly. */')
> +print('')
> +print(CopyRight.strip())
> +print('''
>  #ifndef EG_TABLES_H
>  #define EG_TABLES_H
>  
> @@ -242,20 +242,20 @@ struct eg_packet3 {
>  unsigned name_offset;
>  unsigned op;
>  };
> -'''
> +''')
>  
> -print 'static const struct eg_packet3 packet3_table[] = {'
> +print('static const struct eg_packet3 packet3_table[] = {')
>  for pkt in packets:
> -print '\t{%s, %s},' % (strings.add(pkt[5:]), pkt)
> -print '};'
> -print
> +print('\t{%s, %s},' % (strings.add(pkt[5:]), pkt))
> +print('};')
> +print('')
>  
> -print 'static const struct eg_field egd_fields_table[] = {'
> +print('static const struct eg_field egd_fields_table[] = {')
>  
>  fields_idx = 0
>  for reg in regs:
>  if len(reg.fields) and reg.own_fields:
> -print '\t/* %s */' % (fields_idx)
> +print('\t/* %s */' % (fields_idx))
>  
>  reg.fields_idx = fields_idx
>  
> @@ -266,34 +266,34 @@ struct eg_packet3 {
>  while value[1] >= len(values_offsets):
>  values_offsets.append(-1)
>  values_offsets[value[1]] = 
> strings.add(strip_prefix(value[0]))
> -print '\t{%s, %s(~0u), %s, %s},' % (
> +print('\t{%s, %s(~0u), %s, %s},' % (
>  strings.add(field.name), field.s_name,
> -len(values_offsets), 
> strings_offsets.add(values_offsets))
> +len(values_offsets), 
> strings_offsets.add(values_offsets)))
>  else:
> -print '\t{%s, %s(~0u)},' % (strings.add(field.name), 
> field.s_name)
> +print('\t{%s, %s(~0u)},' % (strings.add(field.name), 
> field.s_name))
>  fields_idx += 1
>  
> -print '};'
> -print
> +print('};')
> +print('')
>  
> -print 'static const struct eg_reg egd_reg_table[] = {'
> +print('static const struct eg_reg egd_reg_table[] = {')
>  for reg in regs:
>  if len(reg.fields):
> -print '\t{%s, 

[Mesa-dev] [Test Patch] Meson: ensure vdpau has proper symbols exposed

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/gallium/targets/vdpau/meson.build | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/targets/vdpau/meson.build 
b/src/gallium/targets/vdpau/meson.build
index 67f1469fb0f..432a32a7340 100644
--- a/src/gallium/targets/vdpau/meson.build
+++ b/src/gallium/targets/vdpau/meson.build
@@ -23,6 +23,7 @@
 # configure.ac)
 
 vdpau_link_args = []
+vdpau_link_with = []
 vdpau_link_depends = []
 vdpau_drivers = []
 
@@ -35,6 +36,13 @@ if with_ld_dynamic_list
   vdpau_link_depends += files('../dri-vdpau.dyn')
 endif
 
+if with_dri
+  vdpau_link_with += libswdri
+endif
+if with_gallium_drisw_kms
+  vdpau_link_with += libswkmsdri
+endif
+
 libvdpau_gallium = shared_library(
   'vdpau_gallium',
   'target.c',
@@ -44,12 +52,14 @@ libvdpau_gallium = shared_library(
   include_directories : [
 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
   ],
+  link_whole : [libvdpau_st],
   link_with : [
-libvdpau_st, libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
-libpipe_loader_static, libws_null, libwsw,
+libgalliumvlwinsys, libgalliumvl, libgallium, libmesa_util,
+libpipe_loader_static, libws_null, libwsw, vdpau_link_with,
   ],
   dependencies : [
-dep_thread, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_libdrm,
+dep_thread, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_xcb_dri3,
+dep_xcb_present, dep_xshmfence, dep_xcb_xfixes, dep_xcb_sync, dep_libdrm,
 driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
   ],
   link_depends : vdpau_link_depends,
-- 
2.15.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 07/10] meson: enable glcpp test

2018-01-11 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 src/compiler/glsl/glcpp/meson.build | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index 17ee1a2..9f869da 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -53,4 +53,20 @@ glcpp = executable(
   build_by_default : false,
 )
 
-# TODO: figure out how to make all of these tests work.
+if with_tests
+  modes = ['unix', 'windows', 'oldmac', 'bizarro']
+  if dep_valgrind != [] and dep_valgrind.found()
+modes += ['valgrind']
+  endif
+
+  foreach m : modes
+test(
+  'glcpp test (@0@)'.format(m),
+  find_program('tests/glcpp_test.py'),
+  args : [
+glcpp, join_paths(meson.current_source_dir(), 'tests'),
+'--@0@'.format(m),
+  ],
+)
+  endforeach
+endif
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 00/10] Finish unit tests for meson build

2018-01-11 Thread Dylan Baker
This series adds the rest of the unit tests in the mesa tree, including
the gallium test binaries. The relevant tests are wired into the `ninja
test` command, and all tests pass.

A big part of this series is converting tests from shell based to a pure
python base. These are mostly straight forward conversions, with one big
exception that the lower_jump_tests is converted from a tool that
generates shell scripts to run, to a single python binary that generates
tests in memory as run, and runs them. The shell scripts have been kept
to allow passing arguments to the python scripts, they are not meant to
be run directly, just to wrap the python scripts for autotools.

Dylan Baker (10):
  glsl/tests: reimplement warnings-test in python
  meson: run glsl compiler warnings test
  glsl/tests: Convert optimization-test.sh to pure python
  meson: enable optimization-test
  glsl/tests: Remove unused compare_ir.py script
  glcpp/tests: Convert shell scripts to a python script
  meson: enable glcpp test
  meson: Remove TODO about mesa/main tests
  meson: Build gallium trivial tests
  meson: build gallium unit tests

 meson.build  |   2 +-
 src/compiler/glsl/glcpp/meson.build  |  18 +-
 src/compiler/glsl/glcpp/tests/glcpp-test-cr-lf.sh| 148 +--
 src/compiler/glsl/glcpp/tests/glcpp-test.sh  | 121 +-
 src/compiler/glsl/glcpp/tests/glcpp_test.py  | 221 +++-
 src/compiler/glsl/tests/compare_ir.py|  58 +-
 src/compiler/glsl/tests/lower_jump_cases.py  | 643 -
 src/compiler/glsl/tests/lower_jumps/.gitignore   |   3 +-
 src/compiler/glsl/tests/lower_jumps/create_test_cases.py | 673 +
 src/compiler/glsl/tests/meson.build  |  16 +-
 src/compiler/glsl/tests/optimization-test.sh |  87 +-
 src/compiler/glsl/tests/optimization_test.py |  95 +-
 src/compiler/glsl/tests/warnings-test.sh |  57 +-
 src/compiler/glsl/tests/warnings_test.py |  74 +-
 src/gallium/meson.build  |   6 +-
 src/gallium/tests/meson.build|  22 +-
 src/gallium/tests/trivial/meson.build|  29 +-
 src/gallium/tests/unit/meson.build   |  31 +-
 src/mesa/meson.build |   2 +-
 19 files changed, 1154 insertions(+), 1152 deletions(-)
 create mode 100755 src/compiler/glsl/glcpp/tests/glcpp_test.py
 delete mode 100644 src/compiler/glsl/tests/compare_ir.py
 create mode 100644 src/compiler/glsl/tests/lower_jump_cases.py
 delete mode 100644 src/compiler/glsl/tests/lower_jumps/.gitignore
 delete mode 100644 src/compiler/glsl/tests/lower_jumps/create_test_cases.py
 create mode 100755 src/compiler/glsl/tests/optimization_test.py
 create mode 100755 src/compiler/glsl/tests/warnings_test.py
 create mode 100644 src/gallium/tests/meson.build
 create mode 100644 src/gallium/tests/trivial/meson.build
 create mode 100644 src/gallium/tests/unit/meson.build

base-commit: b9f4c615f860b1fb00dec2917fcec4df84f6427e
-- 
git-series 0.9.1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa 1/2] meson: centralise the libdrm versions information

2018-01-30 Thread Dylan Baker
Quoting Eric Engestrom (2018-01-30 09:55:53)
> 
> 
> On January 30, 2018 5:34:07 PM UTC, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Eric Engestrom (2018-01-29 10:15:50)
> > > The big comment is taken from the equivalent block in configure.ac
> > > 
> > > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > > ---
> > >  meson.build | 30
> > +
> > >  src/gallium/targets/d3dadapter9/meson.build |  2 +-
> > >  src/mesa/drivers/dri/meson.build|  2 +-
> > >  3 files changed, 24 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 0a00798c2a5093ec803b..6d7a8e976ff6ad002d9a 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -41,6 +41,20 @@ pre_args = [
> > >   
> > '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
> > >  ]
> > >  
> > > +# The idea is that libdrm is distributed as one cohesive package,
> > even
> > > +# though it is composed of multiple libraries. However some drivers
> > > +# may have different version requirements than others. This list
> > > +# codifies which drivers need which version of libdrm. Any libdrm
> > > +# version dependencies in non-driver-specific code should be
> > reflected
> > > +# in the first entry.
> > > +libdrm_version   = '2.4.75'
> > > +libdrm_amdgpu_version= '2.4.89'
> > > +libdrm_etnaviv_version   = '2.4.82'
> > > +libdrm_freedreno_version = '2.4.82'
> > > +libdrm_intel_version = '2.4.75'
> > > +libdrm_nouveau_version   = '2.4.66'
> > > +libdrm_radeon_version= '2.4.71'
> > 
> > Is there any reason we can't just make these (for example):
> > libdrm_radeon_version= '>= 2.4.71'
> > 
> > Since that avoids all of the format calls?
> 
> Sure. I was trying to only have the actual numbers here, but in hindsight
> all these format() calls are a bit ugly.
> I'll send a v2 tomorrow.
> 

I understand, I just didn't see a case where we don't want the '>=' as well.
Thanks for doing this, it's been on my long list of todo's for a while now :)


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH libdrm] meson: fix libdrm_nouveau pkgconfig include directories

2018-01-30 Thread Dylan Baker
ping

Quoting Dylan Baker (2018-01-25 16:14:45)
> Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
> ---
> 
> I have tested building every mesa driver against this (with and without udev!)
> so I'm pretty sure that this is the last pkgbuild problem.
> 
> I'm sure I'll be sad in a day or two...
> 
>  nouveau/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/nouveau/meson.build b/nouveau/meson.build
> index bfecf84b..f031cd63 100644
> --- a/nouveau/meson.build
> +++ b/nouveau/meson.build
> @@ -45,7 +45,7 @@ install_headers(
>  pkg.generate(
>name : 'libdrm_nouveau',
>libraries : libdrm_nouveau,
> -  subdirs : ['.', 'nouveau'],
> +  subdirs : ['.', 'libdrm', 'libdrm/nouveau'],
>version : meson.project_version(),
>requires_private : 'libdrm',
>description : 'Userspace interface to nouveau kernel DRM services',
> -- 
> 2.16.0
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] meson: generate translations for driconf

2018-01-30 Thread Dylan Baker
Quoting Marc Dietrich (2018-01-27 06:36:51)
> Hi Dylan,
> 
> Am Donnerstag, 25. Januar 2018, 20:32:23 CET schrieb Dylan Baker:
> > Currently meson implements the same logic as SCons for translations,
> > namely it doesn't do them. This patch changes meson to use logic more
> > like autotools, and generate translations. To do this we have to go
> > behind meson's back a bit, and wrap the whole thing up in a single
> > python script.
> > 
> > Meson has a module for gettext translations, but it assumes that one
> > will have a pot file, and then .mo translations will be generated and
> > checked into the source repo (or generated by hand using custom ninja
> > targets before building), mesa assumes that the targets will be
> > regenerated on each invocation of make or ninja. I think this can be
> > fixed upstream, but in the mean time this adds support for using
> > translations.
> 
> I have some patch sitting in my local tree which also addresses this problem. 
> It is a bit shorter and doesn't require an external script. I initially tried 
> to solve this by adding some custom targets mostly in order to learn some 
> meson. Unfortunately, I didn't came far. I also tried the i18n module, but as 
> you said, there are still some features missing.
> 
> Nevertheless, here is my solution using run_commands instead of external 
> script. The advantage maybe better maintainability:
> 
> diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
> index 97693fac8c..91f2b025f6 100644
> --- a/src/util/xmlpool/meson.build
> +++ b/src/util/xmlpool/meson.build
> @@ -18,11 +18,36 @@
>  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
>  # SOFTWARE.
>  
> +langs = ['ca', 'es', 'de', 'nl', 'sv', 'fr']
> +deps = []
> +pot = 'xmlpool.pot'
> +out = meson.current_build_dir()
> +in = meson.current_source_dir()
> +
> +xmlpool_pot = custom_target(
> +  pot,
> +  build_by_default : true,
> +  input : 't_options.h',
> +  output : pot,
> +  command : ['xgettext', '-LC', '--from-code=utf-8', '-o', '@OUTPUT@', 
> '@INPUT@'],
> +)
> +
> +foreach l : langs
> +  po = l+'.po'
> +  mo = '@0@/LC_MESSAGES/options.mo'.format(l)
> +  message('Merge new strings @0@ into @1@'.format(po, pot))
> +  run_command('msgmerge', '-o', join_paths(out, po), join_paths(in, po), pot)
> +  message('Updating (@0@) @1@ from @2@.'.format(l, mo, po))
> +  run_command('mkdir', '-p', join_paths(out, l, 'LC_MESSAGES'))
> +  run_command('msgfmt', '-o', join_paths(out, mo), po)
> +  deps += po
> +endforeach
> +

Hi Marc,

I'm not a huge fan of this, it adds three unix specific dependencies, and every
time ninja is run we'll call mkdir and msgfrmt multiple times. I really like the
idea of fixing the i18n module to return custom targets instead of run targets,
but that's going take some work and wont come until a newer version of meson.
Maybe the thing to do is to just rely on distros manually updating the mo files.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa 1/2] meson: centralise the libdrm versions information

2018-01-30 Thread Dylan Baker
Quoting Eric Engestrom (2018-01-29 10:15:50)
> The big comment is taken from the equivalent block in configure.ac
> 
> Signed-off-by: Eric Engestrom 
> ---
>  meson.build | 30 
> +
>  src/gallium/targets/d3dadapter9/meson.build |  2 +-
>  src/mesa/drivers/dri/meson.build|  2 +-
>  3 files changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 0a00798c2a5093ec803b..6d7a8e976ff6ad002d9a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -41,6 +41,20 @@ pre_args = [
>
> '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
>  ]
>  
> +# The idea is that libdrm is distributed as one cohesive package, even
> +# though it is composed of multiple libraries. However some drivers
> +# may have different version requirements than others. This list
> +# codifies which drivers need which version of libdrm. Any libdrm
> +# version dependencies in non-driver-specific code should be reflected
> +# in the first entry.
> +libdrm_version   = '2.4.75'
> +libdrm_amdgpu_version= '2.4.89'
> +libdrm_etnaviv_version   = '2.4.82'
> +libdrm_freedreno_version = '2.4.82'
> +libdrm_intel_version = '2.4.75'
> +libdrm_nouveau_version   = '2.4.66'
> +libdrm_radeon_version= '2.4.71'

Is there any reason we can't just make these (for example):
libdrm_radeon_version= '>= 2.4.71'

Since that avoids all of the format calls?

[snip]

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/6] meson: build src/glx/apple

2018-01-30 Thread Dylan Baker
Quoting Jon Turney (2018-01-28 06:24:10)
> ---
>  src/glx/apple/meson.build | 62 
> +++
>  src/glx/meson.build   |  4 +++
>  2 files changed, 66 insertions(+)
>  create mode 100644 src/glx/apple/meson.build
> 
> diff --git a/src/glx/apple/meson.build b/src/glx/apple/meson.build
> new file mode 100644
> index 000..f69803713e0
> --- /dev/null
> +++ b/src/glx/apple/meson.build
> @@ -0,0 +1,62 @@
> +# Copyright © 2017 Jon Turney
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +# library for native GL on macos
> +files_libappleglx = files(
> +  'apple_cgl.c',
> +  'apple_cgl.h',
> +  'appledri.c',
> +  'appledri.h',
> +  'appledristr.h',
> +  'apple_glapi.c',
> +  'apple_glx.c',
> +  'apple_glx_context.c',
> +  'apple_glx_context.h',
> +  'apple_glx_drawable.c',
> +  'apple_glx_drawable.h',
> +  'apple_glx.h',
> +  'apple_glx_log.c',
> +  'apple_glx_log.h',
> +  'apple_glx_pbuffer.c',
> +  'apple_glx_pixmap.c',
> +  'apple_glx_surface.c',
> +  'apple_visual.c',
> +  'apple_visual.h',
> +  'apple_xgl_api.h',
> +  'apple_xgl_api_read.c',
> +  'apple_xgl_api_stereo.c',
> +  'apple_xgl_api_viewport.c',
> +  'glx_empty.c',
> +)
> +
> +dep_xplugin = []
> +if with_dri_platform == 'apple'
> +  dep_xplugin = meson.get_compiler('c').find_library('Xplugin')
> +endif
> +# -framework ApplicationServices -framework CoreFoundation

Is this not available as a framework? (I don't know, I'm not a mac expert by any
stretch).

> +
> +libappleglx = static_library(
> +  'glxapple',
> +  [files_libappleglx, glapitable_h],
> +  include_directories: [inc_mesa, inc_glx, inc_src, inc_include, inc_glapi],
> +  dependencies: [dep_xext, dep_xplugin],
> +  c_args: [c_vis_args],
> +  build_by_default: false,
> +)
> diff --git a/src/glx/meson.build b/src/glx/meson.build
> index 04cd647ee49..ecedfd60f0e 100644
> --- a/src/glx/meson.build
> +++ b/src/glx/meson.build
> @@ -18,6 +18,9 @@
>  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
>  # SOFTWARE.
>  
> +inc_glx = include_directories('.')
> +
> +subdir('apple')
>  subdir('windows')
>  
>  files_libglx = files(
> @@ -98,6 +101,7 @@ endif
>  
>  if with_dri_platform == 'apple'
>files_libglx += files('applegl_glx.c')
> +  extra_libs_libglx += libappleglx
>  elif with_dri_platform == 'windows'
>files_libglx += files('driwindows_glx.c')
>extra_libs_libglx += [
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/6] meson: osx doesn't have librt, so don't require it

2018-01-30 Thread Dylan Baker
Quoting Jon Turney (2018-01-28 06:24:11)
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 7e194a9f10d..8fdbaa8b8d8 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -935,7 +935,7 @@ elif with_dri_i965 and get_option('shader-cache')
>  endif
>  
>  # Determine whether or not the rt library is needed for time functions
> -if cc.has_function('clock_gettime')
> +if cc.has_function('clock_gettime') or (host_machine.system() == 'darwin')

We don't use parens around conditionals except to group them logically, can we
drop the extra parens here?

>dep_clock = []
>  else
>dep_clock = cc.find_library('rt')
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/6] meson: build src/glx/apple

2018-01-30 Thread Dylan Baker
Quoting Jon Turney (2018-01-28 06:24:07)
> This also requires my "fix osx" series to actually build
> 
> Dylan Baker (2):
>   meson: find python2 on macOS
>   meson: set apple glx defines
> 
> Jon Turney (4):
>   meson: build src/glx/apple
>   meson: osx doesn't have librt, so don't require it
>   meson: osx ld doesn't support --build-id
>   travis: add macOS meson build
> 
>  .travis.yml  |  5 
>  meson.build  | 16 +--
>  src/glx/apple/meson.build| 62 
> 
>  src/glx/meson.build  |  4 +++
>  src/mesa/drivers/dri/meson.build |  2 +-
>  5 files changed, 86 insertions(+), 3 deletions(-)
>  create mode 100644 src/glx/apple/meson.build
> 
> -- 
> 2.15.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Thanks for working on this, you beat me to getting this done. I have a couple of
little nits, but with that fixed, for the series:

Reviewed-by: Dylan Baker <dy...@pnwbakers.com>


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 4/6] meson: osx doesn't have librt, so don't require it

2018-01-30 Thread Dylan Baker
Quoting Emil Velikov (2018-01-30 10:56:42)
> Hi Jon,
> 
> On 28 January 2018 at 14:24, Jon Turney  wrote:
> > ---
> >  meson.build | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 7e194a9f10d..8fdbaa8b8d8 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -935,7 +935,7 @@ elif with_dri_i965 and get_option('shader-cache')
> >  endif
> >
> >  # Determine whether or not the rt library is needed for time functions
> > -if cc.has_function('clock_gettime')
> > +if cc.has_function('clock_gettime') or (host_machine.system() == 'darwin')
> 
> Absolutely no objections against the patch - just a small question.
> If the meson/autotools check fails, does this mean that the resulting
> binaries are having unresolved reference wrt said symbol?
> 
> Thanks
> Emil

Not for meson, it builds -Wl,--no-undefined (or it's MSVC equivalent) by
default, so it shouldn't be possible to get unresolved symbols in a binary or
shared library.

I'm pretty sure that the autotools build sets --no-undefined too, right?

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa 1/2] meson: centralise the libdrm versions information

2018-01-30 Thread Dylan Baker
Quoting Emil Velikov (2018-01-30 10:43:06)
> On 29 January 2018 at 18:57, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Eric Engestrom (2018-01-29 10:15:50)
> >> The big comment is taken from the equivalent block in configure.ac
> >>
> >> Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> >> ---
> >>  meson.build | 30 
> >> +
> >>  src/gallium/targets/d3dadapter9/meson.build |  2 +-
> >>  src/mesa/drivers/dri/meson.build|  2 +-
> >>  3 files changed, 24 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/meson.build b/meson.build
> >> index 0a00798c2a5093ec803b..6d7a8e976ff6ad002d9a 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -41,6 +41,20 @@ pre_args = [
> >>
> >> '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
> >>  ]
> >>
> >> +# The idea is that libdrm is distributed as one cohesive package, even
> >> +# though it is composed of multiple libraries. However some drivers
> >> +# may have different version requirements than others. This list
> >> +# codifies which drivers need which version of libdrm. Any libdrm
> >> +# version dependencies in non-driver-specific code should be reflected
> >> +# in the first entry.
> >> +libdrm_version   = '2.4.75'
> >> +libdrm_amdgpu_version= '2.4.89'
> >> +libdrm_etnaviv_version   = '2.4.82'
> >> +libdrm_freedreno_version = '2.4.82'
> >> +libdrm_intel_version = '2.4.75'
> >> +libdrm_nouveau_version   = '2.4.66'
> >> +libdrm_radeon_version= '2.4.71'
> >
> > Is there any reason we can't just make these (for example):
> > libdrm_radeon_version= '>= 2.4.71'
> >
> > Since that avoids all of the format calls?
> >
> Is there particular reason why meson doesn't allow plain
> concatenation, and one must go through the format dance?
> Off the top of my head, I think that most higher level programming
> languages (including python) have it, making for clearer and more
> obvious code.
> 
> That aside:
> A huge +1 from me on the idea, although the libdrm_foo checks should
> become libdrm && libdrm_foo.
> See commit 2b4eaabff01a3a8ea0c4742ac481492092c1ab4f.
> 
> Thanks
> Emil

I'm confused by that commit. pkg-config is supposed to handle this, libdrm_intel
(for example) has `Requires : libdrm` in it, so when you generate libs you get
`-ldrm_intel -ldrm`. Why do we need to check libdrm as well? If it's just that
we need to make sure that the version matches we should fix the pkg-config files
in libdrm to set `Requires : libdrm >= version`. Or am I missing something?

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] radv: Don't expose VK_KHX_multiview on android.

2018-02-02 Thread Dylan Baker
Quoting Bas Nieuwenhuizen (2018-02-02 10:14:04)
> On Fri, Feb 2, 2018 at 6:59 PM, Emil Velikov  wrote:
> > Hi Bas,
> >
> > On 31 January 2018 at 11:31, Bas Nieuwenhuizen  wrote:
> >> deqp does not allow any KHX extensions, and since deqp is included
> >> in android-cts, android does not allow any khx extensions.
> >>
> >> So disable VK_KHX_multiview on android.
> >> ---
> >>  src/amd/vulkan/radv_extensions.py | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/amd/vulkan/radv_extensions.py 
> >> b/src/amd/vulkan/radv_extensions.py
> >> index ab34c01cb6..e6c6e63627 100644
> >> --- a/src/amd/vulkan/radv_extensions.py
> >> +++ b/src/amd/vulkan/radv_extensions.py
> >> @@ -81,7 +81,7 @@ EXTENSIONS = [
> >>  Extension('VK_KHR_wayland_surface',   6, 
> >> 'VK_USE_PLATFORM_WAYLAND_KHR'),
> >>  Extension('VK_KHR_xcb_surface',   6, 
> >> 'VK_USE_PLATFORM_XCB_KHR'),
> >>  Extension('VK_KHR_xlib_surface',  6, 
> >> 'VK_USE_PLATFORM_XLIB_KHR'),
> >> -Extension('VK_KHX_multiview', 1, True),
> >> +Extension('VK_KHX_multiview', 1, '!ANDROID'),
> >
> > While picking the patch for stable the following questions came to
> > mind. Hope you can you shed some light.
> >
> > Is this restriction effectively a Vulkan loader limitation or ?
> > Should we use the same for the Intel Vulkan driver as well?
> 
> The testsuite Android conformance testing (deqp as part of Android
> CTS) is slightly stricter than the vulkan-CTS. So enabling it results
> in a perfectly working extension, but you just don't have a conformant
> Android device.
> 
> I think Chad expected the KHX extensions to be disabled in all
> releases, as far as I can tell they have not for the past few
> releases, so I'm not entirely sure what is supposed to happen here.
> I'd expect this would be needed by Intel too, but given that the Intel
> driver has been tested for Android for a while and this is not in the
> Intel driver yet, I'm probably overlooking their solution.
> 
> - Bas
> 
> 
> >
> > Thanks
> > Emil
> > ___

Our plan is (and has been) to disable VK_KHX extensions in release branches, but
leave them on in development snapshots, regardless of whether we're running on
Android or !Android. If KHX extensions are on in the release branch that's a bug
and we need to fix it before shipping a release.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] amd: remove support for LLVM 3.9

2018-02-02 Thread Dylan Baker
FYI: I sent out a patch a few minutes ago to set the minimum version more like
autotools does, but I'm fine with this landing first.

Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Marek Olšák (2018-02-02 11:07:57)
> Adding this:
> 
> diff --git a/meson.build b/meson.build
> index 80ea60f..22eb702 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -991,12 +991,12 @@ endif
>  _llvm = get_option('llvm')
>  if _llvm == 'auto'
>    dep_llvm = dependency(
> -    'llvm', version : '>= 3.9.0', modules : llvm_modules,
> +    'llvm', version : '>= 4.0.0', modules : llvm_modules,
>  required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or
> with_gallium_opencl,
>    )
>    with_llvm = dep_llvm.found()
>  elif _llvm == 'true'
> -  dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : llvm_modules)
> +  dep_llvm = dependency('llvm', version : '>= 4.0.0', modules : llvm_modules)
>    with_llvm = true
>  else
>    dep_llvm = []
> @@ -1019,7 +1019,7 @@ if with_llvm
>  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
>    ]
>  elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
> -  error('The following drivers requires LLVM: Radv, RadeonSI, SWR. One of
> these is enabled, but LLVM is disabled.')
> +  error('The following drivers require LLVM: Radv, RadeonSI, SWR. One of 
> these
> is enabled, but LLVM is disabled.')
>  endif
>  
>  dep_glvnd = []
> 
> Marek
> 
> On Fri, Feb 2, 2018 at 8:02 PM, Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
> wrote:
> 
> Also change meson.build?
> 
> On Fri, Feb 2, 2018 at 7:34 PM, Marek Olšák <mar...@gmail.com> wrote:
> > From: Marek Olšák <marek.ol...@amd.com>
> >
> > Only these are supported:
> > - LLVM 4.0
> > - LLVM 5.0
> > - LLVM 6.0
> > - master (7.0)
> > ---
> >  configure.ac                                       |   4 +-
> >  src/amd/common/ac_llvm_build.c                     | 187
> ++---
> >  src/amd/common/ac_llvm_helper.cpp                  |  10 --
> >  src/amd/common/ac_llvm_util.c                      |  39 +
> >  src/amd/common/ac_llvm_util.h                      |  14 +-
> >  src/amd/common/ac_nir_to_llvm.c                    |  32 +---
> >  src/amd/vulkan/radv_device.c                       |   4 -
> >  src/gallium/drivers/radeonsi/si_compute.c          |   3 +-
> >  src/gallium/drivers/radeonsi/si_get.c              |  13 +-
> >  src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c  |   3 +-
> >  .../drivers/radeonsi/si_shader_tgsi_setup.c        |   2 -
> >  11 files changed, 72 insertions(+), 239 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index a54b7cb..8ed606c 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -96,22 +96,22 @@ XDAMAGE_REQUIRED=1.1
> >  XSHMFENCE_REQUIRED=1.1
> >  XVMC_REQUIRED=1.0.6
> >  PYTHON_MAKO_REQUIRED=0.8.0
> >  LIBSENSORS_REQUIRED=4.0.0
> >  ZLIB_REQUIRED=1.2.3
> >
> >  dnl LLVM versions
> >  LLVM_REQUIRED_GALLIUM=3.3.0
> >  LLVM_REQUIRED_OPENCL=3.9.0
> >  LLVM_REQUIRED_R600=3.9.0
> > -LLVM_REQUIRED_RADEONSI=3.9.0
> > -LLVM_REQUIRED_RADV=3.9.0
> > +LLVM_REQUIRED_RADEONSI=4.0.0
> > +LLVM_REQUIRED_RADV=4.0.0
> >  LLVM_REQUIRED_SWR=3.9.0
> >
> >  dnl Check for progs
> >  AC_PROG_CPP
> >  AC_PROG_CC
> >  AC_PROG_CXX
> >  dnl add this here, so the help for this environmnet variable is close 
> to
> >  dnl other CC/CXX flags related help
> >  AC_ARG_VAR([CXX11_CXXFLAGS], [Compiler flag to enable C++11 support
> (only needed if not
> >                                enabled by default and different  from
> -std=c++11)])
> > diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_
> build.c
> > index 6ede60a..3efcaa1 100644
> > --- a/src/amd/common/ac_llvm_build.c
> > +++ b/src/amd/common/ac_llvm_build.c
> > @@ -213,22 +213,21 @@ ac_to_float(struct ac_llvm_context *ctx,
> LLVMValueRef v)
> >         return LLVMBuildBitCast(ctx->builder, v, ac_to_float_type(ctx,
> type), "");
> >  }
> >
> >
> >  LLVMValueRef
> >  ac_build_intrinsic(struct ac_llvm_context *ctx, const char *name,
> >                    LLVMTypeRef return_type, LLVMValueRef *params,
> >                    unsigned param_co

[Mesa-dev] [PATCH] meson: Check for actual LLVM required versions

2018-02-02 Thread Dylan Baker
Currently we always check for 3.9.0, which is pretty safe since
everything except radv work with >= 3.9 and 3.9 is pretty old at this
point. However, radv actually requires 4.0, and there is a patch for
radeonsi to do the same.

Fixes: 673dda833076 ("meson: build "radv" vulkan driver for radeon hardware")
Signed-off-by: Dylan Baker <dylan.c.ba...@intel.com>
---
 meson.build | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 80ea60ffa7d..0a030b92d0a 100644
--- a/meson.build
+++ b/meson.build
@@ -988,15 +988,23 @@ if with_gallium_opencl
   # TODO: optional modules
 endif
 
+if with_amd_vk
+  _llvm_version = '>= 4.0.0'
+elif with_gallium_opencl or with_gallium_swr or with_gallium_r600 or 
with_gallium_radeonsi
+  _llvm_version = '>= 3.9.0'
+else
+  _llvm_version = '>= 3.3.0'
+endif
+
 _llvm = get_option('llvm')
 if _llvm == 'auto'
   dep_llvm = dependency(
-'llvm', version : '>= 3.9.0', modules : llvm_modules,
+'llvm', version : _llvm_version, modules : llvm_modules,
 required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
with_gallium_opencl,
   )
   with_llvm = dep_llvm.found()
 elif _llvm == 'true'
-  dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : llvm_modules)
+  dep_llvm = dependency('llvm', version : _llvm_version, modules : 
llvm_modules)
   with_llvm = true
 else
   dep_llvm = []
-- 
2.16.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] amd: remove support for LLVM 3.9

2018-02-02 Thread Dylan Baker
I went ahead and pushed my patch, the only things you should need to do for the
meson side now is move with_gallium_radeonsi, and remove the stray `s` in the
error message.

Dylan

Quoting Bas Nieuwenhuizen (2018-02-02 11:56:26)
> I'd prefer if Dylan's patch goes first, as we are bumping swr too otherwise.
> 
> Though either way:
> 
> Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
> 
> On Fri, Feb 2, 2018 at 8:15 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > FYI: I sent out a patch a few minutes ago to set the minimum version more 
> > like
> > autotools does, but I'm fine with this landing first.
> >
> > Reviewed-by: Dylan Baker <dy...@pnwbakers.com>
> >
> > Quoting Marek Olšák (2018-02-02 11:07:57)
> >> Adding this:
> >>
> >> diff --git a/meson.build b/meson.build
> >> index 80ea60f..22eb702 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -991,12 +991,12 @@ endif
> >>  _llvm = get_option('llvm')
> >>  if _llvm == 'auto'
> >>dep_llvm = dependency(
> >> -'llvm', version : '>= 3.9.0', modules : llvm_modules,
> >> +'llvm', version : '>= 4.0.0', modules : llvm_modules,
> >>  required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or
> >> with_gallium_opencl,
> >>)
> >>with_llvm = dep_llvm.found()
> >>  elif _llvm == 'true'
> >> -  dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : 
> >> llvm_modules)
> >> +  dep_llvm = dependency('llvm', version : '>= 4.0.0', modules : 
> >> llvm_modules)
> >>with_llvm = true
> >>  else
> >>dep_llvm = []
> >> @@ -1019,7 +1019,7 @@ if with_llvm
> >>  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
> >>]
> >>  elif with_amd_vk or with_gallium_radeonsi or with_gallium_swr
> >> -  error('The following drivers requires LLVM: Radv, RadeonSI, SWR. One of
> >> these is enabled, but LLVM is disabled.')
> >> +  error('The following drivers require LLVM: Radv, RadeonSI, SWR. One of 
> >> these
> >> is enabled, but LLVM is disabled.')
> >>  endif
> >>
> >>  dep_glvnd = []
> >>
> >> Marek
> >>
> >> On Fri, Feb 2, 2018 at 8:02 PM, Bas Nieuwenhuizen 
> >> <b...@basnieuwenhuizen.nl>
> >> wrote:
> >>
> >> Also change meson.build?
> >>
> >> On Fri, Feb 2, 2018 at 7:34 PM, Marek Olšák <mar...@gmail.com> wrote:
> >> > From: Marek Olšák <marek.ol...@amd.com>
> >> >
> >> > Only these are supported:
> >> > - LLVM 4.0
> >> > - LLVM 5.0
> >> > - LLVM 6.0
> >> > - master (7.0)
> >> > ---
> >> >  configure.ac   |   4 +-
> >> >  src/amd/common/ac_llvm_build.c | 187
> >> ++---
> >> >  src/amd/common/ac_llvm_helper.cpp  |  10 --
> >> >  src/amd/common/ac_llvm_util.c  |  39 +
> >> >  src/amd/common/ac_llvm_util.h  |  14 +-
> >> >  src/amd/common/ac_nir_to_llvm.c|  32 +---
> >> >  src/amd/vulkan/radv_device.c   |   4 -
> >> >  src/gallium/drivers/radeonsi/si_compute.c  |   3 +-
> >> >  src/gallium/drivers/radeonsi/si_get.c  |  13 +-
> >> >  src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c  |   3 +-
> >> >  .../drivers/radeonsi/si_shader_tgsi_setup.c|   2 -
> >> >  11 files changed, 72 insertions(+), 239 deletions(-)
> >> >
> >> > diff --git a/configure.ac b/configure.ac
> >> > index a54b7cb..8ed606c 100644
> >> > --- a/configure.ac
> >> > +++ b/configure.ac
> >> > @@ -96,22 +96,22 @@ XDAMAGE_REQUIRED=1.1
> >> >  XSHMFENCE_REQUIRED=1.1
> >> >  XVMC_REQUIRED=1.0.6
> >> >  PYTHON_MAKO_REQUIRED=0.8.0
> >> >  LIBSENSORS_REQUIRED=4.0.0
> >> >  ZLIB_REQUIRED=1.2.3
> >> >
> >> >  dnl LLVM versions
> >> >  LLVM_REQUIRED_GALLIUM=3.3.0
> >> >  LLVM_REQUIRED_OPENCL=3.9.0
> >> >  LLVM_REQUIRED_R600=3.9.0
> >> > -LLVM_REQUIRED_RADEONSI=3.9.0
> >> > -LLVM_REQUIRED_RADV=3.9.0
> >&

<    8   9   10   11   12   13   14   15   16   17   >