Re: [Mesa-dev] [PATCH mesa] intel: various python cleanups

2018-08-16 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-16 07:43:23)
> Signed-off-by: Eric Engestrom 
> ---
> Didn't feel like sending 15 patches for these, but I can split out some
> of it if needed.
> ---
>  src/intel/genxml/gen_bits_header.py |  1 -
>  src/intel/genxml/gen_pack_header.py | 29 ++---
>  src/intel/genxml/gen_zipped_file.py |  1 -
>  src/intel/isl/gen_format_layout.py  |  9 -
>  src/intel/vulkan/anv_extensions.py  |  7 +++
>  5 files changed, 21 insertions(+), 26 deletions(-)
> 
> diff --git a/src/intel/genxml/gen_bits_header.py 
> b/src/intel/genxml/gen_bits_header.py
> index dcd6ccb7d9ec39109cb0..ded2d2dcfcfd74dbec1d 100644
> --- a/src/intel/genxml/gen_bits_header.py
> +++ b/src/intel/genxml/gen_bits_header.py
> @@ -25,7 +25,6 @@
>  
>  import argparse
>  import os
> -import sys
>  import xml.parsers.expat
>  
>  from mako.template import Template
> diff --git a/src/intel/genxml/gen_pack_header.py 
> b/src/intel/genxml/gen_pack_header.py
> index c3d712c7a86e1580ec0f..0bf838de8c60cd8744a6 100644
> --- a/src/intel/genxml/gen_pack_header.py
> +++ b/src/intel/genxml/gen_pack_header.py
> @@ -219,9 +219,9 @@ def safe_name(name):
>  def num_from_str(num_str):
>  if num_str.lower().startswith('0x'):
>  return int(num_str, base=16)
> -else:
> -assert not num_str.startswith('0'), 'octals numbers not allowed'
> -return int(num_str)
> +
> +assert not num_str.startswith('0'), 'octals numbers not allowed'
> +return int(num_str)
>  
>  class Field(object):
>  ufixed_pattern = re.compile(r"u(\d+)\.(\d+)")
> @@ -306,7 +306,7 @@ def emit_template_struct(self, dim):
>  print("   %-36s %s%s;" % (type, self.name, dim))
>  
>  prefix = ""
> -if len(self.values) > 0 and self.default == None:
> +if self.values and self.default == None:

Since you changed the other instances to be correct, 'self.default is None'.

With that change,
Reviewed-by: Dylan Baker 


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/5] configure: Enforce python 2.7.x

2018-08-16 Thread Dylan Baker
Quoting Emil Velikov (2018-08-16 09:19:06)
> On 16 August 2018 at 14:27, Emil Velikov  wrote:
> > On 15 August 2018 at 17:18, Dylan Baker  wrote:
> >> We don't want to support older versions of python 2 anymore, and we
> >> don't support python 3.x in autotools currently.
> >> ---
> >>  configure.ac | 7 +++
> >>  1 file changed, 7 insertions(+)
> >>
> >> diff --git a/configure.ac b/configure.ac
> >> index c2155a541b0..78672734d06 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -162,6 +162,13 @@ if test -z "$PYTHON2"; then
> >>  AC_MSG_ERROR([Python not found - unable to generate sources])
> >>  fi
> >>  else
> >> +PYTHON_VERSION=`$PYTHON2 --version |& awk '{print $2}'`  dnl Yes, 
> >> python2 prints it's version to stderr
> >> +PYTHON_MAJOR=`echo $PYTHON_VERSION | cut -d . -f 1`
> >> +PYTHON_MINOR=`echo $PYTHON_VERSION | cut -d . -f 2`
> >> +if test $PYTHON_MAJOR -ne 2 -o $PYTHON_MINOR -ne 7; then
> >> +AC_MSG_ERROR([Python version 2.7.x not found - unable to generate 
> >> sources])
> >> +fi
> >> +
> > A slightly better alternative is to use AM_PATH_PYTHON as seen here [1]
> > Since there's no reason to keep autoconf python2 only, I've prepped a
> > small series [2].

I like your version much better (I secretly was hoping that you'd propose
something less gross than my lame attempt), so I'll drop the autotools patches
and just keep the scons and meson ones.

> >
> > Once everything is green I'll send it out. Until then, feel free to
> > drop this or reuse as much/little from my patch.
> >
> Jfyi, some of the tests not been ported to python2+3, as mentioned here [A].
> Would be great to check why they haven't flagged up in the meson CI.
> 

Because the python file itself is python 2/3 safe (I wrote or re-wrote that when
I did the initial meson port). The shell script invokes $PYTHON2 but that only
exists to make it easier for autotools, meson invokes the underlying python by
calling python3 foo.py.

Dylan


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


[Mesa-dev] [PATCH v3 02/48] add a git ignore for subprojects

2018-08-06 Thread Dylan Baker
---
 subprojects/.gitignore | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 subprojects/.gitignore

diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 000..68a882edba6
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1,3 @@
+*
+!*.wrap
+!.gitignore
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH v3 02/13] nvc0/ir: return 0 in imageLoad on incomplete textures

2018-08-06 Thread Dylan Baker
Quoting Karol Herbst (2018-07-15 11:15:42)
> We already guarded all OP_SULDP against out of bound accesses, but those
> ended up just reusing whatever value was stored in the dest registers.
> 
> fixes CTS test shader_image_load_store.incomplete_textures
> 
> v2: fix for loads not ending up with predicates (bindless_texture)
> v3: fix replacing the def
> 
> Signed-off-by: Karol Herbst 
> ---
>  .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 33 +--
>  .../nouveau/codegen/nv50_ir_lowering_nvc0.h   |  1 +
>  2 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> index 1410cf26c87..743f5bd552b 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -2151,13 +2151,36 @@ NVC0LoweringPass::convertSurfaceFormat(TexInstruction 
> *su)
> }
>  }
>  
> +void
> +NVC0LoweringPass::insertOOBSurfaceOpResult(TexInstruction *su)
> +{
> +   if (!su->getPredicate())
> +  return;
> +
> +   bld.setPosition(su, true);
> +
> +   for (unsigned i = 0; su->defExists(i); ++i) {
> +  ValueDef  = su->def(i);
> +
> +  Instruction *mov = bld.mkMov(bld.getSSA(), bld.loadImm(NULL, 0));
> +  assert(su->cc == CC_NOT_P);
> +  mov->setPredicate(CC_P, su->getPredicate());
> +  Instruction *uni = bld.mkOp2(OP_UNION, TYPE_U32, bld.getSSA(), NULL, 
> mov->getDef(0));
> +
> +  def.replace(uni->getDef(0), false);
> +  uni->setSrc(0, def.get());
> +   }
> +}
> +
>  void
>  NVC0LoweringPass::handleSurfaceOpNVE4(TexInstruction *su)
>  {
> processSurfaceCoordsNVE4(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>assert(su->getPredicate());
> @@ -2267,8 +2290,10 @@ NVC0LoweringPass::handleSurfaceOpNVC0(TexInstruction 
> *su)
>  
> processSurfaceCoordsNVC0(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDB || su->op == OP_SUREDP) {
>const int dim = su->tex.target.getDim();
> @@ -2370,8 +2395,10 @@ NVC0LoweringPass::handleSurfaceOpGM107(TexInstruction 
> *su)
>  {
> processSurfaceCoordsGM107(su);
>  
> -   if (su->op == OP_SULDP)
> +   if (su->op == OP_SULDP) {
>convertSurfaceFormat(su);
> +  insertOOBSurfaceOpResult(su);
> +   }
>  
> if (su->op == OP_SUREDP) {
>Value *def = su->getDef(0);
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> index 8724c09afd9..5dbb3e4f009 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
> @@ -172,6 +172,7 @@ private:
> void processSurfaceCoordsNVE4(TexInstruction *);
> void processSurfaceCoordsNVC0(TexInstruction *);
> void convertSurfaceFormat(TexInstruction *);
> +   void insertOOBSurfaceOpResult(TexInstruction *);
> Value *calculateSampleOffset(Value *sampleID);
>  
>  protected:
> -- 
> 2.17.1
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Hi Karol,

I had to fix a couple of minor merge conflicts in the 18.1 branch, I've compile
tested, but could you have a look at the staging/18.1 branch and make sure
everything looks good?

Thanks,
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 1/3] meson: use dependency()+find_program() for wayland-scanner

2018-08-06 Thread Dylan Baker
Quoting Emil Velikov (2018-06-28 07:35:44)
> From: Emil Velikov 
> 
> Helps when the native wayland-scanner is located outside of PATH.
> Inspired by the xserver code ;-)
> 
> Cc: Dylan Baker 
> Cc: Eric Engestrom 
> Signed-off-by: Emil Velikov 
> ---
>  meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index b2722c71e5b..79bac89e7d9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1269,7 +1269,8 @@ endif
>  # TODO: symbol mangling
>  
>  if with_platform_wayland
> -  prog_wl_scanner = find_program('wayland-scanner')
> +  dep_wl_scanner = dependency('wayland-scanner', native: true)
> +  prog_wl_scanner = 
> find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
>dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.8')
>dep_wayland_client = dependency('wayland-client', version : '>=1.11')
>dep_wayland_server = dependency('wayland-server', version : '>=1.11')
> -- 
> 2.18.0
> 

Hey Emil, it doesn't look like this ever landed, is there a reason for that I'm
not seeing in the mailing list discussion?

Dylan


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


[Mesa-dev] [PATCH] main/tests: Add AMD_framebuffer_multisample_advanced

2018-08-06 Thread Dylan Baker
Add dispatch_sanity tests

Fixes: 3d6900d76efaef1ff6e84b7b8785bbe3d8f5b29b
   ("glapi: define AMD_framebuffer_multisample_advanced and add its 
functions")
Cc: Marek Olšák 
Cc: Brian Paul 
Signed-off-by: Dylan Baker 
---

Marek, the XML in mesa and the Khronos XML agree that this works for GLES 2.0,
but the spec says 3.0. I assume the spec is wrong and should be corrected?

 src/mesa/main/tests/dispatch_sanity.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 82eb61dcf73..b395a09e13f 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1192,6 +1192,10 @@ const struct function 
common_desktop_functions_possible[] = {
{ "glMultiDrawArraysIndirectCountARB", 11, -1 },
{ "glMultiDrawElementsIndirectCountARB", 11, -1 },
 
+   /* GL_AMD_framebuffer_multisample_advanced */
+   { "glRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
+   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 45, -1 },
+
{ NULL, 0, -1 }
 };
 
@@ -2497,6 +2501,10 @@ const struct function gles2_functions_possible[] = {
/* GL_NV_conservative_raster_pre_snap_triangles */
{ "glConservativeRasterParameteriNV", 20, -1 },
 
+   /* GL_AMD_framebuffer_multisample_advanced */
+   { "glRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
+   { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 30, -1 },
+
{ NULL, 0, -1 }
 };
 
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH 3/4] anv: Use central api generation scripts.

2018-08-13 Thread Dylan Baker
Quoting Emil Velikov (2018-08-13 03:38:13)
> On 10 August 2018 at 00:57, Dylan Baker  wrote:
> > Quoting Chad Versace (2018-08-09 10:37:33)
> >> On Tue 07 Aug 2018, Dylan Baker wrote:
> >> > Quoting Bas Nieuwenhuizen (2018-08-07 16:14:33)
> >> > >
> >> > >  anv_extensions_c = custom_target(
> >> > > @@ -36,10 +37,11 @@ anv_extensions_c = custom_target(
> >> > >input : ['anv_extensions_gen.py', vk_api_xml],
> >> > >output : 'anv_extensions.c',
> >> > >command : [
> >> > > +   'env', 'PYTHONPATH=@0@'.format(join_paths(meson.source_root(), 
> >> > > 'src/vulkan/util/')),
> >> >
> >> > This is really gross, you're adding a dependency on a unix console 
> >> > command. I
> >> > know that anv is only built on Unix-like oses, but this will eventually 
> >> > end up
> >> > being used in some code that needs to run on Windows (or mac, does mac 
> >> > have
> >> > env?).
> >> >
> >> > I know that some people will object, but IMHO a better solution than 
> >> > mucking
> >> > with the python path (either through sys.path or through PYTHONPATH, is 
> >> > to
> >> > put all of the generators in a src/generators directory and be done with 
> >> > it.
> >> > Sure the intel specific bits (for example) aren't in the src/intel 
> >> > folder,
> >> > that's a small price to avoid having to call env just to run a python 
> >> > script.
> >>
> >> Dylan, I think we should avoid introducing complexity in the build
> >> system for the benefit of operating systems not supported by the driver.
> >> That feels like a serious premature optimazation, to me.  Anvil's usage
> >> of ioctls is highly specific to Linux/Unix, will not work on MacOS, and
> >> definitely does not work on Windows.
> >
> > I agree completely. I think where we disagree is on whether mucking with
> > PYTHONPATH and using env is more complex or putting our generators in a 
> > single
> > directory is more complex. I think using env is extremely gross and 
> > complex, I
> > think mucking with PYTHONPATH is extremely gross and complex, and I think 
> > having
> > to reference a file from another directory is a *lot* less gross and *much* 
> > less
> > complex.
> >
> Can we reuse the NIR approach seen here [1] [2]?
> Moving files around just to appease python feels wrong on many levels :-(
> 
> Thanks
> Emil
> 
> [1] 
> https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/intel/compiler/meson.build#L120
> [2] 
> https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/gallium/drivers/freedreno/meson.build#L21

I would begrudgingly accept that.

I really don't understand why this is such a big deal. Imagine for a moment that
a there was a driver for "Magical Unicorn" hardware existed. Imagine it had some
very odd instructions and the developers of the Magic Unicorn driver wanted some
special NIR passes for their hardware. Now lets imagine that they insisted that
those passes must live in src/unicorn, but should be linked into libnir. No one
would accept that, they would be told either to keep the passes in their backend
or to move them into src/compiler/nir. I believe this is an analogous situation.
We want to share code, so we're putting it in src/util/vulkan, but then instead
of calling a generator out of src/util/vulkan in src/intel and src/amd (we
already call python scripts from different directories all over the build
system), we do some elaborate environment variable manipulation which can have
unforseen side effects (like that google sets PYTHONPATH in their distro) and
have to wrap our actual callable with `env`, just so that we could put the
callable in src/intel and src/amd instead of having a callable in
src/util/vulkan. Does no one else think that this is a bit crazy?

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/4] anv: Use central api generation scripts.

2018-08-09 Thread Dylan Baker
Quoting Chad Versace (2018-08-09 10:37:33)
> On Tue 07 Aug 2018, Dylan Baker wrote:
> > Quoting Bas Nieuwenhuizen (2018-08-07 16:14:33) 
> > 
> > 
> >   
> > >   
> > >   
> > >   
> > >   
> > >  anv_extensions_c = custom_target(
> > >   
> > >   
> > >   
> > > @@ -36,10 +37,11 @@ anv_extensions_c = custom_target( 
> > >   
> > >   
> > >   
> > >input : ['anv_extensions_gen.py', vk_api_xml], 
> > >   
> > >   
> > >   
> > >output : 'anv_extensions.c',   
> > >   
> > >   
> > >   
> > >command : [
> > >   
> > >   
> > >   
> > > +   'env', 'PYTHONPATH=@0@'.format(join_paths(meson.source_root(), 
> > > 'src/vulkan/util/')), 
> > >   
> > >  
> > 
> > This is really gross, you're adding a dependency on a unix console command. 
> > I   
> > 
> >   
> > know that anv is only built on Unix-like oses, but this will eventually end 
> > up  
> > 
> >   
> > being used in some code that needs to run on Windows (or mac, does mac have 
> > 
> > 
> >   
> > env?).  
> > 
> > 
> >   
> > 
> > I know that some people will object, but IMHO a better solution than 
> > mucking 
> > 
> >  
> > with the python path (either through sys.path or through PYTHONPATH, is to  
> > 
> > 
> >   
> > put all of the generators in a src/generators directory and be done with 
> > it. 
> >  

Re: [Mesa-dev] [PATCH v3 08/48] meson: fix dl detection on non cygwin windows

2018-08-09 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-09 08:36:55)
> On Monday, 2018-08-06 17:50:48 -0700, Dylan Baker wrote:
> > ---
> >  meson.build | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index c7dd5ddfec6..788021c05e9 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -1027,9 +1027,9 @@ endif
> >  if cc.has_function('dlopen')
> 
> This check is not needed on windows, is it? It will always fail afaict.
> 
> How about this?
>   if host == windows or cc.has_function(dlopen)
> 
> >dep_dl = null_dep
> >  else
> > -  dep_dl = cc.find_library('dl')
> > +  dep_dl = cc.find_library('dl', required : host_machine.system() != 
> > 'windows')
> >  endif
> > -if cc.has_function('dladdr', dependencies : dep_dl)
> > +if host_machine.system() != 'windows' and cc.has_function('dladdr', 
> > dependencies : dep_dl)
> ># This is really only required for megadrivers
> >pre_args += '-DHAVE_DLADDR'
> >  endif

How about:
# check for dl support
dep_dl = null_dep
if host_machine.system() != 'windows'
  if not cc.has_function('dlopen')
dep_dl = cc.find_library('dl')
  endif
  if cc.has_function('dladdr', dependencies : dep_dl)
# This is really only required for megadrivers
pre_args += '-DHAVE_DLADDR'
  endif
endif

> 
> With that, 1-4 and 7-8 are:
> Reviewed-by: Eric Engestrom 
> 
> > -- 
> > 2.18.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 v3 19/48] meson: build libgl-gdi target

2018-08-09 Thread Dylan Baker
Quoting Eric Anholt (2018-08-07 11:12:27)
> Dylan Baker  writes:
> 
> > ---
> >  src/gallium/meson.build   |  1 +
> >  src/gallium/targets/libgl-gdi/meson.build | 44 +++
> >  2 files changed, 45 insertions(+)
> >  create mode 100644 src/gallium/targets/libgl-gdi/meson.build
> >
> > diff --git a/src/gallium/meson.build b/src/gallium/meson.build
> > index a4f28dc4757..5019477788b 100644
> > --- a/src/gallium/meson.build
> > +++ b/src/gallium/meson.build
> > @@ -193,6 +193,7 @@ if with_gallium_st_nine
> >  endif
> >  if with_platform_windows
> >subdir('state_trackers/wgl')
> > +  subdir('targets/libgl-gdi')
> >  endif
> >  if with_tests
> >subdir('targets/graw-null')
> > diff --git a/src/gallium/targets/libgl-gdi/meson.build 
> > b/src/gallium/targets/libgl-gdi/meson.build
> > new file mode 100644
> > index 000..63cc40b97bc
> > --- /dev/null
> > +++ b/src/gallium/targets/libgl-gdi/meson.build
> > @@ -0,0 +1,44 @@
> > +# 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.
> > +
> > +if cc.get_id() == 'gcc' and host_machine.cpu_family() == 'x86_64'
> > +  ogldef = files('../../state_trackers/wgl/opengl32.mingw.def')[0]
> > +else
> > +  ogldef = files('../../state_trackers/wgl/opengl32.def')[0]
> > +endif
> 
> I think you flipped the polarity of the x86_64 check.  Also, please copy
> over the comment explaining what this is about.

You are indeed correct.

> 
> > +libopengl32 = shared_library(
> > +  'opengl32',
> > +  ['libgl_gdi.c'],
> > +  vs_module_defs : ogldef,
> > +  include_directories : [
> > +inc_common, inc_wgl, inc_gallium_winsys_sw, inc_gallium_drivers,
> > +  ],
> > +  link_whole : [libwgl],
> > +  link_with : [
> > +libmesa_util, libgallium, libglsl, libmesa_gallium, libwsgdi,
> > +libglapi_static, libglapi
> > +  ],
> > +  dependencies : [
> > +dep_ws2_32, idep_nir, driver_swrast, driver_swr,
> > +  ],
> > +  name_prefix : '',  # otherwise mingw will create libopengl32.dll
> > +  install : true,
> 
> Looks like you're missing the HAVE_SWR, HAVE_LLVMPIPE definitions.

driver_swrast and driver_swr provide those definitions (driver_swrast is
llvmpipe if that's enabled otherwise it's softpipe).


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 20/48] meson: build graw-gdi target

2018-08-09 Thread Dylan Baker
Quoting Eric Anholt (2018-08-07 11:14:16)
> Dylan Baker  writes:
> 
> > ---
> >  src/gallium/meson.build  |  4 ++-
> >  src/gallium/targets/graw-gdi/meson.build | 36 
> >  2 files changed, 39 insertions(+), 1 deletion(-)
> >  create mode 100644 src/gallium/targets/graw-gdi/meson.build
> >
> > diff --git a/src/gallium/meson.build b/src/gallium/meson.build
> > index 5019477788b..e4e0b88e7fc 100644
> > --- a/src/gallium/meson.build
> > +++ b/src/gallium/meson.build
> > @@ -197,7 +197,9 @@ if with_platform_windows
> >  endif
> >  if with_tests
> >subdir('targets/graw-null')
> > -  if with_glx == 'gallium-xlib'
> > +  if with_platform_windows
> > +subdir('targets/graw-gdi')
> > +  elif with_glx == 'gallium-xlib'
> >  subdir('targets/graw-xlib')
> >endif
> >subdir('tests')
> > diff --git a/src/gallium/targets/graw-gdi/meson.build 
> > b/src/gallium/targets/graw-gdi/meson.build
> > new file mode 100644
> > index 000..e04b454ab53
> > --- /dev/null
> > +++ b/src/gallium/targets/graw-gdi/meson.build
> > @@ -0,0 +1,36 @@
> > +# 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.
> > +
> > +libgraw_gdi = shared_library(
> > +  'graw',
> > +  'graw_gdi.c',
> > +  include_directories : [
> > +inc_include, inc_src, inc_gallium, inc_gallium_aux, 
> > inc_gallium_drivers,
> > +inc_gallium_winsys_sw,
> > +  ],
> > +  link_with : [
> > +libgraw_util, libmesa_util, libgallium, libwsgdi,
> > +  ],
> > +  dependencies : [
> > +dep_ws2_32, driver_swrast,
> > +  ],
> > +)
> 
> Looks like this is missing GALLIUM_SOFTPIPE/GALLIUM_LLVMPIPE
> definitions.

driver_swrast will have the correct defines depending on whether softpipe or
llvmpipe is being built.


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


Re: [Mesa-dev] [Mesa-stable] [PATCH v4 1/2] wayland/egl: initialize window surface size to window size

2018-08-09 Thread Dylan Baker
Quoting Juan A. Suarez Romero (2018-08-07 08:49:36)
> When creating a windows surface with eglCreateWindowSurface(), the
> width and height returned by eglQuerySurface(EGL_{WIDTH,HEIGHT}) is
> invalid until buffers are updated (like calling glClear()).
> 
> But according to EGL 1.5 spec, section 3.5.6 ("Surface Attributes"):
> 
>   "Querying EGL_WIDTH and EGL_HEIGHT returns respectively the width and
>height, in pixels, of the surface. For a window or pixmap surface,
>these values are initially equal to the width and height of the
>native window or pixmap with respect to which the surface was
>created"
> 
> This fixes dEQP-EGL.functional.color_clears.* CTS tests
> 
> v2:
> - Do not modify attached_{width,height} (Daniel)
> - Do not update size on resizing window (Brendan)
> 
> CC: Daniel Stone 
> CC: Brendan King 
> CC: mesa-sta...@lists.freedesktop.org
> Tested-by: Eric Engestrom 
> ---
>  src/egl/drivers/dri2/platform_wayland.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
> b/src/egl/drivers/dri2/platform_wayland.c
> index dca099500a8..a5d43094cf3 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -258,6 +258,9 @@ dri2_wl_create_window_surface(_EGLDriver *drv, 
> _EGLDisplay *disp,
>goto cleanup_surf;
> }
>  
> +   dri2_surf->base.Width = window->width;
> +   dri2_surf->base.Height = window->height;
> +
> visual_idx = dri2_wl_visual_idx_from_config(dri2_dpy, config);
> assert(visual_idx != -1);
>  
> -- 
> 2.17.1
> 

Hi Juan,

There was a minor conflict when I pulled this into staging/18.1, I'm pretty
confident that I resolved it correctly, but if you wouldn't mind taking a look
I'd appreciate it.

Thanks,
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 8/9] python: Rework bytes/unicode string handling

2018-08-09 Thread Dylan Baker
This doesn't work with python 2. It's also pointed out to me that we don't
handle translations in meson at all...

Here's the traceback:
make[5]: Entering directory 
'/home/jenkins/workspace/Leeroy_3/repos/mesa/build_m64/src/util/xmlpool'
Updating (ca) ca/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/ca.po.
Updating (de) de/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/de.po.
Updating (es) es/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/es.po.
Updating (nl) nl/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/nl.po.
Updating (fr) fr/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/fr.po.
Updating (sv) sv/LC_MESSAGES/options.mo from 
/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/sv.po.
  GEN  options.h
Traceback (most recent call last):
  File 
"/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/gen_xmlpool.py", 
line 210, in 
expandMatches ([matchDESC], translations)
  File 
"/home/jenkins/workspace/Leeroy_3/repos/mesa/src/util/xmlpool/gen_xmlpool.py", 
line 133, in expandMatches
text = (matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix)
  File "/usr/lib/python2.7/re.py", line 282, in _expand
return sre_parse.expand_template(template, match)
  File "/usr/lib/python2.7/sre_parse.py", line 862, in expand_template
return sep.join(literals)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal 
not in range(128)
Makefile:720: recipe for target 'options.h' failed

I'm running everything up through this through our CI again, but assuming
everything still looks good I'll be merging everything but this patch and the
next patch today.

For every patch up to this point:
Reviewed-by: Dylan Baker 

Quoting Mathieu Bridon (2018-08-09 01:27:25)
> In both Python 2 and 3, opening a file without specifying the mode will
> open it for reading in text mode ('r').
> 
> On Python 2, the read() method of a file object opened in mode 'r' will
> return byte strings, while on Python 3 it will return unicode strings.
> 
> Explicitly specifying the binary mode ('rb') then decoding the byte
> string means we always handle unicode strings on both Python 2 and 3.
> 
> Which in turns means all re.match(line) will return unicode strings as
> well.
> 
> If we also make expandCString return unicode strings, we don't need the
> call to the unicode() constructor any more.
> 
> We were using the ugettext() method because it always returns unicode
> strings in Python 2, contrarily to the gettext() one which returns
> strings in the same type as its input. The ugettext() method doesn't
> exist on Python 3, so we must use the gettext() one.
> 
> This is fine now that we know we only pass unicode strings to gettext().
> (the return values of expandCString)
> 
> The last hurdles are that Python 3 doesn't let us concatenate unicode
> and byte strings directly, and that Python 2's stdout wants encoded byte
> strings while Python 3's want unicode strings.
> 
> With these changes, the script gives the same output on both Python 2
> and 3.
> 
> Signed-off-by: Mathieu Bridon 
> ---
>  src/util/xmlpool/gen_xmlpool.py | 35 +++--
>  1 file changed, 25 insertions(+), 10 deletions(-)
> 
> diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py
> index b0db183854..db20e2767f 100644
> --- a/src/util/xmlpool/gen_xmlpool.py
> +++ b/src/util/xmlpool/gen_xmlpool.py
> @@ -60,7 +60,7 @@ def expandCString (s):
>  octa = False
>  num = 0
>  digits = 0
> -r = ''
> +r = u''
>  while i < len(s):
>  if not escape:
>  if s[i] == '\\':
> @@ -128,16 +128,29 @@ def expandMatches (matches, translations, end=None):
>  if len(matches) == 1 and i < len(translations) and \
> not matches[0].expand (r'\7').endswith('\\'):
>  suffix = ' \\'
> -# Expand the description line. Need to use ugettext in order to allow
> -# non-ascii unicode chars in the original English descriptions.
> -text = escapeCString (trans.ugettext (unicode (expandCString (
> -matches[0].expand (r'\5')), "utf-8"))).encode("utf-8")
> -print(matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + 
> suffix)
> +text = escapeCString (trans.gettext (expandCString (
> +matches[0].expand (r'\5'
> +text = (matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + 
> suffix)
> +
> +# In Python 2, stdout ex

Re: [Mesa-dev] [PATCH v2 7/9] python: Simplify list sorting

2018-08-09 Thread Dylan Baker
All patches up to here (including this one) have been pushed to master. I had
comments on patch 8, and I want to follow up with our CI team to make sure we
have all the dependencies for python 3 in our CI.

Dylan

Quoting Mathieu Bridon (2018-08-09 01:27:24)
> Instead of copying the list, then sorting the copy in-place, we can just
> get a new sorted copy directly.
> 
> Signed-off-by: Mathieu Bridon 
> ---
>  src/mapi/mapi_abi.py | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mapi/mapi_abi.py b/src/mapi/mapi_abi.py
> index d4c48ec430..dc48fa5935 100644
> --- a/src/mapi/mapi_abi.py
> +++ b/src/mapi/mapi_abi.py
> @@ -291,8 +291,7 @@ class ABIPrinter(object):
>  self.entries = entries
>  
>  # sort entries by their names
> -self.entries_sorted_by_names = self.entries[:]
> -self.entries_sorted_by_names.sort(key=attrgetter('name'))
> +self.entries_sorted_by_names = sorted(self.entries, 
> key=attrgetter('name'))
>  
>  self.indent = ' ' * 3
>  self.noop_warn = 'noop_warn'
> @@ -441,8 +440,7 @@ class ABIPrinter(object):
>  def c_stub_string_pool(self):
>  """Return the string pool for use by stubs."""
>  # sort entries by their names
> -sorted_entries = self.entries[:]
> -sorted_entries.sort(key=attrgetter('name'))
> +sorted_entries = sorted(self.entries, key=attrgetter('name'))
>  
>  pool = []
>  offsets = {}
> -- 
> 2.17.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 3/4] anv: Use central api generation scripts.

2018-08-13 Thread Dylan Baker
Quoting Bas Nieuwenhuizen (2018-08-13 09:25:01)
> On Mon, Aug 13, 2018 at 5:54 PM, Dylan Baker  wrote:
> > Quoting Emil Velikov (2018-08-13 03:38:13)
> >> On 10 August 2018 at 00:57, Dylan Baker  wrote:
> >> > Quoting Chad Versace (2018-08-09 10:37:33)
> >> >> On Tue 07 Aug 2018, Dylan Baker wrote:
> >> >> > Quoting Bas Nieuwenhuizen (2018-08-07 16:14:33)
> >> >> > >
> >> >> > >  anv_extensions_c = custom_target(
> >> >> > > @@ -36,10 +37,11 @@ anv_extensions_c = custom_target(
> >> >> > >input : ['anv_extensions_gen.py', vk_api_xml],
> >> >> > >output : 'anv_extensions.c',
> >> >> > >command : [
> >> >> > > +   'env', 'PYTHONPATH=@0@'.format(join_paths(meson.source_root(), 
> >> >> > > 'src/vulkan/util/')),
> >> >> >
> >> >> > This is really gross, you're adding a dependency on a unix console 
> >> >> > command. I
> >> >> > know that anv is only built on Unix-like oses, but this will 
> >> >> > eventually end up
> >> >> > being used in some code that needs to run on Windows (or mac, does 
> >> >> > mac have
> >> >> > env?).
> >> >> >
> >> >> > I know that some people will object, but IMHO a better solution than 
> >> >> > mucking
> >> >> > with the python path (either through sys.path or through PYTHONPATH, 
> >> >> > is to
> >> >> > put all of the generators in a src/generators directory and be done 
> >> >> > with it.
> >> >> > Sure the intel specific bits (for example) aren't in the src/intel 
> >> >> > folder,
> >> >> > that's a small price to avoid having to call env just to run a python 
> >> >> > script.
> >> >>
> >> >> Dylan, I think we should avoid introducing complexity in the build
> >> >> system for the benefit of operating systems not supported by the driver.
> >> >> That feels like a serious premature optimazation, to me.  Anvil's usage
> >> >> of ioctls is highly specific to Linux/Unix, will not work on MacOS, and
> >> >> definitely does not work on Windows.
> >> >
> >> > I agree completely. I think where we disagree is on whether mucking with
> >> > PYTHONPATH and using env is more complex or putting our generators in a 
> >> > single
> >> > directory is more complex. I think using env is extremely gross and 
> >> > complex, I
> >> > think mucking with PYTHONPATH is extremely gross and complex, and I 
> >> > think having
> >> > to reference a file from another directory is a *lot* less gross and 
> >> > *much* less
> >> > complex.
> >> >
> >> Can we reuse the NIR approach seen here [1] [2]?
> >> Moving files around just to appease python feels wrong on many levels :-(
> >>
> >> Thanks
> >> Emil
> >>
> >> [1] 
> >> https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/intel/compiler/meson.build#L120
> >> [2] 
> >> https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/gallium/drivers/freedreno/meson.build#L21
> >
> > I would begrudgingly accept that.
> >
> > I really don't understand why this is such a big deal. Imagine for a moment 
> > that
> > a there was a driver for "Magical Unicorn" hardware existed. Imagine it had 
> > some
> > very odd instructions and the developers of the Magic Unicorn driver wanted 
> > some
> > special NIR passes for their hardware. Now lets imagine that they insisted 
> > that
> > those passes must live in src/unicorn, but should be linked into libnir. No 
> > one
> > would accept that, they would be told either to keep the passes in their 
> > backend
> > or to move them into src/compiler/nir. I believe this is an analogous 
> > situation.
> > We want to share code, so we're putting it in src/util/vulkan, but then 
> > instead
> > of calling a generator out of src/util/vulkan in src/intel and src/amd (we
> > already call python scripts from different directories all over the build
> > system), we do some elaborate environment variable manipulation which can 
> > have
> > unforseen side effects (like that google sets PYTHONPATH in their distro) 
> > and
> > have to wrap our actual callable with `env`, just so that we could put the
> > callable in src/intel and src/amd instead of having a callable in
> > src/util/vulkan. Does no one else think that this is a bit crazy?
> 
> For the main functions of the generators scripts I agree and can merge
> them a bit further. However the one where I think moving it is
> somewhat crazy is the {radv,anv}_extensions.py, in particular the list
> of supported extensions and the (driver-specific) conditions in which
> they should be enabled. That seems way driver-specific to put in a
> shared directory.

Okay, that's a fair point.

What about having a file that is a list of extensions that could live in
src/$vendor, which the script takes as an argument?

Dylan


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


[Mesa-dev] [ANNOUNCE] mesa 18.1.6

2018-08-13 Thread Dylan Baker
Hi list,

I'm announcing the general availability of the 18.1.6 release. This is an 18.1
bugfix release. There are two more 18.1 bug fix releases planned at this time.

We've had another busy cycle the last two weeks, there have been roughly 3 dozen
fixes in this release. In brief:

- autotools fixes for libglvnd, libgl naming, and pkgconfig
- meson fixed its handling of stale symlinks wrt megadrivers
- windows relaged fixes
- some bug fixes for clover
- plenty of egl, wayland, glx, and dri3 fixes
- a couple of nir fixes
- and on the driver side, radv, intel, vc4, etnaviv, swr, r600, amd, and
  nouveau all had a few fixes

Dylan

git tag: mesa-18.1.6

https://mesa.freedesktop.org/archive/mesa-18.1.6.tar.gz
MD5:  f54b24108f3554ffae84a80f02dfc732  mesa-18.1.6.tar.gz
SHA1: 107427ae87510114a94e4a045f3334e4efaa56a3  mesa-18.1.6.tar.gz
SHA256: 580e03328ffefe1fd43b19ab7669f20d931601a1c0a4c0f8b9c65d6e81a06df3  
mesa-18.1.6.tar.gz
SHA512: 
21ab4a7fc245903fcddfaa4febd1ae5c5cfdb6bd98a0580fe31b58865483505609d46769c55234220678fc4bb1d75c96e7cbef7c522e6de6d89020e01d3ca177
  mesa-18.1.6.tar.gz
PGP:  https://mesa.freedesktop.org/archive/mesa-18.1.6.tar.gz.sig

https://mesa.freedesktop.org/archive/mesa-18.1.6.tar.xz
MD5:  f798814c0b93ca3c1cf395bb936db3e0  mesa-18.1.6.tar.xz
SHA1: 8d4daf725f20404f980b981c9693b58756ba6c48  mesa-18.1.6.tar.xz
SHA256: bb7ce759069801804fcfb8152da3457f76cd7b4e0096e4870ff5adcb5c894289  
mesa-18.1.6.tar.xz
SHA512: 
2966210800215f5ced2720691063a8519b51ebeab9fb1e99bde4b1bd7ccc719d6395a1c29f25c88efe62d1592cf14ceafc163aca349490b1f8cee81070d46fcc
  mesa-18.1.6.tar.xz
PGP:  https://mesa.freedesktop.org/archive/mesa-18.1.6.tar.xz.sig



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, install_megadrivers: Also remove stale symlinks

2018-08-06 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-06 08:59:00)
> On Monday, 2018-08-06 09:41:48 +0200, Gert Wollny wrote:
> > os.path.exists doesn't return True for stale symlinks, but they are in
> > the way later, when a link/file with the same name is to be created.
> > For instance it is conceivable that the pointed to file is replaced by
> > a file with a new name, and then the symlink is dead.
> > 
> > To handle this check specifically for all existing symlinks to be
> > removed. (This bugged me for some time with a link libXvMCr600.so
> > always being in the way of installing this file)
> > 
> > v2: use only os.path.lexist and replace all instances
> > of os.path.exist (Dylan Baker)
> > 
> > Fixes: f7f1b30f81e842db6057591470ce3cb6d4fb2795
> >   ("meson: extend install_megadrivers script to handle symmlinking")
> > 
> > Signed-off-by: Gert Wollny 
> > ---
> >  bin/install_megadrivers.py | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
> > index 8d9ed9c6dc..3a31fddd89 100755
> > --- a/bin/install_megadrivers.py
> > +++ b/bin/install_megadrivers.py
> > @@ -42,14 +42,14 @@ def main():
> >  
> >  master = os.path.join(to, os.path.basename(args.megadriver))
> >  
> > -if not os.path.exists(to):
> > +if not os.path.lexists(to):
> >  os.makedirs(to)
> 
> I'm not convinced on this one: if the `to` destination is a symlink but
> the destination of the symlink doesn't exist, we shouldn't just consider
> that the folder has already been created and is ready for use.
> 
> I think here we should either just ignore that case, or if we want to
> handle it then it should be:
>   if not exists(to):
>   if lexists(to):
>   unlink(to)
>   makedirs(to)
> 
> The other two below are
> Reviewed-by: Eric Engestrom 

Good catch, I wasn't paying good enough attention :/

With either Eric's suggestion, or the first hunk removed:

Reviewed-by: Dylan Baker 

> 
> >  shutil.copy(args.megadriver, master)
> >  
> >  for driver in args.drivers:
> >  abs_driver = os.path.join(to, driver)
> >  
> > -if os.path.exists(abs_driver):
> > +if os.path.lexists(abs_driver):
> >  os.unlink(abs_driver)
> >  print('installing {} to {}'.format(args.megadriver, abs_driver))
> >  os.link(master, abs_driver)
> > @@ -60,7 +60,7 @@ def main():
> >  
> >  name, ext = os.path.splitext(driver)
> >  while ext != '.so':
> > -if os.path.exists(name):
> > +if os.path.lexists(name):
> >  os.unlink(name)
> >  os.symlink(driver, name)
> >  name, ext = os.path.splitext(name)
> > -- 
> > 2.16.4
> > 
> > ___
> > 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


Re: [Mesa-dev] [PATCH v3 14/48] meson: Make shader-cache a trillean instead of boolean

2018-08-08 Thread Dylan Baker
Quoting Eric Anholt (2018-08-07 10:58:52)
> Dylan Baker  writes:
> 
> > So that it can be implicitly disabled on windows, where it doesn't
> > compile.
> 
> I don't see how this option successfully controls the shader cache being
> built.

The entire shader cache code in src/util/disk_cache.[ch] is guarded in "#ifdef
ENABLE_SHADER_CACHE", so if we don't define that then the shader_cache is
disabled.

> Also the "elif with_dri_i965 and get_option('shader-cache')"
> looks like it needs to get updated for the trillian, too.

Fixed locally


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/lower_ycbcr: Use the binding array size for bounds checks

2018-08-20 Thread Dylan Baker
Quoting Lionel Landwerlin (2018-08-20 08:59:38)
> From: Jason Ekstrand 
> 
> Because lower_ycbcr gets called before apply_pipeline_layout, the
> indices are all logical and the binding layout HW size is actually too
> big for the bounds check.  We should just use the regular logical array
> size instead.
> 
> Fixes: f3e91e78a33 "anv: add nir lowering pass for ycbcr textures"
> Reviewed-by: Timothy Arceri 
> Reviewed-by: Lionel Landwerlin 
> (cherry picked from commit 320dacb0a051cd1736e0976f70467b68281edfbf)
> ---
>  src/intel/vulkan/anv_nir_lower_ycbcr_textures.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c 
> b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> index ebf1fd9c267..e2b560364bc 100644
> --- a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> +++ b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> @@ -337,18 +337,16 @@ try_lower_tex_ycbcr(struct anv_pipeline_layout *layout,
> if (binding->immutable_samplers == NULL)
>return false;
>  
> -   unsigned texture_index = tex->texture_index;
> +   assert(tex->texture_index == 0);
> +   unsigned array_index = 0;
> if (tex->texture->deref.child) {
>assert(tex->texture->deref.child->deref_type == nir_deref_type_array);
>nir_deref_array *deref_array = 
> nir_deref_as_array(tex->texture->deref.child);
>if (deref_array->deref_array_type != nir_deref_array_type_direct)
>   return false;
> -  size_t hw_binding_size =
> - anv_descriptor_set_binding_layout_get_hw_size(binding);
> -  texture_index += MIN2(deref_array->base_offset, hw_binding_size - 1);
> +  array_index = MIN2(deref_array->base_offset, binding->array_size - 1);
> }
> -   const struct anv_sampler *sampler =
> -  binding->immutable_samplers[texture_index];
> +   const struct anv_sampler *sampler = 
> binding->immutable_samplers[array_index];
>  
> if (sampler->conversion == NULL)
>return false;
> -- 
> 2.18.0
> 

Thanks! Applied to staging/18.1

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 1/5] anv/lower_ycbcr: Use the binding array size for bounds checks

2018-08-20 Thread Dylan Baker
Quoting Jason Ekstrand (2018-08-08 01:12:49)
> Because lower_ycbcr gets called before apply_pipeline_layout, the
> indices are all logical and the binding layout HW size is actually too
> big for the bounds check.  We should just use the regular logical array
> size instead.
> 
> Fixes: f3e91e78a33 "anv: add nir lowering pass for ycbcr textures"
> ---
>  src/intel/vulkan/anv_nir_lower_ycbcr_textures.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c 
> b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> index 5a971d9be39..71e511f34b7 100644
> --- a/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> +++ b/src/intel/vulkan/anv_nir_lower_ycbcr_textures.c
> @@ -340,18 +340,16 @@ try_lower_tex_ycbcr(struct anv_pipeline_layout *layout,
> if (binding->immutable_samplers == NULL)
>return false;
>  
> -   unsigned texture_index = tex->texture_index;
> +   assert(tex->texture_index == 0);
> +   unsigned array_index = 0;
> if (deref->deref_type != nir_deref_type_var) {
>assert(deref->deref_type == nir_deref_type_array);
>nir_const_value *const_index = 
> nir_src_as_const_value(deref->arr.index);
>if (!const_index)
>   return false;
> -  size_t hw_binding_size =
> - anv_descriptor_set_binding_layout_get_hw_size(binding);
> -  texture_index += MIN2(const_index->u32[0], hw_binding_size - 1);
> +  array_index = MIN2(const_index->u32[0], binding->array_size - 1);
> }
> -   const struct anv_sampler *sampler =
> -  binding->immutable_samplers[texture_index];
> +   const struct anv_sampler *sampler = 
> binding->immutable_samplers[array_index];
>  
> if (sampler->conversion == NULL)
>return false;
> -- 
> 2.17.1
> 

Hi Jason,

f3e91e78a33 is present in 18.1, but this patch doesn't apply cleanly due to (I
think) your rework of how derefs work in NIR. Do you want to backport this patch
to 18.1, or just drop it?

Thanks,
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] autotools: include git_sha1.h in dist tarball

2018-08-20 Thread Dylan Baker
Reviewed-by: Dylan Baker 

Quoting Juan A. Suarez Romero (2018-08-20 07:22:35)
> This fixes `make distcheck`.
> 
> Fixes: 471f708ed6 ("git_sha1: simplify logic")
> CC: Eric Engestrom 
> ---
>  src/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 396865cbe55..412510f435b 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -26,7 +26,7 @@ git_sha1.h:
>  
>  BUILT_SOURCES = git_sha1.h
>  CLEANFILES = $(BUILT_SOURCES)
> -EXTRA_DIST = git_sha1.h.in meson.build
> +EXTRA_DIST = git_sha1.h meson.build
>  
>  SUBDIRS = . gtest util mapi/glapi/gen mapi
>  
> -- 
> 2.17.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] [PATCHv2 1/2] meson: Use python to run glsl tests

2018-08-17 Thread Dylan Baker
Quoting Emil Velikov (2018-08-17 04:11:32)
> From: Dylan Baker 
> 
> There are multiple reasons why the python scripts are executed
> explicitly via $PYTHON or equivalent. In random order:
> 
>  - env is rarely a thing on Windows

windows does something completely different based on file extensions, however
IUC, the python loader for windows does actually read the shbang to decide
whether to invoke python 2 or python 3, so that might not be a problem

>  - env can be outside of /usr/bin/

Ah Haiku. :)

>  - the python executable varies across platforms - pythonX.Y, python
>  - we want to use the same python version everywhere in Mesa
>  - executing the scripts manually, doesn't ensure all the dependencies
> are built and up-to date

This is not true for meson, meson runs tests all at once after all
building/re-building is complete.

>  - last but not least - it hinders python 2/3 compatibility
> 
> Fixes: 877d250ea14 ("meson: enable optimization-test")
> Fixes: ad9c2f20181 ("meson: run glsl compiler warnings test")
> Cc: Dylan Baker 
> Reviewed-by: Emil Velikov 
> [Emil: commit message, fixes tags, add glcpp test]
> Signed-off-by: Emil Velikov 
> ---
> Dylan,
> 
> I _may_ have gone overboard with the list above. Dropping to 1-2 is
> perfectly fine - let me know if your preference.
> 
> Either way, lets drop the execute bit/shebang. Running the scripts
> manually is cool, but not something anyone should do.
> ---
>  src/compiler/glsl/glcpp/meson.build |  3 ++-
>  src/compiler/glsl/tests/meson.build | 11 ---
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/compiler/glsl/glcpp/meson.build 
> b/src/compiler/glsl/glcpp/meson.build
> index 09d44ddd687..769406f5331 100644
> --- a/src/compiler/glsl/glcpp/meson.build
> +++ b/src/compiler/glsl/glcpp/meson.build
> @@ -64,8 +64,9 @@ if with_tests
>foreach m : modes
>  test(
>'glcpp test (@0@)'.format(m),
> -  find_program('tests/glcpp_test.py'),
> +  prog_python,
>args : [
> +join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
>  glcpp, join_paths(meson.current_source_dir(), 'tests'),
>  '--@0@'.format(m),
>],
> diff --git a/src/compiler/glsl/tests/meson.build 
> b/src/compiler/glsl/tests/meson.build
> index fc7b863a278..2a41e30a28d 100644
> --- a/src/compiler/glsl/tests/meson.build
> +++ b/src/compiler/glsl/tests/meson.build
> @@ -84,8 +84,10 @@ test(
>  )
>  
>  test(
> -  'glsl compiler warnings', find_program('warnings_test.py'),
> +  'glsl compiler warnings',
> +  prog_python,
>args : [
> +join_paths(meson.current_source_dir(), 'warnings_test.py'),
>  '--glsl-compiler', glsl_compiler,
>  '--test-directory', join_paths(
>meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
> @@ -94,6 +96,9 @@ test(
>  )
>  test(
>'glsl optimization',
> -  find_program('optimization_test.py'),
> -  args : ['--test-runner', glsl_test],
> +  prog_python,
> +  args : [
> +join_paths(meson.current_source_dir(), 'optimization_test.py'),
> +'--test-runner', glsl_test
> +  ],
>  )
> -- 
> 2.18.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 mesa] util/xmlpool: make indentation coherent

2018-08-17 Thread Dylan Baker
Reviewed-by: Dylan Baker 

Quoting Eric Engestrom (2018-08-16 08:03:23)
> Signed-off-by: Eric Engestrom 
> ---
>  src/util/xmlpool/t_options.h | 26 +-
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h
> index f0537e965b8a3cda894c..a31fafac14c6ffb55bb2 100644
> --- a/src/util/xmlpool/t_options.h
> +++ b/src/util/xmlpool/t_options.h
> @@ -53,7 +53,7 @@
>   */
>  #define DRI_CONF_SECTION_DEBUG \
>  DRI_CONF_SECTION_BEGIN \
> -   DRI_CONF_DESC(en,gettext("Debugging"))
> +DRI_CONF_DESC(en,gettext("Debugging"))
>  
>  #define DRI_CONF_NO_RAST(def) \
>  DRI_CONF_OPT_BEGIN_B(no_rast, def) \
> @@ -77,7 +77,7 @@ DRI_CONF_OPT_END
>  
>  #define DRI_CONF_DISABLE_THROTTLING(def) \
>  DRI_CONF_OPT_BEGIN_B(disable_throttling, def) \
> -   DRI_CONF_DESC(en,gettext("Disable throttling on first batch after 
> flush")) \
> +DRI_CONF_DESC(en,gettext("Disable throttling on first batch after 
> flush")) \
>  DRI_CONF_OPT_END
>  
>  #define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
> @@ -155,11 +155,11 @@ DRI_CONF_OPT_END
>   */
>  #define DRI_CONF_SECTION_QUALITY \
>  DRI_CONF_SECTION_BEGIN \
> -   DRI_CONF_DESC(en,gettext("Image Quality"))
> +DRI_CONF_DESC(en,gettext("Image Quality"))
>  
>  #define DRI_CONF_EXCESS_MIPMAP(def) \
>  DRI_CONF_OPT_BEGIN_B(excess_mipmap, def) \
> -   DRI_CONF_DESC(en,"Enable extra mipmap level") \
> +DRI_CONF_DESC(en,"Enable extra mipmap level") \
>  DRI_CONF_OPT_END
>  
>  #define DRI_CONF_TEXTURE_DEPTH_FB   0
> @@ -168,7 +168,7 @@ DRI_CONF_OPT_END
>  #define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
>  #define DRI_CONF_TEXTURE_DEPTH(def) \
>  DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
> -   DRI_CONF_DESC_BEGIN(en,gettext("Texture color depth")) \
> +DRI_CONF_DESC_BEGIN(en,gettext("Texture color depth")) \
>  DRI_CONF_ENUM(0,gettext("Prefer frame buffer color depth")) \
>  DRI_CONF_ENUM(1,gettext("Prefer 32 bits per texel")) \
>  DRI_CONF_ENUM(2,gettext("Prefer 16 bits per texel")) \
> @@ -205,7 +205,7 @@ DRI_CONF_OPT_END
>  #define DRI_CONF_ROUND_ROUND 1
>  #define DRI_CONF_ROUND_MODE(def) \
>  DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
> -   DRI_CONF_DESC_BEGIN(en,gettext("Color rounding method")) \
> +DRI_CONF_DESC_BEGIN(en,gettext("Color rounding method")) \
>  DRI_CONF_ENUM(0,gettext("Round color components downward")) \
>  DRI_CONF_ENUM(1,gettext("Round to nearest color")) \
>  DRI_CONF_DESC_END \
> @@ -216,7 +216,7 @@ DRI_CONF_OPT_END
>  #define DRI_CONF_DITHER_ORDERED 2
>  #define DRI_CONF_DITHER_MODE(def) \
>  DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
> -   DRI_CONF_DESC_BEGIN(en,gettext("Color dithering method")) \
> +DRI_CONF_DESC_BEGIN(en,gettext("Color dithering method")) \
>  DRI_CONF_ENUM(0,gettext("Horizontal error diffusion")) \
>  DRI_CONF_ENUM(1,gettext("Horizontal error diffusion, reset 
> error at line start")) \
>  DRI_CONF_ENUM(2,gettext("Ordered 2D color dithering")) \
> @@ -321,7 +321,7 @@ DRI_CONF_OPT_END
>  
>  #define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
>  DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
> -   DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA 
> “brilinear” texture filtering")) \
> +DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA 
> “brilinear” texture filtering")) \
>  DRI_CONF_OPT_END
>  
>  #define DRI_CONF_TEXTURE_HEAPS_ALL 0
> @@ -329,11 +329,11 @@ DRI_CONF_OPT_END
>  #define DRI_CONF_TEXTURE_HEAPS_GART 2
>  #define DRI_CONF_TEXTURE_HEAPS(def) \
>  DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
> -   DRI_CONF_DESC_BEGIN(en,gettext("Used types of texture memory")) \
> -   DRI_CONF_ENUM(0,gettext("All available memory")) \
> -   DRI_CONF_ENUM(1,gettext("Only card memory (if available)")) \
> -   DRI_CONF_ENUM(2,gettext("Only GART (AGP/PCIE) memory (if 
> available)")) \
> -   DRI_CONF_DESC_END \
> +DRI_CONF_DESC_BEGIN(en,gettext("Used types of texture memory")) \
> +DRI_CONF_ENUM(0,gettext("All available memory")) \
> +DRI_CONF_ENUM(1,gettext("Only card memory (if available)")) \
> +DRI_CONF_ENUM(2,gettext("Only GART (AGP/PCIE) memory (if 
> available)")) \
> +DRI_CONF_DESC_END \
>  DRI_CONF_OPT_END
>  
>  #define DRI_CONF_MESA_GLTHREAD(def) \
> -- 
> Cheers,
>   Eric
> 
> ___
> 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] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
Quoting Mathieu Bridon (2018-08-16 15:00:39)
> On Thu, 2018-08-16 at 14:21 -0700, Dylan Baker wrote:
> > ---
> > 
> > I didn't see any patches from anyone else, so I wrote some real
> > quick. Please
> > point to them if other patches already exist.
> 
> I was about to send mine, but you were faster. >_<
> 
> They ar every similar though, except that you missed glcpp_test.py,
> which requires a few more changes. (I have them ready, and can send
> them separately)
> 

Can you send your glcpp fixes as well? Please CC me on them.

Dylan


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 1/2] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
v2: - explicitly decode the output of subprocesses
- handle bytes and string types consistently rather than relying on
  python 2's coercion for bytes and ignoring them in python 3
---
 src/compiler/glsl/tests/lower_jump_cases.py  |  2 +-
 src/compiler/glsl/tests/optimization_test.py |  6 --
 src/compiler/glsl/tests/sexps.py | 13 +++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl/tests/lower_jump_cases.py 
b/src/compiler/glsl/tests/lower_jump_cases.py
index b50ab734798..1977f3a9b4f 100644
--- a/src/compiler/glsl/tests/lower_jump_cases.py
+++ b/src/compiler/glsl/tests/lower_jump_cases.py
@@ -54,7 +54,7 @@ def make_test_case(f_name, ret_type, body):
 else:
 make_declarations(s, already_declared)
 make_declarations(body)
-return declarations.values() + \
+return list(declarations.values()) + \
 [['function', f_name, ['signature', ret_type, ['parameters'], body]]]
 
 
diff --git a/src/compiler/glsl/tests/optimization_test.py 
b/src/compiler/glsl/tests/optimization_test.py
index 577d2dfc20f..65bac676963 100755
--- a/src/compiler/glsl/tests/optimization_test.py
+++ b/src/compiler/glsl/tests/optimization_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 # encoding=utf-8
 # Copyright © 2018 Intel Corporation
 
@@ -71,7 +71,9 @@ def main():
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
 stdin=subprocess.PIPE)
-out, err = proc.communicate(source)
+out, err = proc.communicate(source.encode())
+out = out.decode('utf-8')
+err = err.decode('utf-8')
 if err:
 print('FAIL')
 print('Unexpected output on stderr: {}'.format(err),
diff --git a/src/compiler/glsl/tests/sexps.py b/src/compiler/glsl/tests/sexps.py
index a714af8d236..09ca96e3be5 100644
--- a/src/compiler/glsl/tests/sexps.py
+++ b/src/compiler/glsl/tests/sexps.py
@@ -28,6 +28,13 @@
 # as ['constant', 'float', ['1.00']].
 
 import re
+import sys
+if sys.version_info >= (3, 0, 0):
+STRING_TYPE = str
+BYTES_TYPE = bytes
+else:
+STRING_TYPE = unicode
+BYTES_TYPE = str
 
 def check_sexp(sexp):
 """Verify that the argument is a proper sexp.
@@ -39,7 +46,7 @@ def check_sexp(sexp):
 if isinstance(sexp, list):
 for s in sexp:
 check_sexp(s)
-elif not isinstance(sexp, basestring):
+elif not isinstance(sexp, (STRING_TYPE, BYTES_TYPE)):
 raise Exception('Not a sexp: {0!r}'.format(sexp))
 
 def parse_sexp(sexp):
@@ -70,8 +77,10 @@ def sexp_to_string(sexp):
 """Convert a sexp, represented as nested lists containing strings,
 into a single string of the form parseable by mesa.
 """
-if isinstance(sexp, basestring):
+if isinstance(sexp, STRING_TYPE):
 return sexp
+if isinstance(sexp, BYTES_TYPE):
+return sexp.encode('utf-8')
 assert isinstance(sexp, list)
 result = ''
 for s in sexp:
-- 
2.18.0

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


[Mesa-dev] [PATCH v2 2/2] meson: Use python3 to run glsl tests

2018-08-17 Thread Dylan Baker
---
 src/compiler/glsl/tests/meson.build | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index fc7b863a278..2a41e30a28d 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -84,8 +84,10 @@ test(
 )
 
 test(
-  'glsl compiler warnings', find_program('warnings_test.py'),
+  'glsl compiler warnings',
+  prog_python,
   args : [
+join_paths(meson.current_source_dir(), 'warnings_test.py'),
 '--glsl-compiler', glsl_compiler,
 '--test-directory', join_paths(
   meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
@@ -94,6 +96,9 @@ test(
 )
 test(
   'glsl optimization',
-  find_program('optimization_test.py'),
-  args : ['--test-runner', glsl_test],
+  prog_python,
+  args : [
+join_paths(meson.current_source_dir(), 'optimization_test.py'),
+'--test-runner', glsl_test
+  ],
 )
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH 1/2] configure: use AM_PATH_PYTHON to look for the python version

2018-08-17 Thread Dylan Baker
Quoting Emil Velikov (2018-08-17 03:12:56)
> On 16 August 2018 at 21:28, Dylan Baker  wrote:
> > Quoting Eric Engestrom (2018-08-16 09:52:05)
> >> On Thursday, 2018-08-16 17:18:56 +0100, Emil Velikov wrote:
> >> > From: Emil Velikov 
> >> >
> >> > Currently we use AC_CHECK_PROGS looking for python2.7, python2 and
> >> > finally python. That is due to the varying names used across the
> >> > different OS.
> >> >
> >> > Use the handy AM_PATH_PYTHON which finds the correct name and checks for
> >> > the version.
> >> >
> >> > Note: python2.7 has been an unofficial requirement for quite some time.
> >> > Update the docs to reflect that.
> >> >
> >> > Cc: Dylan Baker 
> >> > Signed-off-by: Emil Velikov 
> >> > ---
> >> >  configure.ac  | 7 +--
> >> >  docs/install.html | 2 +-
> >> >  2 files changed, 6 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/configure.ac b/configure.ac
> >> > index c2155a541b0..57fddb927ce 100644
> >> > --- a/configure.ac
> >> > +++ b/configure.ac
> >> > @@ -125,7 +125,10 @@ AC_PROG_GREP
> >> >  AC_PROG_NM
> >> >  AM_PROG_AS
> >> >  AX_CHECK_GNU_MAKE
> >> > -AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
> >> > +AM_PATH_PYTHON([2.7],, [:])
> >> > +PYTHON2=$PYTHON
> >> > +AC_SUBST([PYTHON2])
> >> > +
> >> >  AC_PROG_SED
> >> >  AC_PROG_MKDIR_P
> >> >
> >> > @@ -157,7 +160,7 @@ fi
> >> >
> >> >  AX_CHECK_PYTHON_MAKO_MODULE($PYTHON_MAKO_REQUIRED)
> >> >
> >> > -if test -z "$PYTHON2"; then
> >> > +if test "$PYTHON2" = ":"; then
> >> >  if test ! -f "$srcdir/src/util/format_srgb.c"; then
> >> >  AC_MSG_ERROR([Python not found - unable to generate sources])
> >> >  fi
> >> > diff --git a/docs/install.html b/docs/install.html
> >> > index 08081944cfc..f6094671cf9 100644
> >> > --- a/docs/install.html
> >> > +++ b/docs/install.html
> >> > @@ -72,7 +72,7 @@ you think you've spotted a bug let developers know by 
> >> > filing a
> >> >
> >> >  
> >> >  https://www.python.org/;>Python - Python is required.
> >> > -Version 2.6.4 or later should work.
> >> > +Version 2.7 or later should work.
> >
> > Is this just the autotools build, or is this for all builds? For meson 3.4+ 
> > is
> > required.
> >
> With a 1-2 line change one could use python 2.7 there, not sure if
> that's a good idea though ;-)

For meson I don't think it makes any sense to allow using python 2.7 for the
generators since meson itself requires 3.x; in the same way I don't think it's
worthwhile to allow python 3.x with the current scons build since it requires
2.7

> Since there is no mention about build systems lets leave that as
> follow-up patch?

That seems fine.

> 
> >> >  
> >> >  http://www.makotemplates.org/;>Python Mako module -
> >> >  Python Mako module is required. Version 0.3.4 or later should work.
> >> Side note: I think this is also wrong  ^
> >> Should be 0.8.0 I believe.
> >
> > Yes, it should be 0.8.0, good catch.
> >
> Agreed. Separate patch is out [1] having a correct documentation in
> stable is nice.
> 
> Thanks
> Emil
> 
> [1] https://patchwork.freedesktop.org/patch/244951/


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] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
Quoting Mathieu Bridon (2018-08-16 15:00:39)
> On Thu, 2018-08-16 at 14:21 -0700, Dylan Baker wrote:
> > ---
> > 
> > I didn't see any patches from anyone else, so I wrote some real
> > quick. Please
> > point to them if other patches already exist.
> 
> I was about to send mine, but you were faster. >_<
> 
> They ar every similar though, except that you missed glcpp_test.py,
> which requires a few more changes. (I have them ready, and can send
> them separately)
> 
> > diff --git a/src/compiler/glsl/tests/optimization_test.py
> > b/src/compiler/glsl/tests/optimization_test.py
> > index 577d2dfc20f..f40d0cee6bd 100755
> > --- a/src/compiler/glsl/tests/optimization_test.py
> > +++ b/src/compiler/glsl/tests/optimization_test.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python2
> > +#!/usr/bin/env python
> >  # encoding=utf-8
> >  # Copyright © 2018 Intel Corporation
> >  
> > @@ -71,7 +71,9 @@ def main():
> >  stdout=subprocess.PIPE,
> >  stderr=subprocess.PIPE,
> >  stdin=subprocess.PIPE)
> > -out, err = proc.communicate(source)
> > +out, err = proc.communicate(source.encode())
> > +out = out.decode()
> > +err = err.decode()
> 
> I usually find it too unpredictable to use the default encoding, and
> prefer always specifying 'utf-8'. (even on Python 3, you can't be sure
> that will always be the default)

That's true I guess. I've never seen anyone build python with utf-8 as not the
default, but they can so we should do the right thing.

> 
> > diff --git a/src/compiler/glsl/tests/sexps.py
> > b/src/compiler/glsl/tests/sexps.py
> > index a714af8d236..b69d3a5e5d7 100644
> > --- a/src/compiler/glsl/tests/sexps.py
> > +++ b/src/compiler/glsl/tests/sexps.py
> > @@ -28,6 +28,11 @@
> >  # as ['constant', 'float', ['1.00']].
> >  
> >  import re
> > +import sys
> > +if sys.version_info >= (3, 0, 0):
> > +STRINGS = str
> > +else:
> > +STRINGS = (str, unicode)
> >  
> >  def check_sexp(sexp):
> >  """Verify that the argument is a proper sexp.
> > @@ -39,7 +44,7 @@ def check_sexp(sexp):
> >  if isinstance(sexp, list):
> >  for s in sexp:
> >  check_sexp(s)
> > -elif not isinstance(sexp, basestring):
> > +elif not isinstance(sexp, STRINGS):
> >  raise Exception('Not a sexp: {0!r}'.format(sexp))
> >  
> >  def parse_sexp(sexp):
> > @@ -70,7 +75,7 @@ def sexp_to_string(sexp):
> >  """Convert a sexp, represented as nested lists containing
> > strings,
> >  into a single string of the form parseable by mesa.
> >  """
> > -if isinstance(sexp, basestring):
> > +if isinstance(sexp, STRINGS):
> >  return sexp
> 
> Someone on this list ( :P ) once told me to avoid mising bytes and
> strings.
> 
> In this case, I believe the patch would be better as follows:
> 
> -if isinstance(sexp, basestring):
> +if isinstance(sexp, bytes):
> +return sexp.decode('utf-8')
> +if isinstance(sexp, string_type):
>  return sexp
> 
> And then the previous hunks can be:
> 
> +if sys.version_info < (3, 0):
> +string_type = unicode
> +else:
> +string_type = str
> \u2026
> -elif not isinstance(sexp, basestring):
> +elif not isinstance(sexp, (string_type, bytes)):

Yeah, you're right.

I really want to just remove the s-expression stuff and replace it with json,
since you can represent all s-expressions with json, and then we wouldn't need a
special module in python. But I'll probably never do it, so...

> 
> 
> -- 
> Mathieu
> 


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 2/2] glsl: remove execute bit and shebang from python tests

2018-08-17 Thread Dylan Baker
I don't care one way or the other on this, but it needs to wait for the series I
have to make two of the test cases py 3 ready, and for a patch from Mathieu to
make another py 3 ready.

Just for reference, it is convention (though I don't care to keep it) to use
such a shebang to mark whether a script is python2, python3, or both (using
python is supposed to mean python 2 and 3 compatible.)

You have my r-b, but please wait to push thisfor the other patches to land or
you'll break the meson build and make Mark and Clayton grumpy:
Reviewed-by: Dylan Baker 

Quoting Emil Velikov (2018-08-17 04:11:33)
> From: Emil Velikov 
> 
> Just like the rest of the tree - these should be run either as part of
> the build system check target, or at the very least with an explicitly
> versioned python executable.
> 
> Cc: Dylan Baker 
> Fixes: db8cd8e3677 ("glcpp/tests: Convert shell scripts to a python script")
> Fixes: 97c28cb0823 ("glsl/tests: Convert optimization-test.sh to pure python")
> Fixes: 3b52d292273 ("glsl/tests: reimplement warnings-test in python")
> Signed-off-by: Emil Velikov 
> ---
>  src/compiler/glsl/glcpp/tests/glcpp_test.py  | 1 -
>  src/compiler/glsl/tests/optimization_test.py | 1 -
>  src/compiler/glsl/tests/warnings_test.py | 1 -
>  3 files changed, 3 deletions(-)
>  mode change 100755 => 100644 src/compiler/glsl/glcpp/tests/glcpp_test.py
>  mode change 100755 => 100644 src/compiler/glsl/tests/optimization_test.py
>  mode change 100755 => 100644 src/compiler/glsl/tests/warnings_test.py
> 
> diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py 
> b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> old mode 100755
> new mode 100644
> index 8ac5d7cb0a1..8c7552124a6
> --- a/src/compiler/glsl/glcpp/tests/glcpp_test.py
> +++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> @@ -1,4 +1,3 @@
> -#!/usr/bin/env python2
>  # encoding=utf-8
>  # Copyright © 2018 Intel Corporation
>  
> diff --git a/src/compiler/glsl/tests/optimization_test.py 
> b/src/compiler/glsl/tests/optimization_test.py
> old mode 100755
> new mode 100644
> index 577d2dfc20f..f8518a168e0
> --- a/src/compiler/glsl/tests/optimization_test.py
> +++ b/src/compiler/glsl/tests/optimization_test.py
> @@ -1,4 +1,3 @@
> -#!/usr/bin/env python2
>  # encoding=utf-8
>  # Copyright © 2018 Intel Corporation
>  
> diff --git a/src/compiler/glsl/tests/warnings_test.py 
> b/src/compiler/glsl/tests/warnings_test.py
> old mode 100755
> new mode 100644
> index 2e0f23180f3..2c4fa5a0d5a
> --- a/src/compiler/glsl/tests/warnings_test.py
> +++ b/src/compiler/glsl/tests/warnings_test.py
> @@ -1,4 +1,3 @@
> -#!/usr/bin/env python
>  # encoding=utf-8
>  # Copyright © 2017 Intel Corporation
>  
> -- 
> 2.18.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 1/2] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
Quoting Mathieu Bridon (2018-08-17 11:01:23)
> On Fri, 2018-08-17 at 10:45 -0700, Dylan Baker wrote:
> > Quoting Mathieu Bridon (2018-08-16 15:00:39)
> > > On Thu, 2018-08-16 at 14:21 -0700, Dylan Baker wrote:
> > > > ---
> > > > 
> > > > I didn't see any patches from anyone else, so I wrote some real
> > > > quick. Please
> > > > point to them if other patches already exist.
> > > 
> > > I was about to send mine, but you were faster. >_<
> > > 
> > > They ar every similar though, except that you missed glcpp_test.py,
> > > which requires a few more changes. (I have them ready, and can send
> > > them separately)
> > > 
> > > > diff --git a/src/compiler/glsl/tests/optimization_test.py
> > > > b/src/compiler/glsl/tests/optimization_test.py
> > > > index 577d2dfc20f..f40d0cee6bd 100755
> > > > --- a/src/compiler/glsl/tests/optimization_test.py
> > > > +++ b/src/compiler/glsl/tests/optimization_test.py
> > > > @@ -1,4 +1,4 @@
> > > > -#!/usr/bin/env python2
> > > > +#!/usr/bin/env python
> > > >  # encoding=utf-8
> > > >  # Copyright © 2018 Intel Corporation
> > > >  
> > > > @@ -71,7 +71,9 @@ def main():
> > > >  stdout=subprocess.PIPE,
> > > >  stderr=subprocess.PIPE,
> > > >  stdin=subprocess.PIPE)
> > > > -out, err = proc.communicate(source)
> > > > +out, err = proc.communicate(source.encode())
> > > > +out = out.decode()
> > > > +err = err.decode()
> > > 
> > > I usually find it too unpredictable to use the default encoding,
> > > and
> > > prefer always specifying 'utf-8'. (even on Python 3, you can't be
> > > sure
> > > that will always be the default)
> > 
> > That's true I guess. I've never seen anyone build python with utf-8
> > as not the default, but they can so we should do the right thing.
> 
> That's not a build-time thing though:
> 
>   $ python3 -c 'print("é".encode())'
>   b'\xc3\xa9'
>   $ LC_ALL=C python3 -c 'print("é".encode())'
>   Unable to decode the command from the command line:
>   UnicodeEncodeError: 'utf-8' codec can't encode characters in position 7-8: 
> surrogates not allowed
> 
> This happens regularly in some containers-like environment or SSH-ing
> to a server which doesn't have your client locale.
> 
> 
> -- 
> Mathieu
> 

Ah, I always have some kind of utf-8 encoding on machines I have access to, and
never need containers. I guess that explains why I've never seen that.


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] docs: update required mako version

2018-08-17 Thread Dylan Baker
Reviewed-by: Dylan Baker 

Quoting Emil Velikov (2018-08-16 09:58:53)
> From: Emil Velikov 
> 
> The requirement was bumped a while back, but we forgot to update the
> docs.
> 
> Fixes: ed871af91c2 ("configure.ac: raise Mako required version to
> 0.8.0")
> Cc: Eric Engestrom 
> Signed-off-by: Emil Velikov 
> ---
>  docs/install.html | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/install.html b/docs/install.html
> index f6094671cf9..d3c53d174a3 100644
> --- a/docs/install.html
> +++ b/docs/install.html
> @@ -75,7 +75,7 @@ you think you've spotted a bug let developers know by 
> filing a
>  Version 2.7 or later should work.
>  
>  http://www.makotemplates.org/;>Python Mako module -
> -Python Mako module is required. Version 0.3.4 or later should work.
> +Python Mako module is required. Version 0.8.0 or later should work.
>  
>  lex / yacc - for building the Mesa IR and GLSL compiler.
>  
> -- 
> 2.18.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


[Mesa-dev] [PATCH v3 1/2] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
v2: - explicitly decode the output of subprocesses
- handle bytes and string types consistently rather than relying on
  python 2's coercion for bytes and ignoring them in python 3
v3: - explicitly set encode as well as decode
- python 2.7 and 3.x `bytes` instead of defining an alias
---
 src/compiler/glsl/tests/lower_jump_cases.py  |  2 +-
 src/compiler/glsl/tests/optimization_test.py |  6 --
 src/compiler/glsl/tests/sexps.py | 11 +--
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/compiler/glsl/tests/lower_jump_cases.py 
b/src/compiler/glsl/tests/lower_jump_cases.py
index b50ab734798..1977f3a9b4f 100644
--- a/src/compiler/glsl/tests/lower_jump_cases.py
+++ b/src/compiler/glsl/tests/lower_jump_cases.py
@@ -54,7 +54,7 @@ def make_test_case(f_name, ret_type, body):
 else:
 make_declarations(s, already_declared)
 make_declarations(body)
-return declarations.values() + \
+return list(declarations.values()) + \
 [['function', f_name, ['signature', ret_type, ['parameters'], body]]]
 
 
diff --git a/src/compiler/glsl/tests/optimization_test.py 
b/src/compiler/glsl/tests/optimization_test.py
index 577d2dfc20f..b3147ed08fc 100755
--- a/src/compiler/glsl/tests/optimization_test.py
+++ b/src/compiler/glsl/tests/optimization_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 # encoding=utf-8
 # Copyright © 2018 Intel Corporation
 
@@ -71,7 +71,9 @@ def main():
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
 stdin=subprocess.PIPE)
-out, err = proc.communicate(source)
+out, err = proc.communicate(source.encode('utf-8'))
+out = out.decode('utf-8')
+err = err.decode('utf-8')
 if err:
 print('FAIL')
 print('Unexpected output on stderr: {}'.format(err),
diff --git a/src/compiler/glsl/tests/sexps.py b/src/compiler/glsl/tests/sexps.py
index a714af8d236..7939b42f9a2 100644
--- a/src/compiler/glsl/tests/sexps.py
+++ b/src/compiler/glsl/tests/sexps.py
@@ -28,6 +28,11 @@
 # as ['constant', 'float', ['1.00']].
 
 import re
+import sys
+if sys.version_info >= (3, 0, 0):
+STRING_TYPE = str
+else:
+STRING_TYPE = unicode
 
 def check_sexp(sexp):
 """Verify that the argument is a proper sexp.
@@ -39,7 +44,7 @@ def check_sexp(sexp):
 if isinstance(sexp, list):
 for s in sexp:
 check_sexp(s)
-elif not isinstance(sexp, basestring):
+elif not isinstance(sexp, (STRING_TYPE, bytes)):
 raise Exception('Not a sexp: {0!r}'.format(sexp))
 
 def parse_sexp(sexp):
@@ -70,8 +75,10 @@ def sexp_to_string(sexp):
 """Convert a sexp, represented as nested lists containing strings,
 into a single string of the form parseable by mesa.
 """
-if isinstance(sexp, basestring):
+if isinstance(sexp, STRING_TYPE):
 return sexp
+if isinstance(sexp, bytes):
+return sexp.encode('utf-8')
 assert isinstance(sexp, list)
 result = ''
 for s in sexp:
-- 
2.18.0

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


[Mesa-dev] [PATCH v3 2/2] meson: Use python3 to run glsl tests

2018-08-17 Thread Dylan Baker
---
 src/compiler/glsl/tests/meson.build | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index fc7b863a278..2a41e30a28d 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -84,8 +84,10 @@ test(
 )
 
 test(
-  'glsl compiler warnings', find_program('warnings_test.py'),
+  'glsl compiler warnings',
+  prog_python,
   args : [
+join_paths(meson.current_source_dir(), 'warnings_test.py'),
 '--glsl-compiler', glsl_compiler,
 '--test-directory', join_paths(
   meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
@@ -94,6 +96,9 @@ test(
 )
 test(
   'glsl optimization',
-  find_program('optimization_test.py'),
-  args : ['--test-runner', glsl_test],
+  prog_python,
+  args : [
+join_paths(meson.current_source_dir(), 'optimization_test.py'),
+'--test-runner', glsl_test
+  ],
 )
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH v2 1/2] compiler/glsl/tests: Make tests python3 safe

2018-08-17 Thread Dylan Baker
Quoting Mathieu Bridon (2018-08-17 10:58:38)
> On Fri, 2018-08-17 at 10:51 -0700, Dylan Baker wrote:
> > diff --git a/src/compiler/glsl/tests/optimization_test.py
> > b/src/compiler/glsl/tests/optimization_test.py
> > index 577d2dfc20f..65bac676963 100755
> > --- a/src/compiler/glsl/tests/optimization_test.py
> > +++ b/src/compiler/glsl/tests/optimization_test.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python2
> > +#!/usr/bin/env python
> >  # encoding=utf-8
> >  # Copyright © 2018 Intel Corporation
> >  
> > @@ -71,7 +71,9 @@ def main():
> >  stdout=subprocess.PIPE,
> >  stderr=subprocess.PIPE,
> >  stdin=subprocess.PIPE)
> > -out, err = proc.communicate(source)
> > +out, err = proc.communicate(source.encode())
> > +out = out.decode('utf-8')
> > +err = err.decode('utf-8')
> 
> Shouldn't you also specify the encoding for the source.encode() bit?

Yes

> 
> > diff --git a/src/compiler/glsl/tests/sexps.py
> > b/src/compiler/glsl/tests/sexps.py
> > index a714af8d236..09ca96e3be5 100644
> > --- a/src/compiler/glsl/tests/sexps.py
> > +++ b/src/compiler/glsl/tests/sexps.py
> > @@ -28,6 +28,13 @@
> >  # as ['constant', 'float', ['1.00']].
> >  
> >  import re
> > +import sys
> > +if sys.version_info >= (3, 0, 0):
> > +STRING_TYPE = str
> > +BYTES_TYPE = bytes
> > +else:
> > +STRING_TYPE = unicode
> > +BYTES_TYPE = str
> 
> Note that "bytes" exists on Python 2 and is an alias to "str":
> 
>   >>> bytes
>   
> 
> So you don't actually need BYTES_TYPE at all. :)

Despite all of the projects I've ported I did not know that. :)


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 egl build for surfaceless

2018-08-22 Thread Dylan Baker
Quoting Gurchetan Singh (2018-08-22 16:08:33)
> Without this, I get:
> 
>  > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
>  > #include "loader.h"
>  >  ^~
>  > 1 error generated.
> 
> Fixes: 108d257a16859898f5ce02f4759c5c58f9b8c050 ("meson: build libEGL")
> 
> v2: Split up patches, modify commit message (Dylan)
> ---
>  src/egl/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/egl/meson.build b/src/egl/meson.build
> index c7c22d3637..9c0b6b4b4a 100644
> --- a/src/egl/meson.build
> +++ b/src/egl/meson.build
> @@ -114,6 +114,7 @@ if with_platform_drm
>  endif
>  if with_platform_surfaceless
>files_egl += files('drivers/dri2/platform_surfaceless.c')
> +  incs_for_egl += [inc_loader]
>  endif
>  if with_platform_wayland
>deps_for_egl += [dep_wayland_client, dep_wayland_server, 
> dep_wayland_egl_headers]
> -- 
> 2.16.4
> 

For the series, Reviewed-by: Dylan Baker 

I'll go ahead and push these, thanks for fixing this.

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 v4 46/49] appveyor: use chocolatey (cinst) to install winflexbison

2018-08-23 Thread Dylan Baker
Quoting Jose Fonseca (2018-08-22 11:39:12)
> On 22/08/18 18:05, Dylan Baker wrote:
> > v2: - fix typos in commit message
> > ---
> >   appveyor.yml | 6 +-
> >   1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > diff --git a/appveyor.yml b/appveyor.yml
> > index 15a31da9411..b26a3c624e8 100644
> > --- a/appveyor.yml
> > +++ b/appveyor.yml
> > @@ -34,7 +34,6 @@ branches:
> >   clone_depth: 100
> >   
> >   cache:
> > -- win_flex_bison-2.5.9.zip
> >   - llvm-5.0.1-msvc2015-mtd.7z
> >   - subprojects\packagecache
> >   
> > @@ -46,7 +45,6 @@ init:
> >   - git config --global core.autocrlf true
> >   
> >   environment:
> > -  WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
> > LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
> > matrix:
> >   - BUILD_SYSTEM: meson
> > @@ -72,9 +70,7 @@ install:
> >   - if "%BUILD_SYSTEM%"=="meson" ninja --version
> >   - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft 
> > Visual Studio 14.0\VC\vcvarsall.bat" x86
> >   # Install flex/bison
> > -- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
> > "https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdownloads.sourceforge.net%2Fproject%2Fwinflexbison%2Fold_versions%2F%25WINFLEXBISON_ARCHIVE%25data=02%7C01%7Cjfonseca%40vmware.com%7C075d2af0e3d4415da59f08d6085217c0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636705546029228240sdata=yX%2BTOaizEhvzgHGwArmD4BQcJ54Tr5FCo8H6jFX1DN0%3Dreserved=0;
> > -- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
> > -- set Path=%CD%\winflexbison;%Path%
> > +- cinst -y winflexbison
> >   - win_flex --version
> >   - win_bison --version
> >   # Download and extract LLVM
> > 
> 
> I'm afraid this is a bad idea, because AppVeyor -> SourceForge downloads 
> are not very reliable.
> 
> IIRC, we used to get winflex via cinst, but abandoned because of this.
> 
> Jose

That is very unfortunate, manually downloading and unpacking files and setting
PATH is such a pain compared to a simple cinst. I'll go ahead and drop this
patch.

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 v4 12/49] meson: don't build glx or dri by default on windows

2018-08-23 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-23 10:13:17)
> On Wednesday, 2018-08-22 10:04:35 -0700, Dylan Baker wrote:
> > Signed-off-by: Dylan Baker 
> > Reviewed-by: Eric Anholt 
> > ---
> >  meson.build | 8 ++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 1af610573d5..5102ffe0c7c 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -264,8 +264,12 @@ if with_glx == 'auto'
> >elif with_platform_haiku
> >  with_glx = 'disabled'
> 
> How about simply adding it here, before the with_gallium check?
> 
>   +  elif host_machine.system() == 'windows'
>   +with_glx = 'disabled'
> 
> Otherwise this opens the door to a weird `(gallium + x11 + gl - vk) on
> windows` bug here.

I'm trying to understand the bug, if you build with windows dri you'll get
glx? It seems like then really we should have the first option be "if
with_dri and with_dri_platform == 'drm'" (or should it be "with_dri and not
['windows', 'apple'].contains(with_dri_platform)"?) and instead of simply
with_dri, or am I missing something?

Dylan

> With that:
> Reviewed-by: Eric Engestrom 
> 
> >elif with_gallium
> > -# Even when building just gallium drivers the user probably wants dri
> > -with_glx = 'dri'
> > +if host_machine.system() == 'windows'
> > +  with_glx = 'disabled'
> > +else
> > +  # Even when building just gallium drivers the user probably wants dri
> > +  with_glx = 'dri'
> > +endif
> >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
> > -- 
> > 2.18.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 2/3] configure: allow building with python3

2018-08-24 Thread Dylan Baker
Quoting Emil Velikov (2018-08-24 02:34:04)
> On Fri, 24 Aug 2018 at 04:23, Ilia Mirkin  wrote:
> >
> > This breaks the build for me. It selects python3 instead of python2,
> > and gen_xmlpool.py bails out when trying to print \xf3 to stdout with
> > a LANG=C locale. Revert until scripts are fixed and try again?
> >
> Sure will revert in a moment. The concerning part is why meson "succeeds".
> 
> Having a look if lacks the $(LANGS) argument when invoking gen_xmlpool.py.
> And the .mo and .po files (on which LANGS is based on) are missing all
> together in meson.
> 
> Mathieu, Dylan can you look into this?
> Once the meson build is updated, Ilia's concerns will become more obvious.
> 
> Thanks
> Emil

This (and my dog waking me up at 5 am so she could potty) got me looking into
the translations again. I've sent a series that addresses the lack of
translation handling in meson.

Dylan


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


[Mesa-dev] [PATCH 3/5] meson: add support for generating translation mo files

2018-08-24 Thread Dylan Baker
Meson has handy a handy built-in module for handling gettext called
i18n, this module works a bit differently than our autotools build does,
namely it doesn't automatically generate translations instead it creates
3 new top level targets to run. These are:

xmlpool-pot
xmlpool-update-po
xmlpool-gmo

To use translations from meson you'll want to run:
ninja xmlpool-pot xmlpool-update-po xmlpool-gmo
which will generate the necessary files.
---
 src/util/xmlpool/LINGUAS | 1 +
 src/util/xmlpool/POTFILES| 1 +
 src/util/xmlpool/meson.build | 3 +++
 3 files changed, 5 insertions(+)
 create mode 100644 src/util/xmlpool/LINGUAS
 create mode 100644 src/util/xmlpool/POTFILES

diff --git a/src/util/xmlpool/LINGUAS b/src/util/xmlpool/LINGUAS
new file mode 100644
index 000..3620176519e
--- /dev/null
+++ b/src/util/xmlpool/LINGUAS
@@ -0,0 +1 @@
+ca es de nl sv fr
diff --git a/src/util/xmlpool/POTFILES b/src/util/xmlpool/POTFILES
new file mode 100644
index 000..d68d7009be4
--- /dev/null
+++ b/src/util/xmlpool/POTFILES
@@ -0,0 +1 @@
+src/util/xmlpool/t_options.h
diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
index 3d2de0cdc3a..9696a3d8a81 100644
--- a/src/util/xmlpool/meson.build
+++ b/src/util/xmlpool/meson.build
@@ -29,3 +29,6 @@ xmlpool_options_h = custom_target(
   capture : true,
   depend_files : files('ca.po', 'es.po', 'de.po', 'nl.po', 'sv.po', 'fr.po'),
 )
+
+i18n = import('i18n')
+i18n.gettext('xmlpool')
-- 
2.18.0

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


[Mesa-dev] [PATCH 5/5] meson: use meson generated translation files

2018-08-24 Thread Dylan Baker
This is a change from the current status-quo, namely to get dri-conf
translations you now *must* run the meson generation scripts, even if
you're building from an autotools generated tarball (an official
release).
---
 src/util/xmlpool/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
index 9696a3d8a81..8047f064a3b 100644
--- a/src/util/xmlpool/meson.build
+++ b/src/util/xmlpool/meson.build
@@ -23,7 +23,7 @@ xmlpool_options_h = custom_target(
   input : ['gen_xmlpool.py', 't_options.h'],
   output : 'options.h',
   command : [
-prog_python, '@INPUT@', meson.current_source_dir(),
+prog_python, '@INPUT@', '--meson', meson.current_build_dir(),
 'ca', 'es', 'de', 'nl', 'sv', 'fr',
   ],
   capture : true,
-- 
2.18.0

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


[Mesa-dev] [PATCH 2/5] util/gen_xmlpool: use argparse for argument handling

2018-08-24 Thread Dylan Baker
This is a little cleaner than just looking at sys.argv, but it's also
going to allow us to handle the differences in the way meson and
autotools hand translations more cleanly.
---
 src/util/xmlpool/gen_xmlpool.py | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py
index 56a67bcab55..b40f295738e 100644
--- a/src/util/xmlpool/gen_xmlpool.py
+++ b/src/util/xmlpool/gen_xmlpool.py
@@ -9,25 +9,23 @@
 
 from __future__ import print_function
 
+import argparse
 import io
 import sys
 import gettext
 import re
 
+parser = argparse.ArgumentParser()
+parser.add_argument('template')
+parser.add_argument('localedir')
+parser.add_argument('languages', nargs='*')
+args = parser.parse_args()
 
 if sys.version_info < (3, 0):
 gettext_method = 'ugettext'
 else:
 gettext_method = 'gettext'
 
-# Path to t_options.h
-template_header_path = sys.argv[1]
-
-localedir = sys.argv[2]
-
-# List of supported languages
-languages = sys.argv[3:]
-
 # Escape special characters in C strings
 def escapeCString (s):
 escapeSeqs = {'\a' : '\\a', '\b' : '\\b', '\f' : '\\f', '\n' : '\\n',
@@ -166,9 +164,9 @@ def expandMatches (matches, translations, end=None):
 # Compile a list of translation classes to all supported languages.
 # The first translation is always a NullTranslations.
 translations = [("en", gettext.NullTranslations())]
-for lang in languages:
+for lang in args.languages:
 try:
-trans = gettext.translation ("options", localedir, [lang])
+trans = gettext.translation ("options", args.localedir, [lang])
 except IOError:
 sys.stderr.write ("Warning: language '%s' not found.\n" % lang)
 continue
@@ -188,7 +186,7 @@ 
print("/***\
 
 # Process the options template and generate options.h with all
 # translations.
-template = io.open (template_header_path, mode="rt", encoding='utf-8')
+template = io.open (args.template, mode="rt", encoding='utf-8')
 descMatches = []
 for line in template:
 if len(descMatches) > 0:
-- 
2.18.0

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


[Mesa-dev] [PATCH 0/5] Meson support for gettext translations

2018-08-24 Thread Dylan Baker
This is the last thing I know of that's outstanding for meson (that's not
related to windows). One patch in this series is a fix that needs to go into
18.1 and 18.2.

Dylan Baker (5):
  meson: Actually load translation files
  util/gen_xmlpool: use argparse for argument handling
  meson: add support for generating translation mo files
  util/gen_xmlpool: Add a --meson switch
  meson: use meson generated translation files

 src/util/xmlpool/LINGUAS|  1 +
 src/util/xmlpool/POTFILES   |  1 +
 src/util/xmlpool/gen_xmlpool.py | 33 +++--
 src/util/xmlpool/meson.build|  8 +++-
 4 files changed, 28 insertions(+), 15 deletions(-)
 create mode 100644 src/util/xmlpool/LINGUAS
 create mode 100644 src/util/xmlpool/POTFILES

-- 
2.18.0

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


[Mesa-dev] [PATCH 4/5] util/gen_xmlpool: Add a --meson switch

2018-08-24 Thread Dylan Baker
Meson won't put the .gmo files in the layout that python's
gettext.translation() expects, so we need to handle them differently,
this switch allows the script to load the files as meson lays them out
---
 src/util/xmlpool/gen_xmlpool.py | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py
index b40f295738e..59d7a9bb84d 100644
--- a/src/util/xmlpool/gen_xmlpool.py
+++ b/src/util/xmlpool/gen_xmlpool.py
@@ -8,17 +8,18 @@
 #
 
 from __future__ import print_function
-
 import argparse
-import io
-import sys
 import gettext
+import io
+import os
 import re
+import sys
 
 parser = argparse.ArgumentParser()
 parser.add_argument('template')
 parser.add_argument('localedir')
 parser.add_argument('languages', nargs='*')
+parser.add_argument('--meson', action='store_true')
 args = parser.parse_args()
 
 if sys.version_info < (3, 0):
@@ -166,8 +167,14 @@ def expandMatches (matches, translations, end=None):
 translations = [("en", gettext.NullTranslations())]
 for lang in args.languages:
 try:
-trans = gettext.translation ("options", args.localedir, [lang])
+if args.meson:
+filename = os.path.join(args.localedir, '{}.gmo'.format(lang))
+with io.open(filename, 'rb') as f:
+trans = gettext.GNUTranslations(f)
+else:
+trans = gettext.translation ("options", args.localedir, [lang])
 except IOError:
+raise
 sys.stderr.write ("Warning: language '%s' not found.\n" % lang)
 continue
 translations.append ((lang, trans))
-- 
2.18.0

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


[Mesa-dev] [PATCH 1/5] meson: Actually load translation files

2018-08-24 Thread Dylan Baker
Currently we run the script but don't actually load any files, even in a
tarball where they exist.

Fixes: 3218056e0eb375eeda470058d06add1532acd6d4
   ("meson: Build i965 and dri stack")
---
 src/util/xmlpool/meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
index 346b1956a55..3d2de0cdc3a 100644
--- a/src/util/xmlpool/meson.build
+++ b/src/util/xmlpool/meson.build
@@ -22,7 +22,10 @@ xmlpool_options_h = custom_target(
   'xmlpool_options.h',
   input : ['gen_xmlpool.py', 't_options.h'],
   output : 'options.h',
-  command : [prog_python, '@INPUT@', meson.current_source_dir()],
+  command : [
+prog_python, '@INPUT@', meson.current_source_dir(),
+'ca', 'es', 'de', 'nl', 'sv', 'fr',
+  ],
   capture : true,
   depend_files : files('ca.po', 'es.po', 'de.po', 'nl.po', 'sv.po', 'fr.po'),
 )
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH 2/3] configure: allow building with python3

2018-08-24 Thread Dylan Baker
Quoting Emil Velikov (2018-08-24 02:34:04)
> On Fri, 24 Aug 2018 at 04:23, Ilia Mirkin  wrote:
> >
> > This breaks the build for me. It selects python3 instead of python2,
> > and gen_xmlpool.py bails out when trying to print \xf3 to stdout with
> > a LANG=C locale. Revert until scripts are fixed and try again?
> >
> Sure will revert in a moment. The concerning part is why meson "succeeds".
> 
> Having a look if lacks the $(LANGS) argument when invoking gen_xmlpool.py.
> And the .mo and .po files (on which LANGS is based on) are missing all
> together in meson.
> 
> Mathieu, Dylan can you look into this?
> Once the meson build is updated, Ilia's concerns will become more obvious.

Meson has built-ins for handling gettext, but I haven't wired them up yet. They
work somewhat differently than the way mesa does (they're a separate build step
you run before building the 'all' target). If you're building from a release
tarball meson will pick up the ones generated by autotools for the tarball.

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 4/5] util/gen_xmlpool: Add a --meson switch

2018-08-24 Thread Dylan Baker
Quoting Emil Velikov (2018-08-24 08:57:29)
> On Fri, 24 Aug 2018 at 15:16, Dylan Baker  wrote:
> >
> > Meson won't put the .gmo files in the layout that python's
> > gettext.translation() expects, so we need to handle them differently,
> > this switch allows the script to load the files as meson lays them out
> 
> No obvious reason comes to mind why we want divergence here.
> Can you elaborate more what's happening here - what are the .gmo
> files, I though we're using .mo ones?

Meson uses .gmo to distinguish that they are specifics GNU mo files, as opposed
to one of the other flaovrs like the solaris mo files, which use a completely
different syntax. The real difference is that autotools generates a folder
hierarchy to place the .mo (or .gmo) files in, but meson doesn't guarantee
folder structures in the build directory, so mimicking the autotools behavior
isn't guaranteed to work or continue working.

> 
> If the only difference is a) extension and b) .mo file location - we
> could update the autoconf/others to follow the same pattern.

We certainly could change autotools to follow the same pattern if that's what
you wanted to do. I just don't have the expertise with autotools to do it
quickly, and I wanted to get something wired for meson.

Dylan


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


[Mesa-dev] [ANNOUNCE] mesa 18.1.7

2018-08-24 Thread Dylan Baker
Hi List,

Mesa 18.1.7 is now available for general consumption. This release has been
rather small compared to the last few release, There's just a handful of fixes
in total. Meson, radv, anv, gallium winsys, intel, i965, and r600 were the only
recipients of fixs this go around.

Dylan


git tag: mesa-18.1.7

https://mesa.freedesktop.org/archive/mesa-18.1.7.tar.gz
MD5:  0b0131b708b3e3b7ebb26c753dd59add  mesa-18.1.7.tar.gz
SHA1: ea94c9dd6db2e2deb7113b55ceb2569f0b69d2c4  mesa-18.1.7.tar.gz
SHA256: 0c3c240bcd1352d179e65993214f9d55a399beac852c3ab4433e8df9b6c51c83  
mesa-18.1.7.tar.gz
SHA512: 
6b6cd912ad3fd44ea213df5ff245378a105a5d942fcda374e4d755b3b77a43712dbe732cdfedb539ed687adcf9904468b68f3e29766cc7880583c0c46cdf8f6e
  mesa-18.1.7.tar.gz
PGP:  https://mesa.freedesktop.org/archive/mesa-18.1.7.tar.gz.sig

https://mesa.freedesktop.org/archive/mesa-18.1.7.tar.xz
MD5:  17d8a7e7ecbe146a7dc439e8b6eb02e9  mesa-18.1.7.tar.xz
SHA1: 8f86e16a1c03665e55bc284c0e4a5b0a953bcadc  mesa-18.1.7.tar.xz
SHA256: 655e3b32ce3b5e6e8768596e5d4bdef82d0dd37067c324cc4b2daa207306  
mesa-18.1.7.tar.xz
SHA512: 
697c4f441ae52bc867d9d73b103094a29102168c248a502c4ea0fc48f51bcb86b2e741da39e882f24131326d460cdb1416415604c6994d1b8c09fb8a153a5c77
  mesa-18.1.7.tar.xz
PGP:  https://mesa.freedesktop.org/archive/mesa-18.1.7.tar.xz.sig



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 2/3] configure: allow building with python3

2018-08-24 Thread Dylan Baker
Can we just change the script to write a file instead of sending it's output
through the shell? That should fix any encoding problems since the shell wont
touch it and the LANG settings (no matter what they are) shouldn't matter.

Dylan

Quoting Mathieu Bridon (2018-08-24 07:58:21)
> Hi,
> 
> On Thu, 2018-08-23 at 23:23 -0400, Ilia Mirkin wrote:
> > This breaks the build for me. It selects python3 instead of python2,
> > and gen_xmlpool.py bails out when trying to print \xf3 to stdout with
> > a LANG=C locale.
> 
> In general though, Python 3 works very badly with LANG=C. Upstream
> Python recommends just not using LANG=C at all, and instead using a
> UTF8 locale, like C.UTF-8 instead.
> 
> In fact, starting with 3.7, Python will emit a big warning when it is
> run on a non-UTF8 locale, and try to fallback to C.UTF-8 if it can.
> 
> There might be something to fix in this case (I haven't had time to
> look at it yet), but I'd still advise you try and use a UTF8 locale
> when running Python scripts in the future, if at all possible.
> 
> 
> -- 
> Mathieu
> 
> ___
> 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 2/2] meson: Enable readeon vulkan driver on arm, aarch64

2018-08-26 Thread Dylan Baker
Quoting Guido Günther (2018-08-24 05:22:06)
> This is similar to what the Debian package does so it looks like a sane
> default.
> 
> Signed-off-by: Guido Günther 
> ---
>  meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index ccc0ed6a0ea..bf8f0770915 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -179,6 +179,8 @@ if _vulkan_drivers.contains('auto')
>if system_has_kms_drm
>  if host_machine.cpu_family().startswith('x86')
>_vulkan_drivers = ['amd', 'intel']
> +elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
> +  _vulkan_drivers = ['amd']

This seems odd to me since we don't build either r600 or radeonsi for arm.

Dylan

>  else
>error('Unknown architecture @0@. Please pass -Dvulkan-drivers to set 
> driver options. Patches gladly accepted to fix this.'.format(
>  host_machine.cpu_family()))
> -- 
> 2.18.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 1/5] meson: Actually load translation files

2018-08-28 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-28 07:34:26)
> On Friday, 2018-08-24 07:13:41 -0700, Dylan Baker wrote:
> > Currently we run the script but don't actually load any files, even in a
> > tarball where they exist.
> > 
> > Fixes: 3218056e0eb375eeda470058d06add1532acd6d4
> >("meson: Build i965 and dri stack")
> > ---
> >  src/util/xmlpool/meson.build | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
> > index 346b1956a55..3d2de0cdc3a 100644
> > --- a/src/util/xmlpool/meson.build
> > +++ b/src/util/xmlpool/meson.build
> > @@ -22,7 +22,10 @@ xmlpool_options_h = custom_target(
> >'xmlpool_options.h',
> >input : ['gen_xmlpool.py', 't_options.h'],
> >output : 'options.h',
> > -  command : [prog_python, '@INPUT@', meson.current_source_dir()],
> > +  command : [
> > +prog_python, '@INPUT@', meson.current_source_dir(),
> > +'ca', 'es', 'de', 'nl', 'sv', 'fr',
> > +  ],
> >capture : true,
> >depend_files : files('ca.po', 'es.po', 'de.po', 'nl.po', 'sv.po', 
> > 'fr.po'),
> 
> Nit: I would put that lang list in an array and reuse it to generate the list
> of `depend_files` here, to keep it in sync, but that can be a follow up
> patch (happy to do it).

Let's follow up on that, since I'd like to have this for 18.1.7 so that
translations actually work in the 18.1 series :)

> 
> Reviewed-by: Eric Engestrom 

Thanks!

> 
> >  )
> > -- 
> > 2.18.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] [Mesa-stable] [PATCH] intel: decoder: unify MI_BB_START field naming

2018-08-28 Thread Dylan Baker
Quoting Lionel Landwerlin (2018-08-28 02:39:58)
> Yes, I think so. You asked on another commit too, both are related and 
> this depends on other commits from Jason.
> 
> Here is a list in order of cherry picking :
> 
> commit f430a37fa75f534c3a114b0ec546fa14f05f5da1
> Author: Lionel Landwerlin 
> Date:   Tue Aug 14 11:22:12 2018 +0100
> 
>      intel: decoder: unify MI_BB_START field naming
> 
> commit 2abd7ae189135eb5a1f530a3a1c9412d3a7e238d
> Author: Jason Ekstrand 
> Date:   Fri Aug 24 15:23:04 2018 -0500
> 
>      intel/decoder: Clean up field iteration and fix sub-dword fields
> 
> commit cbd4bc1346f7397242e157bb66099b950a8c5643
> Author: Jason Ekstrand 
> Date:   Fri Aug 24 16:04:03 2018 -0500
> 
>      intel/batch_decoder: Fix dynamic state printing
> 
> commit 70de31d0c106f58d6b7e6d5b79b8d90c1c112a3b
> Author: Jason Ekstrand 
> Date:   Fri Aug 24 16:05:08 2018 -0500
> 
>      intel/batch_decoder: Print blend states properly
> 
> 
> commit 440a988bd1478bb33dafcbb8575473bc643ae383
> Author: Lionel Landwerlin 
> Date:   Sat Aug 25 18:22:00 2018 +0100
> 
>      intel: decoder: handle 0 sized structs
> 
> Thanks,
> 
> -
> Lionel
> 
> On 27/08/2018 22:20, Andres Gomez wrote:
> > Lionel, should we also include this in the stable queues ?
> >
> > On Tue, 2018-08-14 at 11:26 +0100, Lionel Landwerlin wrote:
> >> The batch decoder looks for a field with a particular name to decide
> >> whether an MI_BB_START leads into a second batch buffer level. Because
> >> the names are different between Gen7.5/8 and the newer generation we
> >> fail that test and keep on reading (invalid) instructions.
> >>
> >> Signed-off-by: Lionel Landwerlin 
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107544
> >> ---
> >>   src/intel/genxml/gen75.xml | 6 +++---
> >>   src/intel/genxml/gen8.xml  | 6 +++---
> >>   src/intel/vulkan/anv_batch_chain.c | 2 +-
> >>   3 files changed, 7 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/src/intel/genxml/gen75.xml b/src/intel/genxml/gen75.xml
> >> index 5b01fd45400..dfc3d891498 100644
> >> --- a/src/intel/genxml/gen75.xml
> >> +++ b/src/intel/genxml/gen75.xml
> >> @@ -2314,9 +2314,9 @@
> >> 
> >>>> default="0"/>
> >>>> default="49"/>
> >> -
> >> -  
> >> -  
> >> + >> type="uint">
> >> +  
> >> +  
> >>   
> >>   
> >>   
> >> diff --git a/src/intel/genxml/gen8.xml b/src/intel/genxml/gen8.xml
> >> index 4ed41d15612..330366b7ed0 100644
> >> --- a/src/intel/genxml/gen8.xml
> >> +++ b/src/intel/genxml/gen8.xml
> >> @@ -2553,9 +2553,9 @@
> >> 
> >>>> default="0"/>
> >>>> default="49"/>
> >> -
> >> -  
> >> -  
> >> + >> type="uint">
> >> +  
> >> +  
> >>   
> >>   
> >>   
> >> diff --git a/src/intel/vulkan/anv_batch_chain.c 
> >> b/src/intel/vulkan/anv_batch_chain.c
> >> index c47a81c8a4d..0f7c8325ea4 100644
> >> --- a/src/intel/vulkan/anv_batch_chain.c
> >> +++ b/src/intel/vulkan/anv_batch_chain.c
> >> @@ -531,7 +531,7 @@ emit_batch_buffer_start(struct anv_cmd_buffer 
> >> *cmd_buffer,
> >>  anv_batch_emit(_buffer->batch, GEN8_MI_BATCH_BUFFER_START, bbs) {
> >> bbs.DWordLength   = cmd_buffer->device->info.gen < 8 ?
> >> gen7_length : gen8_length;
> >> -  bbs._2ndLevelBatchBuffer  = _1stlevelbatch;
> >> +  bbs.SecondLevelBatchBuffer= Firstlevelbatch;
> >> bbs.AddressSpaceIndicator = ASI_PPGTT;
> >> bbs.BatchBufferStartAddress   = (struct anv_address) { bo, offset 
> >> };
> >>  }

Hi Lionel,

Only patches 1 and 3 of that list apply cleanly to the 18.1 branch, it looks
like maybe I need a few more patches for things to apply cleanly?

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] meson: consolidate langs lists

2018-08-28 Thread Dylan Baker
Quoting Eric Engestrom (2018-08-28 09:18:09)
> Signed-off-by: Eric Engestrom 
> ---
>  src/util/xmlpool/meson.build | 12 +---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/util/xmlpool/meson.build b/src/util/xmlpool/meson.build
> index 3d2de0cdc3a5fc45d1e4..8bdabcb825b776d06182 100644
> --- a/src/util/xmlpool/meson.build
> +++ b/src/util/xmlpool/meson.build
> @@ -18,14 +18,20 @@
>  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
>  # SOFTWARE.
>  
> +_langs = ['ca', 'es', 'de', 'nl', 'sv', 'fr']
> +
> +_langs_po_files = []
> +foreach lang : _langs
> +  _langs_po_files += files(lang + '.po')
> +endforeach
> +
>  xmlpool_options_h = custom_target(
>'xmlpool_options.h',
>input : ['gen_xmlpool.py', 't_options.h'],
>output : 'options.h',
>command : [
> -prog_python, '@INPUT@', meson.current_source_dir(),
> -'ca', 'es', 'de', 'nl', 'sv', 'fr',
> +prog_python, '@INPUT@', meson.current_source_dir(), _langs,
>],
>capture : true,
> -  depend_files : files('ca.po', 'es.po', 'de.po', 'nl.po', 'sv.po', 'fr.po'),
> +  depend_files : _langs_po_files,
>  )
> -- 
> Cheers,
>   Eric
> 

Reviewed-by: Dylan Baker 


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/3] python: difflib prefers unicode strings

2018-08-17 Thread Dylan Baker
for the series:
Reviewed-by: Dylan Baker 

Quoting Mathieu Bridon (2018-08-17 12:32:16)
> Python 3 does not automatically convert from bytes to unicode strings
> like Python 2 used to do.
> 
> This commit makes sure we pass unicode strings to difflib.unified_diff,
> so that the script works on both Python 2 and 3.
> ---
>  src/compiler/glsl/glcpp/tests/glcpp_test.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py 
> b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> index 8ac5d7cb0a1..e27391093cf 100755
> --- a/src/compiler/glsl/glcpp/tests/glcpp_test.py
> +++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py
> @@ -64,8 +64,9 @@ def test_output(glcpp, filename, expfile, nl_format='\n'):
>  stderr=subprocess.STDOUT,
>  stdin=subprocess.PIPE)
>  actual, _ = proc.communicate(f.read())
> +actual = actual.decode('utf-8')
>  
> -with open(expfile, 'rb') as f:
> +with open(expfile, 'r') as f:
>  expected = f.read()
>  
>  if actual == expected:
> -- 
> 2.17.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 3/3] meson: Run the test with Python 3

2018-08-17 Thread Dylan Baker
Quoting Mathieu Bridon (2018-08-17 12:32:18)
> ---
>  src/compiler/glsl/glcpp/meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/glcpp/meson.build 
> b/src/compiler/glsl/glcpp/meson.build
> index 09d44ddd687..769406f5331 100644
> --- a/src/compiler/glsl/glcpp/meson.build
> +++ b/src/compiler/glsl/glcpp/meson.build
> @@ -64,8 +64,9 @@ if with_tests
>foreach m : modes
>  test(
>'glcpp test (@0@)'.format(m),
> -  find_program('tests/glcpp_test.py'),
> +  prog_python,
>args : [
> +join_paths(meson.current_source_dir(), 'tests/glcpp_test.py'),
>  glcpp, join_paths(meson.current_source_dir(), 'tests'),
>  '--@0@'.format(m),
>],
> -- 
> 2.17.1
> 

Is it okay with you if I just squash this patch and the one in my series into a
single patch?

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 v4 12/49] meson: don't build glx or dri by default on windows

2018-08-27 Thread Dylan Baker
Quoting Dylan Baker (2018-08-23 10:27:17)
> Quoting Eric Engestrom (2018-08-23 10:13:17)
> > On Wednesday, 2018-08-22 10:04:35 -0700, Dylan Baker wrote:
> > > Signed-off-by: Dylan Baker 
> > > Reviewed-by: Eric Anholt 
> > > ---
> > >  meson.build | 8 ++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 1af610573d5..5102ffe0c7c 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -264,8 +264,12 @@ if with_glx == 'auto'
> > >elif with_platform_haiku
> > >  with_glx = 'disabled'
> > 
> > How about simply adding it here, before the with_gallium check?
> > 
> >   +  elif host_machine.system() == 'windows'
> >   +with_glx = 'disabled'
> > 
> > Otherwise this opens the door to a weird `(gallium + x11 + gl - vk) on
> > windows` bug here.
> 
> I'm trying to understand the bug, if you build with windows dri you'll get
> glx? It seems like then really we should have the first option be "if
> with_dri and with_dri_platform == 'drm'" (or should it be "with_dri and not
> ['windows', 'apple'].contains(with_dri_platform)"?) and instead of simply
> with_dri, or am I missing something?
> 
> Dylan

ping?

> 
> > With that:
> > Reviewed-by: Eric Engestrom 
> > 
> > >elif with_gallium
> > > -# Even when building just gallium drivers the user probably wants dri
> > > -with_glx = 'dri'
> > > +if host_machine.system() == 'windows'
> > > +  with_glx = 'disabled'
> > > +else
> > > +  # Even when building just gallium drivers the user probably wants 
> > > dri
> > > +  with_glx = 'dri'
> > > +endif
> > >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
> > > -- 
> > > 2.18.0
> > > 
> > > ___
> > > 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


Re: [Mesa-dev] [PATCH 1/2] meson: Be a bit more helpful when arch or OS is unknown

2018-08-27 Thread Dylan Baker
Quoting Guido Günther (2018-08-27 09:32:54)
> Hi,
> On Mon, Aug 27, 2018 at 09:23:44AM -0700, Dylan Baker wrote:
> > Quoting Guido Günther (2018-08-26 13:23:59)
> > > V2: Add one missing @0@
> > > 
> > > Signed-off-by: Guido Günther 
> > > ---
> > >  meson.build | 21 ++---
> > >  1 file changed, 14 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/meson.build b/meson.build
> > > index 1b3dfa221c9..c3a7e8cdd74 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -102,13 +102,15 @@ if _drivers.contains('auto')
> > >  elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
> > >_drivers = []
> > >  else
> > > -  error('Unknown architecture. Please pass -Ddri-drivers to set 
> > > driver options. Patches gladly accepted to fix this.')
> > > +  error('Unknown architecture @0@. Please pass -Ddri-drivers to set 
> > > driver options. Patches gladly accepted to fix this.'.format(
> > > +host_machine.cpu_family()))
> > >  endif
> > >elif ['darwin', 'windows', 'cygwin', 
> > > 'haiku'].contains(host_machine.system())
> > >  # only swrast would make sense here, but gallium swrast is a much 
> > > better default
> > >  _drivers = []
> > >else
> > > -error('Unknown OS. Please pass -Ddri-drivers to set driver options. 
> > > Patches gladly accepted to fix this.')
> > > +error('Unknown OS @0@. Please pass -Ddri-drivers to set driver 
> > > options. Patches gladly accepted to fix this.'.format(
> > > +  host_machine.system()))
> > >endif
> > >  endif
> > >  
> > > @@ -135,12 +137,14 @@ if _drivers.contains('auto')
> > >  'tegra', 'virgl', 'swrast',
> > >]
> > >  else
> > > -  error('Unknown architecture. Please pass -Dgallium-drivers to set 
> > > driver options. Patches gladly accepted to fix this.')
> > > +  error('Unknown architecture @0@. Please pass -Dgallium-drivers to 
> > > set driver options. Patches gladly accepted to fix this.'.format(
> > > +host_machine.cpu_family()))
> > >  endif
> > >elif ['darwin', 'windows', 'cygwin', 
> > > 'haiku'].contains(host_machine.system())
> > >  _drivers = ['swrast']
> > >else
> > > -error('Unknown OS. Please pass -Dgallium-drivers to set driver 
> > > options. Patches gladly accepted to fix this.')
> > > +error('Unknown OS @0@. Please pass -Dgallium-drivers to set driver 
> > > options. Patches gladly accepted to fix this.'.format(
> > > +  host_machine.system()))
> > >endif
> > >  endif
> > >  with_gallium_pl111 = _drivers.contains('pl111')
> > > @@ -176,13 +180,15 @@ if _vulkan_drivers.contains('auto')
> > >  if host_machine.cpu_family().startswith('x86')
> > >_vulkan_drivers = ['amd', 'intel']
> > >  else
> > > -  error('Unknown architecture. Please pass -Dvulkan-drivers to set 
> > > driver options. Patches gladly accepted to fix this.')
> > > +  error('Unknown architecture @0@. Please pass -Dvulkan-drivers to 
> > > set driver options. Patches gladly accepted to fix this.'.format(
> > > +host_machine.cpu_family()))
> > >  endif
> > >elif ['darwin', 'windows', 'cygwin', 
> > > 'haiku'].contains(host_machine.system())
> > >  # No vulkan driver supports windows or macOS currently
> > >  _vulkan_drivers = []
> > >else
> > > -error('Unknown OS. Please pass -Dvulkan-drivers to set driver 
> > > options. Patches gladly accepted to fix this.')
> > > +error('Unknown OS @0@. Please pass -Dvulkan-drivers to set driver 
> > > options. Patches gladly accepted to fix this.'.format(
> > > +  host_machine.system()))
> > >endif
> > >  endif
> > >  
> > > @@ -230,7 +236,8 @@ if _platforms.contains('auto')
> > >elif ['haiku'].contains(host_machine.system())
> > >  _platforms = ['haiku']
> > >else
> > > -error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
> > > gladly accepted to fix this.')
> > > +error('Unknown OS @0@. Please pass -Dplatforms to set platforms. 
> > > Patches gladly accepted to fix this.'.format(
> > > +  host_machine.system()))
> > >endif
> > >  endif
> > >  
> > > -- 
> > > 2.18.0
> > > 
> > 
> > for the series,
> > Reviewed-by: Dylan Baker 
> 
> Thanks!
> 
> > 
> > Do you need me to push these for you?
> 
> Yes, please.
>  -- Guido
> 

Pushed. Thanks for this!


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/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Dylan Baker
Quoting Kai Wasserbäch (2018-08-22 14:23:07)
> Hey Mariusz,
> Mariusz Ceier wrote on 8/22/18 10:16 PM:
> > Without this patch mesa doesn't compile:
> > 
> > In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
> > ../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such 
> > file or directory
> >  #include "c99_compat.h"
> >   ^~
> > compilation terminated.
> > 
> > Signed-off-by: Mariusz Ceier 
> 
> please add:
>  Fixes 15ca5ce99a (amd/addrlib: mark returnCode as MAYBE_UNUSED in)
> and you can have my
>  Acked-by: Kai Wasserbäch 
> 
> No R-b from me, because I have never used meson to build Mesa and don't plan 
> to
> do so before Debian's packaging switches to it.
> 
> Cheers,
> Kai

I've added the relevant Fixes and a-b tag, plus my r-b and pushed.

Reviewed-by: Dylan Baker 

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 v3 1/2] compiler/glsl/tests: Make tests python3 safe

2018-08-22 Thread Dylan Baker
Thanks! I was going to push these today if someone didn't give me an r-b, but I
wanted to give people proper time.

Dylan

Quoting Mathieu Bridon (2018-08-22 07:35:39)
> I just learned I was supposed to send this :)
> 
> Reviewed-by: Mathieu Bridon 
> 
> On Fri, 2018-08-17 at 11:07 -0700, Dylan Baker wrote:
> > v2: - explicitly decode the output of subprocesses
> > - handle bytes and string types consistently rather than relying
> > on
> >   python 2's coercion for bytes and ignoring them in python 3
> > v3: - explicitly set encode as well as decode
> > - python 2.7 and 3.x `bytes` instead of defining an alias
> > ---
> >  src/compiler/glsl/tests/lower_jump_cases.py  |  2 +-
> >  src/compiler/glsl/tests/optimization_test.py |  6 --
> >  src/compiler/glsl/tests/sexps.py | 11 +--
> >  3 files changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/src/compiler/glsl/tests/lower_jump_cases.py
> > b/src/compiler/glsl/tests/lower_jump_cases.py
> > index b50ab734798..1977f3a9b4f 100644
> > --- a/src/compiler/glsl/tests/lower_jump_cases.py
> > +++ b/src/compiler/glsl/tests/lower_jump_cases.py
> > @@ -54,7 +54,7 @@ def make_test_case(f_name, ret_type, body):
> >  else:
> >  make_declarations(s, already_declared)
> >  make_declarations(body)
> > -return declarations.values() + \
> > +return list(declarations.values()) + \
> >  [['function', f_name, ['signature', ret_type,
> > ['parameters'], body]]]
> >  
> >  
> > diff --git a/src/compiler/glsl/tests/optimization_test.py
> > b/src/compiler/glsl/tests/optimization_test.py
> > index 577d2dfc20f..b3147ed08fc 100755
> > --- a/src/compiler/glsl/tests/optimization_test.py
> > +++ b/src/compiler/glsl/tests/optimization_test.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python2
> > +#!/usr/bin/env python
> >  # encoding=utf-8
> >  # Copyright © 2018 Intel Corporation
> >  
> > @@ -71,7 +71,9 @@ def main():
> >  stdout=subprocess.PIPE,
> >  stderr=subprocess.PIPE,
> >  stdin=subprocess.PIPE)
> > -out, err = proc.communicate(source)
> > +out, err = proc.communicate(source.encode('utf-8'))
> > +out = out.decode('utf-8')
> > +err = err.decode('utf-8')
> >  if err:
> >  print('FAIL')
> >  print('Unexpected output on stderr: {}'.format(err),
> > diff --git a/src/compiler/glsl/tests/sexps.py
> > b/src/compiler/glsl/tests/sexps.py
> > index a714af8d236..7939b42f9a2 100644
> > --- a/src/compiler/glsl/tests/sexps.py
> > +++ b/src/compiler/glsl/tests/sexps.py
> > @@ -28,6 +28,11 @@
> >  # as ['constant', 'float', ['1.00']].
> >  
> >  import re
> > +import sys
> > +if sys.version_info >= (3, 0, 0):
> > +STRING_TYPE = str
> > +else:
> > +STRING_TYPE = unicode
> >  
> >  def check_sexp(sexp):
> >  """Verify that the argument is a proper sexp.
> > @@ -39,7 +44,7 @@ def check_sexp(sexp):
> >  if isinstance(sexp, list):
> >  for s in sexp:
> >  check_sexp(s)
> > -elif not isinstance(sexp, basestring):
> > +elif not isinstance(sexp, (STRING_TYPE, bytes)):
> >  raise Exception('Not a sexp: {0!r}'.format(sexp))
> >  
> >  def parse_sexp(sexp):
> > @@ -70,8 +75,10 @@ def sexp_to_string(sexp):
> >  """Convert a sexp, represented as nested lists containing
> > strings,
> >  into a single string of the form parseable by mesa.
> >  """
> > -if isinstance(sexp, basestring):
> > +if isinstance(sexp, STRING_TYPE):
> >  return sexp
> > +if isinstance(sexp, bytes):
> > +return sexp.encode('utf-8')
> >  assert isinstance(sexp, list)
> >  result = ''
> >  for s in sexp:
> 


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 43/49] tests/vma: fix build with MSVC

2018-08-22 Thread Dylan Baker
---
 src/util/tests/vma/vma_random_test.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/util/tests/vma/vma_random_test.cpp 
b/src/util/tests/vma/vma_random_test.cpp
index 1f194fcdf92..9246176cbf2 100644
--- a/src/util/tests/vma/vma_random_test.cpp
+++ b/src/util/tests/vma/vma_random_test.cpp
@@ -34,7 +34,15 @@
 #include 
 #include 
 
+#ifndef _WIN32
 #include 
+#else
+#define errx(code, msg, ...) \
+   do {  \
+  fprintf(stderr, msg, __VA_ARGS__); \
+  exit(code);\
+   } while (0);
+#endif
 
 #include "vma.h"
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 18/49] meson: build gallium gdi winsys

2018-08-22 Thread Dylan Baker
Reviewed-by: Eric Anholt 
---
 src/gallium/meson.build   |  6 ++
 src/gallium/winsys/sw/gdi/meson.build | 27 +++
 2 files changed, 33 insertions(+)
 create mode 100644 src/gallium/winsys/sw/gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 561af9d339c..7754dbdee3c 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -21,6 +21,7 @@
 
 inc_gallium_drivers = include_directories('drivers')
 inc_gallium_winsys = include_directories('winsys')
+inc_gallium_winsys_sw = include_directories('winsys/sw')
 
 subdir('auxiliary')
 subdir('auxiliary/pipe-loader')
@@ -35,6 +36,11 @@ if with_gallium_drisw_kms
 else
   libswkmsdri = []
 endif
+if with_platform_windows
+  subdir('winsys/sw/gdi')
+else
+  libwsgdi = []
+endif
 subdir('winsys/sw/wrapper')
 if with_platform_haiku
   subdir('winsys/sw/hgl')
diff --git a/src/gallium/winsys/sw/gdi/meson.build 
b/src/gallium/winsys/sw/gdi/meson.build
new file mode 100644
index 000..ac6c7cf0aa2
--- /dev/null
+++ b/src/gallium/winsys/sw/gdi/meson.build
@@ -0,0 +1,27 @@
+# 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.
+
+libwsgdi = static_library(
+  'wsgdi',
+  'gdi_sw_winsys.c',
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+  ],
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 11/49] meson: Add a platform for windows

2018-08-22 Thread Dylan Baker
This mirrors the haiku build which uses a platform.

v2: - Fix some rebase problems

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build   | 8 ++--
 meson_options.txt | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index a5cb5be226c..1af610573d5 100644
--- a/meson.build
+++ b/meson.build
@@ -225,10 +225,12 @@ _platforms = get_option('platforms')
 if _platforms.contains('auto')
   if system_has_kms_drm
 _platforms = ['x11', 'wayland', 'drm', 'surfaceless']
-  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+  elif ['darwin', 'cygwin'].contains(host_machine.system())
 _platforms = ['x11', 'surfaceless']
   elif ['haiku'].contains(host_machine.system())
 _platforms = ['haiku']
+  elif host_machine.system() == 'windows'
+_platforms = ['windows']
   else
 error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
gladly accepted to fix this.')
   endif
@@ -240,6 +242,7 @@ with_platform_wayland = _platforms.contains('wayland')
 with_platform_drm = _platforms.contains('drm')
 with_platform_haiku = _platforms.contains('haiku')
 with_platform_surfaceless = _platforms.contains('surfaceless')
+with_platform_windows = _platforms.contains('windows')
 
 with_platforms = false
 if _platforms.length() != 0 and _platforms != ['']
@@ -375,7 +378,8 @@ if with_any_vk and (with_platform_x11 and not with_dri3)
   error('Vulkan drivers require dri3 for X11 support')
 endif
 if with_dri or with_gallium
-  if with_glx == 'disabled' and not with_egl and not with_platform_haiku
+  if (with_glx == 'disabled' and not with_egl and not with_platform_haiku and
+  not with_platform_windows)
 error('building dri or gallium drivers require at least one window system')
   endif
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 5bb560b61fb..b8df253b323 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,7 @@ option(
   value : ['auto'],
   choices : [
 '', 'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
+'windows',
   ],
   description : 'comma separated list of window systems to support. If this is 
set to auto all platforms applicable to the OS will be enabled.'
 )
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 30/49] meson: for incluse of inttypes.h for glcpp with msvc

2018-08-22 Thread Dylan Baker
Because we provide a copy if MSVC doesn't, and we need it to make flex
do what we want.
---
 src/compiler/glsl/glcpp/meson.build | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index 769406f5331..be0e6ece54c 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -35,13 +35,23 @@ glcpp_lex = custom_target(
   command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
 )
 
+_extra_args = []
+if cpp.get_id() == 'msvc'
+  # Flex relies on __STDC_VERSION__>=199901L to decide when to include C99
+  # inttypes.h.  We always have inttypes.h available with MSVC (either the one
+  # bundled with MSVC 2013, or the one we bundle ourselves), but we can't just
+  # define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully
+  # support C99.  There's also no way to premptively include stdint.
+  _extra_args += '-FIinttypes.h'
+endif
+
 libglcpp = static_library(
   'glcpp',
   [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
   link_with : libmesa_util,
   include_directories : [inc_common],
-  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
-  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
+  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args, 
_extra_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _extra_args],
   build_by_default : false,
 )
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 06/49] meson: add a expat subproject

2018-08-22 Thread Dylan Baker
For Windows

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build|  2 +-
 subprojects/expat.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/expat.wrap

diff --git a/meson.build b/meson.build
index d75762295ac..9298c5ecce6 100644
--- a/meson.build
+++ b/meson.build
@@ -1070,7 +1070,7 @@ if with_amd_vk or with_gallium_radeonsi or 
with_gallium_r600 or with_gallium_ope
 else
   dep_elf = null_dep
 endif
-dep_expat = dependency('expat')
+dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'])
 # this only exists on linux so either this is linux and it will be found, or
 # its not linux and and wont
 dep_m = cc.find_library('m', required : false)
diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap
new file mode 100644
index 000..0b7c53e54db
--- /dev/null
+++ b/subprojects/expat.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = expat-2.2.5
+
+source_url = 
https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
+source_filename = expat-2.2.5.tar.bz2
+source_hash = d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.5/4/get_zip
+patch_filename = expat-2.2.5-4-wrap.zip
+patch_hash = 25748839be2bbdd2ff586d1a05aa6fc37aeada75c78416df6e8347a6321abaac
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 05/49] meson: add a zlib subproject

2018-08-22 Thread Dylan Baker
To help windows build

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build   |  2 +-
 subprojects/zlib.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/zlib.wrap

diff --git a/meson.build b/meson.build
index 1b3dfa221c9..d75762295ac 100644
--- a/meson.build
+++ b/meson.build
@@ -1056,7 +1056,7 @@ else
 endif
 
 # TODO: some of these may be conditional
-dep_zlib = dependency('zlib', version : '>= 1.2.3')
+dep_zlib = dependency('zlib', version : '>= 1.2.3', fallback : ['zlib', 
'zlib_dep'])
 pre_args += '-DHAVE_ZLIB'
 dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 000..f459463bb59
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.11
+
+source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/2/get_zip
+patch_filename = zlib-1.2.11-2-wrap.zip
+patch_hash = aed811a48707be2a374a230c01e2efa17b385fe7e88f4ac0ee122093766aab2b
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 07/49] glapi: export glapi_destroy_multithread when building shared-glapi on windows

2018-08-22 Thread Dylan Baker
Which will allow meson to build a shared glapi build with mingw.

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 src/mapi/glapi/glapi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index d5d4e0a03a6..cbdef2e4c5a 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -114,7 +114,7 @@ _GLAPI_EXPORT extern void *_glapi_Context;
 #endif /* defined (GLX_USE_TLS) */
 
 
-void
+_GLAPI_EXPORT void
 _glapi_destroy_multithread(void);
 
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 49/49] appveyor: cache pip packages

2018-08-22 Thread Dylan Baker
---
 appveyor.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/appveyor.yml b/appveyor.yml
index 2c45f534ec3..2cb520b9604 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -36,6 +36,7 @@ clone_depth: 100
 cache:
 - llvm-5.0.1-msvc2015-mtd.7z
 - subprojects\packagecache
+- '%LOCALAPPDATA%\pip\Cache'
 
 os: Visual Studio 2015
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 32/49] meson: add switches for SWR with MSVC

2018-08-22 Thread Dylan Baker
---
 src/gallium/drivers/swr/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/swr/meson.build 
b/src/gallium/drivers/swr/meson.build
index b95c8bc1bf8..ec4d80e4bb2 100644
--- a/src/gallium/drivers/swr/meson.build
+++ b/src/gallium/drivers/swr/meson.build
@@ -191,6 +191,7 @@ swr_arch_defines = []
 
 swr_avx_args = cpp.first_supported_argument(
   '-target-cpu=sandybridge', '-mavx', '-march=core-avx', '-tp=sandybridge',
+  '/arch:AVX',
   prefix : '''
 #if !defined(__AVX__)
 # error
@@ -215,7 +216,7 @@ endif
 
 if with_swr_arches.contains('avx2')
   swr_avx2_args = cpp.first_supported_argument(
-'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell',
+'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell', '/arch:AVX2',
 prefix : '''
   #if !defined(__AVX2__)
   # error
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 22/49] meson: fix gallium-osmesa to build for windows

2018-08-22 Thread Dylan Baker
v2: - set so_version to '' (only affects windows)
- always set lib prefix to 'lib', even on msvc
---
 src/gallium/state_trackers/osmesa/meson.build | 12 ++--
 src/gallium/targets/osmesa/meson.build| 11 ++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/osmesa/meson.build 
b/src/gallium/state_trackers/osmesa/meson.build
index 912a6226f74..26ec8084f93 100644
--- a/src/gallium/state_trackers/osmesa/meson.build
+++ b/src/gallium/state_trackers/osmesa/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,10 +18,18 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+osmesa_st_c_args = []
+if with_platform_windows
+  osmesa_st_c_args += ['-DBUILD_GL32', '-DWIN32_LEAN_AND_MEAN']
+  if not with_gles1
+osmesa_st_c_args += ['-D_GLAPI_NO_EXPORTS']
+  endif
+endif
+
 libosmesa_st = static_library(
   'osmesa_st',
   'osmesa.c',
-  c_args : ['-DGALLIUM_SOFTPIPE'],
+  c_args : osmesa_st_c_args,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
   ],
diff --git a/src/gallium/targets/osmesa/meson.build 
b/src/gallium/targets/osmesa/meson.build
index b4ae8f4b6ec..d92117988eb 100644
--- a/src/gallium/targets/osmesa/meson.build
+++ b/src/gallium/targets/osmesa/meson.build
@@ -32,12 +32,19 @@ if with_ld_version_script
   osmesa_link_deps += files('osmesa.sym')
 endif
 
+if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
+  osmesa_def = 'osmesa.mingw.def'
+else
+  osmesa_def = 'osmesa.def'
+endif
+
 libosmesa = shared_library(
   osmesa_lib_name,
   'target.c',
   c_args : [c_vis_args],
   cpp_args : cpp_vis_args,
   link_args : [ld_args_gc_sections, osmesa_link_args],
+  vs_module_defs : osmesa_def,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_winsys,
 inc_gallium_drivers,
@@ -48,10 +55,12 @@ libosmesa = shared_library(
 libmesa_gallium, libgallium, libglapi_static, libws_null, osmesa_link_with,
   ],
   dependencies : [
-dep_selinux, dep_thread, dep_clock, dep_unwind,
+dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
 driver_swrast, driver_swr,
   ],
+  soversion : host_machine.system() == 'windows' ? '' : '8',
   version : '8.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 44/49] meson: maintain names of shared API libraries

2018-08-22 Thread Dylan Baker
Mesa uses the lib prefix, and doesn't use a version for it's dynamic
libraries, which meson defaults to.

v2: - this patch
---
 src/mapi/es1api/meson.build   | 2 ++
 src/mapi/es2api/meson.build   | 2 ++
 src/mapi/shared-glapi/meson.build | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 74cd69b8130..057145625c0 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -46,7 +46,9 @@ libglesv1_cm = shared_library(
   include_directories : [inc_src, inc_include, inc_mapi],
   link_with : libglapi,
   dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl],
+  soversion : host_machine.system() == 'windows' ? '' : '1',
   version : '1.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 04cde895f89..1131c1b7b7b 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -46,7 +46,9 @@ libgles2 = shared_library(
   include_directories : [inc_src, inc_include, inc_mapi],
   link_with : libglapi,
   dependencies : [dep_thread, dep_libdrm, dep_m, dep_dl],
+  soversion : host_machine.system() == 'windows' ? '' : '2',
   version : '2.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
diff --git a/src/mapi/shared-glapi/meson.build 
b/src/mapi/shared-glapi/meson.build
index c818dfce30e..d8c698a7d4c 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -53,7 +53,9 @@ libglapi = shared_library(
   link_args : [ld_args_gc_sections],
   include_directories : [inc_src, inc_include, inc_mapi],
   dependencies : [dep_thread, dep_selinux],
+  soversion : host_machine.system() == 'windows' ? '' : '0',
   version : '0.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 01/49] move u_math to src/util

2018-08-22 Thread Dylan Baker
Currently we have two sets of functions for bit counts, one in gallium
and one in core mesa. The ones in core mesa are header only in many
cases, since they reduce to "#define _mesa_bitcount popcount", but they
provide a fallback implementation. This is important because 32bit msvc
doesn't have popcountll, just popcount; so when nir (for example)
includes the core mesa header it doesn't (and shouldn't) link with core
mesa. To fix this we'll promote the version out of gallium util, then
replace the core mesa uses with the util version, since nir (and other
non-core mesa users) can and do link with mesautils.

v4: - Add this patch
---
 src/broadcom/cle/v3d_packet_helpers.h   | 2 +-
 src/gallium/auxiliary/Makefile.sources  | 2 --
 src/gallium/auxiliary/meson.build   | 2 --
 src/gallium/auxiliary/util/u_format.c   | 2 +-
 src/gallium/auxiliary/util/u_format_bptc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_latc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_other.c | 2 +-
 src/gallium/auxiliary/util/u_format_pack.py | 2 +-
 src/gallium/auxiliary/util/u_format_rgtc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_s3tc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_yuv.h   | 2 +-
 src/gallium/auxiliary/util/u_format_zs.c| 2 +-
 src/util/Makefile.sources   | 2 ++
 src/util/meson.build| 2 ++
 src/{gallium/auxiliary => }/util/u_math.c   | 0
 src/{gallium/auxiliary => }/util/u_math.h   | 2 +-
 16 files changed, 15 insertions(+), 15 deletions(-)
 rename src/{gallium/auxiliary => }/util/u_math.c (100%)
 rename src/{gallium/auxiliary => }/util/u_math.h (99%)

diff --git a/src/broadcom/cle/v3d_packet_helpers.h 
b/src/broadcom/cle/v3d_packet_helpers.h
index f340b790697..c46089a0e60 100644
--- a/src/broadcom/cle/v3d_packet_helpers.h
+++ b/src/broadcom/cle/v3d_packet_helpers.h
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include "util/u_math.h"
 
 #ifdef HAVE_VALGRIND
 #include 
diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 626cde123af..4251ddc0edf 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -294,8 +294,6 @@ C_SOURCES := \
util/u_linear.h \
util/u_log.c \
util/u_log.h \
-   util/u_math.c \
-   util/u_math.h \
util/u_memory.h \
util/u_mm.c \
util/u_mm.h \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 858c9d0c79c..38bc681e5bc 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -314,8 +314,6 @@ files_libgallium = files(
   'util/u_linear.h',
   'util/u_log.c',
   'util/u_log.h',
-  'util/u_math.c',
-  'util/u_math.h',
   'util/u_memory.h',
   'util/u_mm.c',
   'util/u_mm.h',
diff --git a/src/gallium/auxiliary/util/u_format.c 
b/src/gallium/auxiliary/util/u_format.c
index 1dd724d9b84..6445f2647cf 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -32,11 +32,11 @@
  * @author Jose Fonseca 
  */
 
-#include "u_math.h"
 #include "u_memory.h"
 #include "u_format.h"
 #include "u_format_s3tc.h"
 #include "u_surface.h"
+#include "util/u_math.h"
 
 #include "pipe/p_defines.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_bptc.c 
b/src/gallium/auxiliary/util/u_format_bptc.c
index 87ec4139e09..519a541e380 100644
--- a/src/gallium/auxiliary/util/u_format_bptc.c
+++ b/src/gallium/auxiliary/util/u_format_bptc.c
@@ -23,10 +23,10 @@
  *
  **/
 
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_bptc.h"
 #include "util/format_srgb.h"
+#include "util/u_math.h"
 
 #define BPTC_BLOCK_DECODE
 #include "../../../mesa/main/texcompress_bptc_tmp.h"
diff --git a/src/gallium/auxiliary/util/u_format_latc.c 
b/src/gallium/auxiliary/util/u_format_latc.c
index 7b2bb00693f..f145081d56d 100644
--- a/src/gallium/auxiliary/util/u_format_latc.c
+++ b/src/gallium/auxiliary/util/u_format_latc.c
@@ -23,11 +23,11 @@
  **/
 
 #include 
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_rgtc.h"
 #include "u_format_latc.h"
 #include "util/rgtc.h"
+#include "util/u_math.h"
 
 void
 util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, 
unsigned i, unsigned j)
diff --git a/src/gallium/auxiliary/util/u_format_other.c 
b/src/gallium/auxiliary/util/u_format_other.c
index 025e096a95c..213cb9fd941 100644
--- a/src/gallium/auxiliary/util/u_format_other.c
+++ b/src/gallium/auxiliary/util/u_format_other.c
@@ -26,8 +26,8 @@
  **/
 
 
-#include "u_math.h"
 #include "u_format_other.h"
+#include "util/u_math.h"
 #include "util/format_rgb9e5.h"
 #include "util/format_r11g11b10f.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_pack.py 

[Mesa-dev] [PATCH v4 14/49] meson: add windows compiler checks and libraries

2018-08-22 Thread Dylan Baker
v4: - Fix typo in warning code (4246 -> 4267)
- Copy comments from scons for what MSVC warnings codes do
- Merge linker argument changes into this commit
---
 meson.build | 155 +++-
 1 file changed, 106 insertions(+), 49 deletions(-)

diff --git a/meson.build b/meson.build
index 32a731e2024..6cdb6888d1e 100644
--- a/meson.build
+++ b/meson.build
@@ -781,69 +781,124 @@ endif
 # TODO: this is very incomplete
 if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
+elif host_machine.system() == 'windows'
+  pre_args += [
+'-D_WINDOWS', '-D_WIN32_WINNT=0x0601', '-D_WINVER=0x0601',
+'-DPIPE_SUBSYSTEM_WINDOWS_USER',
+'-D_USE_MATH_DEFINES',  # XXX: scons doesn't use this for mingw
+  ]
+  if cc.get_id() == 'msvc'
+pre_args += [
+  '-DVC_EXTRALEAN',
+  '-D_CRT_SECURE_NO_WARNINGS',
+  '-D_CRT_SECURE_NO_DEPRECATE',
+  '-D_SCL_SECURE_NO_WARNINGS',
+  '-D_SCL_SECURE_NO_DEPRECATE',
+  '-D_ALLOW_KEYWORD_MACROS',
+  '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
+]
+  else
+pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+  endif
 endif
 
 # Check for generic C arguments
 c_args = []
-foreach a : ['-Wall', '-Werror=implicit-function-declaration',
- '-Werror=missing-prototypes', '-fno-math-errno',
- '-fno-trapping-math', '-Qunused-arguments']
-  if cc.has_argument(a)
-c_args += a
-  endif
-endforeach
-if cc.has_argument('-Wmissing-field-initializers')
-  c_args += '-Wno-missing-field-initializers'
-endif
-
 c_vis_args = []
-if cc.has_argument('-fvisibility=hidden')
-  c_vis_args += '-fvisibility=hidden'
-endif
-
-# Check for generic C++ arguments
+c_msvc_compat_args = []
+no_override_init_args = []
 cpp_args = []
-foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
- '-Qunused-arguments']
-  if cpp.has_argument(a)
-cpp_args += a
+cpp_vis_args = []
+cpp_msvc_compat_args = []
+if cc.get_id() == 'msvc'
+  foreach a : ['/wd4018',  # signed/unsigned mismatch
+   '/wd4056',  # overflow in floating-point constant arithmetic
+   '/wd4244',  # conversion from 'type1' to 'type2', possible loss 
of data
+   '/wd4267',  # 'var' : conversion from 'size_t' to 'type', 
possible loss of data
+   '/wd4305',  # trancation from 'type1' to 'type2'
+   '/wd4351',  # new behavior: elements of array 'array' will be 
default initialized
+   '/wd4756',  # overflow in constant arithmetic
+   '/wd4800',  # forcing value to bool 'true' or 'false' 
(performance warning)
+   '/wd4996']  # disabled deprecated POSIX name warnings
+if cc.has_argument(a)
+  c_args += a
+endif
+if cpp.has_argument(a)
+  cpp_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmicrosoft-enum-value')  # Clang
+c_args += '-Wno-microsoft-enum-value'
+cpp_args += '-Wno-microsoft-enum-value'
   endif
-endforeach
-
-# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
-# option is not supported. Hence, check for -Wfoo instead.
-
-foreach a : ['non-virtual-dtor', 'missing-field-initializers']
-  if cpp.has_argument('-W' + a)
-cpp_args += '-Wno-' + a
+else
+  foreach a : ['-Wall', '-Werror=implicit-function-declaration',
+   '-Werror=missing-prototypes', '-fno-math-errno',
+   '-fno-trapping-math', '-Qunused-arguments']
+if cc.has_argument(a)
+  c_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmissing-field-initializers')
+c_args += '-Wno-missing-field-initializers'
   endif
-endforeach
 
-no_override_init_args = []
-foreach a : ['override-init', 'initializer-overrides']
-  if cc.has_argument('-W' + a)
-no_override_init_args += '-Wno-' + a
+  c_vis_args = []
+  if cc.has_argument('-fvisibility=hidden')
+c_vis_args += '-fvisibility=hidden'
   endif
-endforeach
 
-cpp_vis_args = []
-if cpp.has_argument('-fvisibility=hidden')
-  cpp_vis_args += '-fvisibility=hidden'
-endif
+  # For some reason, the test for -Wno-foo always succeeds with gcc, even if
+  # the option is not supported. Hence, check for -Wfoo instead.
+  foreach a : ['non-virtual-dtor', 'missing-field-initializers']
+if cpp.has_argument('-W' + a)
+  cpp_args += '-Wno-' + a
+endif
+  endforeach
 
-# Check for C and C++ arguments for MSVC2013 compatibility. These are only used
-# in parts of the mesa code base that need to compile with old versions of
-# MSVC, mainly common code
-c_msvc_compat_args = []
-cpp_msvc_compat_args = []
-foreach a : ['-Werror=pointer-arith', '-Werror=vla']
-  if cc.has_argument(a)
-c_msvc_compat_args += a
+  foreach a : ['override-init', 'initializer-overrides']
+if cc.has_argument('-W' + a)
+  no_override_init_args += '-Wno-' + a
+endif
+  endforeach
+
+  if cpp.has_argument('-fvisibility=hidden')
+cpp_vis_args += '-fvisibility=hidden'
   endif
-  if 

[Mesa-dev] [PATCH v4 48/49] appveyor: Add a wrap for llvm

2018-08-22 Thread Dylan Baker
The appveyor build has a copy of llvm 5.0.1 that scons uses, meson can
also use this to build llvm pipe (though not swr, which requires 6.0.0)
as well.

This requires a plain buildtype, since we need to compile single
threaded to link with the provided LLVM, as well as a 32 bit build for
the same reason.

v4: - New in this version
---
 appveyor.yml|  8 ++--
 build-support/appveyor-llvm.meson.build | 56 +
 2 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 build-support/appveyor-llvm.meson.build

diff --git a/appveyor.yml b/appveyor.yml
index 6277e9636d9..2c45f534ec3 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -75,12 +75,14 @@ install:
 # Download and extract LLVM
 - if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile 
"https://people.freedesktop.org/~jrfonseca/llvm/%LLVM_ARCHIVE%;
 - 7z x -y "%LLVM_ARCHIVE%" > nul
-- mkdir llvm\bin
-- set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="scons" mkdir llvm\bin
+- if "%BUILD_SYSTEM%"=="scons" set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="meson" move llvm subprojects\
+- if "%BUILD_SYSTEM%"=="meson" copy build-support\appveyor-llvm.meson.build 
subprojects\llvm\meson.build
 
 build_script:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
-- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
-Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
--buildtype=plain -Dc_args="/MTd /ZI /Ob0 /Od /RTC1"  -Dcpp_args="/MTd /ZI /Ob0 
/Od /RTC1" -Dbuild-tests=true -Dllvm=true -Dllvm-wrap=llvm 
 - if "%BUILD_SYSTEM%"=="meson" cd builddir
 - if "%BUILD_SYSTEM%"=="meson" msbuild mesa.sln /m
 
diff --git a/build-support/appveyor-llvm.meson.build 
b/build-support/appveyor-llvm.meson.build
new file mode 100644
index 000..1f0ad1c148b
--- /dev/null
+++ b/build-support/appveyor-llvm.meson.build
@@ -0,0 +1,56 @@
+# 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.
+
+# This wrap is used by appveyor to build with meson against a pre-compiled llvm
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['LLVMAnalysis', 'LLVMAsmParser', 'LLVMAsmPrinter',
+ 'LLVMBinaryFormat', 'LLVMBitReader', 'LLVMBitWriter',
+ 'LLVMCodeGen', 'LLVMCore', 'LLVMCoroutines', 'LLVMCoverage',
+ 'LLVMDebugInfoCodeView', 'LLVMDebugInfoDWARF', 'LLVMDebugInfoMSF',
+ 'LLVMDebugInfoPDB', 'LLVMDemangle', 'LLVMDlltoolDriver',
+ 'LLVMExecutionEngine', 'LLVMGlobalISel', 'LLVMInstCombine',
+ 'LLVMInstrumentation', 'LLVMInterpreter', 'LLVMipo',
+ 'LLVMIRReader', 'LLVMLibDriver', 'LLVMLineEditor', 'LLVMLinker',
+ 'LLVMLTO', 'LLVMMCDisassembler', 'LLVMMCJIT', 'LLVMMC',
+ 'LLVMMCParser', 'LLVMMIRParser', 'LLVMObjCARCOpts', 'LLVMObject',
+ 'LLVMObjectYAML', 'LLVMOption', 'LLVMOrcJIT', 'LLVMPasses',
+ 'LLVMProfileData', 'LLVMRuntimeDyld', 'LLVMScalarOpts',
+ 'LLVMSelectionDAG', 'LLVMSupport', 'LLVMSymbolize',
+ 'LLVMTableGen', 'LLVMTarget', 'LLVMTransformUtils',
+ 'LLVMVectorize', 'LLVMX86AsmParser', 'LLVMX86AsmPrinter',
+ 'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMX86Disassembler',
+ 'LLVMX86Info', 'LLVMX86Utils', 'LLVMXRay']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '5.0.1',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+# vim: ft=meson.build
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 21/49] meson: build graw-gdi target

2018-08-22 Thread Dylan Baker
---
 src/gallium/meson.build  |  4 ++-
 src/gallium/targets/graw-gdi/meson.build | 36 
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/targets/graw-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 5019477788b..e4e0b88e7fc 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -197,7 +197,9 @@ if with_platform_windows
 endif
 if with_tests
   subdir('targets/graw-null')
-  if with_glx == 'gallium-xlib'
+  if with_platform_windows
+subdir('targets/graw-gdi')
+  elif with_glx == 'gallium-xlib'
 subdir('targets/graw-xlib')
   endif
   subdir('tests')
diff --git a/src/gallium/targets/graw-gdi/meson.build 
b/src/gallium/targets/graw-gdi/meson.build
new file mode 100644
index 000..e04b454ab53
--- /dev/null
+++ b/src/gallium/targets/graw-gdi/meson.build
@@ -0,0 +1,36 @@
+# 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.
+
+libgraw_gdi = shared_library(
+  'graw',
+  'graw_gdi.c',
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+inc_gallium_winsys_sw,
+  ],
+  link_with : [
+libgraw_util, libmesa_util, libgallium, libwsgdi,
+  ],
+  dependencies : [
+dep_ws2_32, driver_swrast,
+  ],
+)
+
+libgraw = libgraw_gdi
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 09/49] meson: fix dl detection on non cygwin windows

2018-08-22 Thread Dylan Baker
v4: - Don't run checks on Windows that will always fail

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt  (v3)
Reviewed-by: Eric Engestrom 
---
 meson.build | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 9298c5ecce6..a5cb5be226c 100644
--- a/meson.build
+++ b/meson.build
@@ -1030,14 +1030,15 @@ if build_machine.system() != 'darwin'
 endif
 
 # check for dl support
-if cc.has_function('dlopen')
-  dep_dl = null_dep
-else
-  dep_dl = cc.find_library('dl')
-endif
-if cc.has_function('dladdr', dependencies : dep_dl)
-  # This is really only required for megadrivers
-  pre_args += '-DHAVE_DLADDR'
+dep_dl = null_dep
+if host_machine.system() != 'windows'
+  if not cc.has_function('dlopen')
+dep_dl = cc.find_library('dl')
+  endif
+  if cc.has_function('dladdr', dependencies : dep_dl)
+# This is really only required for megadrivers
+pre_args += '-DHAVE_DLADDR'
+  endif
 endif
 
 if cc.has_function('dl_iterate_phdr')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 12/49] meson: don't build glx or dri by default on windows

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 1af610573d5..5102ffe0c7c 100644
--- a/meson.build
+++ b/meson.build
@@ -264,8 +264,12 @@ if with_glx == 'auto'
   elif with_platform_haiku
 with_glx = 'disabled'
   elif with_gallium
-# Even when building just gallium drivers the user probably wants dri
-with_glx = 'dri'
+if host_machine.system() == 'windows'
+  with_glx = 'disabled'
+else
+  # Even when building just gallium drivers the user probably wants dri
+  with_glx = 'dri'
+endif
   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
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 08/49] glsl: fix general_ir_test with mingw

2018-08-22 Thread Dylan Baker
Somewhere down in the depths of the mingw headers 'interface' is
defined, change it to iface like a similar patch did.

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 src/compiler/glsl/tests/general_ir_test.cpp | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/tests/general_ir_test.cpp 
b/src/compiler/glsl/tests/general_ir_test.cpp
index 57917f33734..c8bc16b7ad0 100644
--- a/src/compiler/glsl/tests/general_ir_test.cpp
+++ b/src/compiler/glsl/tests/general_ir_test.cpp
@@ -34,7 +34,7 @@ TEST(ir_variable_constructor, interface)
   glsl_struct_field(glsl_type::vec(4), "v")
};
 
-   const glsl_type *const interface =
+   const glsl_type *const iface =
   glsl_type::get_interface_instance(f,
 ARRAY_SIZE(f),
 GLSL_INTERFACE_PACKING_STD140,
@@ -44,12 +44,12 @@ TEST(ir_variable_constructor, interface)
static const char name[] = "named_instance";
 
ir_variable *const v =
-  new(mem_ctx) ir_variable(interface, name, ir_var_uniform);
+  new(mem_ctx) ir_variable(iface, name, ir_var_uniform);
 
EXPECT_STREQ(name, v->name);
EXPECT_NE(name, v->name);
-   EXPECT_EQ(interface, v->type);
-   EXPECT_EQ(interface, v->get_interface_type());
+   EXPECT_EQ(iface, v->type);
+   EXPECT_EQ(iface, v->get_interface_type());
 }
 
 TEST(ir_variable_constructor, interface_array)
@@ -60,7 +60,7 @@ TEST(ir_variable_constructor, interface_array)
   glsl_struct_field(glsl_type::vec(4), "v")
};
 
-   const glsl_type *const interface =
+   const glsl_type *const iface =
   glsl_type::get_interface_instance(f,
 ARRAY_SIZE(f),
 GLSL_INTERFACE_PACKING_STD140,
@@ -68,7 +68,7 @@ TEST(ir_variable_constructor, interface_array)
 "simple_interface");
 
const glsl_type *const interface_array =
-  glsl_type::get_array_instance(interface, 2);
+  glsl_type::get_array_instance(iface, 2);
 
static const char name[] = "array_instance";
 
@@ -78,5 +78,5 @@ TEST(ir_variable_constructor, interface_array)
EXPECT_STREQ(name, v->name);
EXPECT_NE(name, v->name);
EXPECT_EQ(interface_array, v->type);
-   EXPECT_EQ(interface, v->get_interface_type());
+   EXPECT_EQ(iface, v->get_interface_type());
 }
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 37/49] glsl/tests: define ssize_t on windows

2018-08-22 Thread Dylan Baker
---
 src/compiler/glsl/tests/blob_test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/glsl/tests/blob_test.c 
b/src/compiler/glsl/tests/blob_test.c
index 1cc97236e7e..21b8b1efdc1 100644
--- a/src/compiler/glsl/tests/blob_test.c
+++ b/src/compiler/glsl/tests/blob_test.c
@@ -28,6 +28,10 @@
 #include 
 #include 
 #include 
+#ifdef _MSC_VER
+#include 
+typedef SSIZE_T ssize_t;
+#endif
 
 #include "util/ralloc.h"
 #include "blob.h"
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 46/49] appveyor: use chocolatey (cinst) to install winflexbison

2018-08-22 Thread Dylan Baker
v2: - fix typos in commit message
---
 appveyor.yml | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 15a31da9411..b26a3c624e8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -34,7 +34,6 @@ branches:
 clone_depth: 100
 
 cache:
-- win_flex_bison-2.5.9.zip
 - llvm-5.0.1-msvc2015-mtd.7z
 - subprojects\packagecache
 
@@ -46,7 +45,6 @@ init:
 - git config --global core.autocrlf true
 
 environment:
-  WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
   matrix:
 - BUILD_SYSTEM: meson
@@ -72,9 +70,7 @@ install:
 - if "%BUILD_SYSTEM%"=="meson" ninja --version
 - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
 # Install flex/bison
-- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%;
-- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
-- set Path=%CD%\winflexbison;%Path%
+- cinst -y winflexbison
 - win_flex --version
 - win_bison --version
 # Download and extract LLVM
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 35/49] util/tests: Use define instead of VLA

2018-08-22 Thread Dylan Baker
To allow the this test to be built with MSVC, which doesn't support
VLAs.
---
 src/util/tests/hash_table/clear.c | 13 +++--
 src/util/tests/hash_table/delete_management.c | 13 +++--
 src/util/tests/hash_table/insert_many.c   | 11 ++-
 src/util/tests/hash_table/meson.build |  1 +
 src/util/tests/hash_table/random_entry.c  |  7 ---
 src/util/tests/string_buffer/meson.build  |  1 +
 6 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/util/tests/hash_table/clear.c 
b/src/util/tests/hash_table/clear.c
index 526700bfb0f..19494844608 100644
--- a/src/util/tests/hash_table/clear.c
+++ b/src/util/tests/hash_table/clear.c
@@ -23,6 +23,8 @@
 
 #include "hash_table.h"
 
+#define SIZE 1000
+
 static void *make_key(uint32_t i)
 {
   return (void *)(uintptr_t)(1 + i);
@@ -54,13 +56,12 @@ int main()
 {
struct hash_table *ht;
struct hash_entry *entry;
-   const uint32_t size = 1000;
-   bool flags[size];
+   bool flags[SIZE];
uint32_t i;
 
ht = _mesa_hash_table_create(NULL, key_hash, key_equal);
 
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), [i]);
}
@@ -70,19 +71,19 @@ int main()
 
/* Check that delete_function was called and that repopulating the table
 * works. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(flags[i]);
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), [i]);
}
 
/* Check that exactly the right set of entries is in the table. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(_mesa_hash_table_search(ht, make_key(i)));
}
 
hash_table_foreach(ht, entry) {
-  assert(key_id(entry->key) < size);
+  assert(key_id(entry->key) < SIZE);
}
 
_mesa_hash_table_destroy(ht, NULL);
diff --git a/src/util/tests/hash_table/delete_management.c 
b/src/util/tests/hash_table/delete_management.c
index 127d81b3ca9..e3be9fb3d99 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,7 +57,7 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
@@ -69,7 +70,7 @@ main(int argc, char **argv)
}
 
/* Make sure that all our entries were present at the end. */
-   for (i = size - 100; i < size; i++) {
+   for (i = SIZE - 100; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
@@ -79,8 +80,8 @@ main(int argc, char **argv)
for (entry = _mesa_hash_table_next_entry(ht, NULL);
 entry != NULL;
 entry = _mesa_hash_table_next_entry(ht, entry)) {
-  assert(key_value(entry->key) >= size - 100 &&
- key_value(entry->key) < size);
+  assert(key_value(entry->key) >= SIZE - 100 &&
+ key_value(entry->key) < SIZE);
}
assert(ht->entries == 100);
 
diff --git a/src/util/tests/hash_table/insert_many.c 
b/src/util/tests/hash_table/insert_many.c
index b07e40842bf..6bd35d5c0c7 100644
--- a/src/util/tests/hash_table/insert_many.c
+++ b/src/util/tests/hash_table/insert_many.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,18 +57,18 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
}
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
}
-   assert(ht->entries == size);
+   assert(ht->entries == SIZE);
 
_mesa_hash_table_destroy(ht, NULL);
 
diff --git a/src/util/tests/hash_table/meson.build 
b/src/util/tests/hash_table/meson.build
index c7b03f19c56..93605d1e77f 100644
--- a/src/util/tests/hash_table/meson.build
+++ b/src/util/tests/hash_table/meson.build
@@ -27,6 +27,7 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 
'delete_management',
 executable(
  

[Mesa-dev] [PATCH v4 41/49] meson: disable graw tests on mingw

2018-08-22 Thread Dylan Baker
I can't figure out why symbols are being exposed that shouldn't.
---
 src/gallium/tests/meson.build | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 15b9f549647..1d08da2ac10 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -25,4 +25,8 @@ endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-subdir('graw')
+if host_machine.system() == 'windows' and cpp.get_id() != 'gcc'
+  # This has linking errors I can't figure out with MinGW. works fine with
+  # MSVC, works fine with GCC on Linux.
+  subdir('graw')
+endif
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 10/49] meson: build getopt when using msvc

2018-08-22 Thread Dylan Baker
v4: - Don't wrap a single file in a list to match mesa style
- Use null_dep instead of empty list

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt  (v3)
Reviewed-by: Eric Engestrom 
---
 src/getopt/meson.build | 29 +
 src/meson.build|  5 +
 2 files changed, 34 insertions(+)
 create mode 100644 src/getopt/meson.build

diff --git a/src/getopt/meson.build b/src/getopt/meson.build
new file mode 100644
index 000..9a1f666d7ae
--- /dev/null
+++ b/src/getopt/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.
+
+libgetopt = static_library(
+  'getopt',
+  'getopt_long.c',
+)
+
+idep_getopt = declare_dependency(
+  link_with : libgetopt,
+  include_directories : include_directories('.', is_system : true),
+)
diff --git a/src/meson.build b/src/meson.build
index af881cff70b..b9e7f0879c0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,6 +47,11 @@ sha1_h = custom_target(
 )
 
 subdir('gtest')
+if cc.get_id() == 'msvc'
+  subdir('getopt')
+else
+  idep_getopt = null_dep
+endif
 subdir('util')
 subdir('mapi')
 # TODO: opengl
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 45/49] appveyor: Add support for meson as well as scons

2018-08-22 Thread Dylan Baker
v4: - Rebase on python3 generators
- Cache meson wraps
- Build x86 instead of x86_64, since that's what the pre-build LLVM
  is
---
 appveyor.yml | 36 
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 73be3c57df8..15a31da9411 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -36,6 +36,7 @@ clone_depth: 100
 cache:
 - win_flex_bison-2.5.9.zip
 - llvm-5.0.1-msvc2015-mtd.7z
+- subprojects\packagecache
 
 os: Visual Studio 2015
 
@@ -47,22 +48,29 @@ init:
 environment:
   WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
+  matrix:
+- BUILD_SYSTEM: meson
+- BUILD_SYSTEM: scons
 
 install:
 # Check git config
 - git config core.autocrlf
 # Check pip
-- python --version
-- python -m pip --version
+- py -2.7-32 --version
+- py -2.7-32 -m pip --version
+- py -3.7-64 --version
+- py -3.7-64 -m pip --version
 # Install Mako
-- python -m pip install Mako==1.0.6
-# Install pywin32 extensions, needed by SCons
-- python -m pip install pypiwin32
-# Install python wheels, necessary to install SCons via pip
-- python -m pip install wheel
-# Install SCons
-- python -m pip install scons==2.5.1
-- scons --version
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install pypiwin32 wheel mako
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install scons==2.5.1
+- if "%BUILD_SYSTEM%"=="scons" set Path=C:\Python27\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="scons" scons --version
+- if "%BUILD_SYSTEM%"=="meson" py -3.7-64 -m pip install mako meson
+- if "%BUILD_SYSTEM%"=="meson" set Path=C:\Python37-x64\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="meson" meson --version
+- if "%BUILD_SYSTEM%"=="meson" cinst -y ninja pkgconfiglite
+- if "%BUILD_SYSTEM%"=="meson" ninja --version
+- if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
 # Install flex/bison
 - if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%;
 - 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
@@ -76,10 +84,14 @@ install:
 - set LLVM=%CD%\llvm
 
 build_script:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="meson" meson builddir -Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir
 
 after_build:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1 check
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1 check
+# Doesn't work yet, a large number of tests fail
+#- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir test
 
 
 # It's possible to setup notification here, as described in
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 40/49] meson: Fix gtest linkage on msvc

2018-08-22 Thread Dylan Baker
We need to add an extra flag (/SUBSYSTEM:CONSOLE) to get the msvc linker
to find main() in a static library.
---
 src/gtest/meson.build | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/gtest/meson.build b/src/gtest/meson.build
index 91a49240416..ed0d6974bd3 100644
--- a/src/gtest/meson.build
+++ b/src/gtest/meson.build
@@ -25,7 +25,14 @@ libgtest = static_library(
   build_by_default : false,
 )
 
+_gtest_link_args = []
+if cpp.get_id() == 'msvc'
+  # required to use main() from a static library
+  _gtest_link_args += '/SUBSYSTEM:CONSOLE'
+endif
+
 idep_gtest = declare_dependency(
   link_with : libgtest,
+  link_args : _gtest_link_args,
   include_directories : include_directories('include', is_system : true),
 )
-- 
2.18.0

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


[Mesa-dev] mesa 18.1.7 Notice

2018-08-22 Thread Dylan Baker
Hi everyone,

Just a friendly reminder that the plan is to have the mesa 18.1.7 release this
Friday (the 24th) at or around 10am PDT. The patches currently in the
staging/18.1 branch represent what will be in the release, barring any critical
nominations between then and now.

Dylan


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 00/49] Meson for Windows

2018-08-22 Thread Dylan Baker
This is the 4th iteration of my meson for windows series. It includes
(hopefully) all of the review feedback I got on the v3, as well as a few new
fixes and features, namely the appveyor build now uses the same LLVM as scons to
build LLVMPipe (I would like to build SWR, but that requires LLVM 6.0.0, and the
provided LLVM is 5.0.1). It also has a fix for building nir tests with 32-bit
MSVC, due to a dependency on mesa main that is header only with GCC, Clang, and
64-bit MSVC.

This is available on my gitlab:
https://gitlab.freedesktop.org/dbaker/mesa meson-windows

And the appveyor results are here for this exact set of patches:
https://ci.appveyor.com/project/dcbaker/mesa/build/87

Dylan Baker (49):
  move u_math to src/util
  Replace uses of _mesa_bitcount with util_bitcount
  meson: always define libglapi
  add a git ignore for subprojects
  meson: add a zlib subproject
  meson: add a expat subproject
  glapi: export glapi_destroy_multithread when building shared-glapi on
windows
  glsl: fix general_ir_test with mingw
  meson: fix dl detection on non cygwin windows
  meson: build getopt when using msvc
  meson: Add a platform for windows
  meson: don't build glx or dri by default on windows
  meson: don't allow glvnd on windows
  meson: add windows compiler checks and libraries
  meson: Make shader-cache a trillean instead of boolean
  meson: Add windows defines to glapi
  meson: Add necessary defines for mesa_gallium on windows
  meson: build gallium gdi winsys
  meson: build wgl state tracker
  meson: build libgl-gdi target
  meson: build graw-gdi target
  meson: fix gallium-osmesa to build for windows
  meson: Don't check for posix_memalign on windows
  meson: Add support for wrapping llvm
  util/xmlconfig: include strndup.h for windows
  meson: fix pipe-loader compilation for windows
  meson: don't look for rt on windows
  meson: Add support for using win_flex and win_bison on windows
  meson: make nm binary optional
  meson: for incluse of inttypes.h for glcpp with msvc
  meson: disable sse4.1 optimizations with msvc
  meson: add switches for SWR with MSVC
  meson: don't define GLX_USE_TLS for windows
  meson: Add idep_getopt for tests
  util/tests: Use define instead of VLA
  meson: Don't build glsl cache_test for windows
  glsl/tests: define ssize_t on windows
  meson: Set visibility and compat args for graw
  meson: don't build gallium trivial tests on windows
  meson: Fix gtest linkage on msvc
  meson: disable graw tests on mingw
  meson: don't build or run mesa-sha1 test on windows
  tests/vma: fix build with MSVC
  meson: maintain names of shared API libraries
  appveyor: Add support for meson as well as scons
  appveyor: use chocolatey (cinst) to install winflexbison
  appveyor: use msbuild instead of ninja
  appveyor: Add a wrap for llvm
  appveyor: cache pip packages

 appveyor.yml  |  49 ++-
 build-support/appveyor-llvm.meson.build   |  56 +++
 docs/meson.html   |  66 +++
 meson.build   | 401 --
 meson_options.txt |  12 +-
 src/broadcom/cle/v3d_packet_helpers.h |   2 +-
 src/compiler/glsl/glcpp/meson.build   |  16 +-
 src/compiler/glsl/ir_constant_expression.cpp  |   2 +-
 src/compiler/glsl/ir_expression_operation.py  |   2 +-
 src/compiler/glsl/link_varyings.cpp   |   5 +-
 src/compiler/glsl/linker.cpp  |   9 +-
 src/compiler/glsl/meson.build |   6 +-
 src/compiler/glsl/tests/blob_test.c   |   4 +
 src/compiler/glsl/tests/general_ir_test.cpp   |  14 +-
 src/compiler/glsl/tests/meson.build   |  21 +-
 src/compiler/nir/nir.c|   6 +-
 src/egl/meson.build   |   2 +-
 src/gallium/auxiliary/Makefile.sources|   2 -
 src/gallium/auxiliary/meson.build |   2 -
 src/gallium/auxiliary/pipe-loader/meson.build |   9 +-
 src/gallium/auxiliary/util/u_format.c |   2 +-
 src/gallium/auxiliary/util/u_format_bptc.c|   2 +-
 src/gallium/auxiliary/util/u_format_latc.c|   2 +-
 src/gallium/auxiliary/util/u_format_other.c   |   2 +-
 src/gallium/auxiliary/util/u_format_pack.py   |   2 +-
 src/gallium/auxiliary/util/u_format_rgtc.c|   2 +-
 src/gallium/auxiliary/util/u_format_s3tc.c|   2 +-
 src/gallium/auxiliary/util/u_format_yuv.h |   2 +-
 src/gallium/auxiliary/util/u_format_zs.c  |   2 +-
 src/gallium/drivers/swr/meson.build   |   3 +-
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 src/gallium/meson.build   |  14 +-
 src/gallium/state_trackers/glx/xlib/glx_api.c |   7 +-
 src/gallium/state_trackers/glx/xlib/xm_api.c  |  11 +-
 src/gallium/state_trackers/osmesa/meson.build |  12 +-
 .../{osmesa => wgl}/meson.build   |  39 +-
 .../{graw-xlib => graw-gdi}/meson.build   |  21 +-
 src/gallium/targets/graw-null/meson.build |   2 +
 src/g

[Mesa-dev] [PATCH v4 03/49] meson: always define libglapi

2018-08-22 Thread Dylan Baker
This allows the identifier to be used even if shared-glapi isn't build,
which simplifies a bunch of things.

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 src/mapi/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mapi/meson.build b/src/mapi/meson.build
index 798586bfb0c..0be80047e4d 100644
--- a/src/mapi/meson.build
+++ b/src/mapi/meson.build
@@ -30,6 +30,8 @@ mapi_abi_py = files('mapi_abi.py')
 subdir('glapi')
 if with_shared_glapi
   subdir('shared-glapi')
+else
+  libglapi = []
 endif
 if with_gles1
   subdir('es1api')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 02/49] Replace uses of _mesa_bitcount with util_bitcount

2018-08-22 Thread Dylan Baker
and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem
in nir for platforms that don't have popcount or popcountll, such as
32bit msvc.

v4: - add this patch
---
 src/compiler/glsl/ir_constant_expression.cpp  |  2 +-
 src/compiler/glsl/ir_expression_operation.py  |  2 +-
 src/compiler/glsl/link_varyings.cpp   |  5 ++-
 src/compiler/glsl/linker.cpp  |  9 +++--
 src/compiler/nir/nir.c|  6 +--
 src/gallium/state_trackers/glx/xlib/glx_api.c |  7 ++--
 src/gallium/state_trackers/glx/xlib/xm_api.c  | 11 +++---
 src/gallium/targets/libgl-xlib/Makefile.am|  1 +
 src/intel/blorp/blorp_blit.c  |  5 ++-
 src/intel/compiler/brw_fs.cpp |  3 +-
 src/intel/compiler/brw_fs_nir.cpp |  3 +-
 src/intel/compiler/brw_nir.c  |  5 ++-
 src/intel/compiler/brw_vec4.cpp   |  3 +-
 src/intel/compiler/brw_vec4_visitor.cpp   |  3 +-
 src/intel/vulkan/anv_blorp.c  |  2 +-
 src/intel/vulkan/anv_image.c  |  9 +++--
 src/intel/vulkan/anv_nir_lower_multiview.c|  8 ++--
 src/intel/vulkan/anv_pipeline.c   |  2 +-
 src/intel/vulkan/anv_private.h|  7 ++--
 src/intel/vulkan/genX_cmd_buffer.c|  4 +-
 src/intel/vulkan/genX_query.c | 14 +++
 src/mesa/drivers/common/meta.c|  5 ++-
 src/mesa/drivers/dri/i965/brw_curbe.c |  3 +-
 src/mesa/drivers/dri/i965/brw_draw_upload.c   |  3 +-
 .../drivers/dri/i965/brw_performance_query.c  |  5 ++-
 src/mesa/drivers/dri/i965/brw_wm.c|  7 ++--
 src/mesa/drivers/x11/Makefile.am  |  1 +
 src/mesa/drivers/x11/fakeglx.c|  7 ++--
 src/mesa/drivers/x11/meson.build  |  2 +-
 src/mesa/drivers/x11/xm_api.c | 17 +
 src/mesa/main/arrayobj.c  |  5 ++-
 src/mesa/main/buffers.c   |  7 ++--
 src/mesa/main/imports.c   | 38 ---
 src/mesa/main/imports.h   | 15 
 src/mesa/program/program_parse.y  |  4 +-
 35 files changed, 101 insertions(+), 129 deletions(-)

diff --git a/src/compiler/glsl/ir_constant_expression.cpp 
b/src/compiler/glsl/ir_constant_expression.cpp
index c9788c70535..bfc22c0011a 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -39,7 +39,7 @@
 #include "ir.h"
 #include "compiler/glsl_types.h"
 #include "util/hash_table.h"
-#include "main/imports.h"
+#include "util/u_math.h"
 
 static float
 dot_f(ir_constant *op0, ir_constant *op1)
diff --git a/src/compiler/glsl/ir_expression_operation.py 
b/src/compiler/glsl/ir_expression_operation.py
index 16b98690a6d..306fc35f605 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -535,7 +535,7 @@ ir_expression_operation = [
 
# Bit operations, part of ARB_gpu_shader5.
operation("bitfield_reverse", 1, source_types=(uint_type, int_type), 
c_expression="bitfield_reverse({src0})"),
-   operation("bit_count", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="_mesa_bitcount({src0})"),
+   operation("bit_count", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="util_bitcount({src0})"),
operation("find_msb", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression={'u': "find_msb_uint({src0})", 'i': 
"find_msb_int({src0})"}),
operation("find_lsb", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="find_msb_uint({src0} & -{src0})"),
 
diff --git a/src/compiler/glsl/link_varyings.cpp 
b/src/compiler/glsl/link_varyings.cpp
index 211633d9ee3..52e493cb599 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -38,6 +38,7 @@
 #include "link_varyings.h"
 #include "main/macros.h"
 #include "util/hash_table.h"
+#include "util/u_math.h"
 #include "program.h"
 
 
@@ -2879,13 +2880,13 @@ link_varyings(struct gl_shader_program *prog, unsigned 
first, unsigned last,
 
 /* This must be done after all dead varyings are eliminated. */
 if (sh_i != NULL) {
-   unsigned slots_used = _mesa_bitcount_64(reserved_out_slots);
+   unsigned slots_used = util_bitcount64(reserved_out_slots);
if (!check_against_output_limit(ctx, prog, sh_i, slots_used)) {
   return false;
}
 }
 
-unsigned slots_used = _mesa_bitcount_64(reserved_in_slots);
+unsigned slots_used = util_bitcount64(reserved_in_slots);
 if (!check_against_input_limit(ctx, prog, sh_next, slots_used))
return false;
 
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 3ce78fe6428..ea481c17885 100644
--- a/src/compiler/glsl/linker.cpp
+++ 

[Mesa-dev] [PATCH v4 20/49] meson: build libgl-gdi target

2018-08-22 Thread Dylan Baker
v4: - Fix check for broken mingw (should be for x86 not x86_64)
- Add comment about why check is needed
---
 src/gallium/meson.build   |  1 +
 src/gallium/targets/libgl-gdi/meson.build | 46 +++
 2 files changed, 47 insertions(+)
 create mode 100644 src/gallium/targets/libgl-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a4f28dc4757..5019477788b 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -193,6 +193,7 @@ if with_gallium_st_nine
 endif
 if with_platform_windows
   subdir('state_trackers/wgl')
+  subdir('targets/libgl-gdi')
 endif
 if with_tests
   subdir('targets/graw-null')
diff --git a/src/gallium/targets/libgl-gdi/meson.build 
b/src/gallium/targets/libgl-gdi/meson.build
new file mode 100644
index 000..c4c7c772d38
--- /dev/null
+++ b/src/gallium/targets/libgl-gdi/meson.build
@@ -0,0 +1,46 @@
+# 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.
+
+# DEF parser in certain versions of MinGW is busted, as does not behave as
+# MSVC. mingw-w64 works fine.
+if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
+  ogldef = files('../../state_trackers/wgl/opengl32.mingw.def')[0]
+else
+  ogldef = files('../../state_trackers/wgl/opengl32.def')[0]
+endif
+
+libopengl32 = shared_library(
+  'opengl32',
+  ['libgl_gdi.c'],
+  vs_module_defs : ogldef,
+  include_directories : [
+inc_common, inc_wgl, inc_gallium_winsys_sw, inc_gallium_drivers,
+  ],
+  link_whole : [libwgl],
+  link_with : [
+libmesa_util, libgallium, libglsl, libmesa_gallium, libwsgdi,
+libglapi_static, libglapi
+  ],
+  dependencies : [
+dep_ws2_32, idep_nir, driver_swrast, driver_swr,
+  ],
+  name_prefix : '',  # otherwise mingw will create libopengl32.dll
+  install : true,
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 19/49] meson: build wgl state tracker

2018-08-22 Thread Dylan Baker
v4: - Handle enable gles properly
- Add comments about what various #defines do

Reviewed-by: Eric Anholt 
---
 src/gallium/meson.build|  3 ++
 src/gallium/state_trackers/wgl/meson.build | 57 ++
 2 files changed, 60 insertions(+)
 create mode 100644 src/gallium/state_trackers/wgl/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7754dbdee3c..a4f28dc4757 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -191,6 +191,9 @@ if with_gallium_st_nine
   subdir('state_trackers/nine')
   subdir('targets/d3dadapter9')
 endif
+if with_platform_windows
+  subdir('state_trackers/wgl')
+endif
 if with_tests
   subdir('targets/graw-null')
   if with_glx == 'gallium-xlib'
diff --git a/src/gallium/state_trackers/wgl/meson.build 
b/src/gallium/state_trackers/wgl/meson.build
new file mode 100644
index 000..c57568f07f4
--- /dev/null
+++ b/src/gallium/state_trackers/wgl/meson.build
@@ -0,0 +1,57 @@
+# 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.
+
+inc_wgl = include_directories('.')
+_c_args_wgl = []
+if with_gles1 or with_gles2
+  # prevent _glapi_* from being declared __declspec(dllimport)
+  _c_args_wgl += '-D_GLAPI_NO_EXPORTS'
+endif
+
+libwgl = static_library(
+  'wgl',
+  files(
+'stw_context.c',
+'stw_device.c',
+'stw_ext_context.c',
+'stw_ext_extensionsstring.c',
+'stw_ext_pbuffer.c',
+'stw_ext_pixelformat.c',
+'stw_ext_rendertexture.c',
+'stw_ext_swapinterval.c',
+'stw_framebuffer.c',
+'stw_getprocaddress.c',
+'stw_nopfuncs.c',
+'stw_nopfuncs.h',
+'stw_pixelformat.c',
+'stw_st.c',
+'stw_tls.c',
+'stw_wgl.c',
+  ),
+  c_args : [
+'-D_GDI32_', # prevent wgl* being declared 
__declspec(dllimport)
+'-DBUILD_GL32',  # declare gl* as __declspec(dllexport) in Mesa 
headers
+'-DWIN32_LEAN_AND_MEAN', # 
http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx
+_c_args_wgl
+  ],
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
+  ],
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 24/49] meson: Add support for wrapping llvm

2018-08-22 Thread Dylan Baker
For building on Windows (when not using cygwin), the assumption is that
LLVM will have to be handled via a binary wrap. In this case the user
wanting to use LLVM is this way will need to create a directory in
subprojects (any name is fine), and pass that name via the -Dllvm-wrap
option (for example, assuming subprojects/llvm, -Dllvm-wrap=llvm), which
must have a meson.build file and the installed LLVM to link with (this
can be either static or dynamic). There is documentation for what this
needs to look like and how to define it.

v2: - Use  in html docs
---
 docs/meson.html   |  66 +
 meson.build   | 131 +++---
 meson_options.txt |   6 +
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 4 files changed, 163 insertions(+), 53 deletions(-)

diff --git a/docs/meson.html b/docs/meson.html
index 29907a60a9c..b64ca2ec35e 100644
--- a/docs/meson.html
+++ b/docs/meson.html
@@ -132,6 +132,72 @@ dependency interface. It will search $PATH 
(or %PATH%
 llvm-config, so using an LLVM from a non-standard path is as easy as
 PATH=/path/with/llvm-config:$PATH meson build.
 
+
+On windows (and in other cases), using llvm-config is either undesirable
+or impossible. Meson's solution for this is a
+http://mesonbuild.com/Wrap-dependency-system-manual.html;>wrap, in
+this case a "binary wrap". Follow the steps below:
+
+Install the binaries and headers into a directory under the 
$mesa_src/subprojects
+Add a meson build.build file to that directory (more on that 
later)
+add -Dllvm-wrap=$directory to your meson configuration 
(where $directory is the the directory under subprojects
+
+
+The wrap file must define the following:
+
+ext_llvm: a declare_dependency() object with 
include_directories, dependencies, and version set)
+
+
+It may also define:
+
+irbuilder_h: a file() object pointing to 
llvm/IR/IRBuilder.h (for SWR)
+
+
+such a meson.build file might look like:
+
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['libLLVMCodeGen', 'libLLVMScalarOpts', 'libLLVMAnalysis',
+ 'libLLVMTransformUtils', 'libLLVMCore', 'libLLVMX86CodeGen',
+ 'libLLVMSelectionDAG', 'libLLVMipo', 'libLLVMAsmPrinter',
+ 'libLLVMInstCombine', 'libLLVMInstrumentation', 'libLLVMMC',
+ 'libLLVMGlobalISel', 'libLLVMObjectYAML', 'libLLVMDebugInfoPDB',
+ 'libLLVMVectorize', 'libLLVMPasses', 'libLLVMSupport',
+ 'libLLVMLTO', 'libLLVMObject', 'libLLVMDebugInfoCodeView',
+ 'libLLVMDebugInfoDWARF', 'libLLVMOrcJIT', 'libLLVMProfileData',
+ 'libLLVMObjCARCOpts', 'libLLVMBitReader', 'libLLVMCoroutines',
+ 'libLLVMBitWriter', 'libLLVMRuntimeDyld', 'libLLVMMIRParser',
+ 'libLLVMX86Desc', 'libLLVMAsmParser', 'libLLVMTableGen',
+ 'libLLVMFuzzMutate', 'libLLVMLinker', 'libLLVMMCParser',
+ 'libLLVMExecutionEngine', 'libLLVMCoverage', 'libLLVMInterpreter',
+ 'libLLVMTarget', 'libLLVMX86AsmParser', 'libLLVMSymbolize',
+ 'libLLVMDebugInfoMSF', 'libLLVMMCJIT', 'libLLVMXRay',
+ 'libLLVMX86AsmPrinter', 'libLLVMX86Disassembler',
+ 'libLLVMMCDisassembler', 'libLLVMOption', 'libLLVMIRReader',
+ 'libLLVMLibDriver', 'libLLVMDlltoolDriver', 'libLLVMDemangle',
+ 'libLLVMBinaryFormat', 'libLLVMLineEditor',
+ 'libLLVMWindowsManifest', 'libLLVMX86Info', 'libLLVMX86Utils']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '6.0.0',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+
+It is very important that version is defined and is accurate, if it is not,
+workarounds for the wrong version of LLVM might be used resulting in build
+failures.
+
+
 
 
 
diff --git a/meson.build b/meson.build
index c89b805e71f..d7884823ebc 100644
--- a/meson.build
+++ b/meson.build
@@ -1255,59 +1255,94 @@ else
 endif
 
 _llvm = get_option('llvm')
-if _llvm == 'auto'
-  dep_llvm = dependency(
-'llvm',
-version : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_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 : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_modules,
-  )
-  with_llvm = true
-else
-  dep_llvm = null_dep
-  with_llvm = false
-endif
-if with_llvm
-  _llvm_version = dep_llvm.version().split('.')
-  # Development versions of LLVM have an 'svn' or 'git' suffix, we don't want
-  # that for our version checks.
-  # svn suffixes are stripped by meson as of 

[Mesa-dev] [PATCH v4 16/49] meson: Add windows defines to glapi

2018-08-22 Thread Dylan Baker
These are needed to control the export or symbols due to differences
between the way windows and *nix handle symbol exports.

Reviewed-by: Eric Anholt 
---
 src/mapi/es1api/meson.build   | 10 +-
 src/mapi/es2api/meson.build   | 10 +-
 src/mapi/glapi/meson.build| 13 -
 src/mapi/shared-glapi/meson.build |  9 -
 4 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index d8a77a41df2..32b7cc3eaee 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -27,11 +27,19 @@ es1_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es1_c_args = []
+if with_platform_windows
+  _es1_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libglesv1_cm = shared_library(
   'GLESv1_CM',
   ['../entry.c', es1_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es1_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 891e6f7b27b..9e847e6e077 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -27,11 +27,19 @@ es2_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es2_c_args = []
+if with_platform_windows
+  _es2_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libgles2 = shared_library(
   'GLESv2',
   ['../entry.c', es2_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es2_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index 2509e19eaa3..9ecc29ece31 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -25,7 +25,7 @@ inc_glapi = include_directories('.')
 static_glapi_files = []
 static_glapi_args = []
 
-if ['apple', 'windows'].contains(with_dri_platform)
+if with_dri and ['apple', 'windows'].contains(with_dri_platform)
   static_glapi_files += [glapi_gentable_c, glapitable_h]
 endif
 
@@ -45,8 +45,19 @@ if with_shared_glapi
 '-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
   ]
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32']
+  endif
 else
   static_glapi_args += '-DMAPI_MODE_UTIL'
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32', '-DKHRONOS_DLL_EXPORTS']
+if with_gles1 or with_gles2
+  static_glapi_args += '-D_GLAPI_DLL_EXPORTS'
+else
+  static_glapi_args += '-D_GLAPI_NO_EXPORTS'
+endif
+  endif
   static_glapi_files += files(
 'glapi_dispatch.c',
 'glapi_entrypoint.c',
diff --git a/src/mapi/shared-glapi/meson.build 
b/src/mapi/shared-glapi/meson.build
index 44e86f845f6..c818dfce30e 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -36,11 +36,18 @@ shared_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_glapi_c_args = []
+if with_platform_windows
+  _glapi_c_args += ['-D_GLAPI_DLL_EXPORTS']
+endif
+
 libglapi = shared_library(
   'glapi',
   [files_mapi_glapi, files_mapi_util, shared_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, '-DMAPI_MODE_GLAPI',
+_glapi_c_args,
+c_msvc_compat_args,
+'-DMAPI_MODE_GLAPI',
 '-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 13/49] meson: don't allow glvnd on windows

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 5102ffe0c7c..32a731e2024 100644
--- a/meson.build
+++ b/meson.build
@@ -356,7 +356,9 @@ endif
 
 with_glvnd = get_option('glvnd')
 if with_glvnd
-  if with_glx == 'xlib' or with_glx == 'gallium-xlib'
+  if with_platform_windows
+error('glvnd cannot be used on Windows')
+  elif with_glx == 'xlib' or with_glx == 'gallium-xlib'
 error('Cannot build glvnd support for GLX that is not DRI based.')
   elif with_glx == 'disabled' and not with_egl
 error('glvnd requires DRI based GLX and/or EGL')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 39/49] meson: don't build gallium trivial tests on windows

2018-08-22 Thread Dylan Baker
They require the pipe-loaders, which require xmlconfig, which doesn't
build with msvc.
---
 src/gallium/tests/meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 0ee04350c87..15b9f549647 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -18,7 +18,10 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-subdir('trivial')
+if not with_platform_windows
+  # pipe-loader doesn't build on windows.
+  subdir('trivial')
+endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 34/49] meson: Add idep_getopt for tests

2018-08-22 Thread Dylan Baker
There are quite a few tests that require getopt, when using MSVC we need
to use the bundled version of getopt since there isn't a system version.
---
 src/compiler/glsl/glcpp/meson.build | 2 +-
 src/compiler/glsl/meson.build   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index be0e6ece54c..976986ff17b 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -58,7 +58,7 @@ libglcpp = static_library(
 glcpp = executable(
   'glcpp',
   'glcpp.c',
-  dependencies : [dep_m],
+  dependencies : [dep_m, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglcpp, libglsl_util],
   c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index 7e4dd2929a3..45b72dfb3b9 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -229,7 +229,7 @@ libglsl_standalone = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
   link_with : [libglsl, libglsl_util, libmesa_util],
-  dependencies : [dep_thread],
+  dependencies : [dep_thread, idep_getopt],
   build_by_default : false,
 )
 
@@ -238,7 +238,7 @@ glsl_compiler = executable(
   'main.cpp',
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglsl_standalone],
   build_by_default : with_tools.contains('glsl'),
@@ -252,7 +252,7 @@ glsl_test = executable(
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   link_with : [libglsl, libglsl_standalone, libglsl_util],
   build_by_default : with_tools.contains('glsl'),
   install : with_tools.contains('glsl'),
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 23/49] meson: Don't check for posix_memalign on windows

2018-08-22 Thread Dylan Baker
There's a mingw bug for this, it exports __builtin_posix_memalign but
not posix_memalign, so the check will succeed, but compiling will fail.
---
 meson.build | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 0f37117e3fc..c89b805e71f 100644
--- a/meson.build
+++ b/meson.build
@@ -1048,13 +1048,22 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 
'linux/futex.h', 'endian.h', 'dlfcn.h'
 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
 endforeach
-
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 
'memfd_create']
+foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create']
   if cc.has_function(f)
 pre_args += '-DHAVE_@0@'.format(f.to_upper())
   endif
 endforeach
 
+# MinGW provides a __builtin_posix_memalign function, but not a posix_memalign.
+# This means that this check will succeed, but then compilation will later
+# fail. MSVC doesn't have this function at all, so only check for it on
+# non-windows platforms.
+if host_machine.system() != 'windows'
+  if cc.has_function('posix_memalign')
+pre_args += '-DHAVE_POSIX_MEMALIGN'
+  endif
+endif
+
 # strtod locale support
 if cc.links('''
 #define _GNU_SOURCE
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 26/49] meson: fix pipe-loader compilation for windows

2018-08-22 Thread Dylan Baker
v2: - Add missing D to pound define
- Simply define the variable rather than set it to 1 (mirrors
  android.mk not scons)
---
 src/gallium/auxiliary/pipe-loader/meson.build | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
b/src/gallium/auxiliary/pipe-loader/meson.build
index 32e8188c68b..c5db4e18203 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -27,13 +27,18 @@ files_pipe_loader = files(
 )
 
 libpipe_loader_defines = []
+libpipe_loader_links = []
 
 if dep_libdrm.found()
   files_pipe_loader += files('pipe_loader_drm.c')
+  libpipe_loader_links += libloader
 endif
 if with_gallium_drisw_kms
   libpipe_loader_defines += '-DHAVE_PIPE_LOADER_KMS'
 endif
+if not (with_gallium_st_nine or with_gallium_opencl)
+  libpipe_loader_defines += '-DDROP_PIPE_LOADER_MISC'
+endif
 
 libpipe_loader_static = static_library(
   'pipe_loader_static',
@@ -46,7 +51,7 @@ libpipe_loader_static = static_library(
 c_vis_args, '-DHAVE_PIPE_LOADER_DRI', '-DGALLIUM_STATIC_TARGETS=1',
 libpipe_loader_defines,
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
@@ -64,7 +69,7 @@ libpipe_loader_dynamic = static_library(
   join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe')
 )
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 15/49] meson: Make shader-cache a trillean instead of boolean

2018-08-22 Thread Dylan Baker
So that it can be implicitly disabled on windows, where it doesn't
compile.

v2: - Use an auto-option rather than automagic.
- fix shader_cache check (== -> !=)
v4: - Use new with_shader_cache instead of get_option('shader-cache')
  elsewhere in the meson build
---
 meson.build   | 18 ++
 meson_options.txt |  5 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 6cdb6888d1e..0f37117e3fc 100644
--- a/meson.build
+++ b/meson.build
@@ -728,9 +728,19 @@ if get_option('buildtype') == 'debug'
   pre_args += '-DDEBUG'
 endif
 
-if get_option('shader-cache')
-  pre_args += '-DENABLE_SHADER_CACHE'
-elif with_amd_vk
+with_shader_cache = false
+_shader_cache = get_option('shader-cache')
+if _shader_cache != 'false'
+  if host_machine.system() == 'windows'
+if _shader_cache == 'true'
+  error('Shader Cache does not currently work on Windows')
+endif
+  else
+pre_args += '-DENABLE_SHADER_CACHE'
+with_shader_cache = true
+  endif
+endif
+if with_amd_vk and not with_shader_cache
   error('Radv requires shader cache support')
 endif
 
@@ -1112,7 +1122,7 @@ if cc.has_function('dl_iterate_phdr')
   pre_args += '-DHAVE_DL_ITERATE_PHDR'
 elif with_intel_vk
   error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
-elif with_dri_i965 and get_option('shader-cache')
+elif with_dri_i965 and with_shader_cache
   error('Intel i965 GL driver requires dl_iterate_phdr when built with shader 
caching.')
 endif
 
diff --git a/meson_options.txt b/meson_options.txt
index b8df253b323..cb21a68f131 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -158,8 +158,9 @@ option(
 )
 option(
   'shader-cache',
-  type : 'boolean',
-  value : true,
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
   description : 'Build with on-disk shader cache support'
 )
 option(
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 04/49] add a git ignore for subprojects

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 subprojects/.gitignore | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 subprojects/.gitignore

diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 000..68a882edba6
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1,3 @@
+*
+!*.wrap
+!.gitignore
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 25/49] util/xmlconfig: include strndup.h for windows

2018-08-22 Thread Dylan Baker
---
 src/util/xmlconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index 5264f2598b4..51cc5f3dd87 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include "strndup.h"
 #include "xmlconfig.h"
 #include "u_process.h"
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 28/49] meson: Add support for using win_flex and win_bison on windows

2018-08-22 Thread Dylan Baker
---
 meson.build | 27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 9de29b832a0..c5baaf60c68 100644
--- a/meson.build
+++ b/meson.build
@@ -1364,8 +1364,31 @@ endif
 
 # pthread stubs. Lets not and say we didn't
 
-prog_bison = find_program('bison', required : with_any_opengl)
-prog_flex = find_program('flex', required : with_any_opengl)
+if host_machine.system() == 'windows'
+  # Prefer the winflexbison versions, they're much easier to install and have
+  # better windows support.
+
+  prog_flex = find_program('win_flex', required : false)
+  if prog_flex.found()
+# windows compatibility (uses  instead of  and _isatty,
+# _fileno functions)
+prog_flex = [prog_flex, '--wincompat']
+  else
+prog_flex = [find_program('lex', 'flex', required : with_any_opengl)]
+  endif
+  # Force flex to use const keyword in prototypes, as relies on __cplusplus or
+  # __STDC__ macro to determine whether it's safe to use const keyword, but
+  # MSVC never defines __STDC__ unless we disable all MSVC extensions.
+  prog_flex += '-DYY_USE_CONST='
+
+  prog_bison = find_program('win_bison', required : false)
+  if not prog_bison.found()
+prog_bison = find_program('yacc', 'bison', required : with_any_opengl)
+  endif
+else
+  prog_bison = find_program('bison', required : with_any_opengl)
+  prog_flex = find_program('flex', required : with_any_opengl)
+endif
 
 dep_selinux = null_dep
 if get_option('selinux')
-- 
2.18.0

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


<    11   12   13   14   15   16   17   18   19   20   >