OSDN Git Service

android-x86/external-mesa.git
8 years agonv50/ir: fix error finding free element in bitset in some situations
Ilia Mirkin [Tue, 31 May 2016 04:33:50 +0000 (00:33 -0400)]
nv50/ir: fix error finding free element in bitset in some situations

This really only hits for bitsets with a size of a multiple of 32. We
can end up with pos = -1 as a result of the ffs, which we in turn decide
is a valid position (since we fall through the loop and i == 1, we end
up adding 32 to it, so end up returning 31 again).

Up until recently this was largely unreachable, as the register file
sizes were all 63 or 255. However with the advent of compute shaders
which can restrict the number of registers, this can now happen.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 18d11c998940d4228ce0f5057042a885f1aa65af)

8 years agoRevert "glsl: fix xfb_offset unsized array validation"
Timothy Arceri [Tue, 31 May 2016 23:21:01 +0000 (09:21 +1000)]
Revert "glsl: fix xfb_offset unsized array validation"

This reverts commit aac90ba2920cf5ceb4df6dba776dd3952780e456.

The commit caused a regression in:
piglit.spec.glsl-1_50.compiler.gs-input-nonarray-named-block.geom

Also the CTS test it was meant to fix seems like it may be bogus.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 98d40b4d1195ebfaa2fd9ed43755ca6896422c1a)

8 years agoi965/fs: Allow scalar source regions on SNB math instructions.
Francisco Jerez [Sat, 28 May 2016 06:29:14 +0000 (23:29 -0700)]
i965/fs: Allow scalar source regions on SNB math instructions.

I haven't found any evidence that this isn't supported by the
hardware, in fact according to the SNB hardware spec:

 "The supported regioning modes for math instructions are align16,
  align1 with the following restrictions:
   - Scalar source is supported.
  [...]
   - Source and destination offset must be the same, except the case of
     scalar source."

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c1107cec44ab030c7fcc97c67baa12df1cc9d7b5)

8 years agoi965/fs: Fix constant combining for instructions that cannot accept source mods.
Francisco Jerez [Sat, 28 May 2016 06:29:10 +0000 (23:29 -0700)]
i965/fs: Fix constant combining for instructions that cannot accept source mods.

This is the case for SNB math instructions so we need to be careful
and insert the literal value of the immediate into the table (rather
than its absolute value) if the instruction is unable to invert the
sign of the constant on the fly.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 06d8765bc09ecd8ff73fff424c8cfec645cb0ded)

8 years agoi965/fs: Extend remove_duplicate_mrf_writes() to handle non-VGRF to MRF copies.
Francisco Jerez [Wed, 25 May 2016 20:17:41 +0000 (13:17 -0700)]
i965/fs: Extend remove_duplicate_mrf_writes() to handle non-VGRF to MRF copies.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 303ec22ed6124f7860de3856599ab4f02808b84b)

8 years agoi965/fs: Fix compute_to_mrf() to coalesce VGRFs initialized by multiple single-GRF...
Francisco Jerez [Fri, 27 May 2016 23:03:34 +0000 (16:03 -0700)]
i965/fs: Fix compute_to_mrf() to coalesce VGRFs initialized by multiple single-GRF writes.

Which requires using a bitset instead of a boolean flag to keep track
of the GRFs we've seen a generating instruction for already.  The
search loop continues until all instructions initializing the value of
the source VGRF have been found, or it is determined that coalescing
is not possible.

Fixes a few piglit test cases on Gen4-6 which were regressed by
6956015aa514f2d06d0e4b33bfe6bca83142fbf0 due to the different (yet
perfectly valid) ordering in which copy instructions are emitted now
by the simd lowering pass, which had the side effect of causing this
optimization pass to start corrupting the program in cases where a
VGRF-to-MRF copy instruction would be eliminated but only the last
instruction writing to the source VGRF region would be rewritten to
point to the target MRF.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 4fe4f6e8a776acc60633809693e4135f5c894aa3)

8 years agoi965/fs: Teach compute_to_mrf() about the COMPR4 address transformation.
Francisco Jerez [Fri, 27 May 2016 21:17:28 +0000 (14:17 -0700)]
i965/fs: Teach compute_to_mrf() about the COMPR4 address transformation.

This will be required to correctly transform the destination of 8-wide
instructions that write a single GRF of a VGRF to MRF copy marked
COMPR4.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 1898673f586b9110fb2a3125e2781cbb1d795c73)

8 years agoi965/fs: Refactor compute_to_mrf() to split search and rewrite into separate loops.
Francisco Jerez [Fri, 27 May 2016 20:15:55 +0000 (13:15 -0700)]
i965/fs: Refactor compute_to_mrf() to split search and rewrite into separate loops.

This will allow compute_to_mrf to handle cases where the source of the
VGRF-to-MRF copy is initialized by more than one instruction.  In such
cases we cannot rewrite the destination of any of the generating
instructions until it's known whether the whole VGRF source region can
be coalesced into the destination MRF, which will imply continuing the
search until all generating instructions have been found or it has
been determined that the VGRF and MRF registers cannot be coalesced.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 485fbaff03f7d281ff4f22bd6321548512783799)

8 years agoi965/fs: Fix compute-to-mrf VGRF region coverage condition.
Francisco Jerez [Fri, 27 May 2016 23:41:35 +0000 (16:41 -0700)]
i965/fs: Fix compute-to-mrf VGRF region coverage condition.

Compute-to-mrf was checking whether the destination of scan_inst is
more than one component (making assumptions about the instruction data
type) in order to find out whether the result is being fully copied
into the MRF destination, which is rather inaccurate in cases where a
single-component instruction is only partially contained in the source
region, or when the execution size of the copy and scan_inst
instructions differ.  Instead check whether the destination region of
the instruction is really contained within the bounds of the source
region of the copy.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 4b0ec9f4759bab68b51e2f410e9305e39c1e1e7f)

8 years agoi965/fs: Simplify and improve accuracy of compute_to_mrf() by using regions_overlap().
Francisco Jerez [Fri, 27 May 2016 19:50:28 +0000 (12:50 -0700)]
i965/fs: Simplify and improve accuracy of compute_to_mrf() by using regions_overlap().

Compute-to-mrf was being rather heavy-handed about checking whether
instruction source or destination regions interfere with the copy
instruction, which could conceivably lead to program miscompilation.
Fix it by using regions_overlap() instead of the open-coded and
dubiously correct overlap checks.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit bb61e24787952a4796a687a86200a05cf83af7e9)

8 years agoi965/fs: Teach regions_overlap() about COMPR4 MRF regions.
Francisco Jerez [Fri, 27 May 2016 06:53:31 +0000 (23:53 -0700)]
i965/fs: Teach regions_overlap() about COMPR4 MRF regions.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 88f380a2ddbdeda6e83725403b12ee0070f1f0f3)

8 years agoDon't use python 3
Dylan Baker [Tue, 31 May 2016 20:31:44 +0000 (13:31 -0700)]
Don't use python 3

Now there are not files that require python 3, so for now just remove
the python 3 dependency and use python 2. I think the right plan is to
just get all of the python ready for python 3, and then use whatever
python is available.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 604010a7edbe03ff65720cab8dddba1d0ca1571b)

8 years agogenxml: change chbang to python 2
Dylan Baker [Tue, 31 May 2016 18:40:22 +0000 (11:40 -0700)]
genxml: change chbang to python 2

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ab31817fedff4634c7daeb3eb04fac49d4625c54)

8 years agogenxml: use the isalpha method rather than str.isalpha.
Dylan Baker [Tue, 31 May 2016 20:33:50 +0000 (13:33 -0700)]
genxml: use the isalpha method rather than str.isalpha.

This fixes gen_pack_header to work on python 2, where name[0] is unicode
not str.

Signed-off-by: Dylan Bake <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 12c1a01c720f4e9fa16345ee403ac061ed40601e)

8 years agogenxml: require future imports for python2 compatibility.
Dylan Baker [Tue, 31 May 2016 18:36:26 +0000 (11:36 -0700)]
genxml: require future imports for python2 compatibility.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a45a25418bd6310122d52f12a4640e8493246439)

8 years agogenxml: mark re strings as raw
Dylan Baker [Tue, 31 May 2016 18:33:19 +0000 (11:33 -0700)]
genxml: mark re strings as raw

This is a correctness issue.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e5681e4d7056dbe561127dedf76fb2cd9d16fc00)

8 years agogenxml: Make classes descendants of object
Dylan Baker [Tue, 31 May 2016 18:31:18 +0000 (11:31 -0700)]
genxml: Make classes descendants of object

This is the default in python3, but in python2 you get old style
classes. No one likes old-style classes.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit de2e9da2e9b0bfeca535f318c20df93b3a0fd08b)

8 years agogenxml: mark gen_pack_header.py as encoded in utf-8
Dylan Baker [Tue, 31 May 2016 18:29:50 +0000 (11:29 -0700)]
genxml: mark gen_pack_header.py as encoded in utf-8

There is unicode in this file, and I'm actually surprised that the
python interpreter hasn't gotten grumpy.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
cc: 12.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9f50e3572ceca6179438157de04c65d6300902da)

8 years agomesa: fix crash in driver_RenderTexture_is_safe
Marek Olšák [Mon, 30 May 2016 14:29:18 +0000 (16:29 +0200)]
mesa: fix crash in driver_RenderTexture_is_safe

This just fixed the crash with the apitrace in bug report.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95246

Cc: 11.1 11.2 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 8a10192b4b2435577bde1227c06166029b581398)

8 years agoglsl/images: bounds check image unit assignment
Dave Airlie [Mon, 23 May 2016 02:49:25 +0000 (12:49 +1000)]
glsl/images: bounds check image unit assignment

The CTS test:
GL45-CTS.multi_bind.dispatch_bind_image_textures
binds 192 image uniforms, we reject this later,
but not until after we trash the contents of the
struct gl_shader.

Error now reads:
Too many compute shader image uniforms (192 > 16)
instead of
Too many compute shader image uniforms (2745344416 > 16)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f87352d76966b6e4b0ab5fa9129ccd1ade0c2e7a)

8 years agonvc0/ir: fix spilling predicates to registers
Ilia Mirkin [Mon, 30 May 2016 21:25:41 +0000 (17:25 -0400)]
nvc0/ir: fix spilling predicates to registers

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4b1a167a2bce936beabd03ffc313a63d8deeed09)

8 years agoUpdate version to 12.0.0-rc1
Emil Velikov [Mon, 30 May 2016 17:51:53 +0000 (18:51 +0100)]
Update version to 12.0.0-rc1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodocs: rename release notes to 12.0.0
Emil Velikov [Mon, 30 May 2016 17:50:17 +0000 (18:50 +0100)]
docs: rename release notes to 12.0.0

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agonir: add the SConscript.nir to the tarball
Emil Velikov [Mon, 30 May 2016 17:57:09 +0000 (18:57 +0100)]
nir: add the SConscript.nir to the tarball

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 922b471777c524f497fb8eda97153a898900f223)

8 years agovc4: Fix doxygen warnings
Rhys Kidd [Wed, 25 May 2016 21:10:46 +0000 (17:10 -0400)]
vc4: Fix doxygen warnings

Now that vc4 automated code documentation can be generated with
doxygen, fix the warnings issued by Doxygen 1.8.11.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodoxygen: Plumb through gallium/ to automated documentation
Rhys Kidd [Wed, 25 May 2016 21:10:45 +0000 (17:10 -0400)]
doxygen: Plumb through gallium/ to automated documentation

Add Gallium and the Gallium-based drivers to doxygen's automated
code documentation infrastructure.

Can be individually created with:

  cd $MESA_TOP_LEVEL/
  make -C doxygen/ gallium.tag

Benefits from the existing doxygen Makefile runners to clean up
afterwards with 'make clean'.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoRevert "osmesa: don't try to bundle osmesa.def SConscript"
Emil Velikov [Mon, 30 May 2016 16:11:16 +0000 (17:11 +0100)]
Revert "osmesa: don't try to bundle osmesa.def SConscript"

This reverts commit c07df0f2014636b601cdbaff63214296599b1ad5.

Now that the SCons build is back we need to include the files in the
tarball.

8 years agoscons: build osmesa swrast and gallium
Andreas Fänger [Tue, 8 Mar 2016 11:04:00 +0000 (11:04 +0000)]
scons: build osmesa swrast and gallium

This patch makes it possible to build classic osmesa/swrast on windows
again. It was removed in commit 69db422218b0264b5b8eef45bd003a2544e9cbd6.
Although there is a gallium version of osmesa now, the swrast version
still has more features lacking in llvmpipe, e.g. anisotropic filtering.

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
[Emil Velikov: remove trailing whitespace]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: rework the git_sha1.h rule, include in tarball
Emil Velikov [Mon, 30 May 2016 11:32:05 +0000 (12:32 +0100)]
automake: rework the git_sha1.h rule, include in tarball

As we'll need the file in the release tarball, rework the rule so that
the file is regenerated _only_ if we're in a git repository.

With this in place we can build vulkan (anv) from a release tarball.

Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: move the git_sha1.h rule a level up
Emil Velikov [Mon, 30 May 2016 11:09:04 +0000 (12:09 +0100)]
automake: move the git_sha1.h rule a level up

This way we can reuse the header from other places like -
src/intel/vulkan and src/gallium. Only the former is hooked up atm.

Make sure .gitignore is updated, as well as all the users (the mesa
code does not need any changes).

Also ensure that the file is always created by adding it to the
BUILT_SOURCES target.

Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agomesa_glinterop: remove mesa_glinterop typedefs
Emil Velikov [Mon, 30 May 2016 09:56:33 +0000 (10:56 +0100)]
mesa_glinterop: remove mesa_glinterop typedefs

As is there are two places that do the typedefs - dri_interface.h and
this header. As we cannot include the former in here, just drop the
typedefs and use the struct directly (as needed).

This is required because typedef redefinition is C11 feature which is
not supported on all the versions of GCC used to build mesa.

v2: Kill the typedef alltogether, as per Marek.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236
Cc: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglx/glvnd: automake: include all the sources in libglx_la_SOURCES
Emil Velikov [Mon, 30 May 2016 15:49:02 +0000 (16:49 +0100)]
glx/glvnd: automake: include all the sources in libglx_la_SOURCES

Otherwise the headers will be missing from the release tarball.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoglx/glvnd: remove the final if defined($extension) guards
Emil Velikov [Mon, 30 May 2016 15:45:39 +0000 (16:45 +0100)]
glx/glvnd: remove the final if defined($extension) guards

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoglx/glvnd: rework dispatch functions/indices tables lookup
Emil Velikov [Wed, 11 May 2016 18:01:55 +0000 (14:01 -0400)]
glx/glvnd: rework dispatch functions/indices tables lookup

Rather than checking if the function name maps to a valid entry in the
respective table, just create a dummy entry at the end of each table.

This allows us to remove some unnessesary "index >= 0" checks, which get
executed quite often.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoglx/glvnd: Use strcmp() based binary search in FindGLXFunction()
Emil Velikov [Wed, 11 May 2016 18:01:54 +0000 (14:01 -0400)]
glx/glvnd: Use strcmp() based binary search in FindGLXFunction()

It will allows us to find the function within 6 attempts, out of the ~80
entry long table.

v2: calculate middle on each iteration, correctly set the lower limit.

Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoconfigure.ac: correct the xlib/xlib-gallium GLX detection for GLVND
Chuck Atkins [Mon, 30 May 2016 15:35:40 +0000 (16:35 +0100)]
configure.ac: correct the xlib/xlib-gallium GLX detection for GLVND

Things have changed since commit a92910a ("glx: Refactor the configure
options for glx implementation choice (v3)") where only a single
configure option is used to control the GLX provider.

[Emil Velikov: Ensure that the check is moved after the detection code.]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoglx: Implement the libglvnd interface.
Kyle Brenneman [Wed, 11 May 2016 18:01:53 +0000 (14:01 -0400)]
glx: Implement the libglvnd interface.

With reference to the libglvnd branch:

https://cgit.freedesktop.org/mesa/mesa/log/?h=libglvnd

This is a squashed commit containing all of Kyle's commits, all but two
of Emil's commits (to follow), and a small fixup from myself to mark the
rest of the glX* functions as _GLX_PUBLIC so they are not exported when
building for libglvnd. I (ajax) squashed them together both for ease of
review, and because most of the changes are un-useful intermediate
states representing the evolution of glvnd's internal API.

Co-author: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
8 years agogallivm: initialize init_native_targets_once_flag correctly
Frederic Devernay [Mon, 30 May 2016 14:09:21 +0000 (16:09 +0200)]
gallivm: initialize init_native_targets_once_flag correctly

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agonvc0/ir: fix emission of predicate spill to register
Ilia Mirkin [Sun, 29 May 2016 13:58:40 +0000 (09:58 -0400)]
nvc0/ir: fix emission of predicate spill to register

The lane mask only applies to real mov's, while here we're using PSET.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: fix some compute texture validation bits on kepler
Ilia Mirkin [Mon, 30 May 2016 02:15:07 +0000 (22:15 -0400)]
nvc0: fix some compute texture validation bits on kepler

(a) Make sure to update the TIC in case of an updated buffer address
(b) Mark newly-inactive textures dirty so that we update the handle in
set_tex_handles.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agomesa/xfb: report calculated size for XFB buffer objects.
Dave Airlie [Sun, 29 May 2016 20:56:52 +0000 (06:56 +1000)]
mesa/xfb: report calculated size for XFB buffer objects.

This fixes:
GL45-CTS.direct_state_access.xfb_buffers

This test looks correct to me, we should work out the
size value and report it rather than using only the size
from the Range interface.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoswr: automake: silence the python invocation
Emil Velikov [Fri, 27 May 2016 14:35:45 +0000 (15:35 +0100)]
swr: automake: silence the python invocation

Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoswr: automake: attempt to fix the out-of-tree build
Emil Velikov [Fri, 27 May 2016 14:35:44 +0000 (15:35 +0100)]
swr: automake: attempt to fix the out-of-tree build

Make sure that the output folder is created otherwise the python scripts
yells at us.

Cc: 0xe2.0x9a.0x9b@gmail.com
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96238
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoswr: remove LLVM dependency from source generation rules.
Emil Velikov [Fri, 27 May 2016 14:35:43 +0000 (15:35 +0100)]
swr: remove LLVM dependency from source generation rules.

The dependencies should not mention any files external to the project.
If we want to do sanity checks for the LLVM installed on the system we
should do that in configure, yet again where is the merit which header
gets checked and which doesn't ?

Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoswr: add all the generators to the release tarball.
Emil Velikov [Fri, 27 May 2016 14:35:42 +0000 (15:35 +0100)]
swr: add all the generators to the release tarball.

Namely the python scripts and the knobs.template.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoanv: automake: don't forget to cleanup dev_icd.json
Emil Velikov [Fri, 27 May 2016 14:35:39 +0000 (15:35 +0100)]
anv: automake: don't forget to cleanup dev_icd.json

Otherwise `make distcheck' will barf at us as the file is dangling.

Ideally this should be part of the clean-local hook, although we include
install-lib-links.mk which already has one.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoanv: automake: bring back VULKAN_ENTRYPOINT_CPPFLAGS
Emil Velikov [Fri, 27 May 2016 14:35:38 +0000 (15:35 +0100)]
anv: automake: bring back VULKAN_ENTRYPOINT_CPPFLAGS

We should not have removed them in the first place. There's a subtle
difference between generating the complete sources and using them which
was not obvious as we nuked them.

Without this, the release tarball ends up without various hunks of the
generated sources, thus things fail at a later stage as we attempt to
build them.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoanv: automake: ship the json files in the release tarball
Emil Velikov [Fri, 27 May 2016 14:35:37 +0000 (15:35 +0100)]
anv: automake: ship the json files in the release tarball

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agosoftpipe: add sp_buffer.h to the sources list (release tarball)
Emil Velikov [Fri, 27 May 2016 14:35:36 +0000 (15:35 +0100)]
softpipe: add sp_buffer.h to the sources list (release tarball)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agofreedreno: make sure we pick up ir3_nir_trig.py in the release tarball
Emil Velikov [Fri, 27 May 2016 14:35:35 +0000 (15:35 +0100)]
freedreno: make sure we pick up ir3_nir_trig.py in the release tarball

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoisl: add isl_priv.h to the sources list
Emil Velikov [Fri, 27 May 2016 14:35:34 +0000 (15:35 +0100)]
isl: add isl_priv.h to the sources list

Otherwise it will be missing from the release tarball.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoisl: move the sources lists to Makefile.sources
Mauro Rossi [Fri, 27 May 2016 14:35:33 +0000 (15:35 +0100)]
isl: move the sources lists to Makefile.sources

[Emil Velikov: use the file in the autoconf build]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoisl: automake: list builddir before srcdir in the includes list
Emil Velikov [Fri, 27 May 2016 14:35:32 +0000 (15:35 +0100)]
isl: automake: list builddir before srcdir in the includes list

As seen elsewhere - we want to include the freshly built sources as
opposed the the (likely) stale ones in the srcdir.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoisl: automake: flatten the tests rules
Emil Velikov [Fri, 27 May 2016 14:35:31 +0000 (15:35 +0100)]
isl: automake: flatten the tests rules

Fold the unneeded extra variable tests_ldadd, the explicit sources
section (single file with the default extension) and flip the
check_PROGRAMS <> TESTS order (TESTS includes scripts, while
check_PROGRAMS is binaries only).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoisl: automake: remove unneeded install-lib-links.mk include
Emil Velikov [Fri, 27 May 2016 14:35:30 +0000 (15:35 +0100)]
isl: automake: remove unneeded install-lib-links.mk include

One uses the makefile to create compatibility symlinks (to
$top_builddir/libs) for shared libraries/modules. As we don't create any
here, there's no need to include the file.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoisl: automake: remove unneeded SUBDIRS
Emil Velikov [Fri, 27 May 2016 14:35:29 +0000 (15:35 +0100)]
isl: automake: remove unneeded SUBDIRS

As we do not include any other subdirs but self, we don't need to set
it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogenxml: move the sources (headers) list to Makefile.sources
Mauro Rossi [Fri, 27 May 2016 14:35:28 +0000 (15:35 +0100)]
genxml: move the sources (headers) list to Makefile.sources

[Emil Velikov: use the file in the autoconf build]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoanv: bail out if anv_wsi_init() fails
Emil Velikov [Sat, 28 May 2016 19:03:34 +0000 (20:03 +0100)]
anv: bail out if anv_wsi_init() fails

Otherwise we'll end up setting up a device with no winsys integration.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
---
Hard-coding the rendernode name in anv_physical_device_init() is a bad
idea really. We could/should be using drmGetDevices() to get info on all
the devices (master/render/etc. node names, pci location etc.) and apply
our heuristics on top of that.

That can come up as a follow up change.

8 years agoanv: resolve wayland-only build
Emil Velikov [Sat, 28 May 2016 18:49:37 +0000 (19:49 +0100)]
anv: resolve wayland-only build

Ensure that the final X11/XCB hunk is guarded by the correct macro.
Otherwise we'll require the symbol even when building without said
platform.

Cc: Cedric Sodhi <manday@openmail.cc>
Reported-by: Cedric Sodhi <manday@openmail.cc>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoanv: Fix use of uninitialized variable.
Robert Foss [Wed, 4 May 2016 12:58:27 +0000 (08:58 -0400)]
anv: Fix use of uninitialized variable.

The return variable was not set for failure paths.
It has now been changed to VK_ERROR_INITIALIZATION_FAILED
for failure paths.

Coverity: 1358944
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil Velikov: rebase against master, s/vulkan/anv/]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agogallium: push offset down to driver
Stanimir Varbanov [Thu, 26 May 2016 22:10:37 +0000 (01:10 +0300)]
gallium: push offset down to driver

Push offset down to drivers when importing dmabuf. This is needed
to more fully support EGL_EXT_image_dma_buf_import when a non-zero
offset is specified.

Tesing has been done for freedreno, and compile tested following
gallium drivers:
nouveau,svga,virgl,r600,r300,radeonsi,swrast,i915,ilo

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/dri: cleanup image_from_fd/dma_buf paths
Stanimir Varbanov [Thu, 26 May 2016 22:10:36 +0000 (01:10 +0300)]
st/dri: cleanup image_from_fd/dma_buf paths

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/dri: add handling of R8 and GR88 DRI fourcc formats
Stanimir Varbanov [Thu, 26 May 2016 22:10:35 +0000 (01:10 +0300)]
st/dri: add handling of R8 and GR88 DRI fourcc formats

This helps to import dmabuf buffers from DRM_FORMAT_R8 and
DRM_FORMAT_GR88 used for example by GStreamer for YUV to RGB
conversion using shaders.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoradeonsi: Don't offset OFFCHIP_BUFFERING on pre-VI cards.
Bas Nieuwenhuizen [Sun, 29 May 2016 16:35:22 +0000 (18:35 +0200)]
radeonsi: Don't offset OFFCHIP_BUFFERING on pre-VI cards.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96239
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965: Expose GL 4.3 on Gen8+.
Francisco Jerez [Fri, 20 May 2016 07:19:18 +0000 (00:19 -0700)]
i965: Expose GL 4.3 on Gen8+.

ARB_compute_shader was the last feature missing.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Skip gen4 pre/post-send dependency workaronds for the first/last block.
Francisco Jerez [Wed, 25 May 2016 21:21:49 +0000 (14:21 -0700)]
i965/fs: Skip gen4 pre/post-send dependency workaronds for the first/last block.

We know that there cannot be any destination dependency race if we
reach the beginning or end of the program without having found any
other instruction the send could possibly race with.  This avoids
emitting a pile of useless moves at the beginning or end of the
program in the most common case in which the program has a single
basic block only.

On the original i965 I get the following shader-db results:

 total instructions in shared programs: 3354165 -> 3215637 (-4.13%)
 instructions in affected programs: 3183065 -> 3044537 (-4.35%)
 helped: 13498
 HURT: 0

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Skip SIMD lowering source unzipping for regular scalar regions.
Francisco Jerez [Sun, 29 May 2016 05:44:13 +0000 (22:44 -0700)]
i965/fs: Skip SIMD lowering source unzipping for regular scalar regions.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Factor out region zipping and unzipping from the SIMD lowering pass.
Francisco Jerez [Fri, 27 May 2016 06:07:58 +0000 (23:07 -0700)]
i965/fs: Factor out region zipping and unzipping from the SIMD lowering pass.

Just to make sure we keep the SIMD lowering pass tidy when we
introduce additional logic to try to optimize out the copy
instructions used to zip and unzip the destination and source regions
into multiple packed regions of the lowered instruction width.
Shouldn't cause any functional changes.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Generalize regions_overlap() from copy propagation to handle non-VGRF files.
Francisco Jerez [Fri, 27 May 2016 06:20:19 +0000 (23:20 -0700)]
i965/fs: Generalize regions_overlap() from copy propagation to handle non-VGRF files.

This will be useful in several places.  The only externally visible
difference (other than non-VGRF files being supported now) is that the
region sizes are now passed in byte units instead of in GRF units
because the loss of precision would have become a problem in the SIMD
lowering pass.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Refactor offset() into a separate function taking the width as argument.
Francisco Jerez [Fri, 27 May 2016 06:09:46 +0000 (23:09 -0700)]
i965/fs: Refactor offset() into a separate function taking the width as argument.

This will be useful in the SIMD lowering pass to avoid having to
construct a builder object of the known region width just to pass it
as argument to offset(), which doesn't do anything with it other than
taking the builder dispatch_width as region width.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Implement opt_sampler_eot() in terms of logical sends.
Francisco Jerez [Fri, 20 May 2016 07:38:17 +0000 (00:38 -0700)]
i965/fs: Implement opt_sampler_eot() in terms of logical sends.

This makes the whole LOAD_PAYLOAD munging unnecessary which simplifies
the code and will allow the optimization to succeed in more cases
independent of whether the LOAD_PAYLOAD instruction can be found or
not.

The following patch is squashed in:

SQUASH: i965/fs: Add basic dataflow check to opt_sampler_eot().

The sampler EOT optimization pass naively assumes that the texturing
instruction provides all the data used by the FB write just because
they're standing next to each other.  The least we should be checking
is whether the source and destination regions of the FB write and
texturing instructions match.  Without this the previous seemingly
harmless patch would have caused opt_sampler_eot() to misoptimize a
shader from dota-2 causing DCE to eliminate all of its 78 instructions
except for the final sampler EOT message (!).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Fix UB list sentinel dereference in opt_sampler_eot().
Francisco Jerez [Sat, 30 Apr 2016 21:24:31 +0000 (14:24 -0700)]
i965/fs: Fix UB list sentinel dereference in opt_sampler_eot().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Take opt_redundant_discard_jumps out of the optimization loop.
Francisco Jerez [Wed, 4 May 2016 01:36:02 +0000 (18:36 -0700)]
i965/fs: Take opt_redundant_discard_jumps out of the optimization loop.

No shader-db regressions.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Run SIMD and logical send lowering after the optimization loop.
Francisco Jerez [Sat, 30 Apr 2016 22:08:29 +0000 (15:08 -0700)]
i965/fs: Run SIMD and logical send lowering after the optimization loop.

There are two reasons why this is useful:

 - It avoids the introduction of an amount of partial writes emitted
   by the SIMD lowering pass to zip and unzip register regions early
   during optimization, which can make subsequent optimization less
   effective.

 - It substantially reduces the burden on the compiler when a large
   fraction of the instructions in the program need to be split (e.g.
   during SIMD32 builds).  Individual halves of split instructions
   will be optimized identically (if they can still be optimized at
   all), so doing it up front can duplicate the amount of instructions
   the optimizer has to deal with which causes the compilation time to
   explode in some cases due to the worse-than-linear runtime
   behaviour of the back-end.

It seems helpful to re-run a few optimization passes in cases where
any of the lowering passes was able to make progress.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Add FS_OPCODE_FB_WRITE_LOGICAL to has_side_effects().
Francisco Jerez [Sat, 30 Apr 2016 21:57:59 +0000 (14:57 -0700)]
i965/fs: Add FS_OPCODE_FB_WRITE_LOGICAL to has_side_effects().

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Allow constant propagation into logical send sources.
Francisco Jerez [Sat, 30 Apr 2016 06:36:59 +0000 (23:36 -0700)]
i965/fs: Allow constant propagation into logical send sources.

Logical sends are eventually lowered into a series of copies so they
can take almost anything as source.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Let CSE handle logical sampler sends as expressions.
Francisco Jerez [Sat, 30 Apr 2016 06:35:01 +0000 (23:35 -0700)]
i965/fs: Let CSE handle logical sampler sends as expressions.

This will prevent some shader-db regressions when we start plumbing
logical sends through the optimizer.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Pass a BAD_FILE register to the logical FB write when oMask is unused.
Francisco Jerez [Sat, 30 Apr 2016 02:47:44 +0000 (19:47 -0700)]
i965/fs: Pass a BAD_FILE register to the logical FB write when oMask is unused.

This will let the optimizer know that the sample mask value is unused
so its definition can be DCE'ed.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: fix xfb_offset unsized array validation
Timothy Arceri [Fri, 27 May 2016 09:07:19 +0000 (19:07 +1000)]
glsl: fix xfb_offset unsized array validation

This partially fixes CTS test:
GL44-CTS.enhanced_layouts.xfb_get_program_resource_api

The test now fails at a tes evaluation shader with unsized output arrays.

The ARB_enhanced_layouts spec says:

   "It is a compile-time error to apply xfb_offset to the declaration of an
   unsized array."

So this seems like a bug in the CTS.

Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: dont crash when attempting to assign a value to a builtin define
Timothy Arceri [Mon, 30 May 2016 02:16:39 +0000 (12:16 +1000)]
glsl: dont crash when attempting to assign a value to a builtin define

For example GL_ARB_enhanced_layouts = 3;

Fixes:
GL44-CTS.enhanced_layouts.glsl_contant_immutablity

Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agoegl/dri3: don't crash on no context.
Dave Airlie [Sun, 29 May 2016 22:02:00 +0000 (08:02 +1000)]
egl/dri3: don't crash on no context.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94925

Pointed out by Karol Herbst on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agomesa/program_interface_query: fix transform feedback varyings.
Dave Airlie [Mon, 23 May 2016 21:58:32 +0000 (07:58 +1000)]
mesa/program_interface_query: fix transform feedback varyings.

The spec says gl_NextBuffer and gl_SkipComponents need to be
returned to userspace in the program interface queries.

We currently throw those away, this requires a complete piglit
run to make sure no drivers fallover due to the extra varyings.

This fixes:
GL45-CTS.program_interface_query.transform-feedback-built-in

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl/ast: subroutineTypes can't be returned from functions.
Dave Airlie [Mon, 23 May 2016 02:14:01 +0000 (12:14 +1000)]
glsl/ast: subroutineTypes can't be returned from functions.

These types can't be returned.

This fixes:
GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types
for the return type case.

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: use has_double() helper
Timothy Arceri [Sat, 28 May 2016 01:56:17 +0000 (11:56 +1000)]
glsl: use has_double() helper

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
8 years agoglsl: fix explicit uniform block alignment
Timothy Arceri [Sat, 28 May 2016 01:40:22 +0000 (11:40 +1000)]
glsl: fix explicit uniform block alignment

This stops the offset being bumped again when and an explicit
alignment has already been applied.

Fixes alignment issues in:
GL44-CTS.enhanced_layouts.uniform_block_alignment

Note the test still fails due to unrelated issues with doubles.

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
8 years agoi965: Shrink stage_prog_data param array length
Jordan Justen [Sun, 29 May 2016 00:57:31 +0000 (17:57 -0700)]
i965: Shrink stage_prog_data param array length

It appears we were over-allocating these arrays.

Previously we would use nir->num_uniforms directly for scalar
programs, and multiply it by 4 for vec4 programs.

Instead we should have been dividing by 4 in both cases to convert
from bytes to a gl_constant_value count. The size of gl_constant_value
is 4 bytes.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonv50,nvc0: fix the max_vertices=0 case
Ilia Mirkin [Sun, 29 May 2016 13:26:11 +0000 (09:26 -0400)]
nv50,nvc0: fix the max_vertices=0 case

This is apparently legal. Drop any emit/restarts, and pass a 1 to the
hardware.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agost/mesa: fix setting of point_size_per_vertex in ES contexts
Ilia Mirkin [Sun, 29 May 2016 02:38:24 +0000 (22:38 -0400)]
st/mesa: fix setting of point_size_per_vertex in ES contexts

GL ES 2.0+ does not have a GL_PROGRAM_POINT_SIZE enable, unlike desktop
GL. So we have to go and check the last pre-rasterizer stage to see
whether it outputs a point size or not.

This fixes a number of dEQP tests that use a geometry or tessellation
shader to emit points primitives.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
8 years agomesa: skip level checking for FramebufferTexture*D if texture is zero
Marek Olšák [Fri, 27 May 2016 19:40:19 +0000 (21:40 +0200)]
mesa: skip level checking for FramebufferTexture*D if texture is zero

From the OpenGL 4.5 core spec:
  "An INVALID_VALUE error is generated if texture is not zero and level is
  not a supported texture level for textarget, as described above."

Other FramebufferTexture functions already do the right thing.

This fixes the main menu in F1 2015.

Cc: 11.1 11.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agost/mesa: expose OES_shader_io_blocks when we have enough for ES 3.1
Ilia Mirkin [Fri, 27 May 2016 03:02:18 +0000 (23:02 -0400)]
st/mesa: expose OES_shader_io_blocks when we have enough for ES 3.1

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoswr: [rasterizer] Do not define _mm256_storeu2_m128i with icc.
Vinson Lee [Thu, 26 May 2016 04:09:10 +0000 (21:09 -0700)]
swr: [rasterizer] Do not define _mm256_storeu2_m128i with icc.

Fix build error with icc.

  CXX      libswrAVX_la-swr_clear.lo
icpc: command line warning #10006: ignoring unknown option '-Wdelete-non-virtual-dtor'
In file included from ./rasterizer/jitter/jit_api.h(31),
                 from swr_context.h(30),
                 from swr_clear.cpp(24):
./rasterizer/common/os.h(135): error: expected an identifier
  void _mm256_storeu2_m128i(__m128i *hi, __m128i *lo, __m256i a)
       ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoi965: add missing return in if statement
Thomas Hindoe Paaboel Andersen [Sat, 28 May 2016 11:16:03 +0000 (13:16 +0200)]
i965: add missing return in if statement

Re-add the "return false" that was removed in 0c02d7002d6c005b4c1fe997b5ef5916978dd183

It seems that something went wrong when merging the patch. The patch
sent to the mailing list does not directly match what was committed.
https://lists.freedesktop.org/archives/mesa-dev/2016-May/118198.html

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogk110/ir: fix unspilling of predicates from registers
Ilia Mirkin [Sat, 28 May 2016 17:07:12 +0000 (13:07 -0400)]
gk110/ir: fix unspilling of predicates from registers

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96258
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 11.1" <mesa-stable@lists.freedesktop.org>
8 years agonvc0: remove outdated surfaces validation code for GK104
Samuel Pitoiset [Fri, 27 May 2016 08:14:45 +0000 (10:14 +0200)]
nvc0: remove outdated surfaces validation code for GK104

This code was used for validating surfaces with compute but now we use
pipe_image_view instead. Anyway, surfaces support should be
re-introduced properly once OpenCL happens.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: do not always invalidate 3D CBs when using compute
Samuel Pitoiset [Thu, 26 May 2016 22:30:17 +0000 (00:30 +0200)]
nvc0: do not always invalidate 3D CBs when using compute

Constant buffers are aliased between 3D and CP on Fermi, but we should
only invalidate them when a compute shader actually uses CBs and not
all the time after a lauching grid.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965: Update compute workgroup size limit calculation for SIMD32.
Francisco Jerez [Tue, 26 Apr 2016 00:02:25 +0000 (17:02 -0700)]
i965: Update compute workgroup size limit calculation for SIMD32.

This should have the side effect of enabling the ARB_compute_shader
extension on Gen8+ hardware and all Gen7 platforms that didn't
previously expose it (VLV and IVB GT1) due to the number of hardware
threads per subslice being insufficient in SIMD16 mode.

v2: Bump workgroup size limit for GLES too (Jordan).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Add do32 debug option.
Francisco Jerez [Fri, 27 May 2016 04:28:45 +0000 (21:28 -0700)]
i965: Add do32 debug option.

The do32 INTEL_DEBUG option causes the back-end to try to generate a
SIMD32 program when compiling a compute shader regardless of the
specified compute shader workgroup size, which will be useful for
testing SIMD32 code generation in the most common case in which the
workgroup size doesn't exceed the SIMD16 limit so SIMD32 codegen
wouldn't be automatically enabled.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Build 32-wide compute shader when needed.
Francisco Jerez [Tue, 17 May 2016 01:25:22 +0000 (18:25 -0700)]
i965/fs: Build 32-wide compute shader when needed.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Extend back-end interface for limiting the shader dispatch width.
Francisco Jerez [Wed, 18 May 2016 21:39:52 +0000 (14:39 -0700)]
i965/fs: Extend back-end interface for limiting the shader dispatch width.

This replaces the current fs_visitor::no16() interface with
fs_visitor::limit_dispatch_width(), which takes an additional
parameter allowing the caller to specify the maximum dispatch width a
shader can be compiled with.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/fs: Implement SIMD32 register allocation support.
Francisco Jerez [Wed, 18 May 2016 20:52:25 +0000 (13:52 -0700)]
i965/fs: Implement SIMD32 register allocation support.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>