Matt Turner [Thu, 28 Jul 2016 21:41:17 +0000 (14:41 -0700)]
draw: Avoid aliasing violations.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Matt Turner [Thu, 28 Jul 2016 19:38:21 +0000 (12:38 -0700)]
r600g: Avoid aliasing violations.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Matt Turner [Thu, 28 Jul 2016 20:57:06 +0000 (13:57 -0700)]
r300g: Avoid aliasing violation.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Matt Turner [Thu, 28 Jul 2016 21:34:14 +0000 (14:34 -0700)]
gallium/auxiliary: Add u_bitcast.h header.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Matt Turner [Thu, 28 Jul 2016 19:43:19 +0000 (12:43 -0700)]
glsl_to_tgsi: Avoid aliasing violations.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Brian Paul [Mon, 1 Aug 2016 15:56:21 +0000 (09:56 -0600)]
st/mesa: silence missing braces warning in st_program.c
Silence a gcc warning:
state_tracker/st_program.c: In function 'st_create_fp_variant':
state_tracker/st_program.c:957:10: warning: missing braces around initializer [-Wmissing-braces]
nir_lower_drawpixels_options options = {0};
^
state_tracker/st_program.c:957:10: warning: (near initialization for 'options.texcoord_state_tokens') [-Wmissing-braces]
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Brian Paul [Wed, 29 Jun 2016 22:30:54 +0000 (16:30 -0600)]
auxiliary/os: add new os_get_command_line() function
This can be used by the driver to get the command line which started
the process. Will be used by the VMware driver for extra logging.
For now, this is only implemented for Linux via /proc/self/cmdline
and Windows via GetCommandLine().
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Charmaine Lee [Fri, 22 Jul 2016 22:05:02 +0000 (15:05 -0700)]
svga: avoid redundant SetVertexBuffer/SetIndexBuffer commands at rebind
This patch eliminates the redundant SetVertexBuffers and
SetIndexBuffer commands that are emitted for rebind purpose.
With this patch, the set commands will be skipped, but we will still
reference the associated resources to allow the kernel to
bring in the resources.
Tested with Lightsmark2008, Valley, MTT glretrace, piglit, conform.
Reviewed-by: Brian Paul <brianp@vmware.com>
Rob Clark [Sat, 30 Jul 2016 15:22:52 +0000 (11:22 -0400)]
u_vbuf: fix potentially bogus assert
There are cases where we hit u_vbuf path due to alignment or pitch-
alignment restrictions, but for an output-format that u_vbuf does not
support translating (yet the driver does support natively). In which
case we hit the memcpy() path and don't care that u_vbuf doesn't
understand it.
Fixes crash with debug build of mesa in:
dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.user_ptr_stride17_components2_quads1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95000
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Ben Widawsky [Fri, 29 Jul 2016 20:42:04 +0000 (13:42 -0700)]
gbm: Removed unused function.
AFAICT, it's never been used.
It was briefly nudged in the right direction here:
commit
10e5ffd4961055ebba5be4d85a93cc66cdd5a635
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Sat Jan 25 17:19:10 2014 +0000
gbm: do not export _gbm_mesa_get_device
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Timothy Arceri [Mon, 1 Aug 2016 00:35:06 +0000 (10:35 +1000)]
i965: fix comparison warning
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Tue, 26 Jul 2016 22:32:11 +0000 (15:32 -0700)]
vc4: Zero-initialize the hardware sampler view structure.
Fixes failure to initialize the force_first_level flag, causing
failures in piglit levelclamp.
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
mesa: Remove set but not used gl_client_array::Stride.
The field is only read for printing today and
there it was probably a leftover.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
mesa: Remove set but not used gl_client_array::Enabled.
The way it is used today does not care about the
Enabled flag anymore.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
vbo: Use the VAO array enabled flags in vbo_exec_array.
Instead of gl_client_array::Enabled inside a VAO,
directly use the gl_vertex_attrib_array::Enabled value
which is the origin of the above.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
vbo: Walk the VAO in check_array_data.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
vbo: Walk the VAO in print_draw_arrays.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO. Also make use of gl_vert_attrib_name.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
mesa: Walk the VAO in _mesa_print_arrays.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO. Also make use of gl_vert_attrib_name.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
vbo: Walk the VAO to check for mapped buffers.
Similarily to _mesa_all_varyings_in_vbos walk the VAO
to check if we have an illegal mapped buffer object
instead of walking all gl_client_arrays.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:05 +0000 (08:09 +0200)]
vbo: Walk the VAO to see if all varyings are in vbos.
In vbo_draw_transform_feedback we currently look at
exec->array.inputs to determine if all varying
vertex attributes reside in vbos. But the vbo_bind_arrays
call only happens past the vbo_all_varyings_in_vbos
query. Thus we may work on a stale set of client arrays.
Using the current VAOs content for this query feels much
more logical to me.
Additionally with this change mesa makes more use of the
information already tracked in the VAO instead of looping
across VERT_ATTRIB_MAX vertex arrays.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:04 +0000 (08:09 +0200)]
mesa: Implement _mesa_all_varyings_in_vbos.
Implement the equivalent of vbo_all_varyings_in_vbos for
vertex array objects.
v2: Update comment.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Mathias Fröhlich [Fri, 17 Jun 2016 06:09:04 +0000 (08:09 +0200)]
mesa: Unbind deleted vbo using _mesa_bind_vertex_buffer.
When a vertex buffer object gets deleted, it is unbound
at the VAO. To do this use _mesa_bind_vertex_buffer instead
of plain unreferencing the buffer object. This keeps the VAOs
internal state consistent. In this case it showed up with
gl_vertex_array_object::VertexAttribBufferMask getting out of
sync.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Timothy Arceri [Sat, 30 Jul 2016 04:51:21 +0000 (14:51 +1000)]
glsl: be more strict on block qualifiers
V2: Add spec references and allow patch qualifier (Ken)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96528
Timothy Arceri [Sat, 30 Jul 2016 06:33:26 +0000 (16:33 +1000)]
glsl: add name param to validate_flags()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Timothy Arceri [Sat, 30 Jul 2016 04:53:20 +0000 (14:53 +1000)]
glsl: add component to ast_type_qualifier::validate_flags
This was added with ARB_enhanced_layouts.
V2: Add an extra format specifier for the new qualifier.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Timothy Arceri [Sat, 30 Jul 2016 00:25:09 +0000 (10:25 +1000)]
docs: Add GL4.4 and ARB_enhanced_layouts to the release notes
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Kenneth Graunke [Mon, 18 Jul 2016 23:02:02 +0000 (16:02 -0700)]
anv: Perform rasterizer discard in the SOL stage instead of the clipper.
See commit
b0629e6894513a2c49a018bc3342a4e55435a236, where we discovered
that the SOL stage's "Rendering Disable" feature is a lot faster at
throwing away all geometry than the clipper's "reject all" mode.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Roland Scheidegger [Sat, 30 Jul 2016 16:18:09 +0000 (18:18 +0200)]
Revert "gallium/util: fix resource leak"
This reverts commit
d1fe26a62862f4e47a799222dca1bc1dc14ca4af.
Replacing a resource leak with a segfault isn't the solution.
Eric Engestrom [Sat, 30 Jul 2016 00:35:39 +0000 (01:35 +0100)]
gallium/util: fix resource leak
CovID: 401540
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
francians@gmail.com [Sat, 30 Jul 2016 07:49:59 +0000 (09:49 +0200)]
freedreno/a4xx: fix comparison out of range warnings
Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
francians@gmail.com [Sat, 30 Jul 2016 07:49:58 +0000 (09:49 +0200)]
freedreno/a3xx: fix comparison out of range warnings
Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
francians@gmail.com [Sat, 30 Jul 2016 07:49:57 +0000 (09:49 +0200)]
freedreno/a2xx: fix comparison out of range warnings
Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
francians@gmail.com [Sat, 30 Jul 2016 06:20:58 +0000 (08:20 +0200)]
freedreno/ir3: init ir3_shader_key with memset()
To silence missing initializers warning
Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Eric Engestrom [Sat, 30 Jul 2016 00:33:56 +0000 (01:33 +0100)]
gallium/freedreno: move cast to avoid integer overflow
Previously, the bitshift would be performed on a simple int (32 bits on
most systems), overflow, and then be cast to 64 bits.
CovID: 1362461
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Eric Engestrom [Sat, 30 Jul 2016 00:23:09 +0000 (01:23 +0100)]
freedreno/a2xx: remove duplicate assignment
CovID: 1362445, 1362446
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Fri, 22 Jul 2016 21:55:59 +0000 (17:55 -0400)]
freedreno: defer flush_queue allocation
Some apps, like warsow, create a bazillion contexts but don't render on
most of them.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Wed, 20 Jul 2016 18:50:14 +0000 (14:50 -0400)]
freedreno: add some hw query traces
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Tue, 19 Jul 2016 22:24:57 +0000 (18:24 -0400)]
freedreno: some locking
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Thu, 21 Jul 2016 17:51:36 +0000 (13:51 -0400)]
os: add pipe_mutex_assert_locked()
Would be nice if we could also have lockdep, like in the linux kernel.
But this is better than nothing.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Tue, 19 Jul 2016 17:22:01 +0000 (13:22 -0400)]
freedreno: drop needs_rb_fbd
We need to emit RB_FRAME_BUFFER_DIMENSION once per batch.. tracking this
in fd_context is wrong when the gmem code executes asynchronously from
the flush_queue worker. But in fact we don't really need to track it at
all. We cannot assume previous value at the beginning of the batch
(because of other processes potentially using the GPU), so just drop the
tracking and emit it in _tile_init().
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Tue, 19 Jul 2016 16:08:42 +0000 (12:08 -0400)]
freedreno: move needs_wfi into batch
This is also used in gmem code, which executes from the "bottom half"
(ie. from the flush_queue worker thread), so it cannot be in fd_context.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Thu, 14 Jul 2016 20:44:34 +0000 (16:44 -0400)]
freedreno: a bit of micro-optimization
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Thu, 14 Jul 2016 17:27:32 +0000 (13:27 -0400)]
freedreno: drop mem2gmem/gmem2mem query stages
They weren't really used, and it gets somewhat more complicated to deal
with if batches are flushed asynchronously (on another thread). So just
drop them, and move _query_set_state(NULL) call into batch (so it is not
happening on background thread).
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Wed, 13 Jul 2016 13:49:53 +0000 (09:49 -0400)]
freedreno: threaded batch flush
With the state accessed from GMEM+submit factored out of fd_context and
into fd_batch, now it is possible to punt this off to a helper thread.
And more importantly, since there are cases where one context might
force the batch-cache to flush another context's batches (ie. when there
are too many in-flight batches), using a per-context helper thread keeps
various different flushes for a given context serialized.
TODO as with batch-cache, there are a few places where we'll need a
mutex to protect critical sections, which is completely missing at the
moment.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Thu, 14 Jul 2016 14:32:02 +0000 (10:32 -0400)]
freedreno: track batch/blit types
Add a bit of extra book-keeping about blits and back-blits (from
resource shadowing). If the app uploads all mipmap levels, as opposed
to uploading the first level and then glGenerateMipmap(), we can discard
the back-blit (as opposed to being naive and shadowing the resource for
each mipmap level). Also, after a normal blit, we might as well flush
the batch immediately, since there is not likely to be further rendering
to the surface.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Mon, 11 Jul 2016 21:36:45 +0000 (17:36 -0400)]
freedreno: re-order support for hw queries
Push query state down to batch, and use the resource tracking to figure
out which batch(es) need to be flushed to get the query result.
This means we actually need to allocate the prsc up front, before we
know the size. So we have to add a special way to allocate an un-
backed resource, and then later allocate the backing storage.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Mon, 11 Jul 2016 20:23:10 +0000 (16:23 -0400)]
freedreno: use prsc for hw queries
Switch to using a pipe_resource (rather than an fd_bo directly) for hw
query result buffers. This is first step towards making queries work
properly with reordered batches, since we'll need the additional
dependency tracking to know which batches to flush.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Fri, 1 Jul 2016 16:38:16 +0000 (12:38 -0400)]
freedreno: support discarding previous rendering in special cases
Basically, to "DCE" blits triggered by resource shadowing, in cases
where the levels are immediately completely overwritten. For example,
mid-frame texture upload to level zero triggers shadowing and back-blits
to the remaining levels, which are immediately overwritten by
glGenerateMipmap().
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Wed, 29 Jun 2016 17:51:26 +0000 (13:51 -0400)]
freedreno: shadow textures if possible to avoid stall/flush
To make batch re-ordering useful, we need to be able to create shadow
resources to avoid a flush/stall in transfer_map(). For example,
uploading new texture contents or updating a UBO mid-batch. In these
cases, we want to clone the buffer, and update the new buffer, leaving
the old buffer (whose reference is held by cmdstream) as a shadow.
This is done by blitting the remaining other levels (and whatever part
of current level that is not discarded) from the old/shadow buffer to
the new one.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Tue, 28 Jun 2016 11:53:34 +0000 (07:53 -0400)]
freedreno: spiff up some debug traces
Make it easier to track batches, to ensure things happen properly when
they are reordered.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Mon, 27 Jun 2016 13:44:15 +0000 (09:44 -0400)]
freedreno: add batch-cache and batch reordering
Note that I originally also had a entry-point that would construct a key
and do lookup from a pipe_surface. I ended up not needing that (yet?)
but it is easy-enough to re-introduce later if we need it for the blit
path.
For now, not enabled by default, but can be enabled (on a3xx/a4xx) with
FD_MESA_DEBUG=reorder.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Mon, 27 Jun 2016 15:28:37 +0000 (11:28 -0400)]
freedreno: move more batch related tracking to fd_batch
To flush batches out of order, the gmem code needs to not depend on
state from fd_context (since that may apply to a more recent batch).
So this all moves into batch.
The one exception is the gmem/pipe/tile state itself. But this is
only used from gmem code (and batches are flushed serially). The
alternative would be having to re-calculate GMEM layout on every
batch, even if the dimensions of the render targets are the same.
Note: This opens up the possibility of pushing gmem/submit into a
helper thread.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Tue, 21 Jun 2016 16:39:32 +0000 (12:39 -0400)]
freedreno: dynamically sized/growable cmd buffers
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Sat, 21 May 2016 00:05:26 +0000 (20:05 -0400)]
freedreno: push resource tracking down into batch
Signed-off-by: Rob Clark <robdclark@gmail.com>
Rob Clark [Fri, 20 May 2016 19:36:10 +0000 (15:36 -0400)]
freedreno: introduce fd_batch
Introduce the batch object, to track a batch/submit's worth of
ringbuffers and other bookkeeping. In this first step, just move
the ringbuffers into batch, since that is mostly uninteresting
churn.
For now there is just a single batch at a time. Note that one
outcome of this change is that rb's are allocated/freed on each
use. But the expectation is that the bo pool in libdrm_freedreno
will save us the GEM bo alloc/free which was the initial reason
to implement a rb pool in gallium.
The purpose of the batch is to eventually facilitate out-of-order
rendering, with batches associated to framebuffer state, and
tracking the dependencies on other batches.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Marek Olšák [Sun, 17 Jul 2016 18:54:51 +0000 (20:54 +0200)]
mesa: remove dd_function_table::UseProgram
finally unused
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 19:37:58 +0000 (21:37 +0200)]
st/mesa: update sampler states when shaders are changed
This bug seems to have always been there. Applications changing shaders
but not textures between draw calls would have gotten undefined behavior.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 18:59:42 +0000 (20:59 +0200)]
st/mesa: don't dirty sample shading on _NEW_PROGRAM
Already done as part of ST_NEW_FRAGMENT_PROGRAM in st_validate_state.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 18:37:58 +0000 (20:37 +0200)]
st/mesa: remove excessive shader state dirtying
This just needs to be done by st_validate_state.
v2: add "shaders_may_be_dirty" flags for not skipping st_validate_state
on _NEW_PROGRAM to detect real shader changes
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 18:32:46 +0000 (20:32 +0200)]
st/mesa: unreference optional shaders when unbinding
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 17:47:12 +0000 (19:47 +0200)]
st/mesa: skip updates of states that have no effect
v2: - also don't check edge flags for GLES
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 16:38:38 +0000 (18:38 +0200)]
st/mesa: completely rewrite state atoms
The goal is to do this in st_validate_state:
while (dirty)
atoms[u_bit_scan(&dirty)]->update(st);
That implies that atoms can't specify which flags they consume.
There is exactly one ST_NEW_* flag for each atom. (58 flags in total)
There are macros that combine multiple flags into one for easier use.
All _NEW_* flags are translated into ST_NEW_* flags in st_invalidate_state.
st/mesa doesn't keep the _NEW_* flags after that.
torcs is 2% faster between the previous patch and the end of this series.
v2: - add st_atom_list.h to Makefile.sources
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 13:49:56 +0000 (15:49 +0200)]
st/mesa: remove st_tracked_state::name
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Sun, 17 Jul 2016 13:25:01 +0000 (15:25 +0200)]
st/mesa: remove atom debugging code
This won't be needed after the rewrite.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Kenneth Graunke [Tue, 26 Jul 2016 20:19:46 +0000 (13:19 -0700)]
i965: Fix move_interpolation_to_top() pass.
The pass I introduced in commit
a2dc11a7818c04d8dc0324e8fcba98d60bae
was entirely broken. A missing "break" made the load_interpolated_input
case always fall through to "default" and hit a "continue", making it
not actually move any load_interpolated_input intrinsics at all.
It would only move the simple load_barycentric_* intrinsics, which
don't emit any code anyway, making it basically useless.
The initial version I sent of the pass worked, but I apparently
failed to verify that the simplified version in v2 actually worked.
With the obvious fix applied (so we actually tried to move
load_interpolated_input intrinsics), I discovered a second bug: we
weren't moving the offset SSA def to the top, breaking SSA validation.
The new version of the pass actually moves load_interpolated_input
intrinsics and all their dependencies, as intended.
Papers over GPU hangs on Ivybridge and Baytrail caused by the
recent NIR FS input rework by restoring the old behavior.
(I'm not honestly sure why they hang with PLN not at the top.)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97083
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Rob Clark [Fri, 29 Jul 2016 18:58:39 +0000 (14:58 -0400)]
freedreno: limit non-user constant buffers to a4xx
Seems to mostly work on a3xx. Except when it doesn't and kills gpu
quite badly.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Jan Ziak [Fri, 29 Jul 2016 11:56:00 +0000 (13:56 +0200)]
glsl: fix uninitialized instance variable
Valgrind detected that variable ir_copy_propagation_visitor::killed_all
is uninitialized.
Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Jan Ziak [Wed, 27 Jul 2016 11:36:16 +0000 (13:36 +0200)]
configure: add support for LLVM 4.0.0svn static libs
Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Rob Herring [Fri, 17 Jun 2016 22:25:35 +0000 (17:25 -0500)]
virgl: add exported dmabuf to BO hash table
Exported dmabufs can get imported by the same process, but the handle was
not getting added to the hash table on export. Add the handle to the hash
table on export.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Anuj Phogat [Wed, 20 Jul 2016 18:40:31 +0000 (11:40 -0700)]
anv: Enable per sample shading on gen8+
Vulkan CTS test results on gen9:
./deqp-vk --deqp-case=dEQP-VK.pipeline.multisample.min_sample_shading*
Test run totals:
Passed: 60/90 (66.7%)
Failed: 0/90 (0.0%)
Not supported: 30/90 (33.3%)
Warnings: 0/90 (0.0%)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Anuj Phogat [Thu, 28 Jul 2016 16:36:26 +0000 (09:36 -0700)]
anv/pipeline: Fix setting per sample shading in pixel shader
We should use the persample_dispatch variable in prog_data.
Fixes all (~60) the DEQP sample shading tests. Many tests exited with
VK_ERROR_OUT_OF_DEVICE_MEMORY without this patch.
V2: Use the shader key bits set in brw_compile_fs (Jason)
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Nicolas Boichat [Fri, 22 Jul 2016 03:27:41 +0000 (11:27 +0800)]
egl/dri2: Add reference count for dri2_egl_display
android.opengl.cts.WrapperTest#testGetIntegerv1 CTS test calls
eglTerminate, followed by eglReleaseThread. A similar case is
observed in this bug: https://bugs.freedesktop.org/show_bug.cgi?id=69622,
where the test calls eglTerminate, then eglMakeCurrent(dpy, NULL, NULL, NULL).
With the current code, dri2_dpy structure is freed on eglTerminate
call, so the display is not initialized when eglReleaseThread calls
MakeCurrent with NULL parameters, to unbind the context, which
causes a a segfault in drv->API.MakeCurrent (dri2_make_current),
either in glFlush or in a latter call.
eglTerminate specifies that "If contexts or surfaces associated
with display is current to any thread, they are not released until
they are no longer current as a result of eglMakeCurrent."
However, to properly free the current context/surface (i.e., call
glFlush, unbindContext, driDestroyContext), we still need the
display vtbl (and possibly an active dri dpy connection). Therefore,
we add some reference counter to dri2_egl_display, to make sure
the structure is kept allocated as long as it is required.
One drawback of this is that eglInitialize may not completely reinitialize
the display (if eglTerminate was called with a current context), however,
this seems to meet the EGL spec quite well, and does not permanently
leak any context/display even for incorrectly written apps.
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Emil Velikov [Tue, 26 Jul 2016 08:46:02 +0000 (09:46 +0100)]
vc4: automake: remove vc4_drm.h from the sources lists
The file was removed with earlier commit breaking 'make dist'.
Drop it from Makefile.sources since it's no longer around.
Fixes:
16985eb308e ("vc4: Switch to using the libdrm-provided
vc4_drm.h.")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Nicolai Hähnle [Wed, 27 Jul 2016 14:48:07 +0000 (16:48 +0200)]
ddebug: use pclose to close a popen()'d FILE
Found by Coverity.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Nicolai Hähnle [Tue, 26 Jul 2016 08:04:57 +0000 (10:04 +0200)]
glsl: fix optimization of discard nested multiple levels
The order of optimizations can lead to the conditional discard optimization
being applied twice to the same discard statement. In this case, we must
ensure that both conditions are applied.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96762
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Nicolai Hähnle [Mon, 25 Jul 2016 16:05:46 +0000 (18:05 +0200)]
st_glsl_to_tgsi: only skip over slots of an input array that are present
When an application declares varying arrays but does not actually do any
indirect indexing, some array indices may end up unused in the consuming
shader, so the number of input slots that correspond to the array ends
up less than the array_size.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Dieter Nützel [Wed, 27 Jul 2016 22:20:25 +0000 (00:20 +0200)]
clover: make GCC 4.8 happy
Without this GCC 4.8.x throws below error:
error: invalid initialization of non-const reference of type
'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}'
from an rvalue of type '<brace-enclosed initializer list>'
v2: change commit title and add error message like Eric Engestrom requested
Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97019
[ Francisco Jerez: Trivial formatting fix. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Timothy Arceri [Thu, 28 Jul 2016 00:24:57 +0000 (10:24 +1000)]
i965: remove unnecessary null check
We would have hit a segfault already if this could be null.
Fixes Coverity warning spotted by Matt.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Timothy Arceri [Tue, 26 Jul 2016 23:52:04 +0000 (09:52 +1000)]
glsl: free hash tables earlier
These are only used by get_matching_input() which has been call
at this point so free the hash tables.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Samuel Pitoiset [Tue, 14 Jun 2016 16:27:31 +0000 (18:27 +0200)]
nvc0: enable ARB_tessellation_shader on GM107+
This exposes OpenGL 4.1 on Maxwell (tested on GM107 and GM206).
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Wed, 20 Jul 2016 23:18:45 +0000 (01:18 +0200)]
gm107/ir: add a legalize SSA pass for PFETCH
PFETCH, actually ISBERD on GM107+ ISA only accepts a GPR for src0.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Samuel Pitoiset [Tue, 14 Jun 2016 16:40:29 +0000 (18:40 +0200)]
nvc0: fix up TCP header on GM107+
The number of outputs patch (limited to 255) has moved in the TCP
header, but blob seems to also set the old position. Also, the high
8-bits are now located inbetween the min/max parallel output read
address at position 20.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Mathias Fröhlich [Fri, 22 Jul 2016 08:58:58 +0000 (10:58 +0200)]
vbo: Fix handling of POS/GENERIC0 attributes.
In case of split primitives we need to restore
the original setting of the vtx.attrsz array to make
immediate mode attribute array tracking work.
v2: Use bool instead of boolean.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96950
Marek Olšák [Mon, 25 Jul 2016 19:26:05 +0000 (21:26 +0200)]
radeon/llvm: Use alloca instructions for larger arrays [revert a revert]
This reverts commit
f84e9d749fbb6da73a60fb70e6725db773c9b8f8.
Bioshock Infinite no longer hangs.
Marek Olšák [Mon, 11 Jul 2016 22:48:00 +0000 (00:48 +0200)]
r600g: add support for B5G6R5 PBO uploads via texture buffers (v2)
v2: set endian swap to 16
untested
Marek Olšák [Fri, 22 Jul 2016 21:40:45 +0000 (23:40 +0200)]
radeonsi: pre-generate shader logs for ddebug
This cuts down the overhead of si_dump_shader when ddebug is capturing
shader logs, which is done for every draw call unconditionally (that's
quite a lot of work for a draw call).
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Fri, 22 Jul 2016 21:47:49 +0000 (23:47 +0200)]
radeonsi: add empty lines after shader stats
to separate individual shaders dumped consecutively.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Fri, 22 Jul 2016 21:23:11 +0000 (23:23 +0200)]
radeonsi: move the shader key dumping to si_shader_dump
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 19 Jul 2016 16:28:24 +0000 (18:28 +0200)]
ddebug: implement pipelined hang detection mode
For good performance while being able to generate decent hang reports.
The report doesn't contain the parsed IB and the buffer list, but it
isolates the draw call and dumps shaders while not having to flush
the context.
This is for GPU hangs that are harder to reproduce and require interactive
playing for minutes or even hours.
dd_pipe.h explains some implementation details. Initializing, copying
(recording) and clearing states is most of the code.
The performance should be at least 50% of the normal performance depending
on the circumstances. (i.e. 50% is expected to be the worst case scenario,
not the best case) The majority of time is spent in
dump_debug_state(PIPE_DUMP_CURRENT_SHADERS) and that's after all
the optimizations in later patches. There is no obvious way to optimize
that further.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 21 Jul 2016 23:36:55 +0000 (01:36 +0200)]
ddebug: don't save pointers to call parameters
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Thu, 21 Jul 2016 23:09:19 +0000 (01:09 +0200)]
ddebug: move dd_call into dd_pipe.h
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 19 Jul 2016 19:31:02 +0000 (21:31 +0200)]
ddebug: separate draw call dumping logic
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Wed, 13 Jul 2016 14:00:06 +0000 (16:00 +0200)]
ddebug: move all states into a separate structure
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Wed, 20 Jul 2016 14:23:48 +0000 (16:23 +0200)]
ddebug: write contents of dmesg into hang reports
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Fri, 22 Jul 2016 15:30:06 +0000 (17:30 +0200)]
ddebug: implement create_batch_query
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 19 Jul 2016 19:18:25 +0000 (21:18 +0200)]
ddebug: don't use abort()
We don't want a core dump.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 19 Jul 2016 16:23:02 +0000 (18:23 +0200)]
ddebug: make dd_get_file_stream accept the screen only
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Mon, 18 Jul 2016 19:42:14 +0000 (21:42 +0200)]
ddebug: clean up ddebug_screen_create
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Tue, 19 Jul 2016 19:41:03 +0000 (21:41 +0200)]
gallium: rework flags for pipe_context::dump_debug_state
The pipelined hang detection mode will not want to dump everything.
(and it's also time consuming) It will only dump shaders after a draw call
and then dump the status registers separately if a hang is detected.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Rob Herring [Fri, 22 Jul 2016 20:28:30 +0000 (15:28 -0500)]
vc4: add hash table look-up for exported dmabufs
It is necessary to reuse existing BOs when dmabufs are imported. There
are 2 cases that need to be handled. dmabufs can be created/exported and
imported by the same process and can be imported multiple times.
Copying other drivers, add a hash table to track exported BOs so the
BOs get reused.
v2: Whitespace fixup (by anholt)
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>