mesa.git
6 years agomesa: add AllowGLSLCrossStageInterpolationMismatch workaround
Tapani Pälli [Fri, 24 Nov 2017 05:46:07 +0000 (07:46 +0200)]
mesa: add AllowGLSLCrossStageInterpolationMismatch workaround

This fixes issues seen with certain versions of Unreal Engine 4 editor
and games built with that using GLSL 4.30.

v2: add driinfo_gallium change (Emil Velikov)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97852
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103801
Acked-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoanv: Check if memfd_create is already defined.
Vinson Lee [Wed, 29 Nov 2017 07:16:58 +0000 (23:16 -0800)]
anv: Check if memfd_create is already defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103909
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoi965/vec4: use a temp register to compute offsets for pull loads
Iago Toral Quiroga [Wed, 29 Nov 2017 09:50:42 +0000 (10:50 +0100)]
i965/vec4: use a temp register to compute offsets for pull loads

64-bit pull loads are implemented by emitting 2 separate
32-bit pull load messages, where the second message loads from
an offset at +16B.

That addition of 16B to the original offset should not alter the
original offset register used as source for the pull load instruction
though, since the compiler might use that same offset register in other
instructions (for example, for other pull loads in the shader code
that take that same offset as reference).

If the pull load is 32-bit then we only need to emit one message and
we don't need to do offset calculations, but in that case the optimizer
should be able to drop the redundant MOV.

Fixes the following test on Haswell:
KHR-GL45.gpu_shader_fp64.fp64.max_uniform_components

Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103007

7 years agoetnaviv: GC7000: Factor out state based texture functionality
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:40 +0000 (10:44 +0100)]
etnaviv: GC7000: Factor out state based texture functionality

Prepare for two texture handling paths, the descriptor-based
path will be added in a future commit. These are structured
so that the texture implementation handles its own state
emission.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Move active_samplers_bits to texture
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:39 +0000 (10:44 +0100)]
etnaviv: GC7000: Move active_samplers_bits to texture

This needs to be shared between texture_plain and texture_desc.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Factor out incompatible texture handling logic
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:38 +0000 (10:44 +0100)]
etnaviv: GC7000: Factor out incompatible texture handling logic

This will be shared with the texture descriptor path.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Track dirty sampler views
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:37 +0000 (10:44 +0100)]
etnaviv: GC7000: Track dirty sampler views

Need this to efficiently emit texture descriptor invalidations.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Make point sprites work on HALTI5
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:36 +0000 (10:44 +0100)]
etnaviv: GC7000: Make point sprites work on HALTI5

Track varying component offset of the point size output, as well as
provide the offset of the point coord input.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: State changes for HALTI3..5
Wladimir J. van der Laan [Wed, 29 Nov 2017 12:19:45 +0000 (13:19 +0100)]
etnaviv: GC7000: State changes for HALTI3..5

Update state objects to add new state, and emit function to emit new
state.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Update screen specs for HALTI5
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:34 +0000 (10:44 +0100)]
etnaviv: GC7000: Update screen specs for HALTI5

- This core must load shaders from memory (AFAIK)
- Yet another new location for UNIFORMS

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Update context reset for ..HALTI5
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:33 +0000 (10:44 +0100)]
etnaviv: GC7000: Update context reset for ..HALTI5

Update context reset for HALTI3..HALTI5, sorting states for the HALTI
version that has them.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: No RS align when using BLT
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:32 +0000 (10:44 +0100)]
etnaviv: GC7000: No RS align when using BLT

RS align is not necessary and might even be harmful when using the BLT
engine for blitting.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: BLT engine blitting support
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:31 +0000 (10:44 +0100)]
etnaviv: GC7000: BLT engine blitting support

Add an implemenation of key clear_blit functions using the BLT engine
that replaced the RS on GC7000.

Also set level->size correctly for imported resources. This is important
for the BLT resolve-in-place path to work for them.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Factor out RS blit functionality
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:30 +0000 (10:44 +0100)]
etnaviv: GC7000: Factor out RS blit functionality

Prepare for BLT-based blitting path by moving RS-based
blitting to the RS implementation file, making this
self-contained.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Move etna_coalesce to emit header file
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:29 +0000 (10:44 +0100)]
etnaviv: GC7000: Move etna_coalesce to emit header file

Want to be able to emit state from the texture implementation,
and the blitter implementation.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: GC7000: Support BLT as recipient for etna_stall
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:28 +0000 (10:44 +0100)]
etnaviv: GC7000: Support BLT as recipient for etna_stall

When the BLT is involved as source or target, add an extra BLT
enable/disable sequence around the sync sequence.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: Use only DRAW_INSTANCED on GC3000+
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:27 +0000 (10:44 +0100)]
etnaviv: Use only DRAW_INSTANCED on GC3000+

The blob does this, as DRAW_INSTANCED can replace fully all the other
draw commands. It is also required to handle integer vertex formats.
The other path is only there for compatibility and might go away (or at
least rot to become buggy due to dis-use) in newer hardware.

As a by-effect this changes the behavior for GC3000-, by no longer using
the index offset for DRAW_INDEXED but instead adding it to INDEX_ADDR.
This should make no difference.

Preparation for GC7000 support.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
7 years agoetnaviv: Emit SCALE for vertex attributes
Wladimir J. van der Laan [Sat, 18 Nov 2017 09:44:26 +0000 (10:44 +0100)]
etnaviv: Emit SCALE for vertex attributes

This is used by HALTI2+ (GC3000+) when drawing with DRAW_INSTANCED.

It is also necessary when switching between integer and floating point
vertex element formats.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoi965: Reorganize batch/state BO fields into a 'brw_growing_bo' struct.
Kenneth Graunke [Tue, 28 Nov 2017 16:58:21 +0000 (08:58 -0800)]
i965: Reorganize batch/state BO fields into a 'brw_growing_bo' struct.

We're about to add more of them, and need to pass the whole lot of them
around together when growing them.  Putting them in a struct makes this
much easier.

brw->batch.batch.bo is a bit of a mouthful, but it's nice to have things
labeled 'batch' and 'state' now that we have multiple buffers.

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103101
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoi965: Don't grow batch/state buffer on every emit after an overflow.
Kenneth Graunke [Tue, 28 Nov 2017 16:20:39 +0000 (08:20 -0800)]
i965: Don't grow batch/state buffer on every emit after an overflow.

Once we reach the intended size of the buffer (BATCH_SZ or STATE_SZ), we
try and flush.  If we're not allowed to flush, we resort to growing the
buffer so that there's space for the data we need to emit.

We accidentally got the threshold wrong.  The first non-wrappable call
beyond (e.g.) STATE_SZ would grow the buffer to floor(1.5 * STATE_SZ),
The next call would see we were beyond STATE_SZ and think we needed to
grow a second time - when the buffer was already large enough.

We still want to flush when we hit STATE_SZ, but for growing, we should
use the actual size of the buffer as the threshold.  This way, we only
grow when actually necessary.

v2: Simplify the control flow (suggested by Jordan)

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoi965: Preserve EXEC_OBJECT_CAPTURE when growing the BO.
Kenneth Graunke [Tue, 28 Nov 2017 16:59:07 +0000 (08:59 -0800)]
i965: Preserve EXEC_OBJECT_CAPTURE when growing the BO.

The original state buffer was marked with EXEC_OBJECT_CAPTURE.  When
growing it, we want to preserve that flag so we continue to capture it
in GPU hang reports.

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoi965: Use old_bo->align when growing batch/state buffer instead of 4096.
Kenneth Graunke [Tue, 28 Nov 2017 16:30:50 +0000 (08:30 -0800)]
i965: Use old_bo->align when growing batch/state buffer instead of 4096.

The intention here is make the new BO use the same alignment as the old
BO.  This isn't strictly necessary, but we would have to update the
'alignment' field in the validation list when swapping it out, and we
don't bother today.

The batch and state buffers use an alignment of 4096, so this should be
equivalent - it's just clearer than cut and pasting a magic constant.

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agor600: no need to reinit compute regs
Dave Airlie [Thu, 23 Nov 2017 00:19:14 +0000 (10:19 +1000)]
r600: no need to reinit compute regs

Compute setup gets emitted into the normal gfx state buffer,
so no need to reinit the basics.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agor600: split cb setup code out from evergreen compute path.
Dave Airlie [Wed, 29 Nov 2017 03:55:52 +0000 (13:55 +1000)]
r600: split cb setup code out from evergreen compute path.

This just makes it easier to bypass for TGSI later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agor600: add support for compute pkt flags to debug dumping.
Dave Airlie [Mon, 20 Nov 2017 21:28:56 +0000 (07:28 +1000)]
r600: add support for compute pkt flags to debug dumping.

This just lets us see packets marked for compute.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agor600: fix bfe where src/dst are same.
Dave Airlie [Tue, 28 Nov 2017 03:30:41 +0000 (13:30 +1000)]
r600: fix bfe where src/dst are same.

This fixes overlaps where src/dst are the same.

Fixes a bunch of the deqp bitfield tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agogallium/dri2: Enable {GLX_ARB,EGL_KHR}_context_flush_control
Adam Jackson [Mon, 6 Nov 2017 21:28:36 +0000 (16:28 -0500)]
gallium/dri2: Enable {GLX_ARB,EGL_KHR}_context_flush_control

Reviewed-and-tested-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoi965: Program the dynamic state heap size to MAX_STATE_SIZE.
Kenneth Graunke [Wed, 29 Nov 2017 08:27:18 +0000 (00:27 -0800)]
i965: Program the dynamic state heap size to MAX_STATE_SIZE.

STATE_BASE_ADDRESS specifies a maximum size of the dynamic state
section, beyond which data supposedly reads back as 0.  On Gen8+,
we were programming it to the size of the buffer.  This worked fine
until we started growing the state buffer in commit 2dfc119f22f25708.
When the state buffer grows, the value in STATE_BASE_ADDRESS becomes
too small, and our state beyond STATE_SZ bytes would read back as 0.

To avoid having to update the value, we program it to MAX_STATE_SIZE.
We used to program the upper bound to the maximum on older hardware
anyway, so programming it too large isn't a big deal.

Bogus SURFACE_STATE can easily lead to GPU hangs and misrendering.
DiRT Rally was hitting the statebuffer growth path, and suffered from
bad texture corruption and GPU hangs (usually around the same time).

This patch fixes both issues.

Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103101
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agor300,r600,radeonsi: replace RADEON_FLUSH_* with PIPE_FLUSH_*
Marek Olšák [Tue, 28 Nov 2017 16:54:55 +0000 (17:54 +0100)]
r300,r600,radeonsi: replace RADEON_FLUSH_* with PIPE_FLUSH_*

and handle PIPE_FLUSH_HINT_FINISH in r300.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove r600_common_screen
Marek Olšák [Sun, 26 Nov 2017 02:38:44 +0000 (03:38 +0100)]
radeonsi: remove r600_common_screen

Most files in gallium/radeon now include si_pipe.h.

chip_class and family are now here:
    sscreen->info.family
    sscreen->info.chip_class

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove r600_pipe_common::barrier_flags::compute_to_L2
Marek Olšák [Sun, 26 Nov 2017 02:19:20 +0000 (03:19 +0100)]
radeonsi: remove r600_pipe_common::barrier_flags::compute_to_L2

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove query/apply_opaque_metadata callbacks
Marek Olšák [Sun, 26 Nov 2017 02:15:09 +0000 (03:15 +0100)]
radeonsi: remove query/apply_opaque_metadata callbacks

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move shader debug helpers out of r600_pipe_common.c
Marek Olšák [Sun, 26 Nov 2017 02:08:59 +0000 (03:08 +0100)]
radeonsi: move shader debug helpers out of r600_pipe_common.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: dismantle si_common_screen_init/destroy
Marek Olšák [Sun, 26 Nov 2017 02:04:55 +0000 (03:04 +0100)]
radeonsi: dismantle si_common_screen_init/destroy

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: document our vendor string situation
Marek Olšák [Sat, 25 Nov 2017 22:04:31 +0000 (23:04 +0100)]
radeonsi: document our vendor string situation

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: set all pipe buffer functions in r600_buffer_common.c
Marek Olšák [Sat, 25 Nov 2017 22:02:00 +0000 (23:02 +0100)]
radeonsi: set all pipe buffer functions in r600_buffer_common.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi/uvd: don't call ws->query_info
Marek Olšák [Sat, 25 Nov 2017 21:51:43 +0000 (22:51 +0100)]
radeonsi/uvd: don't call ws->query_info

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move video queries into si_get.c
Marek Olšák [Sat, 25 Nov 2017 21:48:36 +0000 (22:48 +0100)]
radeonsi: move video queries into si_get.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove more functions from r600_pipe_common.c
Marek Olšák [Sat, 25 Nov 2017 21:39:28 +0000 (22:39 +0100)]
radeonsi: remove more functions from r600_pipe_common.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move/remove ac_shader_binary helpers
Marek Olšák [Sat, 25 Nov 2017 21:35:27 +0000 (22:35 +0100)]
radeonsi: move/remove ac_shader_binary helpers

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move all get functions to si_get.c; disk_cache_create to si_pipe.c
Marek Olšák [Sat, 25 Nov 2017 21:33:10 +0000 (22:33 +0100)]
radeonsi: move all get functions to si_get.c; disk_cache_create to si_pipe.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove R600_CONTEXT_* flags
Marek Olšák [Sat, 25 Nov 2017 20:37:30 +0000 (21:37 +0100)]
radeonsi: remove R600_CONTEXT_* flags

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: just include si_pipe.h in r600_query.c
Marek Olšák [Sat, 25 Nov 2017 20:36:36 +0000 (21:36 +0100)]
radeonsi: just include si_pipe.h in r600_query.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove some definitions and helpers from r600_pipe_common.h
Marek Olšák [Sat, 25 Nov 2017 20:21:57 +0000 (21:21 +0100)]
radeonsi: remove some definitions and helpers from r600_pipe_common.h

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: don't use fast color clear for small surfaces
Marek Olšák [Sat, 25 Nov 2017 19:16:02 +0000 (20:16 +0100)]
radeonsi: don't use fast color clear for small surfaces

This removes 35+ clear eliminate passes from DOTA 2.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: unify code setting dirty_level_mask for fast clear
Marek Olšák [Tue, 28 Nov 2017 20:37:26 +0000 (21:37 +0100)]
radeonsi: unify code setting dirty_level_mask for fast clear

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: clean up si_do_fast_color_clear parameters
Marek Olšák [Sat, 25 Nov 2017 20:08:20 +0000 (21:08 +0100)]
radeonsi: clean up si_do_fast_color_clear parameters

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: remove r600_common_context::clear_buffer
Marek Olšák [Sat, 25 Nov 2017 19:50:31 +0000 (20:50 +0100)]
radeonsi: remove r600_common_context::clear_buffer

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move r600_test_dma.c into si_test_dma.c
Marek Olšák [Sat, 25 Nov 2017 19:45:21 +0000 (20:45 +0100)]
radeonsi: move r600_test_dma.c into si_test_dma.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move si_pipe_clear_buffer into si_cp_dma.c
Marek Olšák [Sat, 25 Nov 2017 19:39:12 +0000 (20:39 +0100)]
radeonsi: move si_pipe_clear_buffer into si_cp_dma.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move all clear() code into si_clear.c
Marek Olšák [Sat, 25 Nov 2017 19:36:35 +0000 (20:36 +0100)]
radeonsi: move all clear() code into si_clear.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: enable DCC with MSAA for VI
Marek Olšák [Thu, 23 Nov 2017 23:41:47 +0000 (00:41 +0100)]
radeonsi: enable DCC with MSAA for VI

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: implement fast color clear for DCC with MSAA for VI
Marek Olšák [Thu, 23 Nov 2017 23:36:56 +0000 (00:36 +0100)]
radeonsi: implement fast color clear for DCC with MSAA for VI

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: add a workaround for blending with DCC and MSAA
Marek Olšák [Thu, 23 Nov 2017 23:33:53 +0000 (00:33 +0100)]
radeonsi: add a workaround for blending with DCC and MSAA

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: clear PIPE_IMAGE_ACCESS_WRITE when it's invalid to be on the safe side
Marek Olšák [Thu, 23 Nov 2017 23:19:56 +0000 (00:19 +0100)]
radeonsi: clear PIPE_IMAGE_ACCESS_WRITE when it's invalid to be on the safe side

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoac/surface: enable DCC computation for MSAA
Marek Olšák [Thu, 23 Nov 2017 21:29:26 +0000 (22:29 +0100)]
ac/surface: enable DCC computation for MSAA

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: fix layered DCC fast clear
Marek Olšák [Tue, 28 Nov 2017 19:57:10 +0000 (20:57 +0100)]
radeonsi: fix layered DCC fast clear

Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoutil: Also include endian.h on cygwin
Jon Turney [Mon, 27 Nov 2017 13:32:53 +0000 (13:32 +0000)]
util: Also include endian.h on cygwin

If u_endian.h can't determine the endianess, the default behaviour in sha1.c
is to build for big-endian

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agomesa: deal with vs_inputs as 64-bit unsigned integer
Juan A. Suarez Romero [Wed, 29 Nov 2017 11:09:47 +0000 (12:09 +0100)]
mesa: deal with vs_inputs as 64-bit unsigned integer

Commit 78942e ("mesa: shrink VERT_ATTRIB bitfields to 32 bits") uses
vs_prog_data->vs_inputs as if it were a 32-bit unsigned integer.

But actually it is a 64-bit integer, and as such it is used in other
parts of Mesa code. It is worth to note that bits from the entire range
are used, and not only 32-bits. This is due our implementation for
handling 64-bit dual-slot input attributes, which requires to use a
larger bitfield to manage them.

This commit reverts the changes done in brw_draw_upload.c, keeping the
rest of the changes.

This fixes the following tests:

- KHR-GL45.enhanced_layouts.varying_array_locations
- KHR-GL45.enhanced_layouts.varying_locations

Fixes: 78942e ("mesa: shrink VERT_ATTRIB bitfields to 32 bits")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103942
CC: Marek Olšák <marek.olsak@amd.com>
CC: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
7 years agomesa: rework _mesa_add_parameter() to only add a single param
Timothy Arceri [Thu, 15 Jun 2017 23:56:56 +0000 (09:56 +1000)]
mesa: rework _mesa_add_parameter() to only add a single param

This is more inline with what the functions name suggests it should
do, and makes the code much easier to follow.

This will also make adding uniform packing support much simpler.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agor600: lds load cleanups.
Dave Airlie [Wed, 29 Nov 2017 03:13:17 +0000 (13:13 +1000)]
r600: lds load cleanups.

This is just some cleanups on top of the last patch from my compute branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agor600_shader: only load from LDS what is really used
Gert Wollny [Wed, 15 Nov 2017 09:29:12 +0000 (10:29 +0100)]
r600_shader: only load from LDS what is really used

Use the destination write mask to determine which values are really to be
read from LDS and load only these.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
7 years agor600/sb: handle jump after target to end of program. (v2)
Dave Airlie [Sun, 26 Nov 2017 23:36:39 +0000 (23:36 +0000)]
r600/sb: handle jump after target to end of program. (v2)

This fixes hangs on cayman with
tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test

This has a single if/else in it, and when this peephole activated,
it would set the jump target to NULL if there was no instruction
after the final POP. This adds a NOP if we get a jump in this case,
and seems to fix the hangs, so we have a valid target for the ELSE
instruction to go to, instead of 0 (which causes infinite loops).

v2: update last_cf correctly. (I had some other patches hide this)

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoi965: Change a ret == -1 check to ret != 0.
Kenneth Graunke [Tue, 28 Nov 2017 16:12:45 +0000 (08:12 -0800)]
i965: Change a ret == -1 check to ret != 0.

For consistency with most other ret checks.  Suggested by Chris.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoi965: Use C99 struct initializers in brw_bufmgr.c.
Kenneth Graunke [Sun, 26 Nov 2017 09:14:26 +0000 (01:14 -0800)]
i965: Use C99 struct initializers in brw_bufmgr.c.

This is cleaner than using a non-standard memclear macro (which does a
memset to 0) and then initializing fields after the fact.  We move the
declarations to where we initialized the fields.  While we're at it, we
move the declaration of 'ret' that goes with the ioctl, eliminating the
declaration section altogether.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoi965: Move perf_debug and WARN_ONCE back to brw_context.h.
Kenneth Graunke [Sun, 26 Nov 2017 09:42:11 +0000 (01:42 -0800)]
i965: Move perf_debug and WARN_ONCE back to brw_context.h.

These were moved to src/intel/common/gen_debug.h, but they are not
common code.  They assume that brw_context or gl_context variables
exist, named brw or ctx.  That isn't remotely true outside of i965.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agoi965: const a few structs and vars to avoid writing to them by accident
Eric Engestrom [Mon, 27 Nov 2017 13:46:43 +0000 (13:46 +0000)]
i965: const a few structs and vars to avoid writing to them by accident

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Fix Smooth Point Enables.
Kenneth Graunke [Sun, 26 Nov 2017 00:59:27 +0000 (16:59 -0800)]
i965: Fix Smooth Point Enables.

We want to program the 3DSTATE_RASTER field to the gl_context value,
not the other way around.

Fixes: 13ac46557ab1 (i965: Port Gen8+ 3DSTATE_RASTER state to genxml.)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
7 years agomeson: build virgl driver
Dylan Baker [Thu, 26 Oct 2017 22:45:40 +0000 (15:45 -0700)]
meson: build virgl driver

Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build svga driver on linux
Dylan Baker [Thu, 26 Oct 2017 21:19:19 +0000 (14:19 -0700)]
meson: build svga driver on linux

Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build r600 driver
Dylan Baker [Thu, 26 Oct 2017 01:55:38 +0000 (18:55 -0700)]
meson: build r600 driver

v4: - Ensure inc_amd_common defined when radeonsi is disabled (needed by
      r600)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build r300 driver
Dylan Baker [Thu, 26 Oct 2017 00:59:11 +0000 (17:59 -0700)]
meson: build r300 driver

This is build tested only

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agomeson: build i915g driver
Dylan Baker [Wed, 25 Oct 2017 23:54:53 +0000 (16:54 -0700)]
meson: build i915g driver

Build tested only.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agosvga: move svga_is_format_supported() to svga_format.c
Brian Paul [Tue, 21 Nov 2017 14:31:57 +0000 (07:31 -0700)]
svga: move svga_is_format_supported() to svga_format.c

where the other format-related functions live.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agosvga: s/unsigned/SVGA3dDevCapIndex/
Brian Paul [Tue, 21 Nov 2017 14:27:06 +0000 (07:27 -0700)]
svga: s/unsigned/SVGA3dDevCapIndex/

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agoi965: perf: add support for CoffeeLake GT3
Lionel Landwerlin [Thu, 9 Nov 2017 16:40:55 +0000 (16:40 +0000)]
i965: perf: add support for CoffeeLake GT3

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: perf: add support for CoffeeLake GT2
Lionel Landwerlin [Thu, 31 Aug 2017 10:28:30 +0000 (11:28 +0100)]
i965: perf: add support for CoffeeLake GT2

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: perf: add busyness metric sets on gen8/9 platforms
Lionel Landwerlin [Thu, 9 Nov 2017 16:51:26 +0000 (16:51 +0000)]
i965: perf: add busyness metric sets on gen8/9 platforms

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: fix time elapsed counter equations in VME/Media configs
Lionel Landwerlin [Thu, 9 Nov 2017 16:48:45 +0000 (16:48 +0000)]
i965: fix time elapsed counter equations in VME/Media configs

There was a mistake just in those metric sets. We probably didn't
noticed because they're not really interesting for 3D workloads.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: perf: update counter names on gen8/9 platforms
Lionel Landwerlin [Thu, 9 Nov 2017 16:46:47 +0000 (16:46 +0000)]
i965: perf: update counter names on gen8/9 platforms

Just fixing names.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: add a debug option to disable oa config loading
Lionel Landwerlin [Tue, 29 Aug 2017 09:41:27 +0000 (10:41 +0100)]
i965: add a debug option to disable oa config loading

This provides a good way to verify we haven't broken using the perf
driver on older kernels (which don't have the oa config loading
mechanism).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: perf: add support for userspace configurations
Lionel Landwerlin [Tue, 25 Jul 2017 16:22:58 +0000 (17:22 +0100)]
i965: perf: add support for userspace configurations

This allows us to deploy new configurations without touching the
kernel.

v2: Detect loadable configs without creating one (Chris)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: perf: update configs for loading from userspace
Lionel Landwerlin [Thu, 31 Aug 2017 10:04:28 +0000 (11:04 +0100)]
i965: perf: update configs for loading from userspace

When making configs loadable from userspace in the kernel, we left to
userspace more responsability around programming some registers. In
particular one register we use to set directly in the driver has now
been moved into the configs.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoutil: add mesa-sha1 test to meson
Eric Engestrom [Mon, 27 Nov 2017 11:33:48 +0000 (11:33 +0000)]
util: add mesa-sha1 test to meson

Fixes: 513d7ffa23d42e96f831 "util: Add a SHA1 unit test program"
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agocompiler: fix typo
Eric Engestrom [Fri, 24 Nov 2017 18:00:57 +0000 (18:00 +0000)]
compiler: fix typo

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agocompiler: use NDEBUG to guard asserts
Eric Engestrom [Thu, 23 Nov 2017 13:16:43 +0000 (13:16 +0000)]
compiler: use NDEBUG to guard asserts

nir_validate.c's #endif already had the correct NDEBUG comment

Fixes: dcb1acdea00a8f2c29777 "nir/validate: Only build in debug mode"
Fixes: 9ff71b649b4b3808a9e17 "i965/nir: Validate that NIR passes call nir_metadata_preserve()"
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agobroadcom: use NDEBUG to guard asserts
Eric Engestrom [Fri, 24 Nov 2017 17:59:23 +0000 (17:59 +0000)]
broadcom: use NDEBUG to guard asserts

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agovc4: check preprocessor token existence using #ifdef instead of #if
Eric Engestrom [Fri, 24 Nov 2017 16:58:43 +0000 (16:58 +0000)]
vc4: check preprocessor token existence using #ifdef instead of #if

(other uses of USE_VC4_SIMULATOR are already correct)

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agodocs/llvmpipe.html: Minor edits
Ben Crocker [Mon, 27 Nov 2017 19:44:59 +0000 (14:44 -0500)]
docs/llvmpipe.html: Minor edits

Language and spelling fixups in three places.

Cc: "17.2" "17.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Eric: move two fixes from the other patch to this one.]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agost/dri: replace hard-coded array size with ARRAY_SIZE()
Eric Engestrom [Fri, 24 Nov 2017 10:49:25 +0000 (10:49 +0000)]
st/dri: replace hard-coded array size with ARRAY_SIZE()

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi/gfx9: simplify condition for on-chip ESGS
Nicolai Hähnle [Thu, 16 Nov 2017 16:23:43 +0000 (17:23 +0100)]
radeonsi/gfx9: simplify condition for on-chip ESGS

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: clarify that si_shader_selector::esgs_itemsize is set for the ES part
Nicolai Hähnle [Sat, 18 Nov 2017 13:33:34 +0000 (14:33 +0100)]
radeonsi: clarify that si_shader_selector::esgs_itemsize is set for the ES part

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: use si_shader_context instead of lp_build_context in more places
Nicolai Hähnle [Thu, 16 Nov 2017 15:56:21 +0000 (16:56 +0100)]
radeonsi: use si_shader_context instead of lp_build_context in more places

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: cleanup si_initialize_color_surface
Nicolai Hähnle [Thu, 16 Nov 2017 06:33:34 +0000 (07:33 +0100)]
radeonsi: cleanup si_initialize_color_surface

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: avoid attempting to create CMASK if the tiling mode doesn't have it
Nicolai Hähnle [Sun, 19 Nov 2017 16:26:45 +0000 (17:26 +0100)]
radeonsi: avoid attempting to create CMASK if the tiling mode doesn't have it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoradeonsi: check that we don't leak fine.buf references
Nicolai Hähnle [Tue, 14 Nov 2017 08:37:38 +0000 (09:37 +0100)]
radeonsi: check that we don't leak fine.buf references

Just as an added precaution.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoac/surface: fix indentation
Nicolai Hähnle [Sun, 19 Nov 2017 15:09:28 +0000 (16:09 +0100)]
ac/surface: fix indentation

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoamd/common: sid.h cleanups
Nicolai Hähnle [Thu, 9 Nov 2017 09:59:22 +0000 (10:59 +0100)]
amd/common: sid.h cleanups

Fix a bunch of labels indicating when registers were added/removed
and normalize the SI-class GRBM_GFX_INDEX.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agost_glsl_to_tgsi: check for the tail sentinel in merge_two_dsts
Nicolai Hähnle [Fri, 17 Nov 2017 19:01:50 +0000 (20:01 +0100)]
st_glsl_to_tgsi: check for the tail sentinel in merge_two_dsts

This fixes yet another case where DFRACEXP has only one destination. Found
by address sanitizer.

Fixes tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-mantissa.shader_test

Fixes: 3b666aa74795 ("st/glsl_to_tgsi: fix DFRACEXP with only one destination")
Acked-by: Marek Olšák <marek.olsak@amd.com>
7 years agomesa/gles: adjust internal format in glTexSubImage2D error checks
Tapani Pälli [Mon, 20 Nov 2017 13:00:19 +0000 (15:00 +0200)]
mesa/gles: adjust internal format in glTexSubImage2D error checks

When floating point textures are created on OpenGL ES 2.0, driver
is free to choose used internal format. Mesa makes this decision in
adjust_for_oes_float_texture. Error checking for glTexImage2D properly
checks that sized formats are not used. We use same error checking
path for glTexSubImage2D (since there is lot of overlap), however since
those checks include internalFormat checks, we need to pass original
internalFormat passed by the client. Patch adds oes_float_internal_format
that does reverse adjust_for_oes_float_texture to get that format.

Fixes following test failure:
   ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

(when running test with MESA_GLES_VERSION_OVERRIDE=2.0)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227
Cc: "17.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>