[Mesa-dev] [PATCH] mesa: Add glSpecializeShaderARB to common_desktop_functions

2017-12-12 Thread Dylan Baker
CC: Nicolai Hähnle <nicolai.haeh...@amd.com>
CC: Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
CC: Mark Janes <mark.a.ja...@intel.com>
Fixes: 46b21b8f906 ("mesa: add GL_ARB_gl_spirv boilerplate")
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mesa/main/tests/dispatch_sanity.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index b2ff35717b7..00754deb461 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1020,6 +1020,9 @@ const struct function common_desktop_functions_possible[] 
= {
{ "glImportMemoryFdEXT", 45, -1 },
{ "glImportSemaphoreFdEXT", 45, -1 },
 
+   /* GL_ARB_gl_spirv */
+   { "glSpecializeShaderARB", 45, -1 },
+
{ NULL, 0, -1 }
 };
 
-- 
2.15.1

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


Re: [Mesa-dev] [PATCH mesa] meson: add dep_thread to every lib that includes threads.h

2017-12-12 Thread Dylan Baker
Quoting Emil Velikov (2017-12-12 07:04:09)
> On 11 December 2017 at 22:22, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2017-12-11 12:06:35)
> >> On 7 December 2017 at 17:25, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> > Quoting Emil Velikov (2017-12-07 08:40:27)
> >> >> On 7 December 2017 at 14:51, Eric Engestrom <eric.engest...@imgtec.com> 
> >> >> wrote:
> >> >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104141
> >> >> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> >> >> > ---
> >> >> >  src/broadcom/meson.build| 2 +-
> >> >> >  src/gallium/auxiliary/meson.build   | 2 +-
> >> >> >  src/gallium/state_trackers/nine/meson.build | 1 +
> >> >> >  src/gallium/targets/xa/meson.build  | 2 +-
> >> >> >  src/gallium/targets/xvmc/meson.build| 2 +-
> >> >> >  src/gbm/meson.build | 2 +-
> >> >> >  src/intel/common/meson.build| 2 +-
> >> >> >  src/loader/meson.build  | 2 +-
> >> >> >  src/util/meson.build| 2 +-
> >> >> >  9 files changed, 9 insertions(+), 8 deletions(-)
> >> >> >
> >> >> I doubt we can continue and pretend to be libpthread.so free.
> >> >> To make it even funnier, depending on moon cycle or other fun factors,
> >> >> we could get the pthread dependency implicitly satisfied as one of the
> >> >> other shared libraries already pulls the library.
> >> >>
> >> >> So how about we simply append -pthread to CC/CXX with at global scope
> >> >> and drop the all the individual dependencies?
> >> >> It will safe us a few characters to type, plus will ensure that newly
> >> >> added binaries don't fall victim of the same issue.
> >> >
> >> > Absolutely not. The meson build has dep_thread for a reason, because 
> >> > meson
> >> > guarantees that calling `dependency('threads')` will always return the 
> >> > right
> >> > value for your platform, even if that platform is windows and doesn't 
> >> > have
> >> > pthreads at all (but does the right thing for cygwin).
> >> >
> >> I would recommend looking through clang/gcc. AFAICS any* platform/arch
> >> combo supported by Mesa handles -pthread and that toggle does the
> >> "right thing".
> >> Obviously that can seem a bit hacky, so a better way to avoid all the
> >> copy/paste is for meson to grow an option that allows folding the
> >> required cflags/libs with the compiler directive.
> >
> > That's all fine, but the meson build is planning on supporting haiku and 
> > plain
> > windows (with msvc), neither of which have pthreads (haiku does, but it's 
> > not a
> > standalone library and you don't pass -pthreads to the compiler or linker 
> > and
> > it's an error to do so). macOS clang also warns when passing -pthreads to 
> > the
> > linker (but only the one shipped with xcode), not if you build clang 
> > yourself.
> >
> > If you feel strongly about it, open a bug upstream and discuss it with 
> > upstream.
> > If they agree and add a mechanism to do so I'd be fine using it.
> >
> >> > The reason that we're running into this problem is as you guessed that 
> >> > some
> >> > dependencies pull in pthreads implicitly, for example LLVM, which is why 
> >> > we're
> >> > seeing this so often in gallium.
> >> >
> >> Precisely. Due to the combinatoric explosions things are bound to
> >> break again, hence my earlier suggestion.
> >> I doubt you or anyone on the team will be excited to see things break.
> >
> > That's possible, obviously. I also think these sort of issues will work
> > themselves out fairly quickly, while I'm very concerned adding -pthread 
> > into the
> > list of arguments we pass unconditionally is going to break whole platforms 
> > in
> > subtle and hard to fix ways, and really goes against the philosophy of 
> > meson,
> > which is to solve these sort of problems in meson itself, rather than each 
> > build
> > system solving them again and again, usually incorrectly.
> >
> > If we want to trot out the big hammer, I'd be happier just to add 
> > dep_thread to

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

2017-12-13 Thread Dylan Baker
Quoting Francisco Jerez (2017-12-13 13:01:29)
> Jan Vesely  writes:
> > meson asked for libdrm_amdgpu dependency even though I'm only building 
> > clover+r600g driver.
> > after a bit of fiddling with PATH and PK_CONFIG_PATH to pick up the latest 
> > llvm/liblclc
> > linking failed with:
> > src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o):(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x10):
> >  undefined reference to `typeinfo for llvm::RTDyldMemoryManager'
> > collect2: error: ld returned 1 exit status
> >
> > this looks like it did not pick up the rtti setting from llvm-config:
> > $ ~/.local/bin/llvm-config --has-rtti
> > NO
> > $ ~/.local/bin/llvm-config --cxxflags | grep -o fno-rtti
> > fno-rtti
> >
> > rtti setting is quite messy since clover uses dynamic_cast. I think it
> > should be OK to only support rtti build of llvm if it's detected at
> > configure time
> 
> Is that any different with autotools?  Clover is not meant to link
> against an -fno-rtti LLVM, because an LLVM library built in such a way
> has a non-standard C++ ABI.  Picking up the -fno-rtti flag from
> llvm-config is not guaranteed to fix anything.  Attempting to do so
> should probably lead to a build error at configure time...

I can add some logic to detect `-fno-rtti` and error out if you think that's the
right thing to do.


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


Re: [Mesa-dev] [PATCH] meson: warn if building a non-debug build with asserts

2017-12-13 Thread Dylan Baker
Quoting Eric Engestrom (2017-12-13 13:43:24)
> On Wednesday, 2017-12-13 10:33:05 -0800, Dylan Baker wrote:
> > cc: Jason Ekstrand <jason.ekstr...@gmail.com>
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  meson.build | 9 +
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/meson.build b/meson.build
> > index 6e5ae4d24e9..b00c1ffc3dc 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -29,6 +29,15 @@ project(
> >default_options : ['buildtype=debugoptimized', 'c_std=c99', 
> > 'cpp_std=c++11']
> >  )
> >  
> > +if not get_option('b_ndebug') and not 
> > get_option('buildtype').startswith('debug')
> > +  _warn = 'Building a release or plain type build with asserts enabled. 
> > You probably also want to set -Dn_debug=true'
> > +  if meson.version().version_compare('< 0.44')
> > +message(_warn)
> > +  else
> > +warning(_warn)
> 
> A bit surprised this compiles on old meson versions (I guess you weren't
> lying when you said the parser was lazy ^^), but adding a warning for
> this is a good idea given the spread of the confusion that was revealed
> a little while ago.
> 
> Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

Thanks! You basically need the parser to not evaluate paths it's not taking in
an interpreted language since you don't have a preprocessor to remove code that
an older interpreter doesn't understand. Python, for example, behaves the same
way.

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 3/4] meson: build clover

2017-12-13 Thread Dylan Baker
Quoting Jan Vesely (2017-12-13 12:53:25)
> On Wed, 2017-12-13 at 09:47 -0800, Dylan Baker wrote:
> > +if (with_gallium_va or with_gallium_vdpau or with_gallium_omx or
> > +with_gallium_xvmc or with_dri)
> > +  pipe_loader_link_with += libgalliumvl
> > +else
> > +  pipe_loader_link_with += libgalliumvl_stubs
> > +endif
> > +if with_gallium_va or with_gallium_vdpau or with_gallium_omx or 
> > with_gallium_xvmc  
> 
> git am complains about whitespace errors at the end of the above line.

I can fix that.

> 
> I tested with:
> meson -Ddri-drivers= -Dgallium-drivers=r600 -Dopengl=true -Dplatforms=x11 
> -Dopencl=true
> 
> meson asked for libdrm_amdgpu dependency even though I'm only building 
> clover+r600g driver.

That's probably because you didn't add `-Dvulkan-drivers=`, since radv does 
depend
on libdrm_amdgpu. If you add that and still get a request for libdrm_amdgpu let
me know and I'll look into it further.

> after a bit of fiddling with PATH and PK_CONFIG_PATH to pick up the latest 
> llvm/liblclc
> linking failed with:
> src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o):(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x10):
>  undefined reference to `typeinfo for llvm::RTDyldMemoryManager'
> collect2: error: ld returned 1 exit status
> 
> this looks like it did not pick up the rtti setting from llvm-config:
> $ ~/.local/bin/llvm-config --has-rtti
> NO
> $ ~/.local/bin/llvm-config --cxxflags | grep -o fno-rtti
> fno-rtti
> 
> rtti setting is quite messy since clover uses dynamic_cast. I think it
> should be OK to only support rtti build of llvm if it's detected at
> configure time
> 
> it'd also be nice for meson to remember llvm-config location provided
> at configure time. otherwise I need to set PATH every time I run ninja
> in case it tries to reconfigure. I guess that's what "TODO llvm-prefix" 
> will achieve, right?

I'm not sure what the right way to solve this is, maybe to cache any relavent
environment variables between runs in meson itself, since pkg-config has the
same problem with PKG_CONFIG_PATH. ATM there is no way to implement the
llvm-prefix in meson the way it is in autotools.

> 
> in the end I got meson built clover to run (clinfo + simple demo) on my
> turks with these changes:
> * build and install libdrm_amdgpu -- should not be necessary for r600g
> only build
> * switch to distro (fedora) provided libclc and llvm -- avoids rtti
> build problem (note libclc is just tagging along llvm since my local
> builds install headers to the same location)
> * fiddle with pipe-loader dir, for some reason LIBGL_DRIVERS_PATH did
> not work when pointed to meson built pipe_r600.so. I'm not sure if this
> is meson specific, it might be just my ignorance.

I'm not certain, though Curro probably knows, but the dynamic pipeloader is
hard-coded to search $install/$libdir/gallium-pipe for pipe drivers, so you may
need to run ninja install to make it work. Alternatively LD_LIBRARY_PATH might
work as well.

Dylan


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


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

2017-12-13 Thread Dylan Baker
Quoting Jan Vesely (2017-12-13 13:36:25)
> On Wed, 2017-12-13 at 13:01 -0800, Francisco Jerez wrote:
> > Jan Vesely  writes:
> > 
> 
> autotools build works OK with no-rtti build of llvm, I've been running
> like that for some time. LLVM_CXXFLAGS which include fno-rtti are only
> used to build libclllvm.la, so it probably only works by accident.
> 
> fedora ships rtti enabled llvm, I'm not sure what other distros ship.
> 
> It opens up the question whether any flags from llvm-config --cxxflags
> should be used and whether meson needs an equivalent of
> "strip_unwanted_llvm_flags()"
> 
> Jan
> 

Meson only takes --cppflags from llvm-config (except -DNDEBUG), because frankly
LLVM puts garbage in llvm-config's --cflags and --cxxflags.

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 3/4] meson: build clover

2017-12-13 Thread Dylan Baker
Quoting Jan Vesely (2017-12-13 14:23:21)
> On Wed, 2017-12-13 at 13:54 -0800, Dylan Baker wrote:
> > Quoting Jan Vesely (2017-12-13 12:53:25)
> > > On Wed, 2017-12-13 at 09:47 -0800, Dylan Baker wrote:
> > > > +if (with_gallium_va or with_gallium_vdpau or with_gallium_omx or
> > > > +with_gallium_xvmc or with_dri)
> > > > +  pipe_loader_link_with += libgalliumvl
> > > > +else
> > > > +  pipe_loader_link_with += libgalliumvl_stubs
> > > > +endif
> > > > +if with_gallium_va or with_gallium_vdpau or with_gallium_omx or 
> > > > with_gallium_xvmc  
> > > 
> > > git am complains about whitespace errors at the end of the above line.
> > 
> > I can fix that.
> > 
> > > 
> > > I tested with:
> > > meson -Ddri-drivers= -Dgallium-drivers=r600 -Dopengl=true -Dplatforms=x11 
> > > -Dopencl=true
> > > 
> > > meson asked for libdrm_amdgpu dependency even though I'm only building 
> > > clover+r600g driver.
> > 
> > That's probably because you didn't add `-Dvulkan-drivers=`, since radv does 
> > depend
> > on libdrm_amdgpu. If you add that and still get a request for libdrm_amdgpu 
> > let
> > me know and I'll look into it further.
> 
> right, that fixes it. sorry for the noise.
> 
> > 
> > > after a bit of fiddling with PATH and PK_CONFIG_PATH to pick up the 
> > > latest llvm/liblclc
> > > linking failed with:
> > > src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_misc.cpp.o):(.data.rel.ro._ZTI26DelegatingJITMemoryManager[_ZTI26DelegatingJITMemoryManager]+0x10):
> > >  undefined reference to `typeinfo for llvm::RTDyldMemoryManager'
> > > collect2: error: ld returned 1 exit status
> > > 
> > > this looks like it did not pick up the rtti setting from llvm-config:
> > > $ ~/.local/bin/llvm-config --has-rtti
> > > NO
> > > $ ~/.local/bin/llvm-config --cxxflags | grep -o fno-rtti
> > > fno-rtti
> > > 
> > > rtti setting is quite messy since clover uses dynamic_cast. I think it
> > > should be OK to only support rtti build of llvm if it's detected at
> > > configure time
> > > 
> > > it'd also be nice for meson to remember llvm-config location provided
> > > at configure time. otherwise I need to set PATH every time I run ninja
> > > in case it tries to reconfigure. I guess that's what "TODO llvm-prefix" 
> > > will achieve, right?
> > 
> > I'm not sure what the right way to solve this is, maybe to cache any 
> > relavent
> > environment variables between runs in meson itself, since pkg-config has the
> > same problem with PKG_CONFIG_PATH. ATM there is no way to implement the
> > llvm-prefix in meson the way it is in autotools.
> 
> would it be easier to explicitly set location of llvm-config and
> libclc.pc?
> currently it works OK with system packages,
> you can add Tested-by: Jan Vesely <jan.ves...@rutgers.edu>
> 
> I'd need a way to permanently redirect the configuration to use local
> builds of both llvm and libclc to use meson as my daily driver.
> 
> >
> > 
> > > 
> > > in the end I got meson built clover to run (clinfo + simple demo) on my
> > > turks with these changes:
> > > * build and install libdrm_amdgpu -- should not be necessary for r600g
> > > only build
> > > * switch to distro (fedora) provided libclc and llvm -- avoids rtti
> > > build problem (note libclc is just tagging along llvm since my local
> > > builds install headers to the same location)
> > > * fiddle with pipe-loader dir, for some reason LIBGL_DRIVERS_PATH did
> > > not work when pointed to meson built pipe_r600.so. I'm not sure if this
> > > is meson specific, it might be just my ignorance.
> > 
> > I'm not certain, though Curro probably knows, but the dynamic pipeloader is
> > hard-coded to search $install/$libdir/gallium-pipe for pipe drivers, so you 
> > may
> > need to run ninja install to make it work. Alternatively LD_LIBRARY_PATH 
> > might
> > work as well.
> 
> I assumed that it was some loader configuration outside meson. the
> surprising part was that it tried to open cwd local paths:
> openat(AT_FDCWD, "lib64/gallium-pipe/pipe_r600.so", O_RDONLY|O_CLOEXEC) = -1 
> ENOENT (No such file or directory)
> 
> Is this expected without explicitly setting install prefix?
> 
> Jan

If you don't set a prefix you'll get the system default, for fedora (because of
the merged /usr) that's /. Does it work with autotools without install? I can't
image it would. But dynamic library loading in C is hardly my domain of
expertise so I could be totally wrong :)

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/4] meson: Enable SSE4.1 optimizations

2017-11-17 Thread Dylan Baker
Quoting Emil Velikov (2017-11-17 03:11:50)
> On 16 November 2017 at 22:21, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2017-11-16 03:35:17)
> >> Hi Dylan,
> >>
> >> On 16 November 2017 at 01:10, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> > This patch checks for an and then enables sse4.1 optimizations if the
> >> > host machine will be x86/x86_64.
> >> >
> >> Hell yeah, SSE is coming to town :-)
> >>
> >> Will this work if the user disables SSE4.1, say via CFLAGS=-mno-sse4.1
> >> meson ...?
> >> My meson is still bit rough, so I could not quite grok ^^ by reading
> >> through the patch.
> >>
> >> Thanks
> >> Emil
> >
> > It'll explode horribly. Id didn't see any special handling of that in 
> > autotools
> > build though either, did I miss something?
> >
> In autotools it's handled before the normal ld invocation.
> 
> Namely: configure.ac does:
>  - construct a program using sse4.1 intrinsicts
> Note: return _mm_...() is required otherwise the whole program will be
> optimised away
>  - the -msse is passed first and then the user flags (-mno-sse and/or
> anything else)
>  - the user -mno-sse takes precedence, hence the test program fails to build
>  - set see_supported=false and don't build the SSE optimised static library
> 
> HTH
> Emil

That's an interesting question. So arguments passed via CFLAGS and friends will
be passed to tests, but the arguments passed explicitly to those tests are
appended, so -msse4.1 will take precedence. I'm also pretty sure there isn't a
way to check the arguments passed via -Dc_args or CFLAGS (they're treated as
default arguments, like the c_std in the project() argument). I asked on
#mesonbuild, but I haven't gotten an answer yet (Fridays are pretty slow
everywhere).

I think currently the only way to control this would be to have a meson option
to turn off optimizations, and I really don't like that.

Dylan


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


Re: [Mesa-dev] [PATCH v4 11/13] meson: build gallium omx state tracker

2017-11-17 Thread Dylan Baker
Quoting Emil Velikov (2017-11-17 04:19:22)
> Hi Dylan,
> 
> On 17 November 2017 at 00:27, Dylan Baker <dy...@pnwbakers.com> wrote:
> 
> > +  elif not (with_gallium_r600 or with_gallium_radeonsi or 
> > with_gallium_nouveau)
> 
> 
> > +  elif not (with_gallium_r600 or with_gallium_radeonsi or 
> > with_gallium_nouveau)
> > +error('OMX state tracker requires at least one of the following 
> > gallium drivers: r600, radeonsi, nouveau.')
> 
> We had this type of dual tracking (once in configure and second in the
> makefile) in the past for the autotools setup.
> Sadly it was getting out of sync fairly often so Matt removed it.

How often do new drivers get added to media state trackers (real question)? It
seems like the kind of thing that doesn't happen all that often and good review
should catch.

> 
> In the odd case where an empty* target is build we'll effectively nuke
> it as part of the hardlink generation process.

That seems... ugly. And it builds more than we need to since we wouldn't
actually end up installing the state tracker. It would also confuse the heck out
of me if I had turned OMX on and then didn't get an OMX driver or an error.

> 
> If you agreed, I won't bother respinning the series for that. One can
> relax things as follow-up.
> 
> * A target where no driver is actually present, only the state-tracker
> bits are there.
> 
> > --- a/src/gallium/meson.build
> > +++ b/src/gallium/meson.build
> > @@ -105,6 +105,9 @@ endif
> >  if with_gallium_xvmc
> >subdir('state_trackers/xvmc')
> >  endif
> > +if with_gallium_omx
> > +  subdir('state_trackers/omx_bellagio')
> > +endif
> 
> > -# TODO: OMX
> > +if with_gallium_omx
> > +  subdir('targets/omx-bellagio')
> > +endif
> Grouping the state-tracker and target within the same if block will
> make things easier to read.
> Admittedly it's minor polish, so we can do that at later stage.

I have some patches built on top of this that do that grouping, as well as some
other cleanups that I'm pretty happy with the result of for handling linking
drivers into state trackers.

> 
> Last but not least: thanks for removing the overlinking for va/vdpau.
> 
> Emil


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


Re: [Mesa-dev] [PATCH 1/4] meson: Enable SSE4.1 optimizations

2017-11-17 Thread Dylan Baker
Quoting Matt Turner (2017-11-17 12:46:03)
> On Fri, Nov 17, 2017 at 12:34 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2017-11-17 03:11:50)
> >> On 16 November 2017 at 22:21, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> > Quoting Emil Velikov (2017-11-16 03:35:17)
> >> >> Hi Dylan,
> >> >>
> >> >> On 16 November 2017 at 01:10, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> >> > This patch checks for an and then enables sse4.1 optimizations if the
> >> >> > host machine will be x86/x86_64.
> >> >> >
> >> >> Hell yeah, SSE is coming to town :-)
> >> >>
> >> >> Will this work if the user disables SSE4.1, say via CFLAGS=-mno-sse4.1
> >> >> meson ...?
> >> >> My meson is still bit rough, so I could not quite grok ^^ by reading
> >> >> through the patch.
> >> >>
> >> >> Thanks
> >> >> Emil
> >> >
> >> > It'll explode horribly. Id didn't see any special handling of that in 
> >> > autotools
> >> > build though either, did I miss something?
> >> >
> >> In autotools it's handled before the normal ld invocation.
> >>
> >> Namely: configure.ac does:
> >>  - construct a program using sse4.1 intrinsicts
> >> Note: return _mm_...() is required otherwise the whole program will be
> >> optimised away
> >>  - the -msse is passed first and then the user flags (-mno-sse and/or
> >> anything else)
> >>  - the user -mno-sse takes precedence, hence the test program fails to 
> >> build
> >>  - set see_supported=false and don't build the SSE optimised static library
> >>
> >> HTH
> >> Emil
> >
> > That's an interesting question. So arguments passed via CFLAGS and friends 
> > will
> > be passed to tests, but the arguments passed explicitly to those tests are
> > appended, so -msse4.1 will take precedence. I'm also pretty sure there 
> > isn't a
> > way to check the arguments passed via -Dc_args or CFLAGS (they're treated as
> > default arguments, like the c_std in the project() argument). I asked on
> > #mesonbuild, but I haven't gotten an answer yet (Fridays are pretty slow
> > everywhere).
> >
> > I think currently the only way to control this would be to have a meson 
> > option
> > to turn off optimizations, and I really don't like that.
> 
> The original bug report of "Mesa doesn't build with -mno-sse4.1" was
> in Gentoo's bugzilla; https://bugs.gentoo.org/503828
> 
> There's no compelling reason to support that configuration because
> since the -msseX flags are off by default... in order for the
> -mno-sseX flag to do anything the user must be enabling them somehow
> (likely via -march=...). Using -march=... only to disable particular
> instruction sets seems pretty idiotic.
> 
> I can push back harder on such stupidity in the future if we can't
> handle this case, but it would be nice to solve so I never have to
> hear about it again.

Hmmm, yeah. I'd also like to be able to provide an error in that case too,
because I agree it's pretty idiotic. I'll bring it up in the meson bug tracker.


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/4] configure.ac: Define HAVE_ZLIB if zlib is found

2017-11-10 Thread Dylan Baker
Quoting Jordan Justen (2017-11-10 10:24:36)
> Cc: Emil Velikov <emil.veli...@collabora.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>
> Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
> ---
>  configure.ac | 6 +-
>  meson.build  | 6 +-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 411c4f6b3e0..213cfe132fb 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -900,7 +900,11 @@ dnl See if posix_memalign is available
>  AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>  
>  dnl Check for zlib
> -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
> +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED],
> +  [have_zlib=yes], [have_zlib=no])
> +if test "x$have_zlib" = xyes; then
> +DEFINES="$DEFINES -DHAVE_ZLIB"
> +fi
>  
>  dnl Check for pthreads
>  AX_PTHREAD
> diff --git a/meson.build b/meson.build
> index 855c80ed658..4c27b3ba048 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -661,8 +661,12 @@ if dep_libdrm.found()
>endif
>  endif
>  
> +dep_zlib = dependency('zlib', version : '>= 1.2.3', required : false)
> +if dep_zlib.found()
> +  pre_args += '-DHAVE_ZLIB'
> +endif
> +

There's the gen_zipped_file.py in src/intel/genxml that uses zlib for something,
is not having zlib going to break that?

>  # TODO: some of these may be conditional
> -dep_zlib = dependency('zlib', version : '>= 1.2.3')
>  dep_thread = dependency('threads')
>  if dep_thread.found() and host_machine.system() == 'linux'
>pre_args += '-DHAVE_PTHREAD'
> -- 
> 2.14.1
> 


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


[Mesa-dev] [PATCH] meson: don't us build_by_default for specific gallium drivers

2017-11-10 Thread Dylan Baker
Using build_by_default : false is convenient for dependencies that can
be pulled in by various diverse components of the build system, the
gallium hardware/software drivers and state trackers do not fit that
description. Instead, these should be guarded using the variable that tracks
whether that driver should be enabled.

This leaves a few helper libraries: trace, rbug, etc. as
build_by_default : false because there are a large number of gallium
components that pull them in. This fixes odd build errors since the
default drivers patch landed.

Fixes: 1873327c4b5a09 ("meson: implement default driver arguments")
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/gallium/drivers/freedreno/meson.build  |  1 -
 src/gallium/drivers/llvmpipe/meson.build   |  1 -
 src/gallium/drivers/nouveau/meson.build|  1 -
 src/gallium/drivers/radeon/meson.build |  1 -
 src/gallium/drivers/radeonsi/meson.build   |  1 -
 src/gallium/drivers/softpipe/meson.build   |  1 -
 src/gallium/drivers/vc5/meson.build|  1 -
 src/gallium/meson.build| 45 +-
 src/gallium/state_trackers/dri/meson.build |  1 -
 9 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/src/gallium/drivers/freedreno/meson.build 
b/src/gallium/drivers/freedreno/meson.build
index 3fb94ed8cff..6f74d9c35c0 100644
--- a/src/gallium/drivers/freedreno/meson.build
+++ b/src/gallium/drivers/freedreno/meson.build
@@ -205,7 +205,6 @@ libfreedreno = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_libdrm, dep_libdrm_freedreno],
-  build_by_default : false,
 )
 
 ir3_compiler = executable(
diff --git a/src/gallium/drivers/llvmpipe/meson.build 
b/src/gallium/drivers/llvmpipe/meson.build
index ca1d2aa797b..9d0edb0ac33 100644
--- a/src/gallium/drivers/llvmpipe/meson.build
+++ b/src/gallium/drivers/llvmpipe/meson.build
@@ -98,7 +98,6 @@ libllvmpipe = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
   dependencies : dep_llvm,
-  build_by_default : false,
 )
 
 if with_tests and with_gallium_softpipe and with_llvm
diff --git a/src/gallium/drivers/nouveau/meson.build 
b/src/gallium/drivers/nouveau/meson.build
index 2bc6142879e..59fecfc5255 100644
--- a/src/gallium/drivers/nouveau/meson.build
+++ b/src/gallium/drivers/nouveau/meson.build
@@ -211,7 +211,6 @@ libnouveau = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_libdrm, dep_libdrm_nouveau],
-  build_by_default : false,
 )
 
 nouveau_compiler = executable(
diff --git a/src/gallium/drivers/radeon/meson.build 
b/src/gallium/drivers/radeon/meson.build
index b4d2832d016..f378b12e8e8 100644
--- a/src/gallium/drivers/radeon/meson.build
+++ b/src/gallium/drivers/radeon/meson.build
@@ -51,5 +51,4 @@ libradeon = static_library(
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
   ],
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/radeonsi/meson.build 
b/src/gallium/drivers/radeonsi/meson.build
index 4392184dbb6..974004db67f 100644
--- a/src/gallium/drivers/radeonsi/meson.build
+++ b/src/gallium/drivers/radeonsi/meson.build
@@ -75,5 +75,4 @@ libradeonsi = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : dep_llvm,
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/softpipe/meson.build 
b/src/gallium/drivers/softpipe/meson.build
index 0cef15152e2..df23533c72c 100644
--- a/src/gallium/drivers/softpipe/meson.build
+++ b/src/gallium/drivers/softpipe/meson.build
@@ -81,5 +81,4 @@ libsoftpipe = static_library(
   files_softpipe,
   include_directories : [inc_gallium_aux, inc_gallium, inc_include, inc_src],
   c_args : [c_vis_args, c_msvc_compat_args],
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/vc5/meson.build 
b/src/gallium/drivers/vc5/meson.build
index d066366fcc7..61059a15560 100644
--- a/src/gallium/drivers/vc5/meson.build
+++ b/src/gallium/drivers/vc5/meson.build
@@ -61,5 +61,4 @@ libvc5 = static_library(
   c_args : [c_vis_args, v3dv3_c_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind],
-  build_by_default : false,
 )
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 6edfe80321d..a4953617c86 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -27,39 +27,44 @@ subdir('drivers/ddebug')
 subdir('drivers/noop')
 subdir('drivers/trace')
 subdir('drivers/rbug')
-subdir('drivers/radeon')
-subdir('drivers/radeonsi')
-subdir('drivers/nouveau')
-subdir('drivers/freedreno')
-subdir('drivers/softpipe')
-if with_gallium_vc4
-  subdir('drivers/vc4')
-endif
-if with_gallium_vc5
-  subdir('drivers/vc5')
-endif
-if with_gallium_etnaviv
-  subdir('drivers/etnaviv')
-endif
-subdir('drivers/llvmpipe')
 subdir('winsys/sw/null')
 subdir('winsys/sw/dri')

Re: [Mesa-dev] [PATCH] meson: don't us build_by_default for specific gallium drivers

2017-11-10 Thread Dylan Baker
If fixed the typo in the subject locally.

Quoting Dylan Baker (2017-11-10 09:23:37)
> Using build_by_default : false is convenient for dependencies that can
> be pulled in by various diverse components of the build system, the
> gallium hardware/software drivers and state trackers do not fit that
> description. Instead, these should be guarded using the variable that tracks
> whether that driver should be enabled.
> 
> This leaves a few helper libraries: trace, rbug, etc. as
> build_by_default : false because there are a large number of gallium
> components that pull them in. This fixes odd build errors since the
> default drivers patch landed.
> 
> Fixes: 1873327c4b5a09 ("meson: implement default driver arguments")
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  src/gallium/drivers/freedreno/meson.build  |  1 -
>  src/gallium/drivers/llvmpipe/meson.build   |  1 -
>  src/gallium/drivers/nouveau/meson.build|  1 -
>  src/gallium/drivers/radeon/meson.build |  1 -
>  src/gallium/drivers/radeonsi/meson.build   |  1 -
>  src/gallium/drivers/softpipe/meson.build   |  1 -
>  src/gallium/drivers/vc5/meson.build|  1 -
>  src/gallium/meson.build| 45 
> +-
>  src/gallium/state_trackers/dri/meson.build |  1 -
>  9 files changed, 25 insertions(+), 28 deletions(-)
> 
> diff --git a/src/gallium/drivers/freedreno/meson.build 
> b/src/gallium/drivers/freedreno/meson.build
> index 3fb94ed8cff..6f74d9c35c0 100644
> --- a/src/gallium/drivers/freedreno/meson.build
> +++ b/src/gallium/drivers/freedreno/meson.build
> @@ -205,7 +205,6 @@ libfreedreno = static_library(
>c_args : [c_vis_args],
>cpp_args : [cpp_vis_args],
>dependencies : [dep_libdrm, dep_libdrm_freedreno],
> -  build_by_default : false,
>  )
>  
>  ir3_compiler = executable(
> diff --git a/src/gallium/drivers/llvmpipe/meson.build 
> b/src/gallium/drivers/llvmpipe/meson.build
> index ca1d2aa797b..9d0edb0ac33 100644
> --- a/src/gallium/drivers/llvmpipe/meson.build
> +++ b/src/gallium/drivers/llvmpipe/meson.build
> @@ -98,7 +98,6 @@ libllvmpipe = static_library(
>cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
>include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
>dependencies : dep_llvm,
> -  build_by_default : false,
>  )
>  
>  if with_tests and with_gallium_softpipe and with_llvm
> diff --git a/src/gallium/drivers/nouveau/meson.build 
> b/src/gallium/drivers/nouveau/meson.build
> index 2bc6142879e..59fecfc5255 100644
> --- a/src/gallium/drivers/nouveau/meson.build
> +++ b/src/gallium/drivers/nouveau/meson.build
> @@ -211,7 +211,6 @@ libnouveau = static_library(
>c_args : [c_vis_args],
>cpp_args : [cpp_vis_args],
>dependencies : [dep_libdrm, dep_libdrm_nouveau],
> -  build_by_default : false,
>  )
>  
>  nouveau_compiler = executable(
> diff --git a/src/gallium/drivers/radeon/meson.build 
> b/src/gallium/drivers/radeon/meson.build
> index b4d2832d016..f378b12e8e8 100644
> --- a/src/gallium/drivers/radeon/meson.build
> +++ b/src/gallium/drivers/radeon/meson.build
> @@ -51,5 +51,4 @@ libradeon = static_library(
>include_directories : [
>  inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
>],
> -  build_by_default : false,
>  )
> diff --git a/src/gallium/drivers/radeonsi/meson.build 
> b/src/gallium/drivers/radeonsi/meson.build
> index 4392184dbb6..974004db67f 100644
> --- a/src/gallium/drivers/radeonsi/meson.build
> +++ b/src/gallium/drivers/radeonsi/meson.build
> @@ -75,5 +75,4 @@ libradeonsi = static_library(
>c_args : [c_vis_args],
>cpp_args : [cpp_vis_args],
>dependencies : dep_llvm,
> -  build_by_default : false,
>  )
> diff --git a/src/gallium/drivers/softpipe/meson.build 
> b/src/gallium/drivers/softpipe/meson.build
> index 0cef15152e2..df23533c72c 100644
> --- a/src/gallium/drivers/softpipe/meson.build
> +++ b/src/gallium/drivers/softpipe/meson.build
> @@ -81,5 +81,4 @@ libsoftpipe = static_library(
>files_softpipe,
>include_directories : [inc_gallium_aux, inc_gallium, inc_include, inc_src],
>c_args : [c_vis_args, c_msvc_compat_args],
> -  build_by_default : false,
>  )
> diff --git a/src/gallium/drivers/vc5/meson.build 
> b/src/gallium/drivers/vc5/meson.build
> index d066366fcc7..61059a15560 100644
> --- a/src/gallium/drivers/vc5/meson.build
> +++ b/src/gallium/drivers/vc5/meson.build
> @@ -61,5 +61,4 @@ libvc5 = static_library(
>c_args : [c_vis_args, v3dv3_c_args],
>cpp_args : [cpp_vis_args],
>dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind],
> -  build_by_default : false,
>  )
> diff --git a/src/galliu

[Mesa-dev] [PATCH] gallium/xlib: remove GL_{MAJOR,MINOR,TINY}

2017-11-10 Thread Dylan Baker
These variables were removed from autotools in 2008 (sha:
80f68e1b6a0e5bd2da799c), but they have lived on here. The Scons build
meanwhile doesn't set a patch/tiny version at all, just major and minor.
This patch removes the unused variables and simply sets the version,
leaving patch/tiny as 0 since that's what the autotools build as been
doing forever. This shouldn't change any behavior.

cc: Brian Paul <bri...@vmware.com>
cc: Emil Velikov <emil.veli...@collabora.com>
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/gallium/targets/libgl-xlib/Makefile.am | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/gallium/targets/libgl-xlib/Makefile.am 
b/src/gallium/targets/libgl-xlib/Makefile.am
index a29199fe784..263b0846a42 100644
--- a/src/gallium/targets/libgl-xlib/Makefile.am
+++ b/src/gallium/targets/libgl-xlib/Makefile.am
@@ -20,10 +20,6 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
-GL_MAJOR = 1
-GL_MINOR = 5
-GL_TINY = $(MESA_MAJOR)$(MESA_MINOR)0$(MESA_TINY)
-
 if HAVE_SHARED_GLAPI
 SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
 endif
@@ -51,7 +47,7 @@ nodist_EXTRA_lib@GL_LIB@_la_SOURCES = dummy.cpp
 lib@GL_LIB@_la_SOURCES = xlib.c
 lib@GL_LIB@_la_LDFLAGS = \
-no-undefined \
-   -version-number $(GL_MAJOR):$(GL_MINOR):$(GL_TINY) \
+   -version-number 1:5:0 \
$(BSYMBOLIC) \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
-- 
2.15.0

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


Re: [Mesa-dev] [PATCH 1/4] configure.ac: Define HAVE_ZLIB if zlib is found

2017-11-10 Thread Dylan Baker
Quoting Jordan Justen (2017-11-10 11:43:45)
> On 2017-11-10 10:38:19, Dylan Baker wrote:
> > Quoting Jordan Justen (2017-11-10 10:24:36)
> > > Cc: Emil Velikov <emil.veli...@collabora.com>
> > > Cc: Dylan Baker <dy...@pnwbakers.com>
> > > Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
> > > ---
> > >  configure.ac | 6 +-
> > >  meson.build  | 6 +-
> > >  2 files changed, 10 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/configure.ac b/configure.ac
> > > index 411c4f6b3e0..213cfe132fb 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -900,7 +900,11 @@ dnl See if posix_memalign is available
> > >  AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES 
> > > -DHAVE_POSIX_MEMALIGN"])
> > >  
> > >  dnl Check for zlib
> > > -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
> > > +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED],
> > > +  [have_zlib=yes], [have_zlib=no])
> > > +if test "x$have_zlib" = xyes; then
> > > +DEFINES="$DEFINES -DHAVE_ZLIB"
> > > +fi
> > >  
> > >  dnl Check for pthreads
> > >  AX_PTHREAD
> > > diff --git a/meson.build b/meson.build
> > > index 855c80ed658..4c27b3ba048 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -661,8 +661,12 @@ if dep_libdrm.found()
> > >endif
> > >  endif
> > >  
> > > +dep_zlib = dependency('zlib', version : '>= 1.2.3', required : false)
> > > +if dep_zlib.found()
> > > +  pre_args += '-DHAVE_ZLIB'
> > > +endif
> > > +
> > 
> > There's the gen_zipped_file.py in src/intel/genxml that uses zlib for 
> > something,
> > is not having zlib going to break that?
> 
> I think not having zlib would break aubinator. So, I think zlib would
> need to be required if src/intel/tools is being built.
> 
> The only likely place where zlib wouldn't be found is windows.
> 
> One thing we could consider is bundling the MIT licensed miniz:
> 
> https://github.com/richgel999/miniz
> 
> instead of relying on an external zlib.
> 
> I'd prefer this HAVE_ZLIB change for now...

Meson has a wrap for zlib that is maintained by the meson project. So I think in
the long run we can just require zlib and have meson fetch and build it as part
of the windows build process.

I don't have a problem with this as-is for now, the aubinator tools are
non-default targets intended for developer use, and they're only useful on *nix
systems, where zlib is pretty much universally installed.

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 08/15] autotools: change version TINY -> PATCH

2017-11-13 Thread Dylan Baker
Because patch is more common than tiny for talking about the 3rd element
of a version.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 configure.ac  | 6 +++---
 src/gallium/state_trackers/xa/xa_tracker.h.in | 2 +-
 src/gallium/targets/d3dadapter9/Makefile.am   | 2 +-
 src/gallium/targets/xa/Makefile.am| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 55cf9f1d7e7..ad715885466 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2845,8 +2845,8 @@ AM_CONDITIONAL(HAVE_ARM_ASM, test "x$asm_arch" = xarm)
 
 AC_SUBST([NINE_MAJOR], 1)
 AC_SUBST([NINE_MINOR], 0)
-AC_SUBST([NINE_TINY], 0)
-AC_SUBST([NINE_VERSION], "$NINE_MAJOR.$NINE_MINOR.$NINE_TINY")
+AC_SUBST([NINE_PATCH], 0)
+AC_SUBST([NINE_VERSION], "$NINE_MAJOR.$NINE_MINOR.$NINE_PATCH")
 
 AC_SUBST([VDPAU_MAJOR], 1)
 AC_SUBST([VDPAU_MINOR], 0)
@@ -2865,7 +2865,7 @@ AC_SUBST([XVMC_MINOR], 0)
 
 AC_SUBST([XA_MAJOR], 2)
 AC_SUBST([XA_MINOR], 3)
-AC_SUBST([XA_TINY], 0)
+AC_SUBST([XA_PATCH], 0)
 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_PATCH")
 
 AC_ARG_ENABLE(valgrind,
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h.in 
b/src/gallium/state_trackers/xa/xa_tracker.h.in
index 26c4f21d0f4..fc721eed38b 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.h.in
+++ b/src/gallium/state_trackers/xa/xa_tracker.h.in
@@ -38,7 +38,7 @@
 
 #define XA_TRACKER_VERSION_MAJOR @XA_MAJOR@
 #define XA_TRACKER_VERSION_MINOR @XA_MINOR@
-#define XA_TRACKER_VERSION_PATCH @XA_TINY@
+#define XA_TRACKER_VERSION_PATCH @XA_PATCH@
 
 #define XA_FLAG_SHARED (1 << 0)
 #define XA_FLAG_RENDER_TARGET  (1 << 1)
diff --git a/src/gallium/targets/d3dadapter9/Makefile.am 
b/src/gallium/targets/d3dadapter9/Makefile.am
index 9357d30332a..159c8ea3527 100644
--- a/src/gallium/targets/d3dadapter9/Makefile.am
+++ b/src/gallium/targets/d3dadapter9/Makefile.am
@@ -56,7 +56,7 @@ d3dadapter9_la_LDFLAGS = \
-shrext .so \
-module \
-no-undefined \
-   -version-number $(NINE_MAJOR):$(NINE_MINOR):$(NINE_TINY) \
+   -version-number $(NINE_MAJOR):$(NINE_MINOR):$(NINE_PATCH) \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
 
diff --git a/src/gallium/targets/xa/Makefile.am 
b/src/gallium/targets/xa/Makefile.am
index 83a05230ff8..cd9ca49f568 100644
--- a/src/gallium/targets/xa/Makefile.am
+++ b/src/gallium/targets/xa/Makefile.am
@@ -44,7 +44,7 @@ libxatracker_la_LIBADD = \
 
 libxatracker_la_LDFLAGS = \
-no-undefined \
-   -version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY) \
+   -version-number $(XA_MAJOR):$(XA_MINOR):$(XA_PATCH) \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
 
-- 
2.15.0

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


[Mesa-dev] [PATCH v3 12/15] meson: build gallium xvmc state tracker

2017-11-13 Thread Dylan Baker
v2: - set with_gallium_xvmc when -Dgallium-xvmc=true
- Install megadrivers properly
- only use cflags from pkg-config, don't add linker flags.
---
 meson.build | 40 ++-
 meson_options.txt   | 13 +
 src/gallium/meson.build |  7 ++-
 src/gallium/state_trackers/xvmc/meson.build | 53 +++
 src/gallium/targets/xvmc/meson.build| 80 +
 5 files changed, 191 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/xvmc/meson.build
 create mode 100644 src/gallium/targets/xvmc/meson.build

diff --git a/meson.build b/meson.build
index 289c12cd1b6..9c7a5062a7d 100644
--- a/meson.build
+++ b/meson.build
@@ -391,6 +391,44 @@ if vdpau_drivers_path == ''
   vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
 endif
 
+dep_xvmc = []
+_xvmc = get_option('gallium-xvmc')
+if _xvmc == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_xvmc = false
+  elif not with_platform_x11
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+with_gallium_xvmc = false
+  else
+dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
+with_gallium_xvmc = dep_xvmc.found()
+  endif
+elif _xvmc == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('XVMC state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('XVMC state tracker requires X11 support.')
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+error('XVMC state tracker requires at least one of the following gallium 
drivers: r600, nouveau.')
+  endif
+  dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
+  with_gallium_xvmc = true
+else
+  with_gallium_xvmc = false
+endif
+if with_gallium_xvmc
+  dep_xvmc = declare_dependency(
+compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+xvmc_drivers_path = get_option('xvmc-libs-path')
+if xvmc_drivers_path == ''
+  xvmc_drivers_path = get_option('libdir')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -898,7 +936,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  with_gallium_vdpau)
+  (with_gallium_vdpau or with_gallium_xvmc))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 78b78a92dbf..f0de44e751b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -62,6 +62,19 @@ option(
   value : '',
   description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
 )
+option(
+  'gallium-xvmc',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium xvmc state tracker.',
+)
+option(
+  'xvmc-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put xvmc libraries. defaults to $libdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 446710e1495..a8317a53552 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -102,6 +102,9 @@ endif
 if with_gallium_vdpau
   subdir('state_trackers/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('state_trackers/xvmc')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -116,9 +119,11 @@ endif
 if with_gallium_vdpau
   subdir('targets/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('targets/xvmc')
+endif
 # TODO: OMX
 # TODO: VA
 # TODO: xa
-# TODO: xvmc
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/xvmc/meson.build 
b/src/gallium/state_trackers/xvmc/meson.build
new file mode 100644
index 000..a1022c164b1
--- /dev/null
+++ b/src/gallium/state_trackers/xvmc/meson.build
@@ -0,0 +1,53 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR 

[Mesa-dev] [PATCH v3 03/15] meson: build r300 driver

2017-11-13 Thread Dylan Baker
This is build tested only

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build  |   6 +-
 src/gallium/drivers/r300/meson.build | 156 +++
 src/gallium/meson.build  |   9 +-
 src/gallium/targets/dri/meson.build  |  12 ++-
 4 files changed, 176 insertions(+), 7 deletions(-)
 create mode 100644 src/gallium/drivers/r300/meson.build

diff --git a/meson.build b/meson.build
index e80c128f6db..05f171e4d44 100644
--- a/meson.build
+++ b/meson.build
@@ -118,6 +118,7 @@ endif
 with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
+with_gallium_r300 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -131,7 +132,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'radeonsi,nouveau,swrast'
+  _drivers = 'r300,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -145,6 +146,7 @@ if _drivers != ''
   _split = _drivers.split(',')
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
+  with_gallium_r300 = _split.contains('r300')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -693,7 +695,7 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200
+if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
diff --git a/src/gallium/drivers/r300/meson.build 
b/src/gallium/drivers/r300/meson.build
new file mode 100644
index 000..0d525d8d1b3
--- /dev/null
+++ b/src/gallium/drivers/r300/meson.build
@@ -0,0 +1,156 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_r300 = files(
+  'r300_blit.c',
+  'r300_cb.h',
+  'r300_chipset.c',
+  'r300_chipset.h',
+  'r300_context.c',
+  'r300_context.h',
+  'r300_cs.h',
+  'r300_debug.c',
+  'r300_defines.h',
+  'r300_emit.c',
+  'r300_emit.h',
+  'r300_flush.c',
+  'r300_fs.c',
+  'r300_fs.h',
+  'r300_hyperz.c',
+  'r300_public.h',
+  'r300_query.c',
+  'r300_reg.h',
+  'r300_render.c',
+  'r300_render_stencilref.c',
+  'r300_render_translate.c',
+  'r300_resource.c',
+  'r300_screen_buffer.c',
+  'r300_screen_buffer.h',
+  'r300_screen.c',
+  'r300_screen.h',
+  'r300_shader_semantics.h',
+  'r300_state.c',
+  'r300_state_derived.c',
+  'r300_state_inlines.h',
+  'r300_texture.c',
+  'r300_texture_desc.c',
+  'r300_texture_desc.h',
+  'r300_texture.h',
+  'r300_tgsi_to_rc.c',
+  'r300_tgsi_to_rc.h',
+  'r300_transfer.c',
+  'r300_transfer.h',
+  'r300_vs.c',
+  'r300_vs_draw.c',
+  'r300_vs.h',
+  'compiler/memory_pool.c',
+  'compiler/memory_pool.h',
+  'compiler/r300_fragprog.c',
+  'compiler/r300_fragprog_emit.c',
+  'compiler/r300_fragprog.h',
+  'compiler/r300_fragprog_swizzle.c',
+  'compiler/r300_fragprog_swizzle.h',
+  'compiler/r3xx_fragprog.c',
+  'compiler/r3xx_vertprog.c',
+  'compiler/r3xx_vertprog_dump.c',
+  'compiler/r500_fragprog.c',
+  'compiler/r500_fragprog_emit.c',
+  'compiler/r500_fragprog.h',
+  'compiler/radeon_code.c',
+  'compiler/radeon_code.h',
+  'compiler/radeon_compiler.c',
+  'compiler/radeon_compiler.h',
+  'compiler/radeon_compiler_util.c',
+  'compiler/radeon_compiler_util.h',
+  'compiler/radeon_dataflow.c',
+  'compiler/radeon_dataflow_deadcode.c',
+  'compiler/

[Mesa-dev] [PATCH v3 10/15] meson: drop gallium-media argument

2017-11-13 Thread Dylan Baker
This argument is the wrong approach for handling gallium media state
trackers, since it doesn't allow for an auto option. Instead we'll use
tristates, which do allow for auto.

This option has never been wired to anything anyway.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 17 -
 meson_options.txt |  6 --
 2 files changed, 23 deletions(-)

diff --git a/meson.build b/meson.build
index a93ded47093..0f6644a1be4 100644
--- a/meson.build
+++ b/meson.build
@@ -348,23 +348,6 @@ if with_dri or with_gallium
   endif
 endif
 
-with_gallium_xvmc = false
-with_gallium_vdpau = false
-with_gallium_omx = false  # this is bellagio
-with_gallium_va = false
-with_gallium_media = false
-dep_va = []
-_drivers = get_option('gallium-media')
-if _drivers != ''
-  _split = _drivers.split(',')
-  with_gallium_xvmc = _split.contains('xvmc')
-  with_gallium_vdpau = _split.contains('vdpau')
-  with_gallium_omx = _split.contains('omx')
-  with_gallium_va = _split.contains('va')
-  with_gallium_media = (with_gallium_xvmc or with_gallium_vdpau or
-with_gallium_omx or with_gallium_va)
-endif
-
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
diff --git a/meson_options.txt b/meson_options.txt
index 6c9cd33998c..119bec15709 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,12 +49,6 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
-option(
-  'gallium-media',
-  type : 'string',
-  value : '',
-  description : 'comma separated list of gallium media APIs to build 
(omx,va,vdpau,xvmc).'
-)
 option(
   'vulkan-drivers',
   type : 'string',
-- 
2.15.0

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


[Mesa-dev] [PATCH v3 14/15] meson: build gallium va state tracker

2017-11-13 Thread Dylan Baker
v2: - set with_gallium_va when -Dgallium-va=true
- Fix megadrivers install
- only use cflags from pkg-config, don't add linker flags.
- Don't get version from pkg-config, it's not tracking the same
  version information.
---
 meson.build   | 41 +-
 meson_options.txt | 13 +
 src/gallium/meson.build   |  7 ++-
 src/gallium/state_trackers/va/meson.build | 39 ++
 src/gallium/targets/va/meson.build| 89 +++
 5 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/va/meson.build
 create mode 100644 src/gallium/targets/va/meson.build

diff --git a/meson.build b/meson.build
index b1a09a0b6c9..8c20523aab0 100644
--- a/meson.build
+++ b/meson.build
@@ -487,6 +487,44 @@ if with_gallium_omx
   )
 endif
 
+dep_va = []
+_va = get_option('gallium-va')
+if _va == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_va = false
+  elif not with_platform_x11
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_va = false
+  else
+dep_va = dependency('libva', version : '>= 0.38.0', required : false)
+with_gallium_va = dep_va.found()
+  endif
+elif _va == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VA state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('VA state tracker requires X11 or drm or wayland platform support.')
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('VA state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_va = dependency('libva', version : '>= 0.38.0')
+  with_gallium_va = true
+else
+  with_gallium_va = false
+endif
+if with_gallium_va
+  dep_va = declare_dependency(
+compile_args : dep_va.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+va_drivers_path = get_option('va-libs-path')
+if va_drivers_path == ''
+  va_drivers_path = join_paths(get_option('libdir'), 'dri')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -994,7 +1032,8 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
+   with_gallium_xa))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 8ee216d5b8a..0a9f7a9e403 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -88,6 +88,19 @@ option(
   value : '',
   description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
 )
+option(
+  'gallium-va',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium va state tracker.',
+)
+option(
+  'va-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put va libraries. defaults to $libdir/dri.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c17dba51ff2..c379b600d87 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -108,6 +108,9 @@ endif
 if with_gallium_omx
   subdir('state_trackers/omx_bellagio')
 endif
+if with_gallium_va
+  subdir('state_trackers/va')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -128,7 +131,9 @@ endif
 if with_gallium_omx
   subdir('targets/omx-bellagio')
 endif
-# TODO: VA
+if with_gallium_va
+  subdir('targets/va')
+endif
 # TODO: xa
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/va/meson.build 
b/src/gallium/state_trackers/va/meson.build
new file mode 100644
index 000..dd0d03b629a
--- /dev/null
+++ b/src/gallium/state_trackers/va/meson.build
@@ -0,0 +1,39 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, 

[Mesa-dev] [PATCH v3 09/15] meson: extend install_megadrivers script to handle symmlinking

2017-11-13 Thread Dylan Baker
which is required for the gallium media state trackers.
---
 bin/install_megadrivers.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index a98d7dd177b..581ff9791e5 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -33,6 +33,7 @@ def main():
 parser.add_argument('megadriver')
 parser.add_argument('libdir')
 parser.add_argument('drivers', nargs='+')
+parser.add_argument('--so-version', action='append', default=[])
 args = parser.parse_args()
 
 to = os.path.join(os.environ.get('MESON_INSTALL_DESTDIR_PREFIX'), 
args.libdir)
@@ -48,6 +49,11 @@ def main():
 os.unlink(driver)
 print('installing {} to {}'.format(args.megadriver, driver))
 os.link(master, driver)
+for v in args.so_version:
+name = '{}.{}'.format(driver, v)
+if os.path.exists(name):
+os.unlink(name)
+os.symlink(driver, name)
 os.unlink(master)
 
 
-- 
2.15.0

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


[Mesa-dev] [PATCH v3 06/15] meson: build virgl driver

2017-11-13 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build| 16 
 src/gallium/drivers/virgl/meson.build  | 39 ++
 src/gallium/meson.build|  7 +-
 src/gallium/targets/dri/meson.build|  5 
 src/gallium/winsys/virgl/drm/meson.build   | 27 +
 src/gallium/winsys/virgl/vtest/meson.build | 26 
 6 files changed, 114 insertions(+), 6 deletions(-)
 create mode 100644 src/gallium/drivers/virgl/meson.build
 create mode 100644 src/gallium/winsys/virgl/drm/meson.build
 create mode 100644 src/gallium/winsys/virgl/vtest/meson.build

diff --git a/meson.build b/meson.build
index f33d002843e..a93ded47093 100644
--- a/meson.build
+++ b/meson.build
@@ -129,14 +129,15 @@ with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_i915 = false
 with_gallium_svga = false
+with_gallium_virgl = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,svga,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,svga,swrast'
+  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,virgl,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
@@ -159,6 +160,7 @@ if _drivers != ''
   with_gallium_imx = _split.contains('imx')
   with_gallium_i915 = _split.contains('i915')
   with_gallium_svga = _split.contains('svga')
+  with_gallium_virgl = _split.contains('virgl')
   with_gallium = true
 endif
 
@@ -273,9 +275,13 @@ else
   with_egl = false
 endif
 
-# TODO: or virgl
-if with_egl and with_gallium_radeonsi and not (with_platform_drm or 
with_platform_surfaceless)
-  error('RadeonSI requires drm or surfaceless platform when using EGL')
+if with_egl and not (with_platform_drm or with_platform_surfaceless)
+  if with_gallium_radeonsi
+error('RadeonSI requires drm or surfaceless platform when using EGL')
+  endif
+  if with_gallium_virgl
+error('Virgl requires drm or surfaceless platform when using EGL')
+  endif
 endif
 
 pre_args += '-DGLX_USE_TLS'
diff --git a/src/gallium/drivers/virgl/meson.build 
b/src/gallium/drivers/virgl/meson.build
new file mode 100644
index 000..8284f548927
--- /dev/null
+++ b/src/gallium/drivers/virgl/meson.build
@@ -0,0 +1,39 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_libvirgl = files(
+  'virgl_buffer.c',
+  'virgl_context.c',
+  'virgl_encode.c',
+  'virgl_query.c',
+  'virgl_resource.c',
+  'virgl_screen.c',
+  'virgl_streamout.c',
+  'virgl_texture.c',
+  'virgl_tgsi.c',
+)
+
+libvirgl = static_library(
+  'virgl',
+  files_libvirgl,
+  c_args : c_vis_args,
+  include_directories : inc_common,
+  dependencies : dep_libdrm,
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 2a4cb66ad7a..8e8b1466f12 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -1,4 +1,5 @@
 # Copyright © 2017 Dylan Baker
+# Copyright © 2017 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -85,6 +86,11 @@ if with_gallium_svga
   subdir('drivers/svga')
   subdir('winsys/svga/drm')
 endif
+if with_gallium_virgl
+  subdir('drivers/virgl')
+  subdir('winsys/virgl/drm')
+  subdir('winsys/virgl/vtest')
+endif
 subdir('state_trackers/dri')
 if with_osmesa == 'gallium'
   subdir('state_trackers/osmesa')
@@ -94,7 +100,6 @@ if 

[Mesa-dev] [PATCH v3 15/15] meson: build gallium xa state tracker

2017-11-13 Thread Dylan Baker
v2: - set with_gallium_xa when -Dgallium-xa=true
- install pkg config file
---
 meson.build   | 22 
 meson_options.txt |  7 +++
 src/gallium/meson.build   |  7 ++-
 src/gallium/state_trackers/xa/meson.build | 45 +
 src/gallium/targets/xa/meson.build| 84 +++
 5 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/state_trackers/xa/meson.build
 create mode 100644 src/gallium/targets/xa/meson.build

diff --git a/meson.build b/meson.build
index 8c20523aab0..1d29eb67bfe 100644
--- a/meson.build
+++ b/meson.build
@@ -525,6 +525,28 @@ if va_drivers_path == ''
   va_drivers_path = join_paths(get_option('libdir'), 'dri')
 endif
 
+_xa = get_option('gallium-xa')
+if _xa == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_xa = false
+  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
+or with_gallium_svga)
+with_gallium_xa = false
+  else
+with_gallium_xa = true
+  endif
+elif _xa == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('XA state tracker can only be built on unix-like OSes.')
+  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
+or with_gallium_svga)
+error('XA state tracker requires at least one of the following gallium 
drivers: nouveau, freedreno, i915, svga.')
+  endif
+  with_gallium_xa = true
+else
+  with_gallium_xa = false
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
diff --git a/meson_options.txt b/meson_options.txt
index 0a9f7a9e403..bdeb1b7f587 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -101,6 +101,13 @@ option(
   value : '',
   description : 'path to put va libraries. defaults to $libdir/dri.'
 )
+option(
+  'gallium-xa',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium xa state tracker.',
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c379b600d87..8a072322a28 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -111,6 +111,9 @@ endif
 if with_gallium_va
   subdir('state_trackers/va')
 endif
+if with_gallium_xa
+  subdir('state_trackers/xa')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -134,6 +137,8 @@ endif
 if with_gallium_va
   subdir('targets/va')
 endif
-# TODO: xa
+if with_gallium_xa
+  subdir('targets/xa')
+endif
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/xa/meson.build 
b/src/gallium/state_trackers/xa/meson.build
new file mode 100644
index 000..109abc10b7d
--- /dev/null
+++ b/src/gallium/state_trackers/xa/meson.build
@@ -0,0 +1,45 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+xa_version = ['2', '3', '0']
+
+xa_conf = configuration_data()
+xa_conf.set('XA_MAJOR', xa_version[0])
+xa_conf.set('XA_MINOR', xa_version[1])
+xa_conf.set('XA_PATCH', xa_version[2])
+
+xa_tracker_h = configure_file(
+  configuration : xa_conf,
+  input : 'xa_tracker.h.in',
+  output : 'xa_tracker.h',
+  install_dir : get_option('includedir'),
+)
+
+libxa_st = static_library(
+  'xa_st',
+  [xa_tracker_h, files(
+'xa_composite.c', 'xa_context.c', 'xa_renderer.c', 'xa_tgsi.c',
+'xa_tracker.c', 'xa_yuv.c',
+  )],
+  c_args : [c_vis_args, '-pedantic'],
+  include_directories : inc_common,
+)
+
+install_headers('xa_composite.h', 'xa_context.h')
diff --git a/src/gallium/targets/xa/meson.build 
b/src/gallium/targets/xa/meson.build
new file mode 100644
index 000..013b8a0
--- /dev/null
+++ b/src/gallium/targets/xa/meson.build
@@ -0,0 +1,84 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any 

Re: [Mesa-dev] [PATCH 10/10] spirv: Generate SPIR-V builder infrastructure

2017-11-13 Thread Dylan Baker
Quoting Ian Romanick (2017-11-13 16:00:08)
> 
> That's what I had first, and it did not work in some cases.  I believe
> that list==list is only True if the elements have the same order.  This
> function only requires that both lists have the same contents without
> regard for order.  I will add a comment to that effect.

Okay, that seems good then. I would have suggested a conversion to sets, but I 
just
benchmarked it and it's 30% slower than what you have.


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 13/15] meson: build gallium omx state tracker

2017-11-13 Thread Dylan Baker
v2: - set with_gallium_omx when -Dgallium-omx=true
- Fix detection of omx plugins dir
- only use cflags from pkg-config, don't add linker flags.
---
 meson.build| 60 -
 meson_options.txt  | 13 
 src/gallium/meson.build|  7 +-
 .../state_trackers/omx_bellagio/meson.build| 30 +
 src/gallium/targets/omx-bellagio/meson.build   | 77 ++
 5 files changed, 185 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/omx_bellagio/meson.build
 create mode 100644 src/gallium/targets/omx-bellagio/meson.build

diff --git a/meson.build b/meson.build
index 9c7a5062a7d..b1a09a0b6c9 100644
--- a/meson.build
+++ b/meson.build
@@ -429,6 +429,64 @@ if xvmc_drivers_path == ''
   xvmc_drivers_path = get_option('libdir')
 endif
 
+dep_omx = []
+_omx = get_option('gallium-omx')
+if _omx == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_omx = false
+  elif not with_platform_x11
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_omx = false
+  else
+dep_omx = dependency('libomxil-bellagio', required : false)
+with_gallium_omx = dep_omx.found()
+  endif
+elif _omx == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('OMX state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('OMX state tracker requires X11 or drm platform support.')
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('OMX state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_omx = dependency('libomxil-bellagio')
+  with_gallium_omx = true
+else
+  with_gallium_omx = false
+endif
+
+omx_drivers_path = get_option('omx-libs-path')
+if with_gallium_omx
+  # Figure out where to put the omx driver.
+  # FIXME: this could all be vastly simplified by adding a 'defined_variable'
+  # argument to meson's get_pkgconfig_variable method.
+  if omx_drivers_path == ''
+_omx_libdir = dep_omx.get_pkgconfig_variable('libdir')
+_omx_drivers_dir = dep_omx.get_pkgconfig_variable('pluginsdir')
+if _omx_libdir == get_option('libdir')
+  omx_drivers_path = _omx_drivers_dir
+else
+  _omx_base_dir = []
+  # This will fail on windows. Does OMX run on windows?
+  _omx_libdir = _omx_libdir.split('/')
+  _omx_drivers_dir = _omx_drivers_dir.split('/')
+  foreach o : _omx_drivers_dir
+if not _omx_libdir.contains(o)
+  _omx_base_dir += o
+endif
+  endforeach
+  omx_drivers_path = join_paths(get_option('libdir'), _omx_base_dir)
+endif
+  endif
+endif
+if with_gallium_omx
+  dep_omx = declare_dependency(
+compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -936,7 +994,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index f0de44e751b..8ee216d5b8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,6 +75,19 @@ option(
   value : '',
   description : 'path to put xvmc libraries. defaults to $libdir.'
 )
+option(
+  'gallium-omx',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium omx bellagio state tracker.',
+)
+option(
+  'omx-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a8317a53552..c17dba51ff2 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -105,6 +105,9 @@ endif
 if with_gallium_xvmc
   subdir('state_trackers/xvmc')
 endif
+if with_gallium_omx
+  subdir('state_trackers/omx_bellagio')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -122,7 +125,9 @@ endif
 if with_gallium_xvmc
   subdir('targets/xvmc')
 endif
-# TODO: OMX
+if with_gallium_omx
+  subdir('targets/omx-bellagio')
+endif
 # TODO: VA
 # TODO: xa
 # TODO: nine
diff --git a/src/gallium/state_trackers/omx_bellagio/meson.build 
b/src/gallium/state_trackers/omx_bellagio/meson.build
new file mode 100644
index 000..a62a31149e2
--- /dev/null
+++ 

[Mesa-dev] [PATCH v3 11/15] meson: build gallium vdpau state tracker

2017-11-13 Thread Dylan Baker
v2: - set with_gallium_vdpau when -Dgallium-vdpau=true
- Install megadriver hard links and symlinks
- only use cflags from pkg-config, don't add linker flags.
---
 meson.build  | 46 -
 meson_options.txt| 13 
 src/gallium/meson.build  |  7 +-
 src/gallium/state_trackers/vdpau/meson.build | 32 +
 src/gallium/targets/vdpau/meson.build| 99 
 5 files changed, 195 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/vdpau/meson.build
 create mode 100644 src/gallium/targets/vdpau/meson.build

diff --git a/meson.build b/meson.build
index 0f6644a1be4..289c12cd1b6 100644
--- a/meson.build
+++ b/meson.build
@@ -348,6 +348,49 @@ if with_dri or with_gallium
   endif
 endif
 
+dep_vdpau = []
+_vdpau = get_option('gallium-vdpau')
+if _vdpau == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_vdpau = false
+  elif not with_platform_x11
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+with_gallium_vdpau = false
+  else
+dep_vdpau = dependency('vdpau', version : '>= 1.1', required : false)
+with_gallium_vdpau = dep_vdpau.found()
+  endif
+elif _vdpau == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VDPAU state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('VDPAU state tracker requires X11 support.')
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+error('VDPAU state tracker requires at least one of the following gallium 
drivers: r300, r600, radeonsi, nouveau.')
+  endif
+  dep_vdpau = dependency('vdpau', version : '>= 1.1')
+  with_gallium_vdpau = true
+else
+  with_gallium_vdpau = false
+endif
+if with_gallium_vdpau
+  dep_vdpau = declare_dependency(
+compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+if with_gallium_vdpau
+  pre_args += '-DHAVE_ST_VDPAU'
+endif
+vdpau_drivers_path = get_option('vdpau-libs-path')
+if vdpau_drivers_path == ''
+  vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -854,7 +897,8 @@ if with_platform_x11
 dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
-  if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
+  if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
+  with_gallium_vdpau)
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 119bec15709..78b78a92dbf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,6 +49,19 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
+option(
+  'gallium-vdpau',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium vdpau state tracker.',
+)
+option(
+  'vdpau-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 8e8b1466f12..446710e1495 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -99,6 +99,9 @@ if with_glx == 'gallium-xlib'
   subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
+if with_gallium_vdpau
+  subdir('state_trackers/vdpau')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -110,9 +113,11 @@ endif
 if with_glx == 'gallium-xlib'
   subdir('targets/libgl-xlib')
 endif
+if with_gallium_vdpau
+  subdir('targets/vdpau')
+endif
 # TODO: OMX
 # TODO: VA
-# TODO: vdpau
 # TODO: xa
 # TODO: xvmc
 # TODO: nine
diff --git a/src/gallium/state_trackers/vdpau/meson.build 
b/src/gallium/state_trackers/vdpau/meson.build
new file mode 100644
index 000..9678b79ef6c
--- /dev/null
+++ b/src/gallium/state_trackers/vdpau/meson.build
@@ -0,0 +1,32 @@
+# Copyright © 2017 Intel Corproration
+
+# 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 

[Mesa-dev] [PATCH v3 02/15] meson: build i915g driver

2017-11-13 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  7 +++-
 src/gallium/drivers/i915/meson.build| 70 +
 src/gallium/meson.build |  7 ++--
 src/gallium/targets/dri/meson.build |  5 +++
 src/gallium/winsys/i915/drm/meson.build | 31 +++
 5 files changed, 116 insertions(+), 4 deletions(-)
 create mode 100644 src/gallium/drivers/i915/meson.build
 create mode 100644 src/gallium/winsys/i915/drm/meson.build

diff --git a/meson.build b/meson.build
index 8ea2b3e106c..e80c128f6db 100644
--- a/meson.build
+++ b/meson.build
@@ -125,6 +125,7 @@ with_gallium_vc4 = false
 with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
+with_gallium_i915 = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
@@ -151,6 +152,7 @@ if _drivers != ''
   with_gallium_vc5 = _split.contains('vc5')
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
+  with_gallium_i915 = _split.contains('i915')
   with_gallium = true
 endif
 
@@ -180,12 +182,15 @@ endif
 if with_dri_swrast and with_gallium_softpipe
   error('Only one swrast provider can be built')
 endif
+if with_dri_i915 and with_gallium_i915
+  error('Only one i915 provider can be built')
+endif
 if with_gallium_imx and not with_gallium_etnaviv
   error('IMX driver requires etnaviv driver')
 endif
 
 dep_libdrm_intel = []
-if with_dri_i915
+if with_dri_i915 or with_gallium_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
diff --git a/src/gallium/drivers/i915/meson.build 
b/src/gallium/drivers/i915/meson.build
new file mode 100644
index 000..17f0f6adf8f
--- /dev/null
+++ b/src/gallium/drivers/i915/meson.build
@@ -0,0 +1,70 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_i915 = files(
+  'i915_batchbuffer.h',
+  'i915_batch.h',
+  'i915_blit.c',
+  'i915_blit.h',
+  'i915_clear.c',
+  'i915_context.c',
+  'i915_context.h',
+  'i915_debug.c',
+  'i915_debug_fp.c',
+  'i915_debug.h',
+  'i915_debug_private.h',
+  'i915_flush.c',
+  'i915_fpc_emit.c',
+  'i915_fpc.h',
+  'i915_fpc_optimize.c',
+  'i915_fpc_translate.c',
+  'i915_prim_emit.c',
+  'i915_prim_vbuf.c',
+  'i915_public.h',
+  'i915_query.c',
+  'i915_query.h',
+  'i915_reg.h',
+  'i915_resource_buffer.c',
+  'i915_resource.c',
+  'i915_resource.h',
+  'i915_resource_texture.c',
+  'i915_screen.c',
+  'i915_screen.h',
+  'i915_state.c',
+  'i915_state_derived.c',
+  'i915_state_dynamic.c',
+  'i915_state_emit.c',
+  'i915_state_fpc.c',
+  'i915_state.h',
+  'i915_state_immediate.c',
+  'i915_state_inlines.h',
+  'i915_state_sampler.c',
+  'i915_state_static.c',
+  'i915_surface.c',
+  'i915_surface.h',
+  'i915_winsys.h',
+)
+
+libi915 = static_library(
+  'i915',
+  files_i915,
+  c_args : [c_vis_args],
+  include_directories : [inc_include, inc_src, inc_gallium, inc_gallium_aux],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7ccf4819079..715fee86d0a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -70,17 +70,18 @@ endif
 if with_gallium_imx
   subdir('winsys/imx/drm')
 endif
-if with_glx == 'gallium-xlib'
-  subdir('winsys/sw/xlib')
+if with_gallium_i915
+  subdir('winsys/i915/drm')
+  subdir('drivers/i915')
 endif
 subdir('state_trackers/dri')
 if with_osmesa == 'gallium'
   subdir('state_trackers/osmesa')
 endif
 if with_glx == 'gallium-xlib'
+  subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
-# TODO: i915
 # TODO: SVGA
 # TODO: r300
 # TODO: r600
diff --git a/src/gallium/targets/dri/meson.build 
b/src/gallium/targets/dri/meson.build
index c591b75d037..de97e8afeaf 100644
--- a/src/gallium/targets/dri/meson.build
+++ b/src/gallium/targets/dri/

[Mesa-dev] [PATCH v3 07/15] autotools: set XA versions in configure.ac and configure header file

2017-11-13 Thread Dylan Baker
Currently the versions are set in the header, and then sed is used to
extract them, so that autotools can use them elsewhere.

This is odd. Autotools is perfectly capable of configuring the header
with the versions, and then they don't need to be extracted from the
the header. This is cleaner and more obvious.

Tested with make distcheck.

v2: - Split tiny -> patch change
- Drop temporary variables
- change XA_VERSION_* -> XA_*

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Emil Velikov <emli.veli...@collabora.com>
Reviewed-by: Matt Turner <matts...@gmail.com>
---
 configure.ac   | 14 +-
 .../state_trackers/xa/{xa_tracker.h => xa_tracker.h.in}|  6 +++---
 2 files changed, 8 insertions(+), 12 deletions(-)
 rename src/gallium/state_trackers/xa/{xa_tracker.h => xa_tracker.h.in} (98%)

diff --git a/configure.ac b/configure.ac
index 411c4f6b3e0..55cf9f1d7e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2863,15 +2863,10 @@ AM_CONDITIONAL(HAVE_VULKAN_COMMON, test 
"x$VULKAN_DRIVERS" != "x")
 AC_SUBST([XVMC_MAJOR], 1)
 AC_SUBST([XVMC_MINOR], 0)
 
-XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h"
-XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 
's/^#define XA_TRACKER_VERSION_MAJOR //'`
-XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 
's/^#define XA_TRACKER_VERSION_MINOR //'`
-XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define 
XA_TRACKER_VERSION_PATCH //'`
-
-AC_SUBST([XA_MAJOR], $XA_MAJOR)
-AC_SUBST([XA_MINOR], $XA_MINOR)
-AC_SUBST([XA_TINY], $XA_TINY)
-AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
+AC_SUBST([XA_MAJOR], 2)
+AC_SUBST([XA_MINOR], 3)
+AC_SUBST([XA_TINY], 0)
+AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_PATCH")
 
 AC_ARG_ENABLE(valgrind,
   [AS_HELP_STRING([--enable-valgrind],
@@ -2953,6 +2948,7 @@ AC_CONFIG_FILES([Makefile
  src/gallium/state_trackers/va/Makefile
  src/gallium/state_trackers/vdpau/Makefile
  src/gallium/state_trackers/xa/Makefile
+ src/gallium/state_trackers/xa/xa_tracker.h
  src/gallium/state_trackers/xvmc/Makefile
  src/gallium/targets/d3dadapter9/Makefile
  src/gallium/targets/d3dadapter9/d3d.pc
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h 
b/src/gallium/state_trackers/xa/xa_tracker.h.in
similarity index 98%
rename from src/gallium/state_trackers/xa/xa_tracker.h
rename to src/gallium/state_trackers/xa/xa_tracker.h.in
index 44b3eb5cbe4..26c4f21d0f4 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.h
+++ b/src/gallium/state_trackers/xa/xa_tracker.h.in
@@ -36,9 +36,9 @@
 
 #include 
 
-#define XA_TRACKER_VERSION_MAJOR 2
-#define XA_TRACKER_VERSION_MINOR 3
-#define XA_TRACKER_VERSION_PATCH 0
+#define XA_TRACKER_VERSION_MAJOR @XA_MAJOR@
+#define XA_TRACKER_VERSION_MINOR @XA_MINOR@
+#define XA_TRACKER_VERSION_PATCH @XA_TINY@
 
 #define XA_FLAG_SHARED (1 << 0)
 #define XA_FLAG_RENDER_TARGET  (1 << 1)
-- 
2.15.0

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


[Mesa-dev] [PATCH v3 00/15] Remaining gallium drivers + media

2017-11-13 Thread Dylan Baker
This gets most of the remaining gallium drivers building with meson (a feature
needed for SWR and clover is slated to land soon in upstream meson).  For the
most part this should be straight forward stuff

Changes since v1:
- do not link media state trackers with their frontends
- fix building media state trackers with explicitly turned on (off and auto
  worked previous)
- Split the XA autotools changes
- fix gallium media targets megadriver install
- Fix omx pluginsdir detection.

Dylan Baker (15):
  meson: add proper LLVM modules to check for RadeonSI as well
  meson: build i915g driver
  meson: build r300 driver
  meson: build r600 driver
  meson: build svga driver on linux
  meson: build virgl driver
  autotools: set XA versions in configure.ac and configure header file
  autotools: change version TINY -> PATCH
  meson: extend install_megadrivers script to handle symmlinking
  meson: drop gallium-media argument
  meson: build gallium vdpau state tracker
  meson: build gallium xvmc state tracker
  meson: build gallium omx state tracker
  meson: build gallium va state tracker
  meson: build gallium xa state tracker

 bin/install_megadrivers.py |   6 +
 configure.ac   |  18 +-
 meson.build| 261 +++--
 meson_options.txt  |  57 -
 .../gallium/drivers/i915/meson.build   |  83 ---
 src/gallium/drivers/r300/meson.build   | 156 
 src/gallium/drivers/r600/meson.build   | 128 ++
 src/gallium/drivers/svga/meson.build   |  88 +++
 .../gallium/drivers/virgl/meson.build  |  54 ++---
 src/gallium/meson.build|  67 --
 .../state_trackers/omx_bellagio/meson.build|  45 +---
 .../gallium/state_trackers/va/meson.build  |  54 ++---
 .../gallium/state_trackers/vdpau/meson.build   |  49 +---
 .../gallium/state_trackers/xa/meson.build  |  60 ++---
 .../xa/{xa_tracker.h => xa_tracker.h.in}   |   6 +-
 .../gallium/state_trackers/xvmc/meson.build|  68 +++---
 src/gallium/targets/d3dadapter9/Makefile.am|   2 +-
 src/gallium/targets/dri/meson.build|  32 ++-
 src/gallium/targets/omx-bellagio/meson.build   |  77 ++
 src/gallium/targets/va/meson.build |  89 +++
 src/gallium/targets/vdpau/meson.build  |  99 
 src/gallium/targets/xa/Makefile.am |   2 +-
 src/gallium/targets/xa/meson.build |  84 +++
 src/gallium/targets/xvmc/meson.build   |  80 +++
 .../gallium/winsys/i915/drm/meson.build|  46 +---
 .../gallium/winsys/svga/drm/meson.build|  60 ++---
 .../gallium/winsys/virgl/drm/meson.build   |  42 +---
 .../gallium/winsys/virgl/vtest/meson.build |  41 +---
 28 files changed, 1409 insertions(+), 445 deletions(-)
 copy bin/install_megadrivers.py => src/gallium/drivers/i915/meson.build (51%)
 mode change 100755 => 100644
 create mode 100644 src/gallium/drivers/r300/meson.build
 create mode 100644 src/gallium/drivers/r600/meson.build
 create mode 100644 src/gallium/drivers/svga/meson.build
 copy bin/install_megadrivers.py => src/gallium/drivers/virgl/meson.build (54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => 
src/gallium/state_trackers/omx_bellagio/meson.build (54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => src/gallium/state_trackers/va/meson.build 
(54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => 
src/gallium/state_trackers/vdpau/meson.build (52%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => src/gallium/state_trackers/xa/meson.build 
(54%)
 mode change 100755 => 100644
 rename src/gallium/state_trackers/xa/{xa_tracker.h => xa_tracker.h.in} (98%)
 copy bin/install_megadrivers.py => src/gallium/state_trackers/xvmc/meson.build 
(51%)
 mode change 100755 => 100644
 create mode 100644 src/gallium/targets/omx-bellagio/meson.build
 create mode 100644 src/gallium/targets/va/meson.build
 create mode 100644 src/gallium/targets/vdpau/meson.build
 create mode 100644 src/gallium/targets/xa/meson.build
 create mode 100644 src/gallium/targets/xvmc/meson.build
 copy bin/install_megadrivers.py => src/gallium/winsys/i915/drm/meson.build 
(54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => src/gallium/winsys/svga/drm/meson.build 
(54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => src/gallium/winsys/virgl/drm/meson.build 
(54%)
 mode change 100755 => 100644
 copy bin/install_megadrivers.py => src/gallium/winsys/virgl/vtest/meson.build 
(54%)
 mode change 100755 => 100644

-- 
2.15.0

___
mesa-dev mailing list
me

[Mesa-dev] [PATCH v3 04/15] meson: build r600 driver

2017-11-13 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Tested-by: Aaron Watry <awa...@gmail.com>
---
 meson.build  |  22 --
 src/gallium/drivers/r600/meson.build | 128 +++
 src/gallium/meson.build  |   6 +-
 src/gallium/targets/dri/meson.build  |   7 +-
 4 files changed, 154 insertions(+), 9 deletions(-)
 create mode 100644 src/gallium/drivers/r600/meson.build

diff --git a/meson.build b/meson.build
index 05f171e4d44..12816a2535f 100644
--- a/meson.build
+++ b/meson.build
@@ -119,6 +119,7 @@ with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
 with_gallium_r300 = false
+with_gallium_r600 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -132,7 +133,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -147,6 +148,7 @@ if _drivers != ''
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
   with_gallium_r300 = _split.contains('r300')
+  with_gallium_r600 = _split.contains('r600')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -678,9 +680,13 @@ dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() == 'linux'
   pre_args += '-DHAVE_PTHREAD'
 endif
-dep_elf = dependency('libelf', required : false)
-if not dep_elf.found() and (with_amd_vk or with_gallium_radeonsi) # TODO: 
clover, r600
-  dep_elf = cc.find_library('elf')
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
+  dep_elf = dependency('libelf', required : false)
+  if not dep_elf.found()
+dep_elf = cc.find_library('elf')
+  endif
+else
+  dep_elf = []
 endif
 dep_expat = dependency('expat')
 # this only exists on linux so either this is linux and it will be found, or
@@ -695,7 +701,8 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
+if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
+with_gallium_r300 or with_gallium_r600)
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
@@ -709,8 +716,11 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk or with_gallium_radeonsi # TODO: r600
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
+  if with_gallium_r600
+llvm_modules += 'asmparser'
+  endif
 endif
 dep_llvm = []
 if with_llvm
diff --git a/src/gallium/drivers/r600/meson.build 
b/src/gallium/drivers/r600/meson.build
new file mode 100644
index 000..411b550331d
--- /dev/null
+++ b/src/gallium/drivers/r600/meson.build
@@ -0,0 +1,128 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_r600 = files(
+  'r600d_common.h',
+  'compute_memory_pool.c',
+  'compute_memory_pool.h',
+  'eg_asm.c',
+  'eg_debug.c',
+  'eg_sq.h',
+  'evergreen_compute.c',
+  'evergreen_compute.h',
+  'evergreen_compute_internal.h',
+  'evergreend.h',
+  'evergreen_hw_context.c',
+  'evergreen_state.c',
+  'r600_asm.c',
+  'r600_asm.h',
+  'r600_blit.c',
+  'r600d.h',
+  'r600_formats.h',
+  'r600_hw_context.c',
+  'r600_isa.c',
+  'r600_isa.h'

[Mesa-dev] [PATCH v3 05/15] meson: build svga driver on linux

2017-11-13 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  6 ++-
 src/gallium/drivers/svga/meson.build| 88 +
 src/gallium/meson.build |  5 +-
 src/gallium/targets/dri/meson.build |  5 ++
 src/gallium/winsys/svga/drm/meson.build | 45 +
 5 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 src/gallium/drivers/svga/meson.build
 create mode 100644 src/gallium/winsys/svga/drm/meson.build

diff --git a/meson.build b/meson.build
index 12816a2535f..f33d002843e 100644
--- a/meson.build
+++ b/meson.build
@@ -128,14 +128,15 @@ with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_i915 = false
+with_gallium_svga = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
+  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
@@ -157,6 +158,7 @@ if _drivers != ''
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
   with_gallium_i915 = _split.contains('i915')
+  with_gallium_svga = _split.contains('svga')
   with_gallium = true
 endif
 
diff --git a/src/gallium/drivers/svga/meson.build 
b/src/gallium/drivers/svga/meson.build
new file mode 100644
index 000..d9a7da95a33
--- /dev/null
+++ b/src/gallium/drivers/svga/meson.build
@@ -0,0 +1,88 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_svga = files(
+  'svga_cmd.c',
+  'svga_cmd_vgpu10.c',
+  'svga_context.c',
+  'svga_draw_arrays.c',
+  'svga_draw.c',
+  'svga_draw_elements.c',
+  'svga_format.c',
+  'svga_link.c',
+  'svga_msg.c',
+  'svga_pipe_blend.c',
+  'svga_pipe_blit.c',
+  'svga_pipe_clear.c',
+  'svga_pipe_constants.c',
+  'svga_pipe_depthstencil.c',
+  'svga_pipe_draw.c',
+  'svga_pipe_flush.c',
+  'svga_pipe_fs.c',
+  'svga_pipe_gs.c',
+  'svga_pipe_misc.c',
+  'svga_pipe_query.c',
+  'svga_pipe_rasterizer.c',
+  'svga_pipe_sampler.c',
+  'svga_pipe_streamout.c',
+  'svga_pipe_vertex.c',
+  'svga_pipe_vs.c',
+  'svga_resource_buffer.c',
+  'svga_resource_buffer_upload.c',
+  'svga_resource.c',
+  'svga_resource_texture.c',
+  'svga_sampler_view.c',
+  'svga_screen.c',
+  'svga_screen_cache.c',
+  'svga_shader.c',
+  'svga_state.c',
+  'svga_state_constants.c',
+  'svga_state_framebuffer.c',
+  'svga_state_fs.c',
+  'svga_state_gs.c',
+  'svga_state_need_swtnl.c',
+  'svga_state_rss.c',
+  'svga_state_sampler.c',
+  'svga_state_tgsi_transform.c',
+  'svga_state_tss.c',
+  'svga_state_vdecl.c',
+  'svga_state_vs.c',
+  'svga_surface.c',
+  'svga_swtnl_backend.c',
+  'svga_swtnl_draw.c',
+  'svga_swtnl_state.c',
+  'svga_tgsi.c',
+  'svga_tgsi_decl_sm30.c',
+  'svga_tgsi_insn.c',
+  'svga_tgsi_vgpu10.c',
+  'svgadump/svga_dump.c',
+  'svgadump/svga_shader_dump.c',
+  'svgadump/svga_shader_op.c',
+)
+
+libsvga = static_library(
+  'svga',
+  files_svga,
+  c_args : [c_vis_args, c_msvc_compat_args],
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux,
+include_directories('include')
+  ],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 2568e5ddcfc..2a4cb66ad7a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -81,6 +81,10 @@ if with_gallium_i915
   subdir('winsys/i915/drm')
   subdir('drivers/i915')
 e

[Mesa-dev] [PATCH v3 01/15] meson: add proper LLVM modules to check for RadeonSI as well

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

diff --git a/meson.build b/meson.build
index e8467590df2..8ea2b3e106c 100644
--- a/meson.build
+++ b/meson.build
@@ -702,7 +702,7 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk
+if with_amd_vk or with_gallium_radeonsi # TODO: r600
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
 endif
 dep_llvm = []
-- 
2.15.0

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


Re: [Mesa-dev] [PATCH 1/2] meson: Stop requiring platforms for Vulkan

2017-11-13 Thread Dylan Baker
I can't either, so:
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Jason Ekstrand (2017-11-13 09:43:11)
> My quick attempt at grepping configure.ac didn't turn anything up.
> 
> On Mon, Nov 13, 2017 at 9:37 AM, Dylan Baker <dy...@pnwbakers.com> wrote:
> 
> I believe I copied this from autotools, does it have the same restriction?
> 
> Quoting Jason Ekstrand (2017-11-11 10:32:05)
> > It should be perfectly valid to build a completely headless Vulkan
>   river.  We don't need to require a platform.
> > ---
> >  meson.build | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 1f6658b..e4d0e0f 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -306,9 +306,6 @@ if _vulkan_drivers != ''
> >    with_intel_vk = _split.contains('intel')
> >    with_amd_vk = _split.contains('amd')
> >    with_any_vk = with_amd_vk or with_intel_vk
> > -  if not (with_platform_x11 or with_platform_wayland or
> with_platform_android)
> > -    error('Vulkan requires at least one platform (x11, wayland, 
> android)
> ')
> > -  endif
> >  endif
> >
> >  with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
> > --
> > 2.5.0.400.gff86faf
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> 


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


Re: [Mesa-dev] [PATCH] meson: if dep_dl is an empty list, it's not a dependency object

2017-11-13 Thread Dylan Baker
I thought I'd fixed this already,
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Jon Turney (2017-11-13 02:28:27)
> It's ok to use an empty list for dependencies:, but it's not ok to try to
> use the found() method of it.
> 
> See also https://github.com/mesonbuild/meson/issues/2324
> 
> Signed-off-by: Jon Turney <jon.tur...@dronecode.org.uk>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 0cbaefb7882..9b0e495a58c 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -925,7 +925,7 @@ endif
>  if dep_m.found()
>gl_priv_libs += '-lm'
>  endif
> -if dep_dl.found()
> +if dep_dl != [] and dep_dl.found()
>gl_priv_libs += '-ldl'
>  endif
>  
> -- 
> 2.15.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] RFC: meson: Add a new build-dev-tools option

2017-11-13 Thread Dylan Baker
Quoting Jason Ekstrand (2017-11-11 09:42:34)
> A variety of the different drivers in mesa have some sort of developer
> tools to go along with them.  Normal users don't want these but devs do.
> This commit adds a new build-dev-tools option which causes these tools
> to be built and installed.
> 
> Cc: Rob Clark <robdcl...@gmail.com>
> Cc: Dylan Baker <dy...@pnwbakers.com>
> ---
>  meson.build   | 5 +
>  meson_options.txt | 6 ++
>  src/gallium/drivers/freedreno/meson.build | 3 ++-
>  src/intel/meson.build | 4 +++-
>  src/intel/tools/meson.build   | 6 --
>  5 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 1f6658b..98b72e9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -411,6 +411,11 @@ elif with_amd_vk
>error('Radv requires shader cache support')
>  endif
>  
> +build_dev_tools = get_option('build-dev-tools')
> +if build_dev_tools and get_option('buildtype') == 'release'
> +  warning('The build-dev-tools option is for developers only.  Distros and 
> regular users should leave it off.')

`warning` is brand new in 0.43 (or 0.44? I can't remember). Either way you
should use `message` so that this works with 0.42

> +endif
> +
>  # Check for GCC style builtins
>  foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
>   'ffsll', 'popcount', 'popcountll', 'unreachable']
> diff --git a/meson_options.txt b/meson_options.txt
> index 6c9cd33..8e2716a 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -182,3 +182,9 @@ option(
>choices : ['8', '16', '32'],
>description : 'Number of channel bits for OSMesa.'
>  )
> +option(
> +  'build-dev-tools',
> +  type : 'boolean',
> +  value : false,
> +  description: 'Build and install developer tools.  This option is 
> recommended for developers only and should not be set by users or packagers.'
> +)
> diff --git a/src/gallium/drivers/freedreno/meson.build 
> b/src/gallium/drivers/freedreno/meson.build
> index 3fb94ed..cffb9cd 100644
> --- a/src/gallium/drivers/freedreno/meson.build
> +++ b/src/gallium/drivers/freedreno/meson.build
> @@ -224,5 +224,6 @@ ir3_compiler = executable(
>  libglsl_standalone,
>  libmesa_util,
>],
> -  build_by_default : true,
> +  install : build_dev_tools,
> +  build_by_default : build_dev_tools,
>  )
> diff --git a/src/intel/meson.build b/src/intel/meson.build
> index 5767608..777afbf 100644
> --- a/src/intel/meson.build
> +++ b/src/intel/meson.build
> @@ -25,7 +25,9 @@ subdir('genxml')
>  subdir('common')
>  subdir('isl')
>  subdir('compiler')
> -subdir('tools')
> +if (with_dri_i965 or intel_vk) and build_dev_tools
 with_intel_vk
> +  subdir('tools')
> +endif

Using `and build_dev_tools` means that a develper can't use `ninja
path/to/tool`, I don't know if thats the end of the world, but that does make
the ir3 compiler and the intel tools behave differently. I'd prefer to to do:

```meson
intel_tools = (with_dri_i965 or with_intel_vk) and build_dev_tools
executable(
  ...
  build_by_default : intel_tools,
  install: intel_tools,
)
```

Nouveau also has a standalone compiler


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: Move -Dvulkan-drivers handling higher in the file

2017-11-13 Thread Dylan Baker
Oops. I made a rebasing mistake in the GLX-XLIB series. That's my bad
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Jason Ekstrand (2017-11-11 10:32:06)
> The window-system auto-detection code (specifically for glx) relies on
> with_any_vk being available.  This fixes the Vulkan-only build.  Also,
> this puts it up near the handling of -Ddri-drivers and -Dgallium-drivers
> which seems to make a bit more sense.
> ---
>  meson.build | 46 +++---
>  1 file changed, 23 insertions(+), 23 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index e4d0e0f..e846759 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -154,6 +154,29 @@ if _drivers != ''
>with_gallium = true
>  endif
>  
> +with_intel_vk = false
> +with_amd_vk = false
> +with_any_vk = false
> +_vulkan_drivers = get_option('vulkan-drivers')
> +if _vulkan_drivers == 'auto'
> +  if not ['darwin', 'windows'].contains(host_machine.system())
> +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.')
> +endif
> +  else
> +# No vulkan driver supports windows or macOS currently
> +_vulkan_drivers = ''
> +  endif
> +endif
> +if _vulkan_drivers != ''
> +  _split = _vulkan_drivers.split(',')
> +  with_intel_vk = _split.contains('intel')
> +  with_amd_vk = _split.contains('amd')
> +  with_any_vk = with_amd_vk or with_intel_vk
> +endif
> +
>  if with_dri_swrast and with_gallium_softpipe
>error('Only one swrast provider can be built')
>  endif
> @@ -285,29 +308,6 @@ if with_vulkan_icd_dir == ''
>with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d')
>  endif
>  
> -with_intel_vk = false
> -with_amd_vk = false
> -with_any_vk = false
> -_vulkan_drivers = get_option('vulkan-drivers')
> -if _vulkan_drivers == 'auto'
> -  if not ['darwin', 'windows'].contains(host_machine.system())
> -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.')
> -endif
> -  else
> -# No vulkan driver supports windows or macOS currently
> -_vulkan_drivers = ''
> -  endif
> -endif
> -if _vulkan_drivers != ''
> -  _split = _vulkan_drivers.split(',')
> -  with_intel_vk = _split.contains('intel')
> -  with_amd_vk = _split.contains('amd')
> -  with_any_vk = with_amd_vk or with_intel_vk
> -endif
> -
>  with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
>  with_dri3 = get_option('dri3')
>  if with_dri3 == 'auto'
> -- 
> 2.5.0.400.gff86faf
> 
> ___
> 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: Stop requiring platforms for Vulkan

2017-11-13 Thread Dylan Baker
I believe I copied this from autotools, does it have the same restriction?

Quoting Jason Ekstrand (2017-11-11 10:32:05)
> It should be perfectly valid to build a completely headless Vulkan
> driver.  We don't need to require a platform.
> ---
>  meson.build | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 1f6658b..e4d0e0f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -306,9 +306,6 @@ if _vulkan_drivers != ''
>with_intel_vk = _split.contains('intel')
>with_amd_vk = _split.contains('amd')
>with_any_vk = with_amd_vk or with_intel_vk
> -  if not (with_platform_x11 or with_platform_wayland or 
> with_platform_android)
> -error('Vulkan requires at least one platform (x11, wayland, android)')
> -  endif
>  endif
>  
>  with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
> -- 
> 2.5.0.400.gff86faf
> 
> ___
> 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 09/10] spirv: Generate code to track SPIR-V capability dependencies

2017-11-13 Thread Dylan Baker
Quoting Ian Romanick (2017-11-10 14:32:49)
[snip]

> +
> +def collect_data(spirv):
> +for x in spirv["operand_kinds"]:
> +if x["kind"] == "Capability":
> +operands = x

This makes me nervous. dict iteration order is not guaranteed to be repeatable
in python. I think you should either use sorted() [for x in sorted(spirv...)],
or if there's only every going to be on case where x[kind] == capability use a
break statement and leave a comment.

> +
> +# There are some duplicate values in some of the tables (thanks guys!), 
> so
> +# filter them out.
> +
> +# by_value is a dictionary that maps values of enumerants to tuples of
> +# enumerant names and capabilities.
> +by_value = {}
> +
> +# by_name is a dictionary that maps names of enumerants to tuples of
> +# values and required capabilities.
> +by_name = {}
> +
> +for x in operands["enumerants"]:
> +caps = x["capabilities"] if "capabilities" in x else []

caps = x.get("capabilities", [])

> +
> +if x["value"] not in by_value:
> +by_value[x["value"]] = (x["enumerant"], caps)
> +
> +by_name[x["enumerant"]] = (x["value"], caps)
> +
> +# Recall that there are some duplicate values in the table.  These
> +# duplicate values also appear in the "capabilities" list for some
> +# enumerants.  Filter out the duplicates there as well.
> +for capability in by_name:
> +cap_value, dependencies = by_name[capability]
> +for dependency in dependencies:
> +dep_value, skip = by_name[dependency]
> +real_dependency, skip = by_value[dep_value]

I think you can simplify this somewhat:

for capability, (_, dependencies) in by_name.iteritems():
for dep_value, _ in dependencies.itervalues():
real_dependency, _ = by_value[dep_value]

> +
> +# In most cases where there is a duplicate capability, things 
> that
> +# depend on one will also depend on the others.
> +# StorageBuffer16BitAccess and StorageUniformBufferBlock16 have
> +# the same value, and StorageUniform16 depends on both.
> +#
> +# There are exceptions.  ShaderViewportIndexLayerEXT and
> +# ShaderViewportIndexLayerNV have the same value, but
> +# ShaderViewportMaskNV only depends on 
> ShaderViewportIndexLayerNV.
> +#
> +# That's the only case so far, so emit a warning for other cases
> +# that have more than one dependency.  That way we can double
> +# check that they are handled correctly.
> +
> +if real_dependency != dependency:
> +if real_dependency not in by_name[capability][1]:
> +if len(by_name[capability][1]) > 1:
> +print("Warning!  Removed {} from {}, but no name 
> with the same value is in the dependency list.".format(dependency, 
> capability))
> +else:
> +if len(by_name[capability][1]) == 1:
> +print("Error!  Cannot remove {} from {} because it 
> is the only dependency.".format(dependency, capability))

I think you want to add file=sys.stderr to the print command. (You might need to
import sys, I snipped that part of the patch already...)

> +exit(1)
> +
> +by_name[capability][1].remove(dependency)
> +
> +# The table generated from this data and the C code that uses it
> +# assumes that each capability has a single dependency.  That is
> +# currently the case, but it may change in the future.
> +if len(by_name[capability][1]) > 1:
> +print("Error!  Too many dependencies left for {}. 
> {}".format(capability, by_name[capability][1]))
> +exit(1)
> +
> +for cap_value in by_value:
> +name, skip = by_value[cap_value]
> +by_value[cap_value] = (name, by_name[name][1])
> +
> +return (by_name, by_value)
> +
> +TEMPLATE_H = Template(COPYRIGHT + """\
> +#ifndef SPIRV_CAPABILITIES_H
> +#define SPIRV_CAPABILITIES_H
> +
> +#include 
> +#include "spirv.h"
> +#include "util/bitset.h"
> +#ifndef ARRAY_SIZE
> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
> +#endif
> +
> +#define NO_DEPENDENCY ((${"uint16_t" if len(all_values) > 256 else 
> "uint8_t"}) ~0)
> +
> +class spirv_capability_set;
> +
> +/**
> + * Iterator for the enabled capabilities in a spirv_capability_set
> + *
> + * Roughly, this is a wrapper for the bitset iterator functions.  
> Dereferencing
> + * the iterator results in the \c SpvCapability where as the bitset iterator
> + * functions provide the index in the bitset.  The mapping is handled by
> + * \c spirv_capability_set.
> + */
> +class spirv_capability_set_iterator {
> +public:
> +   spirv_capability_set_iterator(const spirv_capability_set *_s);
> +   inline bool operator==(const spirv_capability_set_iterator ) const;
> +   inline bool 

[Mesa-dev] [PATCH 2/3] meson: Don't build intel shared components by default

2017-11-13 Thread Dylan Baker
It's a neat idea, and still useful in some cases, but the intel common
code is used by i965 and anvil only, this is a little clearer.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/intel/blorp/meson.build  | 1 -
 src/intel/common/meson.build | 1 -
 src/intel/isl/meson.build| 3 ---
 src/meson.build  | 4 +++-
 4 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/intel/blorp/meson.build b/src/intel/blorp/meson.build
index 9241535fd20..febdea97f3c 100644
--- a/src/intel/blorp/meson.build
+++ b/src/intel/blorp/meson.build
@@ -33,5 +33,4 @@ libblorp = static_library(
   [files_libblorp, nir_opcodes_h],
   include_directories : [inc_common, inc_intel],
   c_args : [c_vis_args, no_override_init_args],
-  build_by_default : false,
 )
diff --git a/src/intel/common/meson.build b/src/intel/common/meson.build
index db7d74a26d2..cbcf6647531 100644
--- a/src/intel/common/meson.build
+++ b/src/intel/common/meson.build
@@ -41,5 +41,4 @@ libintel_common = static_library(
   include_directories : [inc_common, inc_intel],
   c_args : [c_vis_args, no_override_init_args],
   dependencies : [dep_expat, dep_libdrm],
-  build_by_default : false,
 )
diff --git a/src/intel/isl/meson.build b/src/intel/isl/meson.build
index 54024b4d11b..47fd8d97c32 100644
--- a/src/intel/isl/meson.build
+++ b/src/intel/isl/meson.build
@@ -60,7 +60,6 @@ foreach g : [['40', isl_gen4_files], ['50', []], ['60', 
isl_gen6_files],
 include_directories : [inc_common, inc_intel],
 c_args : [c_vis_args, no_override_init_args,
   '-DGEN_VERSIONx10=@0@'.format(_gen)],
-build_by_default : false,
   )
   isl_gen_libs += _lib
 endforeach
@@ -88,7 +87,6 @@ libisl = static_library(
   include_directories : [inc_common, inc_intel, inc_drm_uapi],
   link_with : isl_gen_libs,
   c_args : [c_vis_args, no_override_init_args],
-  build_by_default : false,
 )
 
 if with_tests
@@ -98,7 +96,6 @@ if with_tests
 dependencies : dep_m,
 include_directories : [inc_common, inc_intel],
 link_with : [libisl, libintel_common],
-build_by_default : false,
   )
 
   test('isl_surf_get_image_offset', isl_surf_get_image_offset_test)
diff --git a/src/meson.build b/src/meson.build
index 53c8269a99e..c3b1ff00d00 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -55,7 +55,9 @@ subdir('amd')
 if with_gallium_vc4
   subdir('broadcom')
 endif
-subdir('intel')
+if with_dri_i965 or with_intel_vk
+  subdir('intel')
+endif
 subdir('mesa')
 subdir('loader')
 subdir('glx')
-- 
2.15.0

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


[Mesa-dev] [PATCH 3/3] meson: Remove build_by_default from amd code

2017-11-13 Thread Dylan Baker
This is the same logic as the previous two patches.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/amd/addrlib/meson.build | 1 -
 src/amd/common/meson.build  | 1 -
 src/meson.build | 4 +++-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/addrlib/meson.build b/src/amd/addrlib/meson.build
index 62beb0ecbc1..1a7f2fdef5d 100644
--- a/src/amd/addrlib/meson.build
+++ b/src/amd/addrlib/meson.build
@@ -57,5 +57,4 @@ libamdgpu_addrlib = static_library(
 'core', 'inc/chip/gfx9', 'inc/chip/r800', 'gfx9/chip', 'r800/chip',
 '../common', '../../'),
   cpp_args : [cpp_vis_args, '-DBRAHMA_BUILD=1'],
-  build_by_default : false,
 )
diff --git a/src/amd/common/meson.build b/src/amd/common/meson.build
index 842b42f897e..4fd7edc5cd3 100644
--- a/src/amd/common/meson.build
+++ b/src/amd/common/meson.build
@@ -59,5 +59,4 @@ libamd_common = static_library(
   dep_valgrind],
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
-  build_by_default : false,
 )
diff --git a/src/meson.build b/src/meson.build
index c3b1ff00d00..9232cc4ab18 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -51,7 +51,9 @@ subdir('mapi')
 subdir('compiler')
 subdir('egl/wayland/wayland-drm')
 subdir('vulkan')
-subdir('amd')
+if with_gallium_radeonsi or with_amd_vk
+  subdir('amd')
+endif
 if with_gallium_vc4
   subdir('broadcom')
 endif
-- 
2.15.0

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


[Mesa-dev] [PATCH 1/3] meson: don't use build_by_default for specific gallium drivers

2017-11-13 Thread Dylan Baker
Using build_by_default : false is convenient for dependencies that can
be pulled in by various diverse components of the build system, the
gallium hardware/software drivers and state trackers do not fit that
description. Instead, these should be guarded using the variable that tracks
whether that driver should be enabled.

This leaves a few helper libraries: trace, rbug, etc, and the generic
winsys bits as `build_by_default : false` because there are a large
number of gallium components that pull them in.

v2: - remove build_by_default from winsys convenience libs as well.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Tested-by: Lionel Landwerlin <lionel.g.landwer...@intel.com> (v1)
---
 src/gallium/drivers/freedreno/meson.build|  1 -
 src/gallium/drivers/llvmpipe/meson.build |  1 -
 src/gallium/drivers/nouveau/meson.build  |  1 -
 src/gallium/drivers/radeon/meson.build   |  1 -
 src/gallium/drivers/radeonsi/meson.build |  1 -
 src/gallium/drivers/softpipe/meson.build |  1 -
 src/gallium/drivers/vc5/meson.build  |  1 -
 src/gallium/meson.build  | 47 +++-
 src/gallium/state_trackers/dri/meson.build   |  1 -
 src/gallium/winsys/amdgpu/drm/meson.build|  1 -
 src/gallium/winsys/freedreno/drm/meson.build |  1 -
 src/gallium/winsys/nouveau/drm/meson.build   |  1 -
 src/gallium/winsys/radeon/drm/meson.build|  1 -
 13 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/src/gallium/drivers/freedreno/meson.build 
b/src/gallium/drivers/freedreno/meson.build
index fe1a902e9e5..d2b901334d0 100644
--- a/src/gallium/drivers/freedreno/meson.build
+++ b/src/gallium/drivers/freedreno/meson.build
@@ -207,7 +207,6 @@ libfreedreno = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_libdrm, dep_libdrm_freedreno],
-  build_by_default : false,
 )
 
 ir3_compiler = executable(
diff --git a/src/gallium/drivers/llvmpipe/meson.build 
b/src/gallium/drivers/llvmpipe/meson.build
index ca1d2aa797b..9d0edb0ac33 100644
--- a/src/gallium/drivers/llvmpipe/meson.build
+++ b/src/gallium/drivers/llvmpipe/meson.build
@@ -98,7 +98,6 @@ libllvmpipe = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
   dependencies : dep_llvm,
-  build_by_default : false,
 )
 
 if with_tests and with_gallium_softpipe and with_llvm
diff --git a/src/gallium/drivers/nouveau/meson.build 
b/src/gallium/drivers/nouveau/meson.build
index 2bc6142879e..59fecfc5255 100644
--- a/src/gallium/drivers/nouveau/meson.build
+++ b/src/gallium/drivers/nouveau/meson.build
@@ -211,7 +211,6 @@ libnouveau = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_libdrm, dep_libdrm_nouveau],
-  build_by_default : false,
 )
 
 nouveau_compiler = executable(
diff --git a/src/gallium/drivers/radeon/meson.build 
b/src/gallium/drivers/radeon/meson.build
index b4d2832d016..f378b12e8e8 100644
--- a/src/gallium/drivers/radeon/meson.build
+++ b/src/gallium/drivers/radeon/meson.build
@@ -51,5 +51,4 @@ libradeon = static_library(
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
   ],
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/radeonsi/meson.build 
b/src/gallium/drivers/radeonsi/meson.build
index 4392184dbb6..974004db67f 100644
--- a/src/gallium/drivers/radeonsi/meson.build
+++ b/src/gallium/drivers/radeonsi/meson.build
@@ -75,5 +75,4 @@ libradeonsi = static_library(
   c_args : [c_vis_args],
   cpp_args : [cpp_vis_args],
   dependencies : dep_llvm,
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/softpipe/meson.build 
b/src/gallium/drivers/softpipe/meson.build
index 0cef15152e2..df23533c72c 100644
--- a/src/gallium/drivers/softpipe/meson.build
+++ b/src/gallium/drivers/softpipe/meson.build
@@ -81,5 +81,4 @@ libsoftpipe = static_library(
   files_softpipe,
   include_directories : [inc_gallium_aux, inc_gallium, inc_include, inc_src],
   c_args : [c_vis_args, c_msvc_compat_args],
-  build_by_default : false,
 )
diff --git a/src/gallium/drivers/vc5/meson.build 
b/src/gallium/drivers/vc5/meson.build
index d066366fcc7..61059a15560 100644
--- a/src/gallium/drivers/vc5/meson.build
+++ b/src/gallium/drivers/vc5/meson.build
@@ -61,5 +61,4 @@ libvc5 = static_library(
   c_args : [c_vis_args, v3dv3_c_args],
   cpp_args : [cpp_vis_args],
   dependencies : [dep_v3dv3, dep_libdrm, dep_valgrind],
-  build_by_default : false,
 )
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c5772b36cb6..5341e093bfb 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -27,41 +27,44 @@ subdir('drivers/ddebug')
 subdir('drivers/noop')
 subdir('drivers/trace')
 subdir('drivers/rbug')
-subdir('drivers/radeon')
-subdir('drivers/radeonsi')
-subdir('drivers/nouveau')
-if with_gallium_freedreno
-  subdir('drive

[Mesa-dev] [PATCH 1/8] glapi: don't walk backwards for includes

2017-11-20 Thread Dylan Baker
Instead just set the proper -I flags and include it from a more standard
path. In this case we'll add -Isrc/mesa (which is common), and #include
main/foo.h.
---
 src/mapi/Makefile.am | 3 ++-
 src/mapi/glapi/meson.build   | 1 +
 src/mapi/glapi/tests/check_table.cpp | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 3f8fcc02e55..015edc37cb3 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -87,7 +87,8 @@ check_PROGRAMS += shared-glapi-test
 shared_glapi_test_SOURCES = shared-glapi/tests/check_table.cpp
 shared_glapi_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
-   -I$(top_srcdir)/src/gtest/include
+   -I$(top_srcdir)/src/gtest/include \
+   -I$(top_srcdir)/src/mesa
 shared_glapi_test_LDADD = \
$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
$(top_builddir)/src/gtest/libgtest.la
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index d2d86afd6c1..892d8b35759 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -79,6 +79,7 @@ if not with_shared_glapi and with_tests
   glapi_static_check_table = executable(
 'glapi_static_check_table',
 'tests/check_table.cpp',
+include_directories : inc_mesa,
 link_with : [libglapi_static],
 dependencies : [idep_gtest],
   )
diff --git a/src/mapi/glapi/tests/check_table.cpp 
b/src/mapi/glapi/tests/check_table.cpp
index 09bf4f3585c..62b3a43d22f 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -22,7 +22,7 @@
  */
 
 #include 
-#include "../mesa/main/glheader.h"
+#include "main/glheader.h"
 
 extern "C" {
 #include "glapi/glapi.h"
-- 
2.15.0

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


[Mesa-dev] [PATCH 7/8] glapi: Don't search through subdirs from glapitable.h

2017-11-20 Thread Dylan Baker
Because meson won't put it in that folder.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mapi/glapi/tests/check_table.cpp | 2 +-
 src/mesa/main/tests/Makefile.am  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/tests/check_table.cpp 
b/src/mapi/glapi/tests/check_table.cpp
index 30f523ca5fb..6230f1273f3 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -25,7 +25,7 @@
 #include "main/glheader.h"
 
 #include "glapi/glapi.h"
-#include "glapi/glapitable.h"
+#include "glapitable.h"
 
 struct name_offset {
const char *name;
diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
index 47fce8a5b78..5c920b70236 100644
--- a/src/mesa/main/tests/Makefile.am
+++ b/src/mesa/main/tests/Makefile.am
@@ -4,6 +4,8 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/mapi \
+   -I$(top_builddir)/src/mapi/glapi \
+   -I$(top_srcdir)/src/mapi/glapi \
-I$(top_builddir)/src/mesa \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/include \
-- 
2.15.0

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


[Mesa-dev] [PATCH 5/8] autotools: Fix includes for non-shared glapi tests.

2017-11-20 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mapi/Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 015edc37cb3..5db888abddc 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -150,7 +150,8 @@ check_PROGRAMS += glapi-test
 glapi_test_SOURCES = glapi/tests/check_table.cpp
 glapi_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
-   -I$(top_srcdir)/src/gtest/include
+   -I$(top_srcdir)/src/gtest/include \
+   -I$(top_srcdir)/src/mesa
 
 glapi_test_LDADD = \
$(top_builddir)/src/mapi/glapi/libglapi.la \
-- 
2.15.0

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


[Mesa-dev] [PATCH 4/8] glapi: remove APPLE extensions from test

2017-11-20 Thread Dylan Baker
Fixes: 7009955281260fbb ("mesa: Remove GL_APPLE_vertex_array_object stubs")
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mapi/glapi/tests/check_table.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mapi/glapi/tests/check_table.cpp 
b/src/mapi/glapi/tests/check_table.cpp
index 7cded8d352f..30f523ca5fb 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -1402,9 +1402,7 @@ const struct name_offset known_dispatch[] = {
{ "glPointParameteri", _O(PointParameteri) },
{ "glPointParameteriv", _O(PointParameteriv) },
{ "glActiveStencilFaceEXT", _O(ActiveStencilFaceEXT) },
-   { "glBindVertexArrayAPPLE", _O(BindVertexArrayAPPLE) },
{ "glDeleteVertexArrays", _O(DeleteVertexArrays) },
-   { "glGenVertexArraysAPPLE", _O(GenVertexArraysAPPLE) },
{ "glIsVertexArray", _O(IsVertexArray) },
{ "glGetProgramNamedParameterdvNV", _O(GetProgramNamedParameterdvNV) },
{ "glGetProgramNamedParameterfvNV", _O(GetProgramNamedParameterfvNV) },
-- 
2.15.0

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


[Mesa-dev] [PATCH 6/8] state_tracker: Don't build st-renumerate-test without shared glapi

2017-11-20 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mesa/state_tracker/tests/Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/state_tracker/tests/Makefile.am 
b/src/mesa/state_tracker/tests/Makefile.am
index 6c58d367694..18c0ce50621 100644
--- a/src/mesa/state_tracker/tests/Makefile.am
+++ b/src/mesa/state_tracker/tests/Makefile.am
@@ -16,9 +16,11 @@ AM_CPPFLAGS = \
$(DEFINES)
 
 if HAVE_STD_CXX11
+if HAVE_SHARED_GLAPI
 TESTS = st-renumerate-test
 check_PROGRAMS = st-renumerate-test
 endif
+endif
 
 st_renumerate_test_SOURCES =   \
test_glsl_to_tgsi_lifetime.cpp
-- 
2.15.0

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


[Mesa-dev] [PATCH 8/8] glapi: fix check_table test for non-shared glapi with meson

2017-11-20 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mapi/glapi/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index 892d8b35759..db6cd834511 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -78,10 +78,10 @@ libglapi_static = static_library(
 if not with_shared_glapi and with_tests
   glapi_static_check_table = executable(
 'glapi_static_check_table',
-'tests/check_table.cpp',
-include_directories : inc_mesa,
+['tests/check_table.cpp', glapitable_h],
+include_directories : [inc_include, inc_src, inc_mesa, inc_mapi],
 link_with : [libglapi_static],
-dependencies : [idep_gtest],
+dependencies : [idep_gtest, dep_thread],
   )
 
   test('glapi_static_check_table', glapi_static_check_table)
-- 
2.15.0

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


[Mesa-dev] [PATCH 3/8] glapi/check_table: Remove 'extern "C"' block

2017-11-20 Thread Dylan Baker
This doesn't actually accomplish what it's meant to do, as extern C
doesn't undefine __cplusplus, so the included headers define a template
(because __cplusplus is defined), but then that code is in an 'extern
"C"' block, and explosion.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mapi/glapi/tests/check_table.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mapi/glapi/tests/check_table.cpp 
b/src/mapi/glapi/tests/check_table.cpp
index 62b3a43d22f..7cded8d352f 100644
--- a/src/mapi/glapi/tests/check_table.cpp
+++ b/src/mapi/glapi/tests/check_table.cpp
@@ -24,10 +24,8 @@
 #include 
 #include "main/glheader.h"
 
-extern "C" {
 #include "glapi/glapi.h"
 #include "glapi/glapitable.h"
-}
 
 struct name_offset {
const char *name;
-- 
2.15.0

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


[Mesa-dev] [PATCH 2/8] meson: fix test source name for static glapi

2017-11-20 Thread Dylan Baker
fixes: 43a6e84927e3 ("meson: build mesa test.")
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 src/mesa/main/tests/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/tests/meson.build b/src/mesa/main/tests/meson.build
index 2c1d8e067e8..78bef00f61e 100644
--- a/src/mesa/main/tests/meson.build
+++ b/src/mesa/main/tests/meson.build
@@ -30,7 +30,7 @@ if with_shared_glapi
   )
   link_main_test += libglapi
 else
-  files_main_test += files('stub.cpp')
+  files_main_test += files('stubs.cpp')
 endif
 
 test('main-test', executable(
-- 
2.15.0

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


[Mesa-dev] [PATCH 0/8] Fix non-shared glapi path

2017-11-20 Thread Dylan Baker
There are two distinct set of problems this series addresses.

1) the meson build has never worked
2) the checks for this path have been broken in several different ways for a
   long time.

Dylan Baker (8):
  glapi: don't walk backwards for includes
  meson: fix test source name for static glapi
  glapi/check_table: Remove 'extern "C"' block
  glapi: remove APPLE extensions from test
  autotools: Fix includes for non-shared glapi tests.
  state_tracker: Don't build st-renumerate-test without shared glapi
  glapi: Don't search through subdirs from glapitable.h
  glapi: fix check_table test for non-shared glapi with meson

 src/mapi/Makefile.am | 6 --
 src/mapi/glapi/meson.build   | 5 +++--
 src/mapi/glapi/tests/check_table.cpp | 8 ++--
 src/mesa/main/tests/Makefile.am  | 2 ++
 src/mesa/main/tests/meson.build  | 2 +-
 src/mesa/state_tracker/tests/Makefile.am | 2 ++
 6 files changed, 14 insertions(+), 11 deletions(-)

-- 
2.15.0

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


Re: [Mesa-dev] [PATCH v4 11/13] meson: build gallium omx state tracker

2017-11-20 Thread Dylan Baker
Quoting Emil Velikov (2017-11-17 04:19:22)
> Hi Dylan,
> 
> On 17 November 2017 at 00:27, Dylan Baker <dy...@pnwbakers.com> wrote:
> 
> > +  elif not (with_gallium_r600 or with_gallium_radeonsi or 
> > with_gallium_nouveau)
> 
> 
> > +  elif not (with_gallium_r600 or with_gallium_radeonsi or 
> > with_gallium_nouveau)
> > +error('OMX state tracker requires at least one of the following 
> > gallium drivers: r600, radeonsi, nouveau.')
> 
> We had this type of dual tracking (once in configure and second in the
> makefile) in the past for the autotools setup.
> Sadly it was getting out of sync fairly often so Matt removed it.

Now that I've had some more time ot think about it it, one of the things we can
do (Eric Anholt suggested it as well), is move some of this logic out of
$top/meson.build and down into the lower meson.build scripts, maybe
src/gallium/targets/*/meson.build, which would make it harder for people to miss
them since the two pieces of logic would be together.

> 
> In the odd case where an empty* target is build we'll effectively nuke
> it as part of the hardlink generation process.
> 
> If you agreed, I won't bother respinning the series for that. One can
> relax things as follow-up.
> 
> * A target where no driver is actually present, only the state-tracker
> bits are there.
> 
> > --- a/src/gallium/meson.build
> > +++ b/src/gallium/meson.build
> > @@ -105,6 +105,9 @@ endif
> >  if with_gallium_xvmc
> >subdir('state_trackers/xvmc')
> >  endif
> > +if with_gallium_omx
> > +  subdir('state_trackers/omx_bellagio')
> > +endif
> 
> > -# TODO: OMX
> > +if with_gallium_omx
> > +  subdir('targets/omx-bellagio')
> > +endif
> Grouping the state-tracker and target within the same if block will
> make things easier to read.
> Admittedly it's minor polish, so we can do that at later stage.
> 
> Last but not least: thanks for removing the overlinking for va/vdpau.
> 
> Emil


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


[Mesa-dev] [PATCH v5 02/13] meson: build i915g driver

2017-11-20 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  7 +++-
 src/gallium/drivers/i915/meson.build| 70 +
 src/gallium/meson.build |  7 ++--
 src/gallium/targets/dri/meson.build |  5 +++
 src/gallium/winsys/i915/drm/meson.build | 31 +++
 5 files changed, 116 insertions(+), 4 deletions(-)
 create mode 100644 src/gallium/drivers/i915/meson.build
 create mode 100644 src/gallium/winsys/i915/drm/meson.build

diff --git a/meson.build b/meson.build
index 87d435fcb71..cbeeef5a749 100644
--- a/meson.build
+++ b/meson.build
@@ -125,6 +125,7 @@ with_gallium_vc4 = false
 with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
+with_gallium_i915 = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
@@ -151,6 +152,7 @@ if _drivers != ''
   with_gallium_vc5 = _split.contains('vc5')
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
+  with_gallium_i915 = _split.contains('i915')
   with_gallium = true
 endif
 
@@ -180,12 +182,15 @@ endif
 if with_dri_swrast and with_gallium_softpipe
   error('Only one swrast provider can be built')
 endif
+if with_dri_i915 and with_gallium_i915
+  error('Only one i915 provider can be built')
+endif
 if with_gallium_imx and not with_gallium_etnaviv
   error('IMX driver requires etnaviv driver')
 endif
 
 dep_libdrm_intel = []
-if with_dri_i915
+if with_dri_i915 or with_gallium_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
diff --git a/src/gallium/drivers/i915/meson.build 
b/src/gallium/drivers/i915/meson.build
new file mode 100644
index 000..17f0f6adf8f
--- /dev/null
+++ b/src/gallium/drivers/i915/meson.build
@@ -0,0 +1,70 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_i915 = files(
+  'i915_batchbuffer.h',
+  'i915_batch.h',
+  'i915_blit.c',
+  'i915_blit.h',
+  'i915_clear.c',
+  'i915_context.c',
+  'i915_context.h',
+  'i915_debug.c',
+  'i915_debug_fp.c',
+  'i915_debug.h',
+  'i915_debug_private.h',
+  'i915_flush.c',
+  'i915_fpc_emit.c',
+  'i915_fpc.h',
+  'i915_fpc_optimize.c',
+  'i915_fpc_translate.c',
+  'i915_prim_emit.c',
+  'i915_prim_vbuf.c',
+  'i915_public.h',
+  'i915_query.c',
+  'i915_query.h',
+  'i915_reg.h',
+  'i915_resource_buffer.c',
+  'i915_resource.c',
+  'i915_resource.h',
+  'i915_resource_texture.c',
+  'i915_screen.c',
+  'i915_screen.h',
+  'i915_state.c',
+  'i915_state_derived.c',
+  'i915_state_dynamic.c',
+  'i915_state_emit.c',
+  'i915_state_fpc.c',
+  'i915_state.h',
+  'i915_state_immediate.c',
+  'i915_state_inlines.h',
+  'i915_state_sampler.c',
+  'i915_state_static.c',
+  'i915_surface.c',
+  'i915_surface.h',
+  'i915_winsys.h',
+)
+
+libi915 = static_library(
+  'i915',
+  files_i915,
+  c_args : [c_vis_args],
+  include_directories : [inc_include, inc_src, inc_gallium, inc_gallium_aux],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7ccf4819079..715fee86d0a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -70,17 +70,18 @@ endif
 if with_gallium_imx
   subdir('winsys/imx/drm')
 endif
-if with_glx == 'gallium-xlib'
-  subdir('winsys/sw/xlib')
+if with_gallium_i915
+  subdir('winsys/i915/drm')
+  subdir('drivers/i915')
 endif
 subdir('state_trackers/dri')
 if with_osmesa == 'gallium'
   subdir('state_trackers/osmesa')
 endif
 if with_glx == 'gallium-xlib'
+  subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
-# TODO: i915
 # TODO: SVGA
 # TODO: r300
 # TODO: r600
diff --git a/src/gallium/targets/dri/meson.build 
b/src/gallium/targets/dri/meson.build
index c591b75d037..de97e8afeaf 100644
--- a/src/gallium/targets/dri/meson.build
+++ b/src/gallium/targets/dri/

[Mesa-dev] [PATCH v5 07/13] meson: extend install_megadrivers script to handle symmlinking

2017-11-20 Thread Dylan Baker
Which is required for the gallium media state trackers.

v4: - Make the full version the hard link and the partial so versiions
  the symlinks
v5: - drop --so-version all-together. Instead pass the full name of the
  DSO and the script will automatically generate the appropriate
  symlinks as necessary.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 bin/install_megadrivers.py | 8 
 1 file changed, 8 insertions(+)

diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index a98d7dd177b..587a1f6726d 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -44,10 +44,18 @@ def main():
 
 for each in args.drivers:
 driver = os.path.join(to, each)
+
 if os.path.exists(driver):
 os.unlink(driver)
 print('installing {} to {}'.format(args.megadriver, driver))
 os.link(master, driver)
+
+name, ext = os.path.splitext(driver)
+while ext != '.so':
+if os.path.exists(name):
+os.unlink(name)
+os.symlink(driver, name)
+name, ext = os.path.splitext(name)
 os.unlink(master)
 
 
-- 
2.15.0

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


[Mesa-dev] [PATCH v5 06/13] meson: build virgl driver

2017-11-20 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build| 16 
 src/gallium/drivers/virgl/meson.build  | 39 ++
 src/gallium/meson.build|  7 +-
 src/gallium/targets/dri/meson.build|  5 
 src/gallium/winsys/virgl/drm/meson.build   | 27 +
 src/gallium/winsys/virgl/vtest/meson.build | 26 
 6 files changed, 114 insertions(+), 6 deletions(-)
 create mode 100644 src/gallium/drivers/virgl/meson.build
 create mode 100644 src/gallium/winsys/virgl/drm/meson.build
 create mode 100644 src/gallium/winsys/virgl/vtest/meson.build

diff --git a/meson.build b/meson.build
index 532176d2121..7452066a167 100644
--- a/meson.build
+++ b/meson.build
@@ -129,14 +129,15 @@ with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_i915 = false
 with_gallium_svga = false
+with_gallium_virgl = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,svga,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,svga,swrast'
+  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,virgl,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
@@ -159,6 +160,7 @@ if _drivers != ''
   with_gallium_imx = _split.contains('imx')
   with_gallium_i915 = _split.contains('i915')
   with_gallium_svga = _split.contains('svga')
+  with_gallium_virgl = _split.contains('virgl')
   with_gallium = true
 endif
 
@@ -273,9 +275,13 @@ else
   with_egl = false
 endif
 
-# TODO: or virgl
-if with_egl and with_gallium_radeonsi and not (with_platform_drm or 
with_platform_surfaceless)
-  error('RadeonSI requires drm or surfaceless platform when using EGL')
+if with_egl and not (with_platform_drm or with_platform_surfaceless)
+  if with_gallium_radeonsi
+error('RadeonSI requires drm or surfaceless platform when using EGL')
+  endif
+  if with_gallium_virgl
+error('Virgl requires drm or surfaceless platform when using EGL')
+  endif
 endif
 
 pre_args += '-DGLX_USE_TLS'
diff --git a/src/gallium/drivers/virgl/meson.build 
b/src/gallium/drivers/virgl/meson.build
new file mode 100644
index 000..8284f548927
--- /dev/null
+++ b/src/gallium/drivers/virgl/meson.build
@@ -0,0 +1,39 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_libvirgl = files(
+  'virgl_buffer.c',
+  'virgl_context.c',
+  'virgl_encode.c',
+  'virgl_query.c',
+  'virgl_resource.c',
+  'virgl_screen.c',
+  'virgl_streamout.c',
+  'virgl_texture.c',
+  'virgl_tgsi.c',
+)
+
+libvirgl = static_library(
+  'virgl',
+  files_libvirgl,
+  c_args : c_vis_args,
+  include_directories : inc_common,
+  dependencies : dep_libdrm,
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 2a4cb66ad7a..8e8b1466f12 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -1,4 +1,5 @@
 # Copyright © 2017 Dylan Baker
+# Copyright © 2017 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -85,6 +86,11 @@ if with_gallium_svga
   subdir('drivers/svga')
   subdir('winsys/svga/drm')
 endif
+if with_gallium_virgl
+  subdir('drivers/virgl')
+  subdir('winsys/virgl/drm')
+  subdir('winsys/virgl/vtest')
+endif
 subdir('state_trackers/dri')
 if with_osmesa == 'gallium'
   subdir('state_trackers/osmesa')
@@ -94,7 +100,6 @@ if 

[Mesa-dev] [PATCH v5 12/13] meson: build gallium va state tracker

2017-11-20 Thread Dylan Baker
v2: - set with_gallium_va when -Dgallium-va=true
- Fix megadrivers install
- only use cflags from pkg-config, don't add linker flags.
- Don't get version from pkg-config, it's not tracking the same
  version information.
v4: - Fix variable double-assignment

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 41 +-
 meson_options.txt | 13 +
 src/gallium/meson.build   |  7 ++-
 src/gallium/state_trackers/va/meson.build | 39 ++
 src/gallium/targets/va/meson.build| 89 +++
 5 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/va/meson.build
 create mode 100644 src/gallium/targets/va/meson.build

diff --git a/meson.build b/meson.build
index 2fffd66861d..bda1642ad5e 100644
--- a/meson.build
+++ b/meson.build
@@ -487,6 +487,44 @@ if with_gallium_omx
   )
 endif
 
+dep_va = []
+_va = get_option('gallium-va')
+if _va == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_va = false
+  elif not with_platform_x11
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_va = false
+  else
+dep_va = dependency('libva', version : '>= 0.38.0', required : false)
+with_gallium_va = dep_va.found()
+  endif
+elif _va == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VA state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('VA state tracker requires X11 or drm or wayland platform support.')
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('VA state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_va = dependency('libva', version : '>= 0.38.0')
+  with_gallium_va = true
+else
+  with_gallium_va = false
+endif
+if with_gallium_va
+  dep_va = declare_dependency(
+compile_args : dep_va.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+va_drivers_path = get_option('va-libs-path')
+if va_drivers_path == ''
+  va_drivers_path = join_paths(get_option('libdir'), 'dri')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -994,7 +1032,8 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
+   with_gallium_xa))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 8ee216d5b8a..0a9f7a9e403 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -88,6 +88,19 @@ option(
   value : '',
   description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
 )
+option(
+  'gallium-va',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium va state tracker.',
+)
+option(
+  'va-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put va libraries. defaults to $libdir/dri.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c17dba51ff2..c379b600d87 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -108,6 +108,9 @@ endif
 if with_gallium_omx
   subdir('state_trackers/omx_bellagio')
 endif
+if with_gallium_va
+  subdir('state_trackers/va')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -128,7 +131,9 @@ endif
 if with_gallium_omx
   subdir('targets/omx-bellagio')
 endif
-# TODO: VA
+if with_gallium_va
+  subdir('targets/va')
+endif
 # TODO: xa
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/va/meson.build 
b/src/gallium/state_trackers/va/meson.build
new file mode 100644
index 000..56e68e9e28d
--- /dev/null
+++ b/src/gallium/state_trackers/va/meson.build
@@ -0,0 +1,39 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial

[Mesa-dev] [PATCH v5 04/13] meson: build r600 driver

2017-11-20 Thread Dylan Baker
v4: - Ensure inc_amd_common defined when radeonsi is disabled (needed by
  r600)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Tested-by: Aaron Watry <awa...@gmail.com>
---
 meson.build  |  22 --
 src/amd/common/meson.build   |   2 -
 src/gallium/drivers/r600/meson.build | 128 +++
 src/gallium/meson.build  |   6 +-
 src/gallium/targets/dri/meson.build  |   7 +-
 src/meson.build  |   1 +
 6 files changed, 155 insertions(+), 11 deletions(-)
 create mode 100644 src/gallium/drivers/r600/meson.build

diff --git a/meson.build b/meson.build
index 8e52b70e201..4aa3dba4ee6 100644
--- a/meson.build
+++ b/meson.build
@@ -119,6 +119,7 @@ with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
 with_gallium_r300 = false
+with_gallium_r600 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -132,7 +133,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -147,6 +148,7 @@ if _drivers != ''
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
   with_gallium_r300 = _split.contains('r300')
+  with_gallium_r600 = _split.contains('r600')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -678,9 +680,13 @@ dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
   pre_args += '-DHAVE_PTHREAD'
 endif
-dep_elf = dependency('libelf', required : false)
-if not dep_elf.found() and (with_amd_vk or with_gallium_radeonsi) # TODO: 
clover, r600
-  dep_elf = cc.find_library('elf')
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
+  dep_elf = dependency('libelf', required : false)
+  if not dep_elf.found()
+dep_elf = cc.find_library('elf')
+  endif
+else
+  dep_elf = []
 endif
 dep_expat = dependency('expat')
 # this only exists on linux so either this is linux and it will be found, or
@@ -695,7 +701,8 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
+if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
+with_gallium_r300 or with_gallium_r600)
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
@@ -709,8 +716,11 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk or with_gallium_radeonsi # TODO: r600
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
+  if with_gallium_r600
+llvm_modules += 'asmparser'
+  endif
 endif
 dep_llvm = []
 if with_llvm
diff --git a/src/amd/common/meson.build b/src/amd/common/meson.build
index 4fd7edc5cd3..8c526675c40 100644
--- a/src/amd/common/meson.build
+++ b/src/amd/common/meson.build
@@ -18,8 +18,6 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-inc_amd_common = include_directories('.')
-
 sid_tables_h = custom_target(
   'sid_tables_h',
   input : ['sid_tables.py', 'sid.h', 'gfx9d.h'],
diff --git a/src/gallium/drivers/r600/meson.build 
b/src/gallium/drivers/r600/meson.build
new file mode 100644
index 000..411b550331d
--- /dev/null
+++ b/src/gallium/drivers/r600/meson.build
@@ -0,0 +1,128 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, 

[Mesa-dev] [PATCH v5 01/13] meson: add proper LLVM modules to check for RadeonSI as well

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

diff --git a/meson.build b/meson.build
index 383ebb36662..87d435fcb71 100644
--- a/meson.build
+++ b/meson.build
@@ -702,7 +702,7 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk
+if with_amd_vk or with_gallium_radeonsi # TODO: r600
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
 endif
 dep_llvm = []
-- 
2.15.0

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


[Mesa-dev] [PATCH v5 13/13] meson: build gallium xa state tracker

2017-11-20 Thread Dylan Baker
v2: - set with_gallium_xa when -Dgallium-xa=true
- install pkg config file

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 22 
 meson_options.txt |  7 +++
 src/gallium/meson.build   |  7 ++-
 src/gallium/state_trackers/xa/meson.build | 45 +
 src/gallium/targets/xa/meson.build| 84 +++
 5 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/state_trackers/xa/meson.build
 create mode 100644 src/gallium/targets/xa/meson.build

diff --git a/meson.build b/meson.build
index bda1642ad5e..408a3892bac 100644
--- a/meson.build
+++ b/meson.build
@@ -525,6 +525,28 @@ if va_drivers_path == ''
   va_drivers_path = join_paths(get_option('libdir'), 'dri')
 endif
 
+_xa = get_option('gallium-xa')
+if _xa == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_xa = false
+  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
+or with_gallium_svga)
+with_gallium_xa = false
+  else
+with_gallium_xa = true
+  endif
+elif _xa == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('XA state tracker can only be built on unix-like OSes.')
+  elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
+or with_gallium_svga)
+error('XA state tracker requires at least one of the following gallium 
drivers: nouveau, freedreno, i915, svga.')
+  endif
+  with_gallium_xa = true
+else
+  with_gallium_xa = false
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
diff --git a/meson_options.txt b/meson_options.txt
index 0a9f7a9e403..bdeb1b7f587 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -101,6 +101,13 @@ option(
   value : '',
   description : 'path to put va libraries. defaults to $libdir/dri.'
 )
+option(
+  'gallium-xa',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium xa state tracker.',
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c379b600d87..8a072322a28 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -111,6 +111,9 @@ endif
 if with_gallium_va
   subdir('state_trackers/va')
 endif
+if with_gallium_xa
+  subdir('state_trackers/xa')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -134,6 +137,8 @@ endif
 if with_gallium_va
   subdir('targets/va')
 endif
-# TODO: xa
+if with_gallium_xa
+  subdir('targets/xa')
+endif
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/xa/meson.build 
b/src/gallium/state_trackers/xa/meson.build
new file mode 100644
index 000..109abc10b7d
--- /dev/null
+++ b/src/gallium/state_trackers/xa/meson.build
@@ -0,0 +1,45 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+xa_version = ['2', '3', '0']
+
+xa_conf = configuration_data()
+xa_conf.set('XA_MAJOR', xa_version[0])
+xa_conf.set('XA_MINOR', xa_version[1])
+xa_conf.set('XA_PATCH', xa_version[2])
+
+xa_tracker_h = configure_file(
+  configuration : xa_conf,
+  input : 'xa_tracker.h.in',
+  output : 'xa_tracker.h',
+  install_dir : get_option('includedir'),
+)
+
+libxa_st = static_library(
+  'xa_st',
+  [xa_tracker_h, files(
+'xa_composite.c', 'xa_context.c', 'xa_renderer.c', 'xa_tgsi.c',
+'xa_tracker.c', 'xa_yuv.c',
+  )],
+  c_args : [c_vis_args, '-pedantic'],
+  include_directories : inc_common,
+)
+
+install_headers('xa_composite.h', 'xa_context.h')
diff --git a/src/gallium/targets/xa/meson.build 
b/src/gallium/targets/xa/meson.build
new file mode 100644
index 000..013b8a0
--- /dev/null
+++ b/src/gallium/targets/xa/meson.build
@@ -0,0 +1,84 @@
+# Copyrigh

[Mesa-dev] [PATCH v5 09/13] meson: build gallium vdpau state tracker

2017-11-20 Thread Dylan Baker
v2: - set with_gallium_vdpau when -Dgallium-vdpau=true
- Install megadriver hard links and symlinks
- only use cflags from pkg-config, don't add linker flags.
v4: - make use of the install_megadrivers.py changes
v5: - adapt for install_megadrivers changes

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build  | 46 -
 meson_options.txt| 13 
 src/gallium/meson.build  |  7 +-
 src/gallium/state_trackers/vdpau/meson.build | 32 ++
 src/gallium/targets/vdpau/meson.build| 96 
 5 files changed, 192 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/vdpau/meson.build
 create mode 100644 src/gallium/targets/vdpau/meson.build

diff --git a/meson.build b/meson.build
index ccbdd8cee47..0f8733f7651 100644
--- a/meson.build
+++ b/meson.build
@@ -348,6 +348,49 @@ if with_dri or with_gallium
   endif
 endif
 
+dep_vdpau = []
+_vdpau = get_option('gallium-vdpau')
+if _vdpau == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_vdpau = false
+  elif not with_platform_x11
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+with_gallium_vdpau = false
+  else
+dep_vdpau = dependency('vdpau', version : '>= 1.1', required : false)
+with_gallium_vdpau = dep_vdpau.found()
+  endif
+elif _vdpau == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VDPAU state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('VDPAU state tracker requires X11 support.')
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+error('VDPAU state tracker requires at least one of the following gallium 
drivers: r300, r600, radeonsi, nouveau.')
+  endif
+  dep_vdpau = dependency('vdpau', version : '>= 1.1')
+  with_gallium_vdpau = true
+else
+  with_gallium_vdpau = false
+endif
+if with_gallium_vdpau
+  dep_vdpau = declare_dependency(
+compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+if with_gallium_vdpau
+  pre_args += '-DHAVE_ST_VDPAU'
+endif
+vdpau_drivers_path = get_option('vdpau-libs-path')
+if vdpau_drivers_path == ''
+  vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -854,7 +897,8 @@ if with_platform_x11
 dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
-  if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
+  if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
+  with_gallium_vdpau)
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 119bec15709..78b78a92dbf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,6 +49,19 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
+option(
+  'gallium-vdpau',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium vdpau state tracker.',
+)
+option(
+  'vdpau-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 8e8b1466f12..446710e1495 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -99,6 +99,9 @@ if with_glx == 'gallium-xlib'
   subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
+if with_gallium_vdpau
+  subdir('state_trackers/vdpau')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -110,9 +113,11 @@ endif
 if with_glx == 'gallium-xlib'
   subdir('targets/libgl-xlib')
 endif
+if with_gallium_vdpau
+  subdir('targets/vdpau')
+endif
 # TODO: OMX
 # TODO: VA
-# TODO: vdpau
 # TODO: xa
 # TODO: xvmc
 # TODO: nine
diff --git a/src/gallium/state_trackers/vdpau/meson.build 
b/src/gallium/state_trackers/vdpau/meson.build
new file mode 100644
index 000..9678b79ef6c
--- /dev/null
+++ b/src/gallium/state_trackers/vdpau/meson.build
@@ -0,0 +1,32 @@
+# Copyright © 2017 Intel Corproration
+
+# 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 lim

[Mesa-dev] [PATCH v5 10/13] meson: build gallium xvmc state tracker

2017-11-20 Thread Dylan Baker
v2: - set with_gallium_xvmc when -Dgallium-xvmc=true
- Install megadrivers properly
- only use cflags from pkg-config, don't add linker flags.
v4: - make use of the install_megadrivers.py changes
v5: - adapt for install_megadrivers changes

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 40 ++-
 meson_options.txt   | 13 +
 src/gallium/meson.build |  7 ++-
 src/gallium/state_trackers/xvmc/meson.build | 53 
 src/gallium/targets/xvmc/meson.build| 77 +
 5 files changed, 188 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/xvmc/meson.build
 create mode 100644 src/gallium/targets/xvmc/meson.build

diff --git a/meson.build b/meson.build
index 0f8733f7651..9e4460e15c5 100644
--- a/meson.build
+++ b/meson.build
@@ -391,6 +391,44 @@ if vdpau_drivers_path == ''
   vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
 endif
 
+dep_xvmc = []
+_xvmc = get_option('gallium-xvmc')
+if _xvmc == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_xvmc = false
+  elif not with_platform_x11
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+with_gallium_xvmc = false
+  else
+dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
+with_gallium_xvmc = dep_xvmc.found()
+  endif
+elif _xvmc == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('XVMC state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('XVMC state tracker requires X11 support.')
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+error('XVMC state tracker requires at least one of the following gallium 
drivers: r600, nouveau.')
+  endif
+  dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
+  with_gallium_xvmc = true
+else
+  with_gallium_xvmc = false
+endif
+if with_gallium_xvmc
+  dep_xvmc = declare_dependency(
+compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+xvmc_drivers_path = get_option('xvmc-libs-path')
+if xvmc_drivers_path == ''
+  xvmc_drivers_path = get_option('libdir')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -898,7 +936,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  with_gallium_vdpau)
+  (with_gallium_vdpau or with_gallium_xvmc))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 78b78a92dbf..f0de44e751b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -62,6 +62,19 @@ option(
   value : '',
   description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
 )
+option(
+  'gallium-xvmc',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium xvmc state tracker.',
+)
+option(
+  'xvmc-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put xvmc libraries. defaults to $libdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 446710e1495..a8317a53552 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -102,6 +102,9 @@ endif
 if with_gallium_vdpau
   subdir('state_trackers/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('state_trackers/xvmc')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -116,9 +119,11 @@ endif
 if with_gallium_vdpau
   subdir('targets/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('targets/xvmc')
+endif
 # TODO: OMX
 # TODO: VA
 # TODO: xa
-# TODO: xvmc
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/xvmc/meson.build 
b/src/gallium/state_trackers/xvmc/meson.build
new file mode 100644
index 000..a1022c164b1
--- /dev/null
+++ b/src/gallium/state_trackers/xvmc/meson.build
@@ -0,0 +1,53 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY

[Mesa-dev] [PATCH v5 11/13] meson: build gallium omx state tracker

2017-11-20 Thread Dylan Baker
v2: - set with_gallium_omx when -Dgallium-omx=true
- Fix detection of omx plugins dir
- only use cflags from pkg-config, don't add linker flags.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build| 60 -
 meson_options.txt  | 13 
 src/gallium/meson.build|  7 +-
 .../state_trackers/omx_bellagio/meson.build| 30 +
 src/gallium/targets/omx-bellagio/meson.build   | 77 ++
 5 files changed, 185 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/omx_bellagio/meson.build
 create mode 100644 src/gallium/targets/omx-bellagio/meson.build

diff --git a/meson.build b/meson.build
index 9e4460e15c5..2fffd66861d 100644
--- a/meson.build
+++ b/meson.build
@@ -429,6 +429,64 @@ if xvmc_drivers_path == ''
   xvmc_drivers_path = get_option('libdir')
 endif
 
+dep_omx = []
+_omx = get_option('gallium-omx')
+if _omx == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_omx = false
+  elif not with_platform_x11
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_omx = false
+  else
+dep_omx = dependency('libomxil-bellagio', required : false)
+with_gallium_omx = dep_omx.found()
+  endif
+elif _omx == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('OMX state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('OMX state tracker requires X11 or drm platform support.')
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('OMX state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_omx = dependency('libomxil-bellagio')
+  with_gallium_omx = true
+else
+  with_gallium_omx = false
+endif
+
+omx_drivers_path = get_option('omx-libs-path')
+if with_gallium_omx
+  # Figure out where to put the omx driver.
+  # FIXME: this could all be vastly simplified by adding a 'defined_variable'
+  # argument to meson's get_pkgconfig_variable method.
+  if omx_drivers_path == ''
+_omx_libdir = dep_omx.get_pkgconfig_variable('libdir')
+_omx_drivers_dir = dep_omx.get_pkgconfig_variable('pluginsdir')
+if _omx_libdir == get_option('libdir')
+  omx_drivers_path = _omx_drivers_dir
+else
+  _omx_base_dir = []
+  # This will fail on windows. Does OMX run on windows?
+  _omx_libdir = _omx_libdir.split('/')
+  _omx_drivers_dir = _omx_drivers_dir.split('/')
+  foreach o : _omx_drivers_dir
+if not _omx_libdir.contains(o)
+  _omx_base_dir += o
+endif
+  endforeach
+  omx_drivers_path = join_paths(get_option('libdir'), _omx_base_dir)
+endif
+  endif
+endif
+if with_gallium_omx
+  dep_omx = declare_dependency(
+compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -936,7 +994,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index f0de44e751b..8ee216d5b8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,6 +75,19 @@ option(
   value : '',
   description : 'path to put xvmc libraries. defaults to $libdir.'
 )
+option(
+  'gallium-omx',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium omx bellagio state tracker.',
+)
+option(
+  'omx-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a8317a53552..c17dba51ff2 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -105,6 +105,9 @@ endif
 if with_gallium_xvmc
   subdir('state_trackers/xvmc')
 endif
+if with_gallium_omx
+  subdir('state_trackers/omx_bellagio')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -122,7 +125,9 @@ endif
 if with_gallium_xvmc
   subdir('targets/xvmc')
 endif
-# TODO: OMX
+if with_gallium_omx
+  subdir('targets/omx-bellagio')
+endif
 # TODO: VA
 # TODO: xa
 # TODO: nine
diff --git a/src/gallium/state_trackers/omx_bellagio/meson.build 
b/src/gallium/state_trackers/omx_bellagio/meson.build
new 

[Mesa-dev] [PATCH v5 03/13] meson: build r300 driver

2017-11-20 Thread Dylan Baker
This is build tested only

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build  |   6 +-
 src/gallium/drivers/r300/meson.build | 156 +++
 src/gallium/meson.build  |   9 +-
 src/gallium/targets/dri/meson.build  |  12 ++-
 4 files changed, 176 insertions(+), 7 deletions(-)
 create mode 100644 src/gallium/drivers/r300/meson.build

diff --git a/meson.build b/meson.build
index cbeeef5a749..8e52b70e201 100644
--- a/meson.build
+++ b/meson.build
@@ -118,6 +118,7 @@ endif
 with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
+with_gallium_r300 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -131,7 +132,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'radeonsi,nouveau,swrast'
+  _drivers = 'r300,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -145,6 +146,7 @@ if _drivers != ''
   _split = _drivers.split(',')
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
+  with_gallium_r300 = _split.contains('r300')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -693,7 +695,7 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200
+if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
diff --git a/src/gallium/drivers/r300/meson.build 
b/src/gallium/drivers/r300/meson.build
new file mode 100644
index 000..0d525d8d1b3
--- /dev/null
+++ b/src/gallium/drivers/r300/meson.build
@@ -0,0 +1,156 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_r300 = files(
+  'r300_blit.c',
+  'r300_cb.h',
+  'r300_chipset.c',
+  'r300_chipset.h',
+  'r300_context.c',
+  'r300_context.h',
+  'r300_cs.h',
+  'r300_debug.c',
+  'r300_defines.h',
+  'r300_emit.c',
+  'r300_emit.h',
+  'r300_flush.c',
+  'r300_fs.c',
+  'r300_fs.h',
+  'r300_hyperz.c',
+  'r300_public.h',
+  'r300_query.c',
+  'r300_reg.h',
+  'r300_render.c',
+  'r300_render_stencilref.c',
+  'r300_render_translate.c',
+  'r300_resource.c',
+  'r300_screen_buffer.c',
+  'r300_screen_buffer.h',
+  'r300_screen.c',
+  'r300_screen.h',
+  'r300_shader_semantics.h',
+  'r300_state.c',
+  'r300_state_derived.c',
+  'r300_state_inlines.h',
+  'r300_texture.c',
+  'r300_texture_desc.c',
+  'r300_texture_desc.h',
+  'r300_texture.h',
+  'r300_tgsi_to_rc.c',
+  'r300_tgsi_to_rc.h',
+  'r300_transfer.c',
+  'r300_transfer.h',
+  'r300_vs.c',
+  'r300_vs_draw.c',
+  'r300_vs.h',
+  'compiler/memory_pool.c',
+  'compiler/memory_pool.h',
+  'compiler/r300_fragprog.c',
+  'compiler/r300_fragprog_emit.c',
+  'compiler/r300_fragprog.h',
+  'compiler/r300_fragprog_swizzle.c',
+  'compiler/r300_fragprog_swizzle.h',
+  'compiler/r3xx_fragprog.c',
+  'compiler/r3xx_vertprog.c',
+  'compiler/r3xx_vertprog_dump.c',
+  'compiler/r500_fragprog.c',
+  'compiler/r500_fragprog_emit.c',
+  'compiler/r500_fragprog.h',
+  'compiler/radeon_code.c',
+  'compiler/radeon_code.h',
+  'compiler/radeon_compiler.c',
+  'compiler/radeon_compiler.h',
+  'compiler/radeon_compiler_util.c',
+  'compiler/radeon_compiler_util.h',
+  'compiler/radeon_dataflow.c',
+  'compiler/radeon_dataflow_deadcode.c',
+  'compiler/

[Mesa-dev] [PATCH v5 08/13] meson: drop gallium-media argument

2017-11-20 Thread Dylan Baker
This argument is the wrong approach for handling gallium media state
trackers, since it doesn't allow for an auto option. Instead we'll use
tristates, which do allow for auto.

This option has never been wired to anything anyway.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 17 -
 meson_options.txt |  6 --
 2 files changed, 23 deletions(-)

diff --git a/meson.build b/meson.build
index 7452066a167..ccbdd8cee47 100644
--- a/meson.build
+++ b/meson.build
@@ -348,23 +348,6 @@ if with_dri or with_gallium
   endif
 endif
 
-with_gallium_xvmc = false
-with_gallium_vdpau = false
-with_gallium_omx = false  # this is bellagio
-with_gallium_va = false
-with_gallium_media = false
-dep_va = []
-_drivers = get_option('gallium-media')
-if _drivers != ''
-  _split = _drivers.split(',')
-  with_gallium_xvmc = _split.contains('xvmc')
-  with_gallium_vdpau = _split.contains('vdpau')
-  with_gallium_omx = _split.contains('omx')
-  with_gallium_va = _split.contains('va')
-  with_gallium_media = (with_gallium_xvmc or with_gallium_vdpau or
-with_gallium_omx or with_gallium_va)
-endif
-
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
diff --git a/meson_options.txt b/meson_options.txt
index 6c9cd33998c..119bec15709 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,12 +49,6 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
-option(
-  'gallium-media',
-  type : 'string',
-  value : '',
-  description : 'comma separated list of gallium media APIs to build 
(omx,va,vdpau,xvmc).'
-)
 option(
   'vulkan-drivers',
   type : 'string',
-- 
2.15.0

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


[Mesa-dev] [PATCH v5 05/13] meson: build svga driver on linux

2017-11-20 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  6 ++-
 src/gallium/drivers/svga/meson.build| 88 +
 src/gallium/meson.build |  5 +-
 src/gallium/targets/dri/meson.build |  5 ++
 src/gallium/winsys/svga/drm/meson.build | 45 +
 5 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 src/gallium/drivers/svga/meson.build
 create mode 100644 src/gallium/winsys/svga/drm/meson.build

diff --git a/meson.build b/meson.build
index 4aa3dba4ee6..532176d2121 100644
--- a/meson.build
+++ b/meson.build
@@ -128,14 +128,15 @@ with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_i915 = false
+with_gallium_svga = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
+  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
@@ -157,6 +158,7 @@ if _drivers != ''
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
   with_gallium_i915 = _split.contains('i915')
+  with_gallium_svga = _split.contains('svga')
   with_gallium = true
 endif
 
diff --git a/src/gallium/drivers/svga/meson.build 
b/src/gallium/drivers/svga/meson.build
new file mode 100644
index 000..d9a7da95a33
--- /dev/null
+++ b/src/gallium/drivers/svga/meson.build
@@ -0,0 +1,88 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_svga = files(
+  'svga_cmd.c',
+  'svga_cmd_vgpu10.c',
+  'svga_context.c',
+  'svga_draw_arrays.c',
+  'svga_draw.c',
+  'svga_draw_elements.c',
+  'svga_format.c',
+  'svga_link.c',
+  'svga_msg.c',
+  'svga_pipe_blend.c',
+  'svga_pipe_blit.c',
+  'svga_pipe_clear.c',
+  'svga_pipe_constants.c',
+  'svga_pipe_depthstencil.c',
+  'svga_pipe_draw.c',
+  'svga_pipe_flush.c',
+  'svga_pipe_fs.c',
+  'svga_pipe_gs.c',
+  'svga_pipe_misc.c',
+  'svga_pipe_query.c',
+  'svga_pipe_rasterizer.c',
+  'svga_pipe_sampler.c',
+  'svga_pipe_streamout.c',
+  'svga_pipe_vertex.c',
+  'svga_pipe_vs.c',
+  'svga_resource_buffer.c',
+  'svga_resource_buffer_upload.c',
+  'svga_resource.c',
+  'svga_resource_texture.c',
+  'svga_sampler_view.c',
+  'svga_screen.c',
+  'svga_screen_cache.c',
+  'svga_shader.c',
+  'svga_state.c',
+  'svga_state_constants.c',
+  'svga_state_framebuffer.c',
+  'svga_state_fs.c',
+  'svga_state_gs.c',
+  'svga_state_need_swtnl.c',
+  'svga_state_rss.c',
+  'svga_state_sampler.c',
+  'svga_state_tgsi_transform.c',
+  'svga_state_tss.c',
+  'svga_state_vdecl.c',
+  'svga_state_vs.c',
+  'svga_surface.c',
+  'svga_swtnl_backend.c',
+  'svga_swtnl_draw.c',
+  'svga_swtnl_state.c',
+  'svga_tgsi.c',
+  'svga_tgsi_decl_sm30.c',
+  'svga_tgsi_insn.c',
+  'svga_tgsi_vgpu10.c',
+  'svgadump/svga_dump.c',
+  'svgadump/svga_shader_dump.c',
+  'svgadump/svga_shader_op.c',
+)
+
+libsvga = static_library(
+  'svga',
+  files_svga,
+  c_args : [c_vis_args, c_msvc_compat_args],
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux,
+include_directories('include')
+  ],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 2568e5ddcfc..2a4cb66ad7a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -81,6 +81,10 @@ if with_gallium_i915
   subdir('winsys/i915/drm')
   subdir('drivers/i915')
 e

[Mesa-dev] [PATCH v4 3/4] meson: Fix TODO for missing dl_iterate_phdr function

2017-11-20 Thread Dylan Baker
This function is required for both the Intel "Anvil" vulkan driver and
the i965 GL driver. Error out if either of those is enabled but this
function isn't found.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 23ed42ec0f9..f844289821a 100644
--- a/meson.build
+++ b/meson.build
@@ -660,8 +660,10 @@ endif
 
 if cc.has_function('dl_iterate_phdr')
   pre_args += '-DHAVE_DL_ITERATE_PHDR'
-else
-  # TODO: this is required for vulkan
+elif with_intel_vk
+  error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
+elif with_dri_i965 and get_option('shader-cache')
+  error('Intel i965 GL driver requires dl_iterate_phdr when built with shader 
caching.')
 endif
 
 # Determine whether or not the rt library is needed for time functions
-- 
2.15.0

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


[Mesa-dev] [PATCH v4 4/4] meson: Remove completed or irrelevant TODO comments

2017-11-20 Thread Dylan Baker
These are all either done already, or are autotools specific. The
misspelled gallium G3DVL is the autotools specific bit, meson is
handling that via build_by_default.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/meson.build b/meson.build
index f844289821a..e6956aafc2f 100644
--- a/meson.build
+++ b/meson.build
@@ -535,13 +535,6 @@ endif
 # TODO: powr8
 # TODO: shared/static? Is this even worth doing?
 
-# I don't think that I need to set any of the debug stuff, I think meson
-# handles that for us
-
-# TODO: ldflags
-
-# TODO: texture-float (gallium/mesa only)
-
 # Building x86 assembly code requires running x86 binaries. It is possible for
 # x86_64 OSes to run x86 binaries, so don't disable asm in those cases
 # TODO: it should be possible to use an exe_wrapper to run the binary during
@@ -788,12 +781,8 @@ else
   dep_unwind = []
 endif
 
-# TODO: flags for opengl, gles, dri
-
 # TODO: gallium-hud
 
-# TODO: glx provider
-
 if with_osmesa != 'none'
   if with_osmesa == 'classic' and not with_dri_swrast
 error('OSMesa classic requires dri (classic) swrast.')
@@ -886,10 +875,6 @@ if with_platform_x11
   endif
 endif
 
-# TODO: osmesa
-
-# TODO: vallium G3DVL
-
 # TODO: nine
 
 # TODO: clover
-- 
2.15.0

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


[Mesa-dev] [PATCH v4 2/4] meson: disable x86 asm in fewer cases.

2017-11-20 Thread Dylan Baker
This patch allows building asm for x86 on x86_64 platforms, when the
operating system is the same. Previously cross compile always turned off
assembly. This allows using a cross file to cross compile x86 binaries
on x86_64 with asm.

This could probably be relaxed further thanks to meson's "exe_wrapper",
which is way to specify an emulator or compatibility layer (wine) that
can run the foreign binaries on the build system. Since the meson build
at this point only supports building on Linux I can't test this and I
don't want to write/enable code that cannot even be build tested.

v4: - set condition to build == x86_64 and host == 'x86' and
  build.system == host.system

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index 049c9a24e4a..23ed42ec0f9 100644
--- a/meson.build
+++ b/meson.build
@@ -542,13 +542,16 @@ endif
 
 # TODO: texture-float (gallium/mesa only)
 
-# TODO: cross-compiling. I don't think this is relavent to meson
-
-# FIXME: enable asm when cross compiler
-# This is doable (autotools does it), but it's not of immediate concern
-if meson.is_cross_build() and host_machine.cpu_family().startswith('x86')
-  message('Cross compiling, disabling x86/x86_64 asm')
-  with_asm = false
+# Building x86 assembly code requires running x86 binaries. It is possible for
+# x86_64 OSes to run x86 binaries, so don't disable asm in those cases
+# TODO: it should be possible to use an exe_wrapper to run the binary during
+# the build. 
+if meson.is_cross_build() 
+  if not (build_machine.cpu_family() == 'x86_64' and host_machine.cpu_family() 
== 'x86'
+  and build_machine.system() == host_machine.system())
+message('Cross compiling to x86 from non-x86, disabling asm')
+with_asm = false
+  endif
 endif
 
 with_asm_arch = ''
-- 
2.15.0

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


[Mesa-dev] [PATCH v4 1/4] meson: Enable SSE4.1 optimizations

2017-11-20 Thread Dylan Baker
This patch checks for an and then enables sse4.1 optimizations if the
host machine will be x86/x86_64.

v2: - Don't compile code, it's unnecessary since we require a compiler
  which always has SSE4.1 (Matt)
v3: - x64 -> x86_64 (Matt)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 meson.build  | 15 ++-
 src/mesa/meson.build | 14 +++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 383ebb36662..049c9a24e4a 100644
--- a/meson.build
+++ b/meson.build
@@ -502,7 +502,20 @@ foreach a : ['-Wno-override-init', 
'-Wno-initializer-overrides']
   endif
 endforeach
 
-# TODO: SSE41 (which is only required for core mesa)
+if host_machine.cpu_family().startswith('x86')
+  pre_args += '-DHAVE_SSE41'
+  with_sse41 = true
+  sse41_args = ['-msse4.1']
+
+  # GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
+  # that's not guaranteed
+  if host_machine.cpu_family() == 'x86'
+sse41_args += '-mstackrealign'
+  endif
+else
+  with_sse41 = false
+  sse41_args = []
+endif
 
 # Check for GCC style atomics
 if cc.compiles('int main() { int n; return __atomic_load_n(, 
__ATOMIC_ACQUIRE); }',
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index b839fd02981..05a3a9ac55d 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -592,9 +592,6 @@ files_libmesa_gallium = files(
   'state_tracker/st_vdpau.h',
 )
 
-# TODO: sse41
-libmesa_sse41 = []
-
 matypes_h = []
 if with_asm_arch == 'x86' or with_asm_arch == 'x86_64'
   gen_matypes = executable(
@@ -692,6 +689,17 @@ files_libmesa_common += [
   sha1_h,
 ]
 
+if with_sse41
+  libmesa_sse41 = static_library(
+'mesa_sse41',
+files('main/streaming-load-memcpy.c', 'main/sse_minmax.c'),
+c_args : [c_vis_args, c_msvc_compat_args, sse41_args],
+include_directories : inc_common,
+  )
+else
+  libmesa_sse41 = []
+endif
+
 libmesa_classic = static_library(
   'mesa_classic',
   [files_libmesa_common, files_libmesa_classic],
-- 
2.15.0

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


[Mesa-dev] [PATCH 5/6] meson: add logic to select apple and windows dri

2017-11-20 Thread Dylan Baker
This is still not fully correct (haiku and BSD are probably not
correct), but Linux is not regressed and this should be correct for
macOS and Windows.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 52f2c1cb0d0..e7d2afb3d0a 100644
--- a/meson.build
+++ b/meson.build
@@ -187,8 +187,19 @@ if with_dri_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
-# TODO: other OSes
-with_dri_platform = 'drm'
+# TODO: gnu 
+if host_machine.system() == 'darwin'
+  with_dri_platform = 'apple'
+elif host_machine.system() == 'windows'
+  with_dri_platform = 'windows'
+elif host_machine.system() == 'linux'
+  # FIXME: This should include BSD and possibly other systems
+  with_dri_platform = 'drm'
+else
+  # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should
+  # assert here that one of those cases has been met.
+  with_dri_platform = 'none'
+endif
 
 with_platform_android = false
 with_platform_wayland = false
-- 
2.15.0

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


[Mesa-dev] [PATCH 3/6] meson: convert llvm option to tristate

2017-11-20 Thread Dylan Baker
This option has been acting as a strange sort of half-tri state anyway.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 48 +---
 meson_options.txt |  5 +++--
 2 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/meson.build b/meson.build
index 7dd6f89991b..c568fdb8785 100644
--- a/meson.build
+++ b/meson.build
@@ -46,7 +46,6 @@ with_tests = get_option('build-tests')
 with_valgrind = get_option('valgrind')
 with_libunwind = get_option('libunwind')
 with_asm = get_option('asm')
-with_llvm = get_option('llvm')
 with_osmesa = get_option('osmesa')
 if get_option('texture-float')
   pre_args += '-DTEXTURE_FLOAT_ENABLED'
@@ -711,30 +710,33 @@ llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 
'mcjit']
 if with_amd_vk
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
 endif
-dep_llvm = []
-if with_llvm
+
+_llvm = get_option('llvm')
+if _llvm == 'auto'
   dep_llvm = dependency(
-'llvm', version : '>= 3.9.0', required : with_amd_vk, modules : 
llvm_modules,
+'llvm', version : '>= 3.9.0', modules : llvm_modules,
+required : with_amd_vk,
   )
-  if dep_llvm.found()
-_llvm_version = dep_llvm.version().split('.')
-# Development versions of LLVM have an 'svn' suffix, we don't want that for
-# our version checks.
-_llvm_patch = _llvm_version[2]
-if _llvm_patch.endswith('svn')
-  _llvm_patch = _llvm_patch.split('s')[0]
-endif
-pre_args += [
-  '-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], 
_llvm_patch),
-  '-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
-]
-  else
-if with_gallium_softpipe
-  error('Cannot find LLVM to build LLVMPipe. If you wanted softpipe pass 
-Dllvm=false to meson')
-elif with_amd_vk or with_gallium_radeonsi # etc
-  error('The following drivers requires LLVM: Radv, RadeonSI. One of these 
is enabled, but LLVM was not found.')
-endif
-  endif
+  with_llvm = dep_llvm.found()
+elif _llvm == 'true'
+  dep_llvm = dependency('llvm', version : '>= 3.9.0', modules : llvm_modules)
+  with_llvm = true
+else
+  dep_llvm = []
+  with_llvm = false
+endif
+if with_llvm
+  _llvm_version = dep_llvm.version().split('.')
+  # Development versions of LLVM have an 'svn' suffix, we don't want that for
+  # our version checks.
+  _llvm_patch = _llvm_version[2]
+  if _llvm_patch.endswith('svn')
+_llvm_patch = _llvm_patch.split('s')[0]
+  endif
+  pre_args += [
+'-DHAVE_LLVM=0x0@0@@1@@2@'.format(_llvm_version[0], _llvm_version[1], 
_llvm_patch),
+'-DMESA_LLVM_VERSION_PATCH=@0@'.format(_llvm_patch),
+  ]
 elif with_amd_vk or with_gallium_radeonsi
   error('The following drivers requires LLVM: Radv, RadeonSI. One of these is 
enabled, but LLVM is disabled.')
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 1134a250295..44d46fe0b32 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -132,8 +132,9 @@ option(
 )
 option(
   'llvm',
-  type : 'boolean',
-  value : true,
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
   description : 'Build with LLVM support.'
 )
 option(
-- 
2.15.0

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


[Mesa-dev] [PATCH 1/6] meson: Remove duplicate _GNU_SOURCE

2017-11-20 Thread Dylan Baker
There is one provided unconditionally, and one guarded by platform ==
linux. Remove the unconditional one.

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

diff --git a/meson.build b/meson.build
index 383ebb36662..ce2c8c2c1d0 100644
--- a/meson.build
+++ b/meson.build
@@ -39,7 +39,6 @@ pre_args = [
   '-DVERSION="@0@"'.format(meson.project_version()),
   '-DPACKAGE_VERSION=VERSION',
   
'-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa;',
-  '-D_GNU_SOURCE',
 ]
 
 with_vulkan_icd_dir = get_option('vulkan-icd-dir')
-- 
2.15.0

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


[Mesa-dev] [PATCH 0/6] meson: some non-linux OS work

2017-11-20 Thread Dylan Baker
This is a rough cross section of work to get the meson build working on macOS
and on Haiku, with one radeonsi fixup added. Most of this work is pretty
straight forward, turning some options that can be assumed on Linux into
tri-states, fixing up some early windows and macos stubs that I put in during
the initial meosn pass, and removing some code duplication.

Dylan Baker (6):
  meson: Remove duplicate _GNU_SOURCE
  meson: Convert platform to auto
  meson: convert llvm option to tristate
  meson: Fix LLVM requires for radeonsi
  meson: add logic to select apple and windows dri
  meson: replace with_*dri with with_dri_platform

 meson.build| 77 +++---
 meson_options.txt  |  9 +++---
 src/glx/meson.build|  4 +--
 src/mapi/glapi/meson.build |  2 +-
 4 files changed, 54 insertions(+), 38 deletions(-)

-- 
2.15.0

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


[Mesa-dev] [PATCH 6/6] meson: replace with_*dri with with_dri_platform

2017-11-20 Thread Dylan Baker
This fixes the windows and macos stubs to be consistent with the *nix
path.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build| 4 
 src/glx/meson.build| 4 ++--
 src/mapi/glapi/meson.build | 2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index e7d2afb3d0a..bcc560217cb 100644
--- a/meson.build
+++ b/meson.build
@@ -52,10 +52,6 @@ if get_option('texture-float')
   message('WARNING: Floating-point texture enabled. Please consult 
docs/patents.txt and your lawyer before building mesa.')
 endif
 
-# XXX: yeah, do these
-with_appledri = false
-with_windowsdri = false
-
 dri_drivers_path = get_option('dri-drivers-path')
 if dri_drivers_path == ''
   dri_drivers_path = join_paths(get_option('libdir'), 'dri')
diff --git a/src/glx/meson.build b/src/glx/meson.build
index 43f8fb24efd..deef3ed2235 100644
--- a/src/glx/meson.build
+++ b/src/glx/meson.build
@@ -95,9 +95,9 @@ if with_dri3
   files_libglx += files('dri3_glx.c', 'dri3_priv.h')
 endif
 
-if with_appledri
+if with_dri_platform == 'apple'
   files_libglx += files('applegl_glx.c')
-elif with_windowsdri
+elif with_dri_platform == 'windows'
   files_libglx += files('driwindows_glx.c')
   # TODO
   #extra_libs_libglx += [
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index d2d86afd6c1..f2012644785 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -23,7 +23,7 @@ inc_glapi = include_directories('.')
 static_glapi_files = []
 static_glapi_args = []
 
-if with_appledri or with_windowsdri
+if ['apple', 'windows'].contains(with_dri_platform)
   static_glapi_files += files('glapi_gentable.c')
 endif
 
-- 
2.15.0

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


[Mesa-dev] [PATCH 4/6] meson: Fix LLVM requires for radeonsi

2017-11-20 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index c568fdb8785..52f2c1cb0d0 100644
--- a/meson.build
+++ b/meson.build
@@ -707,7 +707,7 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk
+if with_amd_vk or with_gallium_radeonsi
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
 endif
 
@@ -715,7 +715,7 @@ _llvm = get_option('llvm')
 if _llvm == 'auto'
   dep_llvm = dependency(
 'llvm', version : '>= 3.9.0', modules : llvm_modules,
-required : with_amd_vk,
+required : with_amd_vk or with_gallium_radeonsi,
   )
   with_llvm = dep_llvm.found()
 elif _llvm == 'true'
-- 
2.15.0

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


[Mesa-dev] [PATCH 2/6] meson: Convert platform to auto

2017-11-20 Thread Dylan Baker
This is necessary to support operating systems other than the *nix
family (excluding macOS). For Linux nothing has changed, the defaults
are still the same.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 7 +++
 meson_options.txt | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index ce2c8c2c1d0..7dd6f89991b 100644
--- a/meson.build
+++ b/meson.build
@@ -198,6 +198,13 @@ with_platform_drm = false
 with_platform_surfaceless = false
 egl_native_platform = ''
 _platforms = get_option('platforms')
+if _platforms == 'auto'
+  if ['linux'].contains(host_machine.system())
+_platforms = 'x11,wayland,drm,surfaceless'
+  else
+error('Unknown OS, no platforms enabled. Patches gladly accepted to fix 
this.')
+  endif
+endif
 if _platforms != ''
   _split = _platforms.split(',')
   with_platform_android = _split.contains('android')
diff --git a/meson_options.txt b/meson_options.txt
index 6c9cd33998c..1134a250295 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,8 +21,8 @@
 option(
   'platforms',
   type : 'string',
-  value : 'x11,wayland,drm,surfaceless',
-  description : 'comma separated list of window systems to support. wayland, 
x11, surfaceless, drm, etc.'
+  value : 'auto',
+  description : 'comma separated list of window systems to support. If this is 
set to auto all platforms applicable to the OS will be enabled.'
 )
 option(
   'dri3',
-- 
2.15.0

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


Re: [Mesa-dev] [PATCH v2] meson: add logic to select apple and windows dri

2017-11-21 Thread Dylan Baker
Quoting Eric Engestrom (2017-11-21 10:38:25)
> On Tuesday, 2017-11-21 10:21:07 -0800, Dylan Baker wrote:
> > This is still not fully correct (haiku and BSD is notably probably not
> > correct), but Linux is not regressed and this should be correct for
> > macOS and Windows.
> > 
> > v2: - set the dri_platform to windows on Cygwin as well (Jon)
> 
> R-b stands
> 
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  meson.build | 15 +--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 52f2c1cb0d0..4248cbcfd7e 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -187,8 +187,19 @@ if with_dri_i915
> >dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
> >  endif
> >  
> > -# TODO: other OSes
> > -with_dri_platform = 'drm'
> > +# TODO: gnu 
> 
> I missed that comment the first time around; I don't understand what it
> means?

The autotools build has a handlers for setting the dri_platform to 'none' on
gnu* (which I assume to be hurd). See configure.ac:1513

As far as I know meson doesn't support hurd ATM (though I doubt they'd turn away
patches for it).

We can drop the TODO if you'd prefer, I just like to note things in the
autotools/scons build that aren't currently supported in the meson build.

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 7/8] glapi: Don't search through subdirs from glapitable.h

2017-11-21 Thread Dylan Baker
Quoting Eric Engestrom (2017-11-21 06:06:33)
> On Monday, 2017-11-20 15:12:51 -0800, Dylan Baker wrote:
> > Because meson won't put it in that folder.
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  src/mapi/glapi/tests/check_table.cpp | 2 +-
> >  src/mesa/main/tests/Makefile.am  | 2 ++
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/mapi/glapi/tests/check_table.cpp 
> > b/src/mapi/glapi/tests/check_table.cpp
> > index 30f523ca5fb..6230f1273f3 100644
> > --- a/src/mapi/glapi/tests/check_table.cpp
> > +++ b/src/mapi/glapi/tests/check_table.cpp
> > @@ -25,7 +25,7 @@
> >  #include "main/glheader.h"
> >  
> >  #include "glapi/glapi.h"
> > -#include "glapi/glapitable.h"
> > +#include "glapitable.h"
> >  
> >  struct name_offset {
> > const char *name;
> > diff --git a/src/mesa/main/tests/Makefile.am 
> > b/src/mesa/main/tests/Makefile.am
> > index 47fce8a5b78..5c920b70236 100644
> > --- a/src/mesa/main/tests/Makefile.am
> > +++ b/src/mesa/main/tests/Makefile.am
> > @@ -4,6 +4,8 @@ AM_CPPFLAGS = \
> >   -I$(top_srcdir)/src/gtest/include \
> >   -I$(top_srcdir)/src \
> >   -I$(top_srcdir)/src/mapi \
> > + -I$(top_builddir)/src/mapi/glapi \
> > + -I$(top_srcdir)/src/mapi/glapi \
> 
> do we need srcdir here?

I might have misunderstood Emil, but I think it is needed for building from a
tarball. CCing Emil for clarification.

> 
> Other than that, the series is
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> >   -I$(top_builddir)/src/mesa \
> >   -I$(top_srcdir)/src/mesa \
> >   -I$(top_srcdir)/include \
> > -- 
> > 2.15.0
> > 


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


[Mesa-dev] [PATCH v2] meson: add logic to select apple and windows dri

2017-11-21 Thread Dylan Baker
This is still not fully correct (haiku and BSD is notably probably not
correct), but Linux is not regressed and this should be correct for
macOS and Windows.

v2: - set the dri_platform to windows on Cygwin as well (Jon)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 52f2c1cb0d0..4248cbcfd7e 100644
--- a/meson.build
+++ b/meson.build
@@ -187,8 +187,19 @@ if with_dri_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
-# TODO: other OSes
-with_dri_platform = 'drm'
+# TODO: gnu 
+if host_machine.system() == 'darwin'
+  with_dri_platform = 'apple'
+elif ['windows', 'cygwin'].contains(host_machine.system())
+  with_dri_platform = 'windows'
+elif host_machine.system() == 'linux'
+  # FIXME: This should include BSD and possibly other systems
+  with_dri_platform = 'drm'
+else
+  # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should
+  # assert here that one of those cases has been met.
+  with_dri_platform = 'none'
+endif
 
 with_platform_android = false
 with_platform_wayland = false
-- 
2.15.0

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


Re: [Mesa-dev] [PATCH mesa] meson: fix strtof locale support check

2017-11-21 Thread Dylan Baker
Oops, that's what I get for not copy-n-pasting.
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Eric Engestrom (2017-11-21 06:26:03)
> Fixes: d1992255bb29054fa5176 "meson: Add build Intel "anv" vulkan driver"
> Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> ---
>  meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 383ebb366625edf9f262..4918194de48799f594d3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -597,7 +597,7 @@ if cc.links('''
>const char *s = "1.0";
>char *end;
>double d = strtod_l(s, end, loc);
> -  float f = strtod_l(s, end, loc);
> +  float f = strtof_l(s, end, loc);
>freelocale(loc);
>return 0;
>  }''',
> -- 
> Cheers,
>   Eric
> 


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


Re: [Mesa-dev] [PATCH mesa 1/2] meson: reorder subdirs to avoid directly including more than one level

2017-11-21 Thread Dylan Baker
for the series:
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Eric Engestrom (2017-11-21 07:09:40)
> Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> ---
>  src/mapi/glapi/meson.build | 2 ++
>  src/mapi/meson.build   | 2 +-
>  src/meson.build| 1 -
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
> index d2d86afd6c1f07e06489..c2295b431404c401bad2 100644
> --- a/src/mapi/glapi/meson.build
> +++ b/src/mapi/glapi/meson.build
> @@ -18,6 +18,8 @@
>  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
>  # SOFTWARE.
>  
> +subdir('gen')
> +
>  inc_glapi = include_directories('.')
>  
>  static_glapi_files = []
> diff --git a/src/mapi/meson.build b/src/mapi/meson.build
> index ce94ee4b27a956380617..afdde3dd8cc31f96ca97 100644
> --- a/src/mapi/meson.build
> +++ b/src/mapi/meson.build
> @@ -25,10 +25,10 @@ files_mapi_util = files(
>'u_execmem.h',
>  )
>  
> +subdir('glapi')
>  if with_shared_glapi
>subdir('shared-glapi')
>  endif
> -subdir('glapi')
>  if with_gles1
>subdir('es1api')
>  endif
> diff --git a/src/meson.build b/src/meson.build
> index 00bbaa8989c4cac6ca1d..db36866df6375addf72a 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -45,7 +45,6 @@ sha1_h = custom_target(
>  
>  subdir('gtest')
>  subdir('util')
> -subdir('mapi/glapi/gen')
>  subdir('mapi')
>  # TODO: opengl
>  subdir('compiler')
> -- 
> Cheers,
>   Eric
> 


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 v5 07/13] meson: extend install_megadrivers script to handle symmlinking

2017-11-21 Thread Dylan Baker
Quoting Eric Engestrom (2017-11-21 02:39:44)
> On Monday, 2017-11-20 11:09:39 -0800, Dylan Baker wrote:
> > Which is required for the gallium media state trackers.
> > 
> > v4: - Make the full version the hard link and the partial so versiions
> >   the symlinks
> > v5: - drop --so-version all-together. Instead pass the full name of the
> >   DSO and the script will automatically generate the appropriate
> >   symlinks as necessary.
> 
> I'm ok with this solution :)
> One typo in the commit title ("symmlinking" s/mm/m/), but this patch and
> patch 8/13 are:
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> (sorry for being a bit of a pain with the previous revisions of this patch)
> 
> I had a look at the rest of the series and didn't notice anything wrong,
> but that's not an actual review.
> 

No worries, I'd rather have people reviewing my patches and forcing me to make
things better than ignoring them.


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: add si_driinfo.h in libgallium_dri

2017-11-21 Thread Dylan Baker
Thanks for making that change.
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

Quoting Juan A. Suarez Romero (2017-11-21 03:40:51)
> v2: generate target conditionally (Dylan)
> ---
>  src/gallium/targets/dri/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/targets/dri/meson.build 
> b/src/gallium/targets/dri/meson.build
> index c591b75d037..595fd0a1a54 100644
> --- a/src/gallium/targets/dri/meson.build
> +++ b/src/gallium/targets/dri/meson.build
> @@ -63,6 +63,7 @@ if with_gallium_radeonsi
>  libamd_common,
>]
>gallium_dri_drivers += 'radeonsi_dri.so'
> +  gallium_dri_sources += [si_driinfo_h]
>  endif
>  if with_gallium_nouveau
>gallium_dri_c_args += '-DGALLIUM_NOUVEAU'
> -- 
> 2.14.3
> 


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


Re: [Mesa-dev] [PATCH 4/5] egl/wayland: move teardown code to the platform file

2017-11-16 Thread Dylan Baker
Hey Emil, this commit breaks mesa pretty badly, wflinfo segfaults:

40a01c9a0ef2c8110d79c284976ef34c0f73be92 is the first bad commit
commit 40a01c9a0ef2c8110d79c284976ef34c0f73be92
Author: Emil Velikov 
Date:   Thu Nov 9 19:04:25 2017 +

egl/drm: move teardown code to the platform file

Signed-off-by: Emil Velikov 
Reviewed-by: Eric Engestrom 

:04 04 2b357f3f681f8c4a1a672dd7694f18b4866226d8 
0b1507c3b436555f37c160ebed6757ebcd84e41a M  src

Quoting Emil Velikov (2017-11-13 06:06:13)
> From: Emil Velikov 
> 
> Signed-off-by: Emil Velikov 
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 21 +
>  src/egl/drivers/dri2/egl_dri2.h |  4 
>  src/egl/drivers/dri2/platform_wayland.c | 22 ++
>  3 files changed, 27 insertions(+), 20 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index fc56e6357a6..28a3591ed49 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -994,28 +994,9 @@ dri2_display_destroy(_EGLDisplay *disp)
> case _EGL_PLATFORM_DRM:
>dri2_teardown_drm(disp);
>break;
> -#ifdef HAVE_WAYLAND_PLATFORM
> case _EGL_PLATFORM_WAYLAND:
> -  if (dri2_dpy->wl_drm)
> -  wl_drm_destroy(dri2_dpy->wl_drm);
> -  if (dri2_dpy->wl_dmabuf)
> -  zwp_linux_dmabuf_v1_destroy(dri2_dpy->wl_dmabuf);
> -  if (dri2_dpy->wl_shm)
> -  wl_shm_destroy(dri2_dpy->wl_shm);
> -  if (dri2_dpy->wl_registry)
> - wl_registry_destroy(dri2_dpy->wl_registry);
> -  if (dri2_dpy->wl_queue)
> - wl_event_queue_destroy(dri2_dpy->wl_queue);
> -  if (dri2_dpy->wl_dpy_wrapper)
> - wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
> -  u_vector_finish(_dpy->wl_modifiers.argb);
> -  u_vector_finish(_dpy->wl_modifiers.xrgb);
> -  u_vector_finish(_dpy->wl_modifiers.rgb565);
> -  if (dri2_dpy->own_device) {
> - wl_display_disconnect(dri2_dpy->wl_dpy);
> -  }
> +  dri2_teardown_wayland(disp);
>break;
> -#endif
> default:
>break;
> }
> diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
> index 9222fa122b2..ef375b68f82 100644
> --- a/src/egl/drivers/dri2/egl_dri2.h
> +++ b/src/egl/drivers/dri2/egl_dri2.h
> @@ -433,12 +433,16 @@ dri2_teardown_drm(struct dri2_egl_display *dri2_dpy) {}
>  #ifdef HAVE_WAYLAND_PLATFORM
>  EGLBoolean
>  dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
> +void
> +dri2_teardown_wayland(struct dri2_egl_display *dri2_dpy);
>  #else
>  static inline EGLBoolean
>  dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
>  {
> return _eglError(EGL_NOT_INITIALIZED, "Wayland platform not built");
>  }
> +static inline void
> +dri2_teardown_wayland(struct dri2_egl_display *dri2_dpy) {}
>  #endif
>  
>  #ifdef HAVE_ANDROID_PLATFORM
> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
> b/src/egl/drivers/dri2/platform_wayland.c
> index b38eb1c3354..b8f644210b3 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -1980,3 +1980,25 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay 
> *disp)
> return initialized;
>  
>  }
> +
> +void
> +dri2_teardown_wayland(struct dri2_egl_display *dri2_dpy)
> +{
> +   if (dri2_dpy->wl_drm)
> +  wl_drm_destroy(dri2_dpy->wl_drm);
> +   if (dri2_dpy->wl_dmabuf)
> +  zwp_linux_dmabuf_v1_destroy(dri2_dpy->wl_dmabuf);
> +   if (dri2_dpy->wl_shm)
> +  wl_shm_destroy(dri2_dpy->wl_shm);
> +   if (dri2_dpy->wl_registry)
> +  wl_registry_destroy(dri2_dpy->wl_registry);
> +   if (dri2_dpy->wl_queue)
> +  wl_event_queue_destroy(dri2_dpy->wl_queue);
> +   if (dri2_dpy->wl_dpy_wrapper)
> +  wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
> +   u_vector_finish(_dpy->wl_modifiers.argb);
> +   u_vector_finish(_dpy->wl_modifiers.xrgb);
> +   u_vector_finish(_dpy->wl_modifiers.rgb565);
> +   if (dri2_dpy->own_device)
> +  wl_display_disconnect(dri2_dpy->wl_dpy);
> +}
> -- 
> 2.15.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] egl: pass the dri2_dpy to the $plat_teardown functions

2017-11-16 Thread Dylan Baker
Tested-by: Dylan Baker <dy...@pnwbakers.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103784

Quoting Emil Velikov (2017-11-16 10:36:01)
> From: Emil Velikov <emil.veli...@collabora.com>
> 
> Cc: Mark Janes <mark.a.ja...@intel.com>
> Fixes: 40a01c9a0ef ("egl/drm: move teardown code to the platform file")
> Fixes: 8d745abc009 ("egl/wayland: move teardown code to the platform file")
> Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index c362206a431..7cc9f20ba25 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -992,10 +992,10 @@ dri2_display_destroy(_EGLDisplay *disp)
>dri2_teardown_x11(dri2_dpy);
>break;
> case _EGL_PLATFORM_DRM:
> -  dri2_teardown_drm(disp);
> +  dri2_teardown_drm(dri2_dpy);
>break;
> case _EGL_PLATFORM_WAYLAND:
> -  dri2_teardown_wayland(disp);
> +  dri2_teardown_wayland(dri2_dpy);
>break;
> default:
>/* TODO: add teardown for other platforms */
> -- 
> 2.15.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/4] meson: Enable SSE4.1 optimizations

2017-11-16 Thread Dylan Baker
Quoting Matt Turner (2017-11-15 21:57:37)
> On Wed, Nov 15, 2017 at 5:10 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > This patch checks for an and then enables sse4.1 optimizations if the
> > host machine will be x86/x86_64.
> 
> There's some stack realignment stuff that probably needs to stay, but
> depending on what gcc version we require we can just always enable SSE
> 4.1. It's existed since GCC 4.3 (March 2008).

Well, since we require 4.6 in the meson build unconditionally, I think that
we can just set the stackalignment variable.

So, we can just drop the whole compile check altogether in that case, correct?

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] meson: Enable SSE4.1 optimizations

2017-11-16 Thread Dylan Baker
This patch checks for an and then enables sse4.1 optimizations if the
host machine will be x86/x86_64.

v2: - Don't compile code, it's unnecessary since we require a compiler
  which always has SSE4.1 (Matt)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (v1)
---
 meson.build  | 15 ++-
 src/mesa/meson.build | 14 +++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 383ebb36662..2df4610a2fd 100644
--- a/meson.build
+++ b/meson.build
@@ -502,7 +502,20 @@ foreach a : ['-Wno-override-init', 
'-Wno-initializer-overrides']
   endif
 endforeach
 
-# TODO: SSE41 (which is only required for core mesa)
+if host_machine.cpu_family().startswith('x86')
+  pre_args += '-DHAVE_SSE41'
+  with_sse41 = true
+  sse41_args = ['-msse4.1']
+
+  # GCC on x86 (not x64) with -msse* assumes a 16 byte aligned stack, but
+  # that's not guaranteed
+  if host_machine.cpu_family() == 'x86'
+sse41_args += '-mstackrealign'
+  endif
+else
+  with_sse41 = false
+  sse41_args = []
+endif
 
 # Check for GCC style atomics
 if cc.compiles('int main() { int n; return __atomic_load_n(, 
__ATOMIC_ACQUIRE); }',
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index b839fd02981..05a3a9ac55d 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -592,9 +592,6 @@ files_libmesa_gallium = files(
   'state_tracker/st_vdpau.h',
 )
 
-# TODO: sse41
-libmesa_sse41 = []
-
 matypes_h = []
 if with_asm_arch == 'x86' or with_asm_arch == 'x86_64'
   gen_matypes = executable(
@@ -692,6 +689,17 @@ files_libmesa_common += [
   sha1_h,
 ]
 
+if with_sse41
+  libmesa_sse41 = static_library(
+'mesa_sse41',
+files('main/streaming-load-memcpy.c', 'main/sse_minmax.c'),
+c_args : [c_vis_args, c_msvc_compat_args, sse41_args],
+include_directories : inc_common,
+  )
+else
+  libmesa_sse41 = []
+endif
+
 libmesa_classic = static_library(
   'mesa_classic',
   [files_libmesa_common, files_libmesa_classic],
-- 
2.15.0

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


Re: [Mesa-dev] [PATCH 3/4] meson: Fix TODO for missing dl_iterate_phdr function

2017-11-16 Thread Dylan Baker
Quoting Emil Velikov (2017-11-16 05:21:50)
> On 16 November 2017 at 01:11, Dylan Baker <dy...@pnwbakers.com> wrote:
> > This function is required for both the Intel "Anvil" vulkan driver and
> > the i965 GL driver. Error out if either of those is enabled but this
> > function isn't found.
> >
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  meson.build | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 261c4753427..5ac2ebc9e5d 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -672,8 +672,10 @@ endif
> >
> >  if cc.has_function('dl_iterate_phdr')
> >pre_args += '-DHAVE_DL_ITERATE_PHDR'
> > -else
> > -  # TODO: this is required for vulkan
> > +elif with_intel_vk
> > +  error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr 
> > function')
> > +elif with_dri_i965 and get_option('shader-cache')
> > +  error('Intel i965 GL driver requires dl_iterate_phdr when built with 
> > shader caching.')
> >  endif
> >
> One idea for the future: factor out the else case into a helper
> function, so that it simpler to read and can be extended easily.

meson doesn't have user definable functions. On the other hand, if we dropped
the shader-cache option altoghether we could just combine this into:
 error('The Intel "Anvil" and "i965" drivers require the dl_iterate_phdr 
function')

> 
> As-is patch is:
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> 
> Side note: can we drop the shader-cache option?
> 
> Thanks
> Emil


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


Re: [Mesa-dev] [PATCH 1/4] meson: Enable SSE4.1 optimizations

2017-11-16 Thread Dylan Baker
Quoting Emil Velikov (2017-11-16 03:35:17)
> Hi Dylan,
> 
> On 16 November 2017 at 01:10, Dylan Baker <dy...@pnwbakers.com> wrote:
> > This patch checks for an and then enables sse4.1 optimizations if the
> > host machine will be x86/x86_64.
> >
> Hell yeah, SSE is coming to town :-)
> 
> Will this work if the user disables SSE4.1, say via CFLAGS=-mno-sse4.1
> meson ...?
> My meson is still bit rough, so I could not quite grok ^^ by reading
> through the patch.
> 
> Thanks
> Emil

It'll explode horribly. Id didn't see any special handling of that in autotools
build though either, did I miss something?

Dylan


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


Re: [Mesa-dev] [PATCH 3/4] meson: Fix TODO for missing dl_iterate_phdr function

2017-11-16 Thread Dylan Baker
Quoting Emil Velikov (2017-11-16 05:21:50)
> On 16 November 2017 at 01:11, Dylan Baker <dy...@pnwbakers.com> wrote:
> > This function is required for both the Intel "Anvil" vulkan driver and
> > the i965 GL driver. Error out if either of those is enabled but this
> > function isn't found.
> >
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  meson.build | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 261c4753427..5ac2ebc9e5d 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -672,8 +672,10 @@ endif
> >
> >  if cc.has_function('dl_iterate_phdr')
> >pre_args += '-DHAVE_DL_ITERATE_PHDR'
> > -else
> > -  # TODO: this is required for vulkan
> > +elif with_intel_vk
> > +  error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr 
> > function')
> > +elif with_dri_i965 and get_option('shader-cache')
> > +  error('Intel i965 GL driver requires dl_iterate_phdr when built with 
> > shader caching.')
> >  endif
> >
> One idea for the future: factor out the else case into a helper
> function, so that it simpler to read and can be extended easily.
> 
> As-is patch is:
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> 
> Side note: can we drop the shader-cache option?

Yes, I'm all for dropping options!

> 
> Thanks
> Emil


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


Re: [Mesa-dev] [PATCH 2/4] meson: disable x86 asm in fewer cases.

2017-11-16 Thread Dylan Baker
Quoting Eric Engestrom (2017-11-16 03:46:04)
> On Wednesday, 2017-11-15 17:11:00 -0800, Dylan Baker wrote:
> > This patch allows building asm for x86 on x86_64 platforms, when the
> > operating system is the same. Previously cross compile always turned off
> > assembly. This allows using a cross file to cross compile x86 binaries
> > on x86_64 with asm.
> > 
> > This could probably be relaxed further thanks to meson's "exe_wrapper",
> > which is way to specify an emulator or compatibility layer (wine) that
> > can run the foreign binaries on the build system. Since the meson build
> > at this point only supports building on Linux I can't test this and I
> > don't want to write/enable code that cannot even be build tested.
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> >  meson.build | 17 ++---
> >  1 file changed, 10 insertions(+), 7 deletions(-)
> > 
> > diff --git a/meson.build b/meson.build
> > index 0d201c711a0..261c4753427 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -554,13 +554,16 @@ endif
> >  
> >  # TODO: texture-float (gallium/mesa only)
> >  
> > -# TODO: cross-compiling. I don't think this is relavent to meson
> > -
> > -# FIXME: enable asm when cross compiler
> > -# This is doable (autotools does it), but it's not of immediate concern
> > -if meson.is_cross_build() and host_machine.cpu_family().startswith('x86')
> > -  message('Cross compiling, disabling x86/x86_64 asm')
> > -  with_asm = false
> > +# Building x86 assembly code requires running x86 binaries. It is possible 
> > for
> > +# x86_64 OSes to run x86 binaries, so don't disable asm in those cases
> > +# TODO: it should be possible to use an exe_wrapper to run the binary 
> > durring
> 
> "during"
> 
> > +# the build. 
> > +if meson.is_cross_build() 
> > +  if (not (build_machine.cpu_family() == 'x86_64' and 
> > host_machine.cpu_family() == 'x86')
> > +  and build_machine.system() == host_machine.system())
> > +message('Cross compiling to x86 from non-x86, disabling asm')
> > +with_asm = false
> > +  endif
> 
> This looks off to me.
> Shouldn't the `and build_os==host_os` be `or not build_os==host_os`?
> 
> In other words, if cross-building on the same os from 64bit to 32bit,
> allow asm, and otherwise disable it?
> 
> If so, you could factor the `not` out, and it would be:
>   if not (build_os==host_os and build==64bit and host==32bit)
> with_asm = false

This is covering for a very specific case. As part of the x86 and x64 asm
process we build an executable matypes, which needs to be of the target
architecture, because it detects how big certain structs are, and returns those
values.

So this can be built only in 1 cross compiling case, x64 building x86 (since x64
can run x86 binaries), and only if the OSes are the same (unless we had
exe_wrapper, but I haven't gotten there yet).

However, I think you're right that the not should apply to both conditions, or
the second hsould be build != host. Does that seem correct?



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 04/13] meson: build r600 driver

2017-11-16 Thread Dylan Baker
v4: - Ensure inc_amd_common defined when radeonsi is disabled (needed by
  r600)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Tested-by: Aaron Watry <awa...@gmail.com>
---
 meson.build  |  22 --
 src/amd/common/meson.build   |   2 -
 src/gallium/drivers/r600/meson.build | 128 +++
 src/gallium/meson.build  |   6 +-
 src/gallium/targets/dri/meson.build  |   7 +-
 src/meson.build  |   1 +
 6 files changed, 155 insertions(+), 11 deletions(-)
 create mode 100644 src/gallium/drivers/r600/meson.build

diff --git a/meson.build b/meson.build
index 8e52b70e201..4aa3dba4ee6 100644
--- a/meson.build
+++ b/meson.build
@@ -119,6 +119,7 @@ with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
 with_gallium_r300 = false
+with_gallium_r600 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -132,7 +133,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -147,6 +148,7 @@ if _drivers != ''
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
   with_gallium_r300 = _split.contains('r300')
+  with_gallium_r600 = _split.contains('r600')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -678,9 +680,13 @@ dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
   pre_args += '-DHAVE_PTHREAD'
 endif
-dep_elf = dependency('libelf', required : false)
-if not dep_elf.found() and (with_amd_vk or with_gallium_radeonsi) # TODO: 
clover, r600
-  dep_elf = cc.find_library('elf')
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 # TODO: clover
+  dep_elf = dependency('libelf', required : false)
+  if not dep_elf.found()
+dep_elf = cc.find_library('elf')
+  endif
+else
+  dep_elf = []
 endif
 dep_expat = dependency('expat')
 # this only exists on linux so either this is linux and it will be found, or
@@ -695,7 +701,8 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
+if (with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or
+with_gallium_r300 or with_gallium_r600)
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
@@ -709,8 +716,11 @@ if with_gallium_freedreno
 endif
 
 llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit']
-if with_amd_vk or with_gallium_radeonsi # TODO: r600
+if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
   llvm_modules += ['amdgpu', 'bitreader', 'ipo']
+  if with_gallium_r600
+llvm_modules += 'asmparser'
+  endif
 endif
 dep_llvm = []
 if with_llvm
diff --git a/src/amd/common/meson.build b/src/amd/common/meson.build
index 4fd7edc5cd3..8c526675c40 100644
--- a/src/amd/common/meson.build
+++ b/src/amd/common/meson.build
@@ -18,8 +18,6 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-inc_amd_common = include_directories('.')
-
 sid_tables_h = custom_target(
   'sid_tables_h',
   input : ['sid_tables.py', 'sid.h', 'gfx9d.h'],
diff --git a/src/gallium/drivers/r600/meson.build 
b/src/gallium/drivers/r600/meson.build
new file mode 100644
index 000..411b550331d
--- /dev/null
+++ b/src/gallium/drivers/r600/meson.build
@@ -0,0 +1,128 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, 

[Mesa-dev] [PATCH v4 03/13] meson: build r300 driver

2017-11-16 Thread Dylan Baker
This is build tested only

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build  |   6 +-
 src/gallium/drivers/r300/meson.build | 156 +++
 src/gallium/meson.build  |   9 +-
 src/gallium/targets/dri/meson.build  |  12 ++-
 4 files changed, 176 insertions(+), 7 deletions(-)
 create mode 100644 src/gallium/drivers/r300/meson.build

diff --git a/meson.build b/meson.build
index cbeeef5a749..8e52b70e201 100644
--- a/meson.build
+++ b/meson.build
@@ -118,6 +118,7 @@ endif
 with_gallium = false
 with_gallium_pl111 = false
 with_gallium_radeonsi = false
+with_gallium_r300 = false
 with_gallium_nouveau = false
 with_gallium_freedreno = false
 with_gallium_softpipe = false
@@ -131,7 +132,7 @@ if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'radeonsi,nouveau,swrast'
+  _drivers = 'r300,radeonsi,nouveau,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
   _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
 else
@@ -145,6 +146,7 @@ if _drivers != ''
   _split = _drivers.split(',')
   with_gallium_pl111 = _split.contains('pl111')
   with_gallium_radeonsi = _split.contains('radeonsi')
+  with_gallium_r300 = _split.contains('r300')
   with_gallium_nouveau = _split.contains('nouveau')
   with_gallium_freedreno = _split.contains('freedreno')
   with_gallium_softpipe = _split.contains('swrast')
@@ -693,7 +695,7 @@ dep_libdrm_freedreno = []
 if with_amd_vk or with_gallium_radeonsi
   dep_libdrm_amdgpu = dependency('libdrm_amdgpu', version : '>= 2.4.88')
 endif
-if with_gallium_radeonsi or with_dri_r100 or with_dri_r200
+if with_gallium_radeonsi or with_dri_r100 or with_dri_r200 or with_gallium_r300
   dep_libdrm_radeon = dependency('libdrm_radeon', version : '>= 2.4.71')
 endif
 if with_gallium_nouveau or with_dri_nouveau
diff --git a/src/gallium/drivers/r300/meson.build 
b/src/gallium/drivers/r300/meson.build
new file mode 100644
index 000..0d525d8d1b3
--- /dev/null
+++ b/src/gallium/drivers/r300/meson.build
@@ -0,0 +1,156 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_r300 = files(
+  'r300_blit.c',
+  'r300_cb.h',
+  'r300_chipset.c',
+  'r300_chipset.h',
+  'r300_context.c',
+  'r300_context.h',
+  'r300_cs.h',
+  'r300_debug.c',
+  'r300_defines.h',
+  'r300_emit.c',
+  'r300_emit.h',
+  'r300_flush.c',
+  'r300_fs.c',
+  'r300_fs.h',
+  'r300_hyperz.c',
+  'r300_public.h',
+  'r300_query.c',
+  'r300_reg.h',
+  'r300_render.c',
+  'r300_render_stencilref.c',
+  'r300_render_translate.c',
+  'r300_resource.c',
+  'r300_screen_buffer.c',
+  'r300_screen_buffer.h',
+  'r300_screen.c',
+  'r300_screen.h',
+  'r300_shader_semantics.h',
+  'r300_state.c',
+  'r300_state_derived.c',
+  'r300_state_inlines.h',
+  'r300_texture.c',
+  'r300_texture_desc.c',
+  'r300_texture_desc.h',
+  'r300_texture.h',
+  'r300_tgsi_to_rc.c',
+  'r300_tgsi_to_rc.h',
+  'r300_transfer.c',
+  'r300_transfer.h',
+  'r300_vs.c',
+  'r300_vs_draw.c',
+  'r300_vs.h',
+  'compiler/memory_pool.c',
+  'compiler/memory_pool.h',
+  'compiler/r300_fragprog.c',
+  'compiler/r300_fragprog_emit.c',
+  'compiler/r300_fragprog.h',
+  'compiler/r300_fragprog_swizzle.c',
+  'compiler/r300_fragprog_swizzle.h',
+  'compiler/r3xx_fragprog.c',
+  'compiler/r3xx_vertprog.c',
+  'compiler/r3xx_vertprog_dump.c',
+  'compiler/r500_fragprog.c',
+  'compiler/r500_fragprog_emit.c',
+  'compiler/r500_fragprog.h',
+  'compiler/radeon_code.c',
+  'compiler/radeon_code.h',
+  'compiler/radeon_compiler.c',
+  'compiler/radeon_compiler.h',
+  'compiler/radeon_compiler_util.c',
+  'compiler/radeon_compiler_util.h',
+  'compiler/radeon_dataflow.c',
+  'compiler/radeon_dataflow_deadcode.c',
+  'compiler/

[Mesa-dev] [PATCH v3] meson: Enable SSE4.1 optimizations

2017-11-16 Thread Dylan Baker
This patch checks for an and then enables sse4.1 optimizations if the
host machine will be x86/x86_64.

v2: - Don't compile code, it's unnecessary since we require a compiler
  which always has SSE4.1 (Matt)
v3: - x64 -> x86_64 (Matt)

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> (v1)
---
 meson.build  | 15 ++-
 src/mesa/meson.build | 14 +++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 383ebb36662..049c9a24e4a 100644
--- a/meson.build
+++ b/meson.build
@@ -502,7 +502,20 @@ foreach a : ['-Wno-override-init', 
'-Wno-initializer-overrides']
   endif
 endforeach
 
-# TODO: SSE41 (which is only required for core mesa)
+if host_machine.cpu_family().startswith('x86')
+  pre_args += '-DHAVE_SSE41'
+  with_sse41 = true
+  sse41_args = ['-msse4.1']
+
+  # GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but
+  # that's not guaranteed
+  if host_machine.cpu_family() == 'x86'
+sse41_args += '-mstackrealign'
+  endif
+else
+  with_sse41 = false
+  sse41_args = []
+endif
 
 # Check for GCC style atomics
 if cc.compiles('int main() { int n; return __atomic_load_n(, 
__ATOMIC_ACQUIRE); }',
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index b839fd02981..05a3a9ac55d 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -592,9 +592,6 @@ files_libmesa_gallium = files(
   'state_tracker/st_vdpau.h',
 )
 
-# TODO: sse41
-libmesa_sse41 = []
-
 matypes_h = []
 if with_asm_arch == 'x86' or with_asm_arch == 'x86_64'
   gen_matypes = executable(
@@ -692,6 +689,17 @@ files_libmesa_common += [
   sha1_h,
 ]
 
+if with_sse41
+  libmesa_sse41 = static_library(
+'mesa_sse41',
+files('main/streaming-load-memcpy.c', 'main/sse_minmax.c'),
+c_args : [c_vis_args, c_msvc_compat_args, sse41_args],
+include_directories : inc_common,
+  )
+else
+  libmesa_sse41 = []
+endif
+
 libmesa_classic = static_library(
   'mesa_classic',
   [files_libmesa_common, files_libmesa_classic],
-- 
2.15.0

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


[Mesa-dev] [PATCH v4 09/13] meson: build gallium vdpau state tracker

2017-11-16 Thread Dylan Baker
v2: - set with_gallium_vdpau when -Dgallium-vdpau=true
- Install megadriver hard links and symlinks
- only use cflags from pkg-config, don't add linker flags.
v4: - make use of the install_megadrivers.py changes

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build  |  46 +++-
 meson_options.txt|  13 
 src/gallium/meson.build  |   7 +-
 src/gallium/state_trackers/vdpau/meson.build |  32 +
 src/gallium/targets/vdpau/meson.build| 100 +++
 5 files changed, 196 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/vdpau/meson.build
 create mode 100644 src/gallium/targets/vdpau/meson.build

diff --git a/meson.build b/meson.build
index ccbdd8cee47..0f8733f7651 100644
--- a/meson.build
+++ b/meson.build
@@ -348,6 +348,49 @@ if with_dri or with_gallium
   endif
 endif
 
+dep_vdpau = []
+_vdpau = get_option('gallium-vdpau')
+if _vdpau == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_vdpau = false
+  elif not with_platform_x11
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+with_gallium_vdpau = false
+  else
+dep_vdpau = dependency('vdpau', version : '>= 1.1', required : false)
+with_gallium_vdpau = dep_vdpau.found()
+  endif
+elif _vdpau == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VDPAU state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('VDPAU state tracker requires X11 support.')
+with_gallium_vdpau = false
+  elif not (with_gallium_r300 or with_gallium_r600 or with_gallium_radeonsi or
+with_gallium_nouveau)
+error('VDPAU state tracker requires at least one of the following gallium 
drivers: r300, r600, radeonsi, nouveau.')
+  endif
+  dep_vdpau = dependency('vdpau', version : '>= 1.1')
+  with_gallium_vdpau = true
+else
+  with_gallium_vdpau = false
+endif
+if with_gallium_vdpau
+  dep_vdpau = declare_dependency(
+compile_args : dep_vdpau.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+if with_gallium_vdpau
+  pre_args += '-DHAVE_ST_VDPAU'
+endif
+vdpau_drivers_path = get_option('vdpau-libs-path')
+if vdpau_drivers_path == ''
+  vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -854,7 +897,8 @@ if with_platform_x11
 dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
-  if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
+  if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
+  with_gallium_vdpau)
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 119bec15709..78b78a92dbf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,6 +49,19 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
+option(
+  'gallium-vdpau',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium vdpau state tracker.',
+)
+option(
+  'vdpau-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 8e8b1466f12..446710e1495 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -99,6 +99,9 @@ if with_glx == 'gallium-xlib'
   subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
+if with_gallium_vdpau
+  subdir('state_trackers/vdpau')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -110,9 +113,11 @@ endif
 if with_glx == 'gallium-xlib'
   subdir('targets/libgl-xlib')
 endif
+if with_gallium_vdpau
+  subdir('targets/vdpau')
+endif
 # TODO: OMX
 # TODO: VA
-# TODO: vdpau
 # TODO: xa
 # TODO: xvmc
 # TODO: nine
diff --git a/src/gallium/state_trackers/vdpau/meson.build 
b/src/gallium/state_trackers/vdpau/meson.build
new file mode 100644
index 000..9678b79ef6c
--- /dev/null
+++ b/src/gallium/state_trackers/vdpau/meson.build
@@ -0,0 +1,32 @@
+# Copyright © 2017 Intel Corproration
+
+# 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

[Mesa-dev] [PATCH v4 12/13] meson: build gallium va state tracker

2017-11-16 Thread Dylan Baker
v2: - set with_gallium_va when -Dgallium-va=true
- Fix megadrivers install
- only use cflags from pkg-config, don't add linker flags.
- Don't get version from pkg-config, it's not tracking the same
  version information.
v4: - Fix variable double-assignment

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 41 +-
 meson_options.txt | 13 +
 src/gallium/meson.build   |  7 ++-
 src/gallium/state_trackers/va/meson.build | 39 ++
 src/gallium/targets/va/meson.build| 89 +++
 5 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/va/meson.build
 create mode 100644 src/gallium/targets/va/meson.build

diff --git a/meson.build b/meson.build
index 2fffd66861d..bda1642ad5e 100644
--- a/meson.build
+++ b/meson.build
@@ -487,6 +487,44 @@ if with_gallium_omx
   )
 endif
 
+dep_va = []
+_va = get_option('gallium-va')
+if _va == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_va = false
+  elif not with_platform_x11
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_va = false
+  else
+dep_va = dependency('libva', version : '>= 0.38.0', required : false)
+with_gallium_va = dep_va.found()
+  endif
+elif _va == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('VA state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('VA state tracker requires X11 or drm or wayland platform support.')
+with_gallium_va = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('VA state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_va = dependency('libva', version : '>= 0.38.0')
+  with_gallium_va = true
+else
+  with_gallium_va = false
+endif
+if with_gallium_va
+  dep_va = declare_dependency(
+compile_args : dep_va.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+va_drivers_path = get_option('va-libs-path')
+if va_drivers_path == ''
+  va_drivers_path = join_paths(get_option('libdir'), 'dri')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -994,7 +1032,8 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx or
+   with_gallium_xa))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 8ee216d5b8a..0a9f7a9e403 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -88,6 +88,19 @@ option(
   value : '',
   description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
 )
+option(
+  'gallium-va',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium va state tracker.',
+)
+option(
+  'va-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put va libraries. defaults to $libdir/dri.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index c17dba51ff2..c379b600d87 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -108,6 +108,9 @@ endif
 if with_gallium_omx
   subdir('state_trackers/omx_bellagio')
 endif
+if with_gallium_va
+  subdir('state_trackers/va')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -128,7 +131,9 @@ endif
 if with_gallium_omx
   subdir('targets/omx-bellagio')
 endif
-# TODO: VA
+if with_gallium_va
+  subdir('targets/va')
+endif
 # TODO: xa
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/va/meson.build 
b/src/gallium/state_trackers/va/meson.build
new file mode 100644
index 000..56e68e9e28d
--- /dev/null
+++ b/src/gallium/state_trackers/va/meson.build
@@ -0,0 +1,39 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial

[Mesa-dev] [PATCH v4 11/13] meson: build gallium omx state tracker

2017-11-16 Thread Dylan Baker
v2: - set with_gallium_omx when -Dgallium-omx=true
- Fix detection of omx plugins dir
- only use cflags from pkg-config, don't add linker flags.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build| 60 -
 meson_options.txt  | 13 
 src/gallium/meson.build|  7 +-
 .../state_trackers/omx_bellagio/meson.build| 30 +
 src/gallium/targets/omx-bellagio/meson.build   | 77 ++
 5 files changed, 185 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/omx_bellagio/meson.build
 create mode 100644 src/gallium/targets/omx-bellagio/meson.build

diff --git a/meson.build b/meson.build
index 9e4460e15c5..2fffd66861d 100644
--- a/meson.build
+++ b/meson.build
@@ -429,6 +429,64 @@ if xvmc_drivers_path == ''
   xvmc_drivers_path = get_option('libdir')
 endif
 
+dep_omx = []
+_omx = get_option('gallium-omx')
+if _omx == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_omx = false
+  elif not with_platform_x11
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+with_gallium_omx = false
+  else
+dep_omx = dependency('libomxil-bellagio', required : false)
+with_gallium_omx = dep_omx.found()
+  endif
+elif _omx == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('OMX state tracker can only be built on unix-like OSes.')
+  elif not (with_platform_x11 or with_platform_drm)
+error('OMX state tracker requires X11 or drm platform support.')
+with_gallium_omx = false
+  elif not (with_gallium_r600 or with_gallium_radeonsi or with_gallium_nouveau)
+error('OMX state tracker requires at least one of the following gallium 
drivers: r600, radeonsi, nouveau.')
+  endif
+  dep_omx = dependency('libomxil-bellagio')
+  with_gallium_omx = true
+else
+  with_gallium_omx = false
+endif
+
+omx_drivers_path = get_option('omx-libs-path')
+if with_gallium_omx
+  # Figure out where to put the omx driver.
+  # FIXME: this could all be vastly simplified by adding a 'defined_variable'
+  # argument to meson's get_pkgconfig_variable method.
+  if omx_drivers_path == ''
+_omx_libdir = dep_omx.get_pkgconfig_variable('libdir')
+_omx_drivers_dir = dep_omx.get_pkgconfig_variable('pluginsdir')
+if _omx_libdir == get_option('libdir')
+  omx_drivers_path = _omx_drivers_dir
+else
+  _omx_base_dir = []
+  # This will fail on windows. Does OMX run on windows?
+  _omx_libdir = _omx_libdir.split('/')
+  _omx_drivers_dir = _omx_drivers_dir.split('/')
+  foreach o : _omx_drivers_dir
+if not _omx_libdir.contains(o)
+  _omx_base_dir += o
+endif
+  endforeach
+  omx_drivers_path = join_paths(get_option('libdir'), _omx_base_dir)
+endif
+  endif
+endif
+if with_gallium_omx
+  dep_omx = declare_dependency(
+compile_args : dep_omx.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -936,7 +994,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  (with_gallium_vdpau or with_gallium_xvmc))
+  (with_gallium_vdpau or with_gallium_xvmc or with_gallium_omx))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index f0de44e751b..8ee216d5b8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,6 +75,19 @@ option(
   value : '',
   description : 'path to put xvmc libraries. defaults to $libdir.'
 )
+option(
+  'gallium-omx',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium omx bellagio state tracker.',
+)
+option(
+  'omx-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put omx libraries. defaults to omx-bellagio 
pkg-config pluginsdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a8317a53552..c17dba51ff2 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -105,6 +105,9 @@ endif
 if with_gallium_xvmc
   subdir('state_trackers/xvmc')
 endif
+if with_gallium_omx
+  subdir('state_trackers/omx_bellagio')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -122,7 +125,9 @@ endif
 if with_gallium_xvmc
   subdir('targets/xvmc')
 endif
-# TODO: OMX
+if with_gallium_omx
+  subdir('targets/omx-bellagio')
+endif
 # TODO: VA
 # TODO: xa
 # TODO: nine
diff --git a/src/gallium/state_trackers/omx_bellagio/meson.build 
b/src/gallium/state_trackers/omx_bellagio/meson.build
new 

[Mesa-dev] [PATCH v4 05/13] meson: build svga driver on linux

2017-11-16 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  6 ++-
 src/gallium/drivers/svga/meson.build| 88 +
 src/gallium/meson.build |  5 +-
 src/gallium/targets/dri/meson.build |  5 ++
 src/gallium/winsys/svga/drm/meson.build | 45 +
 5 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 src/gallium/drivers/svga/meson.build
 create mode 100644 src/gallium/winsys/svga/drm/meson.build

diff --git a/meson.build b/meson.build
index 4aa3dba4ee6..532176d2121 100644
--- a/meson.build
+++ b/meson.build
@@ -128,14 +128,15 @@ with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
 with_gallium_i915 = false
+with_gallium_svga = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
 # TODO: PPC, Sparc
 if ['x86', 'x86_64'].contains(host_machine.cpu_family())
-  _drivers = 'r300,r600,radeonsi,nouveau,swrast'
+  _drivers = 'r300,r600,radeonsi,nouveau,svga,swrast'
 elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,swrast'
+  _drivers = 'pl111,vc4,vc5,freedreno,etnaviv,imx,svga,swrast'
 else
   error('Unknown architecture. Please pass -Dgallium-drivers to set driver 
options. Patches gladly accepted to fix this.')
 endif
@@ -157,6 +158,7 @@ if _drivers != ''
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
   with_gallium_i915 = _split.contains('i915')
+  with_gallium_svga = _split.contains('svga')
   with_gallium = true
 endif
 
diff --git a/src/gallium/drivers/svga/meson.build 
b/src/gallium/drivers/svga/meson.build
new file mode 100644
index 000..d9a7da95a33
--- /dev/null
+++ b/src/gallium/drivers/svga/meson.build
@@ -0,0 +1,88 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_svga = files(
+  'svga_cmd.c',
+  'svga_cmd_vgpu10.c',
+  'svga_context.c',
+  'svga_draw_arrays.c',
+  'svga_draw.c',
+  'svga_draw_elements.c',
+  'svga_format.c',
+  'svga_link.c',
+  'svga_msg.c',
+  'svga_pipe_blend.c',
+  'svga_pipe_blit.c',
+  'svga_pipe_clear.c',
+  'svga_pipe_constants.c',
+  'svga_pipe_depthstencil.c',
+  'svga_pipe_draw.c',
+  'svga_pipe_flush.c',
+  'svga_pipe_fs.c',
+  'svga_pipe_gs.c',
+  'svga_pipe_misc.c',
+  'svga_pipe_query.c',
+  'svga_pipe_rasterizer.c',
+  'svga_pipe_sampler.c',
+  'svga_pipe_streamout.c',
+  'svga_pipe_vertex.c',
+  'svga_pipe_vs.c',
+  'svga_resource_buffer.c',
+  'svga_resource_buffer_upload.c',
+  'svga_resource.c',
+  'svga_resource_texture.c',
+  'svga_sampler_view.c',
+  'svga_screen.c',
+  'svga_screen_cache.c',
+  'svga_shader.c',
+  'svga_state.c',
+  'svga_state_constants.c',
+  'svga_state_framebuffer.c',
+  'svga_state_fs.c',
+  'svga_state_gs.c',
+  'svga_state_need_swtnl.c',
+  'svga_state_rss.c',
+  'svga_state_sampler.c',
+  'svga_state_tgsi_transform.c',
+  'svga_state_tss.c',
+  'svga_state_vdecl.c',
+  'svga_state_vs.c',
+  'svga_surface.c',
+  'svga_swtnl_backend.c',
+  'svga_swtnl_draw.c',
+  'svga_swtnl_state.c',
+  'svga_tgsi.c',
+  'svga_tgsi_decl_sm30.c',
+  'svga_tgsi_insn.c',
+  'svga_tgsi_vgpu10.c',
+  'svgadump/svga_dump.c',
+  'svgadump/svga_shader_dump.c',
+  'svgadump/svga_shader_op.c',
+)
+
+libsvga = static_library(
+  'svga',
+  files_svga,
+  c_args : [c_vis_args, c_msvc_compat_args],
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux,
+include_directories('include')
+  ],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 2568e5ddcfc..2a4cb66ad7a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -81,6 +81,10 @@ if with_gallium_i915
   subdir('winsys/i915/drm')
   subdir('drivers/i915')
 e

[Mesa-dev] [PATCH v4 02/13] meson: build i915g driver

2017-11-16 Thread Dylan Baker
Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build |  7 +++-
 src/gallium/drivers/i915/meson.build| 70 +
 src/gallium/meson.build |  7 ++--
 src/gallium/targets/dri/meson.build |  5 +++
 src/gallium/winsys/i915/drm/meson.build | 31 +++
 5 files changed, 116 insertions(+), 4 deletions(-)
 create mode 100644 src/gallium/drivers/i915/meson.build
 create mode 100644 src/gallium/winsys/i915/drm/meson.build

diff --git a/meson.build b/meson.build
index 87d435fcb71..cbeeef5a749 100644
--- a/meson.build
+++ b/meson.build
@@ -125,6 +125,7 @@ with_gallium_vc4 = false
 with_gallium_vc5 = false
 with_gallium_etnaviv = false
 with_gallium_imx = false
+with_gallium_i915 = false
 _drivers = get_option('gallium-drivers')
 if _drivers == 'auto'
   if not ['darwin', 'windows'].contains(host_machine.system())
@@ -151,6 +152,7 @@ if _drivers != ''
   with_gallium_vc5 = _split.contains('vc5')
   with_gallium_etnaviv = _split.contains('etnaviv')
   with_gallium_imx = _split.contains('imx')
+  with_gallium_i915 = _split.contains('i915')
   with_gallium = true
 endif
 
@@ -180,12 +182,15 @@ endif
 if with_dri_swrast and with_gallium_softpipe
   error('Only one swrast provider can be built')
 endif
+if with_dri_i915 and with_gallium_i915
+  error('Only one i915 provider can be built')
+endif
 if with_gallium_imx and not with_gallium_etnaviv
   error('IMX driver requires etnaviv driver')
 endif
 
 dep_libdrm_intel = []
-if with_dri_i915
+if with_dri_i915 or with_gallium_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
diff --git a/src/gallium/drivers/i915/meson.build 
b/src/gallium/drivers/i915/meson.build
new file mode 100644
index 000..17f0f6adf8f
--- /dev/null
+++ b/src/gallium/drivers/i915/meson.build
@@ -0,0 +1,70 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_i915 = files(
+  'i915_batchbuffer.h',
+  'i915_batch.h',
+  'i915_blit.c',
+  'i915_blit.h',
+  'i915_clear.c',
+  'i915_context.c',
+  'i915_context.h',
+  'i915_debug.c',
+  'i915_debug_fp.c',
+  'i915_debug.h',
+  'i915_debug_private.h',
+  'i915_flush.c',
+  'i915_fpc_emit.c',
+  'i915_fpc.h',
+  'i915_fpc_optimize.c',
+  'i915_fpc_translate.c',
+  'i915_prim_emit.c',
+  'i915_prim_vbuf.c',
+  'i915_public.h',
+  'i915_query.c',
+  'i915_query.h',
+  'i915_reg.h',
+  'i915_resource_buffer.c',
+  'i915_resource.c',
+  'i915_resource.h',
+  'i915_resource_texture.c',
+  'i915_screen.c',
+  'i915_screen.h',
+  'i915_state.c',
+  'i915_state_derived.c',
+  'i915_state_dynamic.c',
+  'i915_state_emit.c',
+  'i915_state_fpc.c',
+  'i915_state.h',
+  'i915_state_immediate.c',
+  'i915_state_inlines.h',
+  'i915_state_sampler.c',
+  'i915_state_static.c',
+  'i915_surface.c',
+  'i915_surface.h',
+  'i915_winsys.h',
+)
+
+libi915 = static_library(
+  'i915',
+  files_i915,
+  c_args : [c_vis_args],
+  include_directories : [inc_include, inc_src, inc_gallium, inc_gallium_aux],
+)
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7ccf4819079..715fee86d0a 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -70,17 +70,18 @@ endif
 if with_gallium_imx
   subdir('winsys/imx/drm')
 endif
-if with_glx == 'gallium-xlib'
-  subdir('winsys/sw/xlib')
+if with_gallium_i915
+  subdir('winsys/i915/drm')
+  subdir('drivers/i915')
 endif
 subdir('state_trackers/dri')
 if with_osmesa == 'gallium'
   subdir('state_trackers/osmesa')
 endif
 if with_glx == 'gallium-xlib'
+  subdir('winsys/sw/xlib')
   subdir('state_trackers/glx/xlib')
 endif
-# TODO: i915
 # TODO: SVGA
 # TODO: r300
 # TODO: r600
diff --git a/src/gallium/targets/dri/meson.build 
b/src/gallium/targets/dri/meson.build
index c591b75d037..de97e8afeaf 100644
--- a/src/gallium/targets/dri/meson.build
+++ b/src/gallium/targets/dri/

[Mesa-dev] [PATCH v4 10/13] meson: build gallium xvmc state tracker

2017-11-16 Thread Dylan Baker
v2: - set with_gallium_xvmc when -Dgallium-xvmc=true
- Install megadrivers properly
- only use cflags from pkg-config, don't add linker flags.
v4: - make use of the install_megadrivers.py changes

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build | 40 +-
 meson_options.txt   | 13 +
 src/gallium/meson.build |  7 ++-
 src/gallium/state_trackers/xvmc/meson.build | 53 +++
 src/gallium/targets/xvmc/meson.build| 81 +
 5 files changed, 192 insertions(+), 2 deletions(-)
 create mode 100644 src/gallium/state_trackers/xvmc/meson.build
 create mode 100644 src/gallium/targets/xvmc/meson.build

diff --git a/meson.build b/meson.build
index 0f8733f7651..9e4460e15c5 100644
--- a/meson.build
+++ b/meson.build
@@ -391,6 +391,44 @@ if vdpau_drivers_path == ''
   vdpau_drivers_path = join_paths(get_option('libdir'), 'vdpau')
 endif
 
+dep_xvmc = []
+_xvmc = get_option('gallium-xvmc')
+if _xvmc == 'auto'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+with_gallium_xvmc = false
+  elif not with_platform_x11
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+with_gallium_xvmc = false
+  else
+dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : false)
+with_gallium_xvmc = dep_xvmc.found()
+  endif
+elif _xvmc == 'true'
+  if not ['linux', 'bsd'].contains(host_machine.system())
+error('XVMC state tracker can only be build on unix-like OSes.')
+  elif not with_platform_x11
+error('XVMC state tracker requires X11 support.')
+with_gallium_xvmc = false
+  elif not (with_gallium_r600 or with_gallium_nouveau)
+error('XVMC state tracker requires at least one of the following gallium 
drivers: r600, nouveau.')
+  endif
+  dep_xvmc = dependency('xvmc', version : '>= 1.0.6')
+  with_gallium_xvmc = true
+else
+  with_gallium_xvmc = false
+endif
+if with_gallium_xvmc
+  dep_xvmc = declare_dependency(
+compile_args : dep_xvmc.get_pkgconfig_variable('cflags').split()
+  )
+endif
+
+xvmc_drivers_path = get_option('xvmc-libs-path')
+if xvmc_drivers_path == ''
+  xvmc_drivers_path = get_option('libdir')
+endif
+
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
@@ -898,7 +936,7 @@ if with_platform_x11
 dep_xxf86vm = dependency('xxf86vm', required : false)
   endif
   if (with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm') or
-  with_gallium_vdpau)
+  (with_gallium_vdpau or with_gallium_xvmc))
 dep_xcb = dependency('xcb')
 dep_x11_xcb = dependency('x11-xcb')
 dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
diff --git a/meson_options.txt b/meson_options.txt
index 78b78a92dbf..f0de44e751b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -62,6 +62,19 @@ option(
   value : '',
   description : 'path to put vdpau libraries. defaults to $libdir/vdpau.'
 )
+option(
+  'gallium-xvmc',
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
+  description : 'enable gallium xvmc state tracker.',
+)
+option(
+  'xvmc-libs-path',
+  type : 'string',
+  value : '',
+  description : 'path to put xvmc libraries. defaults to $libdir.'
+)
 option(
   'vulkan-drivers',
   type : 'string',
diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 446710e1495..a8317a53552 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -102,6 +102,9 @@ endif
 if with_gallium_vdpau
   subdir('state_trackers/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('state_trackers/xvmc')
+endif
 # TODO: SWR
 # TODO: clover
 if with_dri and with_gallium
@@ -116,9 +119,11 @@ endif
 if with_gallium_vdpau
   subdir('targets/vdpau')
 endif
+if with_gallium_xvmc
+  subdir('targets/xvmc')
+endif
 # TODO: OMX
 # TODO: VA
 # TODO: xa
-# TODO: xvmc
 # TODO: nine
 # TODO: tests
diff --git a/src/gallium/state_trackers/xvmc/meson.build 
b/src/gallium/state_trackers/xvmc/meson.build
new file mode 100644
index 000..a1022c164b1
--- /dev/null
+++ b/src/gallium/state_trackers/xvmc/meson.build
@@ -0,0 +1,53 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDIN

[Mesa-dev] [PATCH v4 08/13] meson: drop gallium-media argument

2017-11-16 Thread Dylan Baker
This argument is the wrong approach for handling gallium media state
trackers, since it doesn't allow for an auto option. Instead we'll use
tristates, which do allow for auto.

This option has never been wired to anything anyway.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 meson.build   | 17 -
 meson_options.txt |  6 --
 2 files changed, 23 deletions(-)

diff --git a/meson.build b/meson.build
index 7452066a167..ccbdd8cee47 100644
--- a/meson.build
+++ b/meson.build
@@ -348,23 +348,6 @@ if with_dri or with_gallium
   endif
 endif
 
-with_gallium_xvmc = false
-with_gallium_vdpau = false
-with_gallium_omx = false  # this is bellagio
-with_gallium_va = false
-with_gallium_media = false
-dep_va = []
-_drivers = get_option('gallium-media')
-if _drivers != ''
-  _split = _drivers.split(',')
-  with_gallium_xvmc = _split.contains('xvmc')
-  with_gallium_vdpau = _split.contains('vdpau')
-  with_gallium_omx = _split.contains('omx')
-  with_gallium_va = _split.contains('va')
-  with_gallium_media = (with_gallium_xvmc or with_gallium_vdpau or
-with_gallium_omx or with_gallium_va)
-endif
-
 gl_pkgconfig_c_flags = []
 if with_platform_x11
   if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
diff --git a/meson_options.txt b/meson_options.txt
index 6c9cd33998c..119bec15709 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,12 +49,6 @@ option(
   value : 'auto',
   description : 'comma separated list of gallium drivers to build. If this is 
set to auto all drivers applicable to the target OS/architecture will be built'
 )
-option(
-  'gallium-media',
-  type : 'string',
-  value : '',
-  description : 'comma separated list of gallium media APIs to build 
(omx,va,vdpau,xvmc).'
-)
 option(
   'vulkan-drivers',
   type : 'string',
-- 
2.15.0

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


<    3   4   5   6   7   8   9   10   11   12   >