platform/upstream/mesa.git
8 years agoclover: Fix kernel metadata retrieval after clang r273425
Jan Vesely [Thu, 23 Jun 2016 00:52:26 +0000 (20:52 -0400)]
clover: Fix kernel metadata retrieval after clang r273425

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
8 years agoclover/llvm: Fix copyright attribution of invocation.cpp.
Francisco Jerez [Tue, 17 May 2016 14:02:32 +0000 (16:02 +0200)]
clover/llvm: Fix copyright attribution of invocation.cpp.

This file still only has my name on the copyright notice even though
most of the code (likely more than 90% of it) was authored by various
contributors -- It doesn't seem right to have the whole file
attributed to myself.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Serge Martin <edb+mesa@sigluy.net>
8 years agoi965: Print EOT in fs_visitor::dump_instruction().
Kenneth Graunke [Sun, 26 Jun 2016 07:39:32 +0000 (00:39 -0700)]
i965: Print EOT in fs_visitor::dump_instruction().

This was useful when debugging the previous commit's issue.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Make emit_urb_writes() not produce an EOT message for GS.
Kenneth Graunke [Sun, 26 Jun 2016 07:39:19 +0000 (00:39 -0700)]
i965: Make emit_urb_writes() not produce an EOT message for GS.

emit_urb_writes() contains code to emit an EOT write with no actual
data when there are no output varyings.  This makes sense for the VS
and TES stages, where it's called once at the end of the program.

However, in the geometry shader stage, emit_urb_writes() is called once
for every EmitVertex().  We explicitly emit a URB write with EOT set at
the end of the shader, separately from this path.  So we'd better not
terminate the thread.  This could get us into trouble for shaders which
do EmitVertex() with no varyings followed by SSBO/image/atomic writes.

It also caused us to emit multiple sends with EOT set, which apparently
confuses the register allocator into not using g112-g127 for all but
the first one.  This caused EU validation failures in OglGSCloth
shaders in shader-db.  (The actual application was fine, but shader-db
thinks there are no outputs because it doesn't understand transform
feedback.)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoglsl: Ignore ir_texture in lower_const_arrays_to_uniforms.
Kenneth Graunke [Fri, 24 Jun 2016 22:37:35 +0000 (15:37 -0700)]
glsl: Ignore ir_texture in lower_const_arrays_to_uniforms.

The only part of an ir_texture which can be an array is the
offsets array in textureGatherOffsets() calls.  We don't want
to lower those, because they're required to remain constants.

Fixes textureGatherOffsets with Gallium drivers such as llvmpipe,
which commit ef78df8d3b0cf540e5f08c8c2f6caa338b64a6c7 regressed.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agogm107/ir: add missing setcond flags for LOP variants
Samuel Pitoiset [Mon, 27 Jun 2016 22:13:05 +0000 (00:13 +0200)]
gm107/ir: add missing setcond flags for LOP variants

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agogm107/ir: make use of LOP32I for all immediates
Samuel Pitoiset [Mon, 27 Jun 2016 21:55:53 +0000 (23:55 +0200)]
gm107/ir: make use of LOP32I for all immediates

LOP only allows to emit 19-bits immediates.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agovirgl: reduce some limits for now
Dave Airlie [Mon, 27 Jun 2016 20:45:28 +0000 (06:45 +1000)]
virgl: reduce some limits for now

These need to be passed from the host in caps structure if they
are larger, this fixes a bunch of tests on Intel hw, that I'd
put the limits too high for.

Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agost/omx: count number of slices
Julien Isorce [Mon, 4 Jan 2016 22:17:59 +0000 (22:17 +0000)]
st/omx: count number of slices

Used by nouveau driver.
Similar patch was done for st/va:
851e7e12aa628d6781b5a3af2f2fc16ee73f435f

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agost/omx: add support for nouveau / interlaced
Julien Isorce [Tue, 8 Dec 2015 21:50:03 +0000 (21:50 +0000)]
st/omx: add support for nouveau / interlaced

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agost/omx: retrieve preferred interlaced and buffer_formats
Julien Isorce [Tue, 1 Dec 2015 08:10:42 +0000 (08:10 +0000)]
st/omx: retrieve preferred interlaced and buffer_formats

Interlaced can be true for nouveau driver.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoradeonsi: use optimal WD settings for primitive restart on Polaris
Marek Olšák [Fri, 8 Apr 2016 10:57:43 +0000 (12:57 +0200)]
radeonsi: use optimal WD settings for primitive restart on Polaris

ported from Vulkan

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agost/va: Check NULL pointer
Gurkirpal Singh [Sun, 26 Jun 2016 07:02:25 +0000 (12:32 +0530)]
st/va: Check NULL pointer

Call to handle_table_get in vlVaDestroySurfaces can
return NULL on failure.

CID: 1243522

Signed-off-by: Gurkirpal Singh <gurkirpal204@gmail.com>
Reviewed-by: Julien Isorce <j.isorce@samsung.com>
8 years agonir: Fix copy_prop_src when src is an indirect access on a reg.
Eric Anholt [Sun, 26 Jun 2016 00:33:16 +0000 (17:33 -0700)]
nir: Fix copy_prop_src when src is an indirect access on a reg.

The intent was to continue down the indirect chain, not to call ourselves
with unchanged input arguments.  Found by code inspection, and comparison
to copy_prop_alu_src().

We haven't hit this because callers of NIR's copy prop are doing so in
SSA, before indirect variable dereferences have been lowered to registers.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogm107/ir: make use of MOV32I for all immediates
Samuel Pitoiset [Sun, 26 Jun 2016 22:52:46 +0000 (00:52 +0200)]
gm107/ir: make use of MOV32I for all immediates

MOV only allows to emit 19-bits immediates. This is similar to the
previous fix I did for IMUL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agoi965: Use miptree to decide format on multi-plane images for gen < 7
Jordan Justen [Sun, 12 Jun 2016 01:16:47 +0000 (18:16 -0700)]
i965: Use miptree to decide format on multi-plane images for gen < 7

This wasn't handled correctly for multi-plane images on gen < 7 in
727a9b24933d384f5440ed4318fb720ed11d6dd1.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96674
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonvc0: update "derived" state function names
Ilia Mirkin [Sat, 25 Jun 2016 22:15:57 +0000 (18:15 -0400)]
nvc0: update "derived" state function names

derived_1/2/etc aren't too informative. Instead name them based on the
state they're derived from.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: provide support for unscaled poly offset units
Ilia Mirkin [Sat, 25 Jun 2016 19:20:00 +0000 (15:20 -0400)]
nvc0: provide support for unscaled poly offset units

On at least Kepler hardware, the units differ based on RT format. Emit a
properly scaled value for Z16 depth buffers vs other formats, to help
out st/nine.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agogm107/ir: make use of IMUL32I for all immediates
Samuel Pitoiset [Sun, 26 Jun 2016 16:42:22 +0000 (18:42 +0200)]
gm107/ir: make use of IMUL32I for all immediates

IMUL only allows to emit 19-bits immediates. This is similar to
d30768025a2283d4cc57930b784798bf278969da which fixed the same thing
for the GK110 emitter.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agoradeonsi: make si_is_format_supported static
Marek Olšák [Tue, 21 Jun 2016 19:46:16 +0000 (21:46 +0200)]
radeonsi: make si_is_format_supported static

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: boolean -> bool, TRUE -> true, FALSE -> false
Marek Olšák [Tue, 21 Jun 2016 19:29:39 +0000 (21:29 +0200)]
radeonsi: boolean -> bool, TRUE -> true, FALSE -> false

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: boolean -> bool, TRUE -> true, FALSE -> false
Marek Olšák [Tue, 21 Jun 2016 19:29:39 +0000 (21:29 +0200)]
gallium/radeon: boolean -> bool, TRUE -> true, FALSE -> false

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon/winsyses: boolean -> bool, TRUE -> true, FALSE -> false
Marek Olšák [Tue, 21 Jun 2016 19:29:39 +0000 (21:29 +0200)]
gallium/radeon/winsyses: boolean -> bool, TRUE -> true, FALSE -> false

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: use r600_resource_reference
Marek Olšák [Tue, 21 Jun 2016 19:13:00 +0000 (21:13 +0200)]
gallium/radeon: use r600_resource_reference

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agonir: Add a NIR_VALIDATE environment variable
Jason Ekstrand [Thu, 23 Jun 2016 21:22:03 +0000 (14:22 -0700)]
nir: Add a NIR_VALIDATE environment variable

It defaults to true so default behavior doesn't change but it allows you to
do NIR_VALIDATE=false if you don't want validation.  Disabling validation
can substantially speed up shader compiles so you frequently want to turn
it off if compiler invariants aren't in question.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agost/nine: Use offset_units_unscaled
Axel Davy [Tue, 14 Jun 2016 21:24:24 +0000 (23:24 +0200)]
st/nine: Use offset_units_unscaled

offset_units_unscaled enables proper support
for depth bias for gallium nine. Use it
if available.

Solves issues with some games using depth bias.
For example:
https://github.com/iXit/Mesa-3D/issues/220

Signed-off-by: Axel Davy <axel.davy@ens.fr>
8 years agor600g: Implement POLYGON_OFFSET_UNITS_UNSCALED
Axel Davy [Tue, 14 Jun 2016 21:13:26 +0000 (23:13 +0200)]
r600g: Implement POLYGON_OFFSET_UNITS_UNSCALED

Empirical tests show that the polygon offset
behaviour is entirely determined by the content of
the PA_SU_POLY_OFFSET states, and not by the depth buffer
format bound.

PA_SU_POLY_OFFSET seems to directly set the parameters of
the polygon offset formula, and setting 0 for
PA_SU_POLY_OFFSET_DB_FMT_CNTL (ie setting the unorm depth
bias behaviour with a scale of 2^0 = 1.0f) gives the unscaled
behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: Implement POLYGON_OFFSET_UNITS_UNSCALED
Axel Davy [Tue, 14 Jun 2016 20:41:50 +0000 (22:41 +0200)]
radeonsi: Implement POLYGON_OFFSET_UNITS_UNSCALED

Empirical tests show that the polygon offset
behaviour is entirely determined by the content of
the PA_SU_POLY_OFFSET states, and not by the depth buffer
format bound.

PA_SU_POLY_OFFSET seems to directly set the parameters of
the polygon offset formula, and setting 0 for
PA_SU_POLY_OFFSET_DB_FMT_CNTL (ie setting the unorm depth
bias behaviour with a scale of 2^0 = 1.0f) gives the unscaled
behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeon: Remove useless pa_su_poly_offset_db_fmt_cntl
Axel Davy [Tue, 14 Jun 2016 20:32:04 +0000 (22:32 +0200)]
radeon: Remove useless pa_su_poly_offset_db_fmt_cntl

pa_su_poly_offset_db_fmt_cntl usages were removed in
previous patches.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agor600g: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states for evergreen
Axel Davy [Tue, 14 Jun 2016 20:30:11 +0000 (22:30 +0200)]
r600g: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states for evergreen

Emit PA_SU_POLY_OFFSET_DB_FMT_CNTL with the other poly_offset states.
This will be useful to implement
PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED.

v2: Increase the num_dw field for the poly offset atom

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agor600g: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states for r600
Axel Davy [Tue, 14 Jun 2016 20:22:50 +0000 (22:22 +0200)]
r600g: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states for r600

Emit PA_SU_POLY_OFFSET_DB_FMT_CNTL with the other poly_offset states.
This will be useful to implement
PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED.

v2: Increase the num_dw field for the poly offset atom

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states
Axel Davy [Tue, 14 Jun 2016 20:04:41 +0000 (22:04 +0200)]
radeonsi: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to poly offset states

Emit PA_SU_POLY_OFFSET_DB_FMT_CNTL with rasterizer poly_offset states.
This will be useful to implement
PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: Add a cap for offset_units_unscaled
Axel Davy [Mon, 13 Jun 2016 20:28:32 +0000 (22:28 +0200)]
gallium: Add a cap for offset_units_unscaled

D3D9 has a different behaviour for depth bias.

For OGL/D3D1X, the depth bias unit is the
minimal resolvable value for the depth buffer,
which depends on the format (and has different
behaviour for float depth buffers).

For D3D9, the depth bias unit is 1.0f.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965: Skip update_texture_surface when the plane doesn't exist
Jordan Justen [Sun, 12 Jun 2016 01:16:47 +0000 (18:16 -0700)]
i965: Skip update_texture_surface when the plane doesn't exist

Reported-by: Grazvydas Ignotas <notasas@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96607
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoi965: Validate a few SEND-from-GRF requirements.
Kenneth Graunke [Thu, 9 Jun 2016 19:36:55 +0000 (12:36 -0700)]
i965: Validate a few SEND-from-GRF requirements.

We recently had a mistake where we emitted SEND instructions with EOT
set, but from g107 rather than g112-g127.  Adding validation code should
prevent these sorts of problems from slipping back in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Delete send-from-GRF only opcodes from implied_mrf_writes().
Kenneth Graunke [Thu, 23 Jun 2016 00:15:13 +0000 (17:15 -0700)]
i965: Delete send-from-GRF only opcodes from implied_mrf_writes().

These only exist post-Sandybridge, and always use send-from-GRF.
So inst->base_mrf will be -1, and we will have already returned 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Drop unnecessary inst->base_mrf = -1 assignments.
Kenneth Graunke [Thu, 23 Jun 2016 00:14:05 +0000 (17:14 -0700)]
i965: Drop unnecessary inst->base_mrf = -1 assignments.

These are now unnecessary, as base_mrf is -1 by default.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Set fs_inst::base_mrf = -1 by default.
Kenneth Graunke [Thu, 23 Jun 2016 00:01:12 +0000 (17:01 -0700)]
i965: Set fs_inst::base_mrf = -1 by default.

On MRF platforms, we need to set base_mrf to the first MRF value we'd
like to use for the message.  On send-from-GRF platforms, we set it to
-1 to indicate that the operation doesn't use MRFs.

As MRF platforms are becoming increasingly a thing of the past, we've
forgotten to bother with this.  It makes more sense to set it to -1 by
default, so we don't have to think about it for new code.

I searched the code for every instance of 'mlen =' in brw_fs*cpp, and
it appears that all MRF-based messages correctly program a base_mrf.

Forgetting to set base_mrf = -1 can confuse the register allocator,
causing it to think we have a large fake-MRF region.  This ends up
moving the send-with-EOT registers earlier, sometimes even out of
the g112-g127 range, which is illegal.  For example, this fixes
illegal sends in Piglit's arb_gpu_shader_fp64-layout-std430-fp64-shader,
which had SSBO messages with mlen > 0 but base_mrf == 0.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Drop unused return value from intel_finalize_mipmap_tree().
Kenneth Graunke [Sun, 19 Jun 2016 06:40:21 +0000 (23:40 -0700)]
i965: Drop unused return value from intel_finalize_mipmap_tree().

The old return type of GLuint was wonky - it should have been bool.
But nothing actually uses the return value anyway, so we can just drop
that and make it a void function.

In theory, it might make sense to ask whether the texture validated
successfully, but just checking intel_obj->mt != NULL works for that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Move contents of brw_tex.c into intel_tex_validate.c.
Kenneth Graunke [Sun, 19 Jun 2016 06:36:59 +0000 (23:36 -0700)]
i965: Move contents of brw_tex.c into intel_tex_validate.c.

brw_tex.c is a tiny file containing a single function.  It's closely
tied to the validation logic in intel_tex_validate.c, so it makes sense
to put both in the same file.

While we're at it, update the function to our modern style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoradeonsi: fix fractional odd tessellation spacing for Polaris
Marek Olšák [Fri, 24 Jun 2016 00:17:38 +0000 (02:17 +0200)]
radeonsi: fix fractional odd tessellation spacing for Polaris

ported from Vulkan (and no source explains why this is needed)

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: set some VGT context registers on SI-CI
Marek Olšák [Thu, 23 Jun 2016 22:03:26 +0000 (00:03 +0200)]
radeonsi: set some VGT context registers on SI-CI

the kernel sets them, but other UMDs can change them

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: optimize rendering to linear color buffers
Marek Olšák [Thu, 23 Jun 2016 21:55:24 +0000 (23:55 +0200)]
radeonsi: optimize rendering to linear color buffers

loosely ported from Vulkan

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: set almost optimal settings in SC_MODE_CNTL_1
Marek Olšák [Thu, 23 Jun 2016 21:26:25 +0000 (23:26 +0200)]
radeonsi: set almost optimal settings in SC_MODE_CNTL_1

ported from Vulkan

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: let drivers specify SC_MODE_CNTL_1 fields
Marek Olšák [Thu, 23 Jun 2016 20:24:07 +0000 (22:24 +0200)]
gallium/radeon: let drivers specify SC_MODE_CNTL_1 fields

radeonsi will set more fields

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: disable complicated point clipping against user clip planes
Marek Olšák [Thu, 23 Jun 2016 19:42:39 +0000 (21:42 +0200)]
gallium/radeon: disable complicated point clipping against user clip planes

Nothing in the GL spec says that we should expand points to triangles.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: fix a compute shader hang with big threadgroups on SI & CI
Marek Olšák [Fri, 24 Jun 2016 00:22:42 +0000 (02:22 +0200)]
radeonsi: fix a compute shader hang with big threadgroups on SI & CI

ported from Vulkan

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agonvc0: when mapping directly, provide accurate xfer info + start
Ilia Mirkin [Fri, 24 Jun 2016 02:33:59 +0000 (22:33 -0400)]
nvc0: when mapping directly, provide accurate xfer info + start

We were ignoring the incoming box parameters, and were providing totally
bogus stride/layer stride, and other bits, for when a non-full-surface
map was requested.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
8 years agost/mesa: don't assume that the whole surface gets mapped
Ilia Mirkin [Fri, 24 Jun 2016 02:27:40 +0000 (22:27 -0400)]
st/mesa: don't assume that the whole surface gets mapped

Under some circumstances, the driver may choose to return a temporary
surface instead of a pointer to the original. Make sure to pass the
actual view volume to be mapped to the transfer function rather than
adjusting the map pointer after-the-fact.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: drop the DRAW_PREAMBLE packet on Polaris
Nicolai Hähnle [Thu, 23 Jun 2016 23:11:09 +0000 (01:11 +0200)]
radeonsi: drop the DRAW_PREAMBLE packet on Polaris

It will be removed from the firmware for the Polaris.

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: use DRAW_(INDEX_)INDIRECT_MULTI on Polaris
Nicolai Hähnle [Thu, 23 Jun 2016 13:00:53 +0000 (15:00 +0200)]
radeonsi: use DRAW_(INDEX_)INDIRECT_MULTI on Polaris

The non-MULTI variants will be removed in Polaris firmware.

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agost/mesa: handle negative _ColorDrawBufferIndexes values correctly
Francesco Ansanelli [Thu, 23 Jun 2016 17:56:09 +0000 (19:56 +0200)]
st/mesa: handle negative _ColorDrawBufferIndexes values correctly

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agowinsys/radeon: add guard pages when R600_DEBUG=check_vm is enabled
Nicolai Hähnle [Wed, 22 Jun 2016 09:22:33 +0000 (11:22 +0200)]
winsys/radeon: add guard pages when R600_DEBUG=check_vm is enabled

This should help flush out GPU VM faults.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agowinsys/amdgpu: add guard pages when R600_DEBUG=check_vm is enabled
Nicolai Hähnle [Wed, 22 Jun 2016 09:22:33 +0000 (11:22 +0200)]
winsys/amdgpu: add guard pages when R600_DEBUG=check_vm is enabled

This should help flush out GPU VM faults.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: report a failure to parse dmesg instead of asserting
Nicolai Hähnle [Mon, 20 Jun 2016 18:24:03 +0000 (20:24 +0200)]
radeonsi: report a failure to parse dmesg instead of asserting

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeon: check VM faults from DMA flush
Nicolai Hähnle [Mon, 20 Jun 2016 15:19:28 +0000 (17:19 +0200)]
radeon: check VM faults from DMA flush

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: move gfx fence wait out of si_check_vm_faults
Nicolai Hähnle [Mon, 20 Jun 2016 14:47:06 +0000 (16:47 +0200)]
radeonsi: move gfx fence wait out of si_check_vm_faults

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: extract IB and bo list saving into separate functions
Nicolai Hähnle [Mon, 20 Jun 2016 14:30:29 +0000 (16:30 +0200)]
radeonsi: extract IB and bo list saving into separate functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agost/mesa: fix readpixels regression with MESA_pack_invert
Nicolai Hähnle [Wed, 22 Jun 2016 15:36:18 +0000 (17:36 +0200)]
st/mesa: fix readpixels regression with MESA_pack_invert

Fixes an error introduced in commit 3948cd37973696dc319170877382676809659465.

Reported-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: set LLVM denormal flags
Marek Olšák [Tue, 21 Jun 2016 21:28:46 +0000 (23:28 +0200)]
radeonsi: set LLVM denormal flags

- make sure FP32 denormals will stay disabled in LLVM in the future
  (the current default is disabled)
- tell LLVM that FP64 denormals are enabled

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agoradeonsi: emit 1/sqrt for RSQ
Marek Olšák [Tue, 21 Jun 2016 20:45:29 +0000 (22:45 +0200)]
radeonsi: emit 1/sqrt for RSQ

We don't need the clamped version and we don't have to use any intrinsic.

Stats on Tonga:

15382 shaders in 9128 tests
Totals:
SGPRS: 1230560 -> 1230560 (0.00 %)
VGPRS: 469577 -> 462504 (-1.51 %)
Code Size: 22089908 -> 21730052 (-1.63 %) bytes
LDS: 598 -> 598 (0.00 %) blocks
Scratch: 283648 -> 281600 (-0.72 %) bytes per wave
Max Waves: 125664 -> 126969 (1.04 %)
Wait states: 0 -> 0 (0.00 %)

Totals from affected shaders:
SGPRS: 547280 -> 547280 (0.00 %)
VGPRS: 269132 -> 262059 (-2.63 %)
Code Size: 15709604 -> 15349748 (-2.29 %) bytes
LDS: 198 -> 198 (0.00 %) blocks
Scratch: 74752 -> 72704 (-2.74 %) bytes per wave
Max Waves: 47840 -> 49145 (2.73 %)
Wait states: 0 -> 0 (0.00 %)

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agor600g: Enable FMA on chips that support it
Jan Vesely [Wed, 15 Jun 2016 23:41:22 +0000 (19:41 -0400)]
r600g: Enable FMA on chips that support it

v2: Merge with PIPE_SHADER_CAP_DOUBLES
    Add CHIP_HEMLOCK

v3: only set the instruction on EG and CM

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/u_queue: allow the execute function to differ per job
Marek Olšák [Sat, 11 Jun 2016 15:28:52 +0000 (17:28 +0200)]
gallium/u_queue: allow the execute function to differ per job

so that independent types of jobs can use the same queue.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/u_queue: reduce the number of mutexes by 2
Marek Olšák [Thu, 16 Jun 2016 23:33:12 +0000 (01:33 +0200)]
gallium/u_queue: reduce the number of mutexes by 2

by converting semaphores to condvars and using the main mutex

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/u_queue: add an option to name threads
Marek Olšák [Sun, 12 Jun 2016 11:36:39 +0000 (13:36 +0200)]
gallium/u_queue: add an option to name threads

for debugging

v2: correct the snprintf use

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/u_queue: add an option to have multiple worker threads
Marek Olšák [Sat, 11 Jun 2016 13:40:28 +0000 (15:40 +0200)]
gallium/u_queue: add an option to have multiple worker threads

independent jobs don't have to be stuck on only one thread

v2: use CALLOC & FREE

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/u_queue: rewrite util_queue_fence to allow multiple waiters
Marek Olšák [Sat, 11 Jun 2016 15:51:22 +0000 (17:51 +0200)]
gallium/u_queue: rewrite util_queue_fence to allow multiple waiters

Checking "signalled" is first done without a mutex, then with a mutex.
Also, checking without waiting doesn't lock the mutex. This is racy, but
should be safe.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/u_queue: use a ring instead of a stack
Marek Olšák [Sun, 12 Jun 2016 10:54:42 +0000 (12:54 +0200)]
gallium/u_queue: use a ring instead of a stack

and allow specifying its size in util_queue_init.

v2: use CALLOC & FREE

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoi965: Preserve the internal format of the dri image
Jordan Justen [Wed, 22 Jun 2016 17:34:08 +0000 (17:34 +0000)]
i965: Preserve the internal format of the dri image

Since the OpenGLES API is strict about the internal format matching
the for many operations, we need to preserve it.

See _mesa_es3_error_check_format_and_type in
src/mesa/main/glformats.c.

Fixes ES2-CTS.gtf.GL2ExtensionTests.egl_image.egl_image

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96351
Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Chad Versace <chad.versace@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoanv: Add anv_render_pass_attachment::store_op
Chad Versace [Wed, 22 Jun 2016 16:17:41 +0000 (09:17 -0700)]
anv: Add anv_render_pass_attachment::store_op

Will be needed for resolving auxiliary surfaces.

I didn't add anv_render_pass_attachment::stencil_store_op, as the driver
would likely never use it, as stencil surfaces never have auxiliary
surfaces.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogbm: Fix comments
Gurkirpal Singh [Thu, 23 Jun 2016 10:24:11 +0000 (15:54 +0530)]
gbm: Fix comments

Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agogbm: doc fixes
Eric Engestrom [Thu, 23 Jun 2016 11:00:44 +0000 (12:00 +0100)]
gbm: doc fixes

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoRemove wrongly repeated words in comments
Giuseppe Bilotta [Thu, 23 Jun 2016 17:20:18 +0000 (19:20 +0200)]
Remove wrongly repeated words in comments

Clean up misrepetitions ('if if', 'the the' etc) found throughout the
comments. This has been done manually, after grepping
case-insensitively for duplicate if, is, the, then, do, for, an,
plus a few other typos corrected in fly-by

v2:
    * proper commit message and non-joke title;
    * replace two 'as is' followed by 'is' to 'as-is'.
v3:
    * 'a integer' => 'an integer' and similar (originally spotted by
      Jason Ekstrand, I fixed a few other similar ones while at it)

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agosvga: update some comments in svga_buffer_handle()
Brian Paul [Wed, 22 Jun 2016 23:24:12 +0000 (17:24 -0600)]
svga: update some comments in svga_buffer_handle()

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: add a const qualifier in svga_buffer_upload_piecewise()
Brian Paul [Wed, 22 Jun 2016 23:19:58 +0000 (17:19 -0600)]
svga: add a const qualifier in svga_buffer_upload_piecewise()

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: minor code refactor for svga_buffer_upload_command()
Brian Paul [Wed, 22 Jun 2016 23:18:17 +0000 (17:18 -0600)]
svga: minor code refactor for svga_buffer_upload_command()

Put the HBS code into a separate function.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosvga: minor code simplification in svga_context_finish()
Brian Paul [Wed, 22 Jun 2016 22:51:15 +0000 (16:51 -0600)]
svga: minor code simplification in svga_context_finish()

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agoi965: Implement rasterizer discard via SOL unless required for queries.
Kenneth Graunke [Wed, 22 Jun 2016 18:25:26 +0000 (11:25 -0700)]
i965: Implement rasterizer discard via SOL unless required for queries.

We currently use CL_INVOCATION_COUNT for the GL_PRIMITIVES_GENERATED
query, which involves passing all primitives to the clipper.  When
rasterizer discard is enabled, we program the clipper in REJECT_ALL
mode, rather than using the SOL stage's "Rendering Disable" feature.

See commit f09b91f78247409f54c975f56cb10d5f350fe64e for an explanation
of why we implement GL_PRIMITIVES_GENERATED this way.

Apparently the SOL stage's "Rendering Disable" feature is a lot faster
than having the clipper reject all primitives.  It's safe to use when
no GL_PRIMITIVES_GENERATED query is active, as we don't care about
CL_INVOCATION_COUNT incrementing.

This patch makes us use SO_RENDERING_DISABLE when no query is active,
but continues falling back to the clipper in REJECT_ALL mode when the
queries are enabled.  It brings back the perf_debug for the clipper
case (which I removed in commit 1f9445ff57b, thinking it wasn't useful).

Improves performance in Gl32GSCloth by 84.8303% +/- 2.07132% (n = 10)
on my Broadwell GT2 laptop.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: Combine 3DSTATE_STREAMOUT emitters and genX_sol_state atoms.
Kenneth Graunke [Wed, 22 Jun 2016 07:33:46 +0000 (00:33 -0700)]
i965: Combine 3DSTATE_STREAMOUT emitters and genX_sol_state atoms.

They're basically the same.  Let's avoid the code duplication.

v2: Fix SO_BUFFER_ENABLE stuff to only happen on Gen < 8 (caught
    by Jason Ekstrand).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: Don't constant propagate arrays.
Kenneth Graunke [Sat, 30 Apr 2016 00:57:46 +0000 (17:57 -0700)]
glsl: Don't constant propagate arrays.

Constant propagation on arrays doesn't make a lot of sense.  If the
array is only accessed with constant indexes, then opt_array_splitting
would split it up.  Otherwise, we have variable indexing.  If there's
multiple accesses, then constant propagation would end up replicating
the data.

The lower_const_arrays_to_uniforms pass creates uniforms for each
ir_constant with array type that it encounters.  This means that it
creates redundant uniforms for each copy of the constant, which means
uploading too much data.  It can even mean exceeding the maximum number
of uniform components, causing link failures.

We could try and teach the pass to de-duplicate the data by hashing
constants, but it makes more sense to avoid duplicating it in the first
place.  We should promote constant arrays to uniforms, then propagate
the uniform access.

Fixes the TressFX shaders from Tomb Raider, which exceeded the maximum
number of uniform components by a huge margin and failed to link.

On Broadwell:

total instructions in shared programs: 9067702 -> 9068202 (0.01%)
instructions in affected programs: 10335 -> 10835 (4.84%)
helped: 10 (Hoard, Shadow of Mordor, Amnesia: The Dark Descent)
HURT: 20 (Natural Selection 2)

loops in affected programs: 4 -> 0

The hurt programs appear to no longer have a constarray uniform, as
all constants were successfully propagated.  Apparently before this
patch, we successfully unrolled a loop containing array access, but
only after promoting constant arrays to uniforms.  With this patch,
we unroll it first, so all array access is direct, and the array
is split up, and individual constants are propagated.  This seems
better.

Cc: mesa-stable@lists.freedesktop.org
Reported-by: Karol Herbst <nouveau@karolherbst.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoglsl: Make lower_const_arrays_to_uniforms work directly on constants.
Kenneth Graunke [Sat, 30 Apr 2016 01:05:26 +0000 (18:05 -0700)]
glsl: Make lower_const_arrays_to_uniforms work directly on constants.

There's really no point in looking at ir_dereference_array of a
constant.  It also misses cases like:

  (assign () (var_ref tmp) (constant (array ...) ...))

No changes in shader-db, but keeps it working after the next commit.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965: Copy propagate before doing variable index lowering.
Kenneth Graunke [Sat, 30 Apr 2016 04:12:15 +0000 (21:12 -0700)]
i965: Copy propagate before doing variable index lowering.

The scalar backend currently doesn't support variable indexing on
temporary arrays, but it does support it on uniform arrays, and
some stages support it for input arrays.  Make sure these are
propagated through before exploding indirects into piles of
if-ladders unnecessarily.

On Broadwell, no instruction count change in shader-db.

total cycles in shared programs: 80675652 -> 80674928 (-0.00%)
cycles in affected programs: 649972 -> 649248 (-0.11%)
helped: 386
HURT: 165

This will help avoid code quality regressions in a future commit.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoglsl: Propagate invariant/precise after lowering const arrays.
Kenneth Graunke [Wed, 22 Jun 2016 00:42:59 +0000 (17:42 -0700)]
glsl: Propagate invariant/precise after lowering const arrays.

The new uniform may need precise as well.

Fixes copy propagation of constant array uniforms in Tomb Raider shaders.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoglsl: Split arrays even in the presence of whole-array copies.
Kenneth Graunke [Mon, 20 Jun 2016 18:20:51 +0000 (11:20 -0700)]
glsl: Split arrays even in the presence of whole-array copies.

Previously, we failed to split constant arrays.  Code such as

   int[2] numbers = int[](1, 2);

would generates a whole-array assignment:

  (assign () (var_ref numbers)
             (constant (array int 4) (constant int 1) (constant int 2)))

opt_array_splitting generally tried to visit ir_dereference_array nodes,
and avoid recursing into the inner ir_dereference_variable.  So if it
ever saw a ir_dereference_variable, it assumed this was a whole-array
read and bailed.  However, in the above case, there's no array deref,
and we can totally handle it - we just have to "unroll" the assignment,
creating assignments for each element.

This was mitigated by the fact that we constant propagate whole arrays,
so a dereference of a single component would usually get the desired
single value anyway.  However, I plan to stop doing that shortly;
early experiments with disabling constant propagation of arrays
revealed this shortcoming.

This patch causes some arrays in Gl32GSCloth's geometry shaders to be
split, which allows other optimizations to eliminate unused GS inputs.
The VS then doesn't have to write them, which eliminates the entire VS
(5 -> 2 instructions).  It still renders correctly.

No other change in shader-db.

v2: Drop !AOA check and improve a comment (feedback from Tim Arceri).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoglsl: Make constant propagation's folder not propagate into an LHS.
Kenneth Graunke [Mon, 20 Jun 2016 23:48:02 +0000 (16:48 -0700)]
glsl: Make constant propagation's folder not propagate into an LHS.

opt_constant_propagation.cpp contains constant folding code which can
actually do constant propagation in some cases.  It was happily
propagating constants into the left-hand-side of assignments.

For example,

   (assign () (var_ref temp) (constant ...))

would brilliantly be turned into:

   (assign () (constant ...) (constant ....))

This is a bigger hammer than necessary - it prevents propagation
into the left-hand-side altogether.  We could certainly do better
someday.  Notably, the constant propagation pass itself already
takes this approach - it's just the constant propagation pass's
built-in constant folding code (which actually propagates, too)
that was broken.

No change in shader-db, but prevents regressions after future commits.
It seems plausible that this could be hit today, but I haven't seen it
happen.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965/blorp: Disable vertex element swizzling
Topi Pohjolainen [Wed, 18 May 2016 13:18:59 +0000 (16:18 +0300)]
i965/blorp: Disable vertex element swizzling

Without vertex elements originating directly from vertex fetcher
are not passed to wm-state correctly.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/blorp: Let program data tell if push constants are needed
Topi Pohjolainen [Mon, 16 May 2016 07:18:53 +0000 (10:18 +0300)]
i965/blorp: Let program data tell if push constants are needed

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/blorp: Use prog data counters to guide wm/ps setup
Topi Pohjolainen [Wed, 18 May 2016 13:09:49 +0000 (16:09 +0300)]
i965/blorp: Use prog data counters to guide wm/ps setup

just as core upload logic does.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/blorp: Use prog data counters to guide sf/sbe setup
Topi Pohjolainen [Sun, 15 May 2016 08:34:37 +0000 (11:34 +0300)]
i965/blorp: Use prog data counters to guide sf/sbe setup

just as core upload logic does.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Avoid division by zero.
Ardinartsev Nikita [Thu, 23 Jun 2016 01:28:11 +0000 (18:28 -0700)]
i965: Avoid division by zero.

Fixes regression introduced by af5ca43f2676bff7499f93277f908b681cb821d0

Cc: "12.0 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95419

8 years agoswr: [rasterizer core] fix dependency bug
Tim Rowley [Tue, 14 Jun 2016 23:54:34 +0000 (17:54 -0600)]
swr: [rasterizer core] fix dependency bug

Never be dependent on "draw 0", instead have a bool that makes the draw
dependent on the previous draw or not dependent at all.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] use wrap-around safe compares for dependency checking
Tim Rowley [Tue, 14 Jun 2016 23:02:11 +0000 (17:02 -0600)]
swr: [rasterizer core] use wrap-around safe compares for dependency checking

Move drawIDs from 64-bit to 32-bit to increase perf.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer jitter] add support for component packing for 'odd' formats
Tim Rowley [Tue, 14 Jun 2016 18:57:31 +0000 (12:57 -0600)]
swr: [rasterizer jitter] add support for component packing for 'odd' formats

Add early-out if no components are enabled. Add asserts.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] track whether GS outputs viewport array index
Tim Rowley [Tue, 14 Jun 2016 16:25:02 +0000 (10:25 -0600)]
swr: [rasterizer core] track whether GS outputs viewport array index

So we can skip the index gather in PA.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] GS viewport array index attribute
Tim Rowley [Mon, 13 Jun 2016 15:19:38 +0000 (09:19 -0600)]
swr: [rasterizer core] GS viewport array index attribute

Only adds the attribute mapping to the jitter; no implementation yet.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] conservative rasterization frontend support
Tim Rowley [Fri, 10 Jun 2016 17:31:16 +0000 (11:31 -0600)]
swr: [rasterizer core] conservative rasterization frontend support

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] stop single threaded crash exit crash
Tim Rowley [Fri, 10 Jun 2016 16:18:45 +0000 (10:18 -0600)]
swr: [rasterizer core] stop single threaded crash exit crash

Function static destructors were getting called by exit
handlers before context teardown.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer jitter] small fetch jit cleanup
Tim Rowley [Thu, 9 Jun 2016 21:17:49 +0000 (15:17 -0600)]
swr: [rasterizer jitter] small fetch jit cleanup

Handle SGV stores separate from the stream fetch code.

Because of this change, there is a potential to jit an extra unused store.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer core] remove old comment
Tim Rowley [Tue, 7 Jun 2016 19:03:27 +0000 (13:03 -0600)]
swr: [rasterizer core] remove old comment

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer jitter] cleanup supporting different llvm versions
Tim Rowley [Tue, 7 Jun 2016 01:13:22 +0000 (19:13 -0600)]
swr: [rasterizer jitter] cleanup supporting different llvm versions

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>