mesa.git
8 years agovc4: Add kernel support for branching in shader validation.
Eric Anholt [Tue, 15 Mar 2016 20:53:02 +0000 (13:53 -0700)]
vc4: Add kernel support for branching in shader validation.

We're already checking that branch instructions are within the
contents of the shader and the proper PROG_END sequence is present.
The other thing we need in the presence of branching is to verify that
the shader doesn't overflow past the end of the uniforms stream.

To do that, we require that at the start of any basic block reading
uniforms have the following instructions:

load_imm temp, <offset within uniform stream>
add unif_addr, temp, unif

The instructions are generated by userspace, and the kernel verifies
that the load_imm is of the expected offset, and that the add adds it
to a uniform.  We track which uniform in the stream that is, and at
draw call time fix up the uniform stream to have the address of the
start of the shader's uniforms for that draw call.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agovc4: Add a bitmap of branch targets in kernel validation.
Eric Anholt [Sat, 2 Jul 2016 17:03:05 +0000 (10:03 -0700)]
vc4: Add a bitmap of branch targets in kernel validation.

This isn't used yet, it's just a first step toward loop validation.
During the main parsing of instructions, we need to know when we hit a new
basic block so that we can reset validated state.

8 years agovc4: Track the current instruction into the validation_state.
Eric Anholt [Fri, 3 Jun 2016 19:48:59 +0000 (12:48 -0700)]
vc4: Track the current instruction into the validation_state.

This reduces how much we need to pass around as arguments, which was
becoming more of a problem with looping validation.

8 years agovc4: Add QPU support for generating BRANCH instructions.
Eric Anholt [Tue, 15 Mar 2016 20:43:54 +0000 (13:43 -0700)]
vc4: Add QPU support for generating BRANCH instructions.

8 years agovc4: Print live variable start/ends during QIR dumping.
Eric Anholt [Wed, 6 Jul 2016 19:49:52 +0000 (12:49 -0700)]
vc4: Print live variable start/ends during QIR dumping.

This only happens when live variables are set up, which is not in the
normal dump, but is set up when we've failed to register allocate.

8 years agovc4: Implement live intervals using a CFG.
Eric Anholt [Thu, 10 Mar 2016 20:53:57 +0000 (12:53 -0800)]
vc4: Implement live intervals using a CFG.

Right now our CFG is always a trivial single basic block, but that will
change when enable loops.

8 years agovc4: Make vc4_qir_schedule handle each block in the program.
Eric Anholt [Tue, 19 Jan 2016 22:15:54 +0000 (14:15 -0800)]
vc4: Make vc4_qir_schedule handle each block in the program.

Basically we just treat each block independently.  The only inter-block
scheduling I can think of that would be be interesting would be to move
texture result collection to after a short loop/if block that doesn't do
texturing.  However, the kernel disallows that as part of its security
validation.

8 years agovc4: Convert uniforms lowering to work with multiple blocks.
Eric Anholt [Sat, 9 Jul 2016 00:10:38 +0000 (17:10 -0700)]
vc4: Convert uniforms lowering to work with multiple blocks.

We still decide which uniform to lower based on how many
instructions-that-need-lowering use that uniform, but now we emit a new
temporary uniform load in each of the basic blocks containing an
instruction being lowered.

This commit is best reviewed with diff -b.

8 years agovc4: Convert vc4_opt_peephole_sf to work with control flow.
Eric Anholt [Fri, 8 Jul 2016 23:59:15 +0000 (16:59 -0700)]
vc4: Convert vc4_opt_peephole_sf to work with control flow.

We need to apply the peephole pass to each of the blocks in the program.
We don't do dataflow analysis for SF across blocks, but we also don't
generate code that would need us to do so.

8 years agovc4: Create a basic block structure and move the instructions into it.
Eric Anholt [Fri, 8 Jul 2016 22:42:15 +0000 (15:42 -0700)]
vc4: Create a basic block structure and move the instructions into it.

The optimization passes and scheduling aren't actually ready for multiple
blocks with control flow yet (as seen by the "cur_block" references in
them instead of iterating over blocks), but this creates the structures
necessary for converting them.

8 years agovc4: Add a "qir_for_each_inst_inorder" macro and use it in many places.
Eric Anholt [Fri, 8 Jul 2016 22:24:34 +0000 (15:24 -0700)]
vc4: Add a "qir_for_each_inst_inorder" macro and use it in many places.

We have the prior list_foreach() all over the code, but I need to move
where instructions live as part of adding support for control flow.  Start
by just converting to a helper iterator macro.  (The simpler
"qir_for_each_inst()" will be used for the for-each-inst-in-a-block
iterator macro later)

8 years agovc4: Also enable phi elimination.
Eric Anholt [Wed, 6 Jul 2016 22:21:53 +0000 (15:21 -0700)]
vc4: Also enable phi elimination.

This avoids a bunch of code gen regressions when enabling loops in vc4.

Prior to that, the GLSL that would have generated these optimizable phi
nodes was being lowered to csels between either (undef, a) or (a, a), and
those were being dealt with by nir_opt_undef and nir_opt_algebraic.

8 years agovc4: fix memory leak
Eric Engestrom [Tue, 12 Jul 2016 22:29:34 +0000 (23:29 +0100)]
vc4: fix memory leak

The allocation has succeeded by that point, so it needs to be freed.

CovID: 1358929
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agovc4: Close our screen's fd on screen close.
Eric Anholt [Mon, 11 Jul 2016 23:46:20 +0000 (16:46 -0700)]
vc4: Close our screen's fd on screen close.

We're passed in a freshly dup()ed fd on screen create, so we should close
it on exit.  Debugged by Hugh Cole-Baker.

8 years agonir: Add optimization for (a || True == True)
Eric Anholt [Wed, 6 Jul 2016 22:00:45 +0000 (15:00 -0700)]
nir: Add optimization for (a || True == True)

This was appearing in vc4 VS/CS in mupen64, due to vertex attrib lowering
producing some constants that were getting compared.

total instructions in shared programs: 112276 -> 112198 (-0.07%)
instructions in affected programs:     2239 -> 2161 (-3.48%)
total estimated cycles in shared programs: 283102 -> 283038 (-0.02%)
estimated cycles in affected programs:     2365 -> 2301 (-2.71%)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoswr: [rasterizer core] correct MSAA behavior for conservative rasterization
Tim Rowley [Wed, 29 Jun 2016 15:47:31 +0000 (09:47 -0600)]
swr: [rasterizer core] correct MSAA behavior for conservative rasterization

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: [rasterizer core] conservative rast backend changes
Tim Rowley [Mon, 27 Jun 2016 21:50:58 +0000 (15:50 -0600)]
swr: [rasterizer core] conservative rast backend changes

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: [rasterizer] buckets cleanup
Tim Rowley [Mon, 20 Jun 2016 05:37:57 +0000 (23:37 -0600)]
swr: [rasterizer] buckets cleanup

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: [rasterizer core] make all api functions call GetContext
Tim Rowley [Thu, 16 Jun 2016 19:53:28 +0000 (13:53 -0600)]
swr: [rasterizer core] make all api functions call GetContext

Small api cleanup.  Make all api functions call GetContext instead
of locally casting handle.  Makes debugging easier by providing a
single point to track context changes.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: [rasterizer] add support for llvm-3.9
Tim Rowley [Tue, 14 Jun 2016 23:54:34 +0000 (17:54 -0600)]
swr: [rasterizer] add support for llvm-3.9

v2: use signed compare, remove unneeded vmask

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: [rasterizer jitter] fix llvm-3.7 compile
Tim Rowley [Wed, 6 Jul 2016 21:26:16 +0000 (16:26 -0500)]
swr: [rasterizer jitter] fix llvm-3.7 compile

d3d97f8 broke llvm-3.7, which has a mismatched API for
setDataLayout/getDataLayout.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agodocs: remove duplicated line in 12.0.1 release notes file
Brian Paul [Tue, 12 Jul 2016 15:42:16 +0000 (09:42 -0600)]
docs: remove duplicated line in 12.0.1 release notes file

Signed-off-by: Brian Paul <brianp@vmware.com>
8 years agost/omx/dec: convert decoder video buffer to progressive
Leo Liu [Mon, 4 Jul 2016 20:32:48 +0000 (16:32 -0400)]
st/omx/dec: convert decoder video buffer to progressive

with encode tunneling

The idea of encode tunneling is to use video buffer directly for encoder,
but currently the encoder doesn’t support interlaced surface, the OMX
decoder set progressive surface before on that purpose.

Since now we are polling the driver for interlacing information for
decoder, we got the interlaced as preferred as other APIs(VDPAU, VA-API),
thus breaking the transcode with tunneling.

The solution is when with tunnel detected, re-allocate progressive target
buffers, and then converting the interlaced decoder results to there.

This has been tested with transcode results bit to bit matching as before
with surface from progressive to progressive.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Tested-by: Julien Isorce <j.isorce@samsung.com>
8 years agovl/compositor: set layer of y or uv to render
Leo Liu [Wed, 6 Jul 2016 16:42:37 +0000 (12:42 -0400)]
vl/compositor: set layer of y or uv to render

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Tested-by: Julien Isorce <j.isorce@samsung.com>
8 years agovl/compositor: add weave to yuv shader
Leo Liu [Wed, 6 Jul 2016 16:34:02 +0000 (12:34 -0400)]
vl/compositor: add weave to yuv shader

This shader will make interlaced yuv to progressive yuv.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Tested-by: Julien Isorce <j.isorce@samsung.com>
8 years agovl/compositor: move weave shader out from rgb weaving
Leo Liu [Mon, 4 Jul 2016 19:59:00 +0000 (15:59 -0400)]
vl/compositor: move weave shader out from rgb weaving

We'll use weave shader in the later patch.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Tested-by: Julien Isorce <j.isorce@samsung.com>
8 years agoglsl_to_tgsi: don't use the negate modifier in integer ops after bitcast
Marek Olšák [Sun, 3 Jul 2016 12:33:55 +0000 (14:33 +0200)]
glsl_to_tgsi: don't use the negate modifier in integer ops after bitcast

This bug is uncovered by glsl/lower_if_to_cond_assign.
I don't know if it can be reproduced in any other way.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoclover/api: Implement clLinkProgram per-device binary presence validation rule.
Francisco Jerez [Mon, 6 Jun 2016 02:12:22 +0000 (19:12 -0700)]
clover/api: Implement clLinkProgram per-device binary presence validation rule.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Add clLinkProgram (CL 1.2).
Serge Martin [Mon, 9 May 2016 04:57:34 +0000 (21:57 -0700)]
clover: Add clLinkProgram (CL 1.2).

[ Francisco Jerez: Use validate_build_common for error checking,
  simplify control flow slightly and handle additional exception
  types. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Trivial cleanups for api/program.cpp.
Francisco Jerez [Tue, 17 May 2016 14:03:18 +0000 (16:03 +0200)]
clover: Trivial cleanups for api/program.cpp.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/core: Remove compiler.hpp.
Francisco Jerez [Tue, 17 May 2016 14:03:17 +0000 (16:03 +0200)]
clover/core: Remove compiler.hpp.

header_map was the only definition left in compiler.hpp, move it into
program.hpp which is its only user in clover/core.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Get rid of compile_program_llvm().
Francisco Jerez [Tue, 17 May 2016 14:03:16 +0000 (16:03 +0200)]
clover/llvm: Get rid of compile_program_llvm().

Superseded by compile_program() and link_program().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Provide separate program methods for compilation and linking.
Francisco Jerez [Tue, 17 May 2016 14:03:14 +0000 (16:03 +0200)]
clover: Provide separate program methods for compilation and linking.

[ Serge Martin: Fix inverted opts and log build ctor args.
  Keep the log related to the build. Fix indentation ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Unify program::build_* into a single method returning a struct.
Francisco Jerez [Tue, 17 May 2016 14:03:13 +0000 (16:03 +0200)]
clover: Unify program::build_* into a single method returning a struct.

This gets rid of the program::build_* query methods and replaces them
with the program::build() method that returns a single data structure
containing all parameters for the last build done on the given target
device (including build logs, options and the binary itself).

[ Serge Martin: Fix inverted opts and log build ctor args ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Change program::build opts argument to std::string.
Serge Martin [Tue, 17 May 2016 14:03:12 +0000 (16:03 +0200)]
clover: Change program::build opts argument to std::string.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Define error subclass to signal build option parse failure.
Francisco Jerez [Tue, 17 May 2016 14:03:11 +0000 (16:03 +0200)]
clover: Define error subclass to signal build option parse failure.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Move back to using build_error to signal compilation failure.
Francisco Jerez [Sun, 19 Jun 2016 21:31:59 +0000 (14:31 -0700)]
clover: Move back to using build_error to signal compilation failure.

This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc.
Having two different exception subclasses for compilation and linking
makes it more difficult to share or move code between the two
codepaths, because the exact same function under the same error
condition would need to throw one exception or the other depending on
what top-level API is being implemented with it.  There is little
benefit anyway because clCompileProgram() and clLinkProgram() can tell
whether they are linking or compiling a program.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Override ret_object.
Serge Martin [Tue, 17 May 2016 14:03:09 +0000 (16:03 +0200)]
clover: Override ret_object.

Return an API object from an intrusive reference to a Clover object,
incrementing the reference count of the object.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/tgsi: Add stub link_program() function.
Francisco Jerez [Tue, 17 May 2016 14:03:08 +0000 (16:03 +0200)]
clover/tgsi: Add stub link_program() function.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.
Francisco Jerez [Tue, 17 May 2016 14:03:07 +0000 (16:03 +0200)]
clover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Implement the -create-library linker option.
Francisco Jerez [Fri, 3 Jun 2016 22:46:21 +0000 (15:46 -0700)]
clover/llvm: Implement the -create-library linker option.

[ Serge Martin: disable internalize pass when building a library.
  Otherwise some functions may be inlined and removed ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Implement linkage of multiple clover modules.
Francisco Jerez [Mon, 13 Jun 2016 08:41:05 +0000 (01:41 -0700)]
clover/llvm: Implement linkage of multiple clover modules.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Split compilation and linking.
Francisco Jerez [Tue, 17 May 2016 14:03:04 +0000 (16:03 +0200)]
clover/llvm: Split compilation and linking.

Split the work previously done by compile_program_llvm() into
compile_program() (which simply runs the front-end and serializes the
resulting LLVM IR) and link_program() (which takes care of everything
else down to binary codegen).

[ Serge Martin: allow LLVM IR dump after compilation ]

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Implement library bitcode codegen.
Francisco Jerez [Tue, 17 May 2016 14:03:03 +0000 (16:03 +0200)]
clover/llvm: Implement library bitcode codegen.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Trivial assorted cleanups for invocation.cpp.
Francisco Jerez [Tue, 17 May 2016 14:03:02 +0000 (16:03 +0200)]
clover/llvm: Trivial assorted cleanups for invocation.cpp.

Drop a few include and using directives which are no longer necessary.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Split native codegen into separate file.
Francisco Jerez [Mon, 20 Jun 2016 00:56:15 +0000 (17:56 -0700)]
clover/llvm: Split native codegen into separate file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Split bitcode codegen into separate file.
Francisco Jerez [Tue, 17 May 2016 14:03:00 +0000 (16:03 +0200)]
clover/llvm: Split bitcode codegen into separate file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Split shared codegen support code into separate file.
Francisco Jerez [Sun, 3 Jul 2016 22:44:01 +0000 (15:44 -0700)]
clover/llvm: Split shared codegen support code into separate file.

This is the common part of the code used to generate a clover::module
from LLVM bitcode, shared between the native and LLVM paths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Define function for bitcode print-out.
Francisco Jerez [Tue, 17 May 2016 14:02:58 +0000 (16:02 +0200)]
clover/llvm: Define function for bitcode print-out.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Split native codegen and assembly print-out into separate functions.
Francisco Jerez [Tue, 17 May 2016 14:02:57 +0000 (16:02 +0200)]
clover/llvm: Split native codegen and assembly print-out into separate functions.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Clean up bitcode codegen.
Francisco Jerez [Tue, 17 May 2016 14:02:56 +0000 (16:02 +0200)]
clover/llvm: Clean up bitcode codegen.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Use metadata introspection utils for kernel enumeration.
Francisco Jerez [Tue, 28 Jun 2016 07:03:24 +0000 (00:03 -0700)]
clover/llvm: Use metadata introspection utils for kernel enumeration.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Use metadata introspection utils for kernel argument set-up.
Francisco Jerez [Sun, 3 Jul 2016 22:41:51 +0000 (15:41 -0700)]
clover/llvm: Use metadata introspection utils for kernel argument set-up.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Add simplified utility functions for metadata introspection.
Francisco Jerez [Tue, 17 May 2016 14:02:53 +0000 (16:02 +0200)]
clover/llvm: Add simplified utility functions for metadata introspection.

v2: Fix for latest LLVM from SVN.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net> (v1)
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Clean up codestyle of get_kernel_args().
Francisco Jerez [Tue, 17 May 2016 14:02:52 +0000 (16:02 +0200)]
clover/llvm: Clean up codestyle of get_kernel_args().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Fold compile_native() call into build_module_native().
Francisco Jerez [Tue, 28 Jun 2016 06:46:26 +0000 (23:46 -0700)]
clover/llvm: Fold compile_native() call into build_module_native().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Factor out duplicated construction of clover::module.
Francisco Jerez [Tue, 17 May 2016 14:02:50 +0000 (16:02 +0200)]
clover/llvm: Factor out duplicated construction of clover::module.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Clean up compile_native().
Francisco Jerez [Tue, 17 May 2016 14:02:49 +0000 (16:02 +0200)]
clover/llvm: Clean up compile_native().

This switches compile_native() to the C++ API (which the rest of this
file makes use of anyway so there is little benefit from using the C
API), what should get rid of an amount of boilerplate and fix a leak
of the TargetMachine object in the error path.

v2: Additional fixes for LLVM 3.6.
v3: Update for the latest LLVM SVN changes.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Clean up ELF parsing.
Francisco Jerez [Tue, 17 May 2016 14:02:48 +0000 (16:02 +0200)]
clover/llvm: Clean up ELF parsing.

This function was doing three separate things:
 - Initializing and releasing the ELF parsing state (the latter can be
   better done using RAII).
 - Searching for the symbol table in the ELF file.
 - Extraction of kernel symbol offsets from the symbol table.

Split each one into a separate function for clarity and clean up the
result slightly.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Move a bunch of utility functions into separate file.
Francisco Jerez [Tue, 17 May 2016 14:02:47 +0000 (16:02 +0200)]
clover/llvm: Move a bunch of utility functions into separate file.

Some of these will be useful from a different compilation unit in the
same subtree so put them in a publicly accessible header file.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Tidy debug handling.
Francisco Jerez [Tue, 17 May 2016 14:02:46 +0000 (16:02 +0200)]
clover/llvm: Tidy debug handling.

Most significant change is debugging flags are now a scoped enum and
all debugging helpers live in the debug namespace.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Use helper function to abort compilation with error message.
Francisco Jerez [Tue, 17 May 2016 14:02:45 +0000 (16:02 +0200)]
clover/llvm: Use helper function to abort compilation with error message.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Simplify diagnostic_handler().
Francisco Jerez [Tue, 17 May 2016 14:02:44 +0000 (16:02 +0200)]
clover/llvm: Simplify diagnostic_handler().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Trivial codestyle clean-up for optimize().
Francisco Jerez [Tue, 17 May 2016 14:02:43 +0000 (16:02 +0200)]
clover/llvm: Trivial codestyle clean-up for optimize().

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Clean up compilation into LLVM IR.
Francisco Jerez [Tue, 17 May 2016 14:02:42 +0000 (16:02 +0200)]
clover/llvm: Clean up compilation into LLVM IR.

Some assorted and mostly trivial clean-ups for the source to bitcode
compilation path.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Factor out LLVM context init.
Francisco Jerez [Tue, 17 May 2016 14:02:41 +0000 (16:02 +0200)]
clover/llvm: Factor out LLVM context init.

So it can be shared between the compilation and linking codepaths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Declare compiler instance at top level and pass down as argument.
Francisco Jerez [Tue, 28 Jun 2016 06:45:30 +0000 (23:45 -0700)]
clover/llvm: Declare compiler instance at top level and pass down as argument.

This allows simplifying the interface of compile_llvm() because it no
longer needs to read out and return the optimization level and address
space map from the compiler instance.  Instead declare the compiler
instance at the top level so that both properties are available
directly.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Refactor compiler instance initialization.
Francisco Jerez [Sat, 25 Jun 2016 23:56:58 +0000 (16:56 -0700)]
clover/llvm: Refactor compiler instance initialization.

This will be shared between the compiler and linker codepaths.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Factor out compiler option tokenization.
Francisco Jerez [Tue, 17 May 2016 14:02:38 +0000 (16:02 +0200)]
clover/llvm: Factor out compiler option tokenization.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Factor out target string parsing.
Francisco Jerez [Sat, 25 Jun 2016 23:52:55 +0000 (16:52 -0700)]
clover/llvm: Factor out target string parsing.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Collect #ifdef mess into a separate file.
Francisco Jerez [Sat, 25 Jun 2016 23:52:11 +0000 (16:52 -0700)]
clover/llvm: Collect #ifdef mess into a separate file.

This gets rid of most ifdef's from the invocation.cpp code -- Only a
couple of them are left which will be removed differently in the
following commits.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Drop dead code.
Francisco Jerez [Tue, 17 May 2016 14:02:35 +0000 (16:02 +0200)]
clover/llvm: Drop dead code.

This ifdef'ed out code was meant to handle compilation into TGSI, but
it doesn't seem likely that it will ever be useful even if the TGSI
back-end is resurrected because the TGSI bitcode can just be plumbed
through in ELF format and dealt with as a regular "native" back-end.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover/llvm: Drop support for LLVM < 3.6.
Francisco Jerez [Tue, 28 Jun 2016 06:24:59 +0000 (23:24 -0700)]
clover/llvm: Drop support for LLVM < 3.6.

Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agoclover: Bump required LLVM version to 3.6.
Serge Martin [Tue, 17 May 2016 14:02:33 +0000 (16:02 +0200)]
clover: Bump required LLVM version to 3.6.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
8 years agomesa: set _NEW_BUFFERS when updating texture bound to current buffers
Ilia Mirkin [Fri, 8 Jul 2016 18:24:38 +0000 (14:24 -0400)]
mesa: set _NEW_BUFFERS when updating texture bound to current buffers

When a glTexImage call updates the parameters of a currently bound
framebuffer, we might miss out on revalidating whether it is complete.
Make sure to set _NEW_BUFFERS which will trigger the revalidation in
that case.

Also while we're at it, fix the fb parameter passed in to the eventual
RenderTexture call.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94148
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
8 years agometa/texsubimage: tex_image is always non-null, avoid confusing code
Ilia Mirkin [Fri, 8 Jul 2016 16:35:11 +0000 (12:35 -0400)]
meta/texsubimage: tex_image is always non-null, avoid confusing code

Probably a copy-paste from mesa_meta_pbo_GetTexSubImage where tex_image
may apparently be null.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agost/mesa: return appropriate mesa format for ETC texture formats
Ilia Mirkin [Fri, 8 Jul 2016 03:46:28 +0000 (23:46 -0400)]
st/mesa: return appropriate mesa format for ETC texture formats

Even when the backend driver does not support ETC formats, we handle the
decoding into an uncompressed backing texture. However as far as core
mesa is concerned, it's an ETC texture and we should return the relevant
ETC mesa format. This condition can get hit when using glTexStorage to
create the texture object.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agomesa: etc2 online compression is unsupported, don't attempt it
Ilia Mirkin [Fri, 8 Jul 2016 22:41:03 +0000 (18:41 -0400)]
mesa: etc2 online compression is unsupported, don't attempt it

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agonvc0: initial support for GP100 GPUs
Ben Skeggs [Sat, 9 Jul 2016 00:06:44 +0000 (10:06 +1000)]
nvc0: initial support for GP100 GPUs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
8 years agonvc0: use a define for the driver constant buffer size
Samuel Pitoiset [Mon, 11 Jul 2016 20:25:05 +0000 (22:25 +0200)]
nvc0: use a define for the driver constant buffer size

This might avoid mistakes if the size is bumped in the future.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: fix the driver cb size when draw parameters are used
Samuel Pitoiset [Mon, 11 Jul 2016 19:26:25 +0000 (21:26 +0200)]
nvc0: fix the driver cb size when draw parameters are used

The size of the driver constant buffer for each stage should be 2048
and not 512 because it has been increased recently for buffers/images.
While we are at it, do the same change for indirect draws.

This fixes all ARB_shader_draw_parameters tests on GM107.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 12.0 <mesa-stable@lists.freedesktop.org>
8 years agonvc0/ir: fix images indirect access on Fermi
Samuel Pitoiset [Sun, 10 Jul 2016 14:19:46 +0000 (16:19 +0200)]
nvc0/ir: fix images indirect access on Fermi

This fixes the following piglits:

arb_arrays_of_arrays-basic-imagestore-mixed-const-non-const-uniform-index
arb_arrays_of_arrays-basic-imagestore-mixed-const-non-const-uniform-index2

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 12.0 <mesa-stable@lists.freedesktop.org>
8 years agost/mesa: remove st_dump_program_for_shader_db
Marek Olšák [Fri, 1 Jul 2016 18:43:29 +0000 (20:43 +0200)]
st/mesa: remove st_dump_program_for_shader_db

replaced by MESA_SHADER_CAPTURE_PATH in core Mesa

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallivm: set LLVMNoUnwindAttribute on all intrinsics
Marek Olšák [Fri, 1 Jul 2016 18:09:47 +0000 (20:09 +0200)]
gallivm: set LLVMNoUnwindAttribute on all intrinsics

RadeonSI stats: Mostly 0% difference, but Valley shows a small improvement:

 Application            Files    SGPRs     VGPRs   SpillSGPR SpillVGPR Code Size    LDS    Max Waves   Waits
 unigine_valley           278    0.00 %   -0.29 %    0.00 %    0.00 %    0.01 %    0.00 %    0.17 %    0.00 %

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agoi965: fix ignored qualifiers warning
Francesco Ansanelli [Sat, 9 Jul 2016 08:16:29 +0000 (10:16 +0200)]
i965: fix ignored qualifiers warning

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agogallium/u_queue: assert that users must wait on fences before destroying them
Nicolai Hähnle [Sat, 9 Jul 2016 17:44:13 +0000 (19:44 +0200)]
gallium/u_queue: assert that users must wait on fences before destroying them

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agogallium/u_queue: guard fence->signalled checks with fence->mutex
Nicolai Hähnle [Sat, 9 Jul 2016 17:40:51 +0000 (19:40 +0200)]
gallium/u_queue: guard fence->signalled checks with fence->mutex

I have seen a hang during application shutdown that could be explained by the
following race condition which this patch fixes:

1. Worker thread enters util_queue_fence_signal, sets fence->signalled = true.
2. Main thread calls util_queue_job_wait, which returns immediately.
3. Main thread deletes the job and fence structures, leaving garbage behind.
4. Worker thread calls pipe_condvar_broadcast, which gets stuck forever because
   it is accessing garbage.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoanv/dump: Fix post-blit memory barrier
Chad Versace [Thu, 7 Jul 2016 23:04:59 +0000 (16:04 -0700)]
anv/dump: Fix post-blit memory barrier

Swap srcAccessMask and dstAccessMask.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoanv/dump: Fix vkCmdPipelineBarrier flags
Chad Versace [Thu, 7 Jul 2016 23:04:58 +0000 (16:04 -0700)]
anv/dump: Fix vkCmdPipelineBarrier flags

'true' is not valid for VkDependencyFlags.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoanv/dump: Add support for dumping framebuffers
Jason Ekstrand [Wed, 15 Jun 2016 23:13:46 +0000 (16:13 -0700)]
anv/dump: Add support for dumping framebuffers

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoanv/dump: Add a barrier for the source image
Jason Ekstrand [Wed, 15 Jun 2016 22:08:09 +0000 (15:08 -0700)]
anv/dump: Add a barrier for the source image

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoanv/dump: Refactor the guts into helpers
Jason Ekstrand [Wed, 15 Jun 2016 22:01:45 +0000 (15:01 -0700)]
anv/dump: Refactor the guts into helpers

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoanv/dump: Use anv_minify instead of hand-rolling it
Jason Ekstrand [Wed, 15 Jun 2016 21:30:07 +0000 (14:30 -0700)]
anv/dump: Use anv_minify instead of hand-rolling it

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoanv/dump: Take an aspect in dump_image_to_ppm
Jason Ekstrand [Tue, 14 Jun 2016 00:08:59 +0000 (17:08 -0700)]
anv/dump: Take an aspect in dump_image_to_ppm

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoradeonsi: fix bad assertion in si_emit_sample_mask
Nicolai Hähnle [Fri, 8 Jul 2016 17:12:00 +0000 (19:12 +0200)]
radeonsi: fix bad assertion in si_emit_sample_mask

The blitter sets mask == 1, which is fine since it doesn't use smoothing.
Fixes a regression introduced in commit 5bcfbf91.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoglx: Fix for commit 2c86668694.
Matt Turner [Thu, 23 Jun 2016 06:11:27 +0000 (23:11 -0700)]
glx: Fix for commit 2c86668694.

Ian suggested these changes in his review and I made them, but I pushed
the old version of the patch.

8 years agodocs: add news item and link release notes for 12.0.0/12.0.1
Emil Velikov [Fri, 8 Jul 2016 23:09:51 +0000 (00:09 +0100)]
docs: add news item and link release notes for 12.0.0/12.0.1

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodocs: add sha256 checksums for 12.0.1
Emil Velikov [Fri, 8 Jul 2016 23:02:13 +0000 (00:02 +0100)]
docs: add sha256 checksums for 12.0.1

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

8 years agodocs: add release notes for 12.0.1
Emil Velikov [Fri, 8 Jul 2016 22:45:44 +0000 (23:45 +0100)]
docs: add release notes for 12.0.1

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

8 years agodocs: add sha256 checksums for 12.0.0
Emil Velikov [Fri, 8 Jul 2016 22:47:39 +0000 (23:47 +0100)]
docs: add sha256 checksums for 12.0.0

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