mesa.git
5 years agopan/midgard: Treat cubemaps "stores" as loads
Alyssa Rosenzweig [Fri, 16 Aug 2019 14:50:12 +0000 (07:50 -0700)]
pan/midgard: Treat cubemaps "stores" as loads

It's always been ambiguous which they are, but their primary register is
their output, not their input; therefore, they are loads.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Clamp cubemap swizzle to XYXX
Alyssa Rosenzweig [Fri, 16 Aug 2019 14:41:29 +0000 (07:41 -0700)]
pan/midgard: Clamp cubemap swizzle to XYXX

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Clamp st_vary swizzle by number of components
Alyssa Rosenzweig [Thu, 15 Aug 2019 23:53:03 +0000 (16:53 -0700)]
pan/midgard: Clamp st_vary swizzle by number of components

Same issue with liveness analysis. If we store out a vec3, we should not
reference the .w component.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Use type-appropriate swizzle for texture coordinate
Alyssa Rosenzweig [Thu, 15 Aug 2019 23:41:53 +0000 (16:41 -0700)]
pan/midgard: Use type-appropriate swizzle for texture coordinate

The texture coordinate for a 2D texture could be a vec2 or a vec3,
depending if it's an array texture or not. If it's vec2 (non-array
texture), we should not reference the z component; otherwise, liveness
analysis will get very confused when z is never written.

v2: Fix typo (Ilia).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Set mask for lowered read-hazard moves
Alyssa Rosenzweig [Thu, 15 Aug 2019 23:29:15 +0000 (16:29 -0700)]
pan/midgard: Set mask for lowered read-hazard moves

If we need to lower a move for a read from a vec2 texture coordinate, we
shouldn't write zw, even incidentally.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Fix texw lowering with complex control flow
Alyssa Rosenzweig [Thu, 15 Aug 2019 21:23:05 +0000 (14:23 -0700)]
pan/midgard: Fix texw lowering with complex control flow

Fixes shaders with control flow like:

   out = 0;

   if (A) {
      if (B)
         out = texture(A, ...)
   } else {
      out = texture(B, ...)
   }

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_rewrite_index_dst_single helper
Alyssa Rosenzweig [Thu, 15 Aug 2019 21:22:48 +0000 (14:22 -0700)]
pan/midgard: Add mir_rewrite_index_dst_single helper

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Print predecessors in MIR
Alyssa Rosenzweig [Thu, 15 Aug 2019 17:49:33 +0000 (10:49 -0700)]
pan/midgard: Print predecessors in MIR

Just as a sanity check.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Index blocks for printing
Alyssa Rosenzweig [Thu, 15 Aug 2019 17:43:56 +0000 (10:43 -0700)]
pan/midgard: Index blocks for printing

Better than having pointers flying about.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_foreach_src
Alyssa Rosenzweig [Thu, 15 Aug 2019 16:53:25 +0000 (09:53 -0700)]
pan/midgard: Add mir_foreach_src

This is repeated often enough.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_foreach_instr_in_block_rev
Alyssa Rosenzweig [Thu, 15 Aug 2019 16:51:13 +0000 (09:51 -0700)]
pan/midgard: Add mir_foreach_instr_in_block_rev

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_foreach_successor helper
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:48:34 +0000 (08:48 -0700)]
pan/midgard: Add mir_foreach_successor helper

Now we should be able to walk the control-flow graph naturally.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_foreach_predecessor utility
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:36:41 +0000 (08:36 -0700)]
pan/midgard: Add mir_foreach_predecessor utility

It's ugly, but c'est la vie.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Link exit block
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:23:48 +0000 (08:23 -0700)]
pan/midgard: Link exit block

The exit block has been 'dangling' in the successors graph, so let's
ensure it's linked in.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_exit_block helper
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:16:38 +0000 (08:16 -0700)]
pan/midgard: Add mir_exit_block helper

The exit block is gauranteed to be empty, signaling the end of the
program.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Maintain block predecessor set
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:11:10 +0000 (08:11 -0700)]
pan/midgard: Maintain block predecessor set

While we already compute the successors array, for backwards data flow
analysis, it is useful to walk the control flow graph backwards based on
predecessors, so let's compute that information as well.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Use ralloc on ctx/blocks
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:10:46 +0000 (08:10 -0700)]
pan/midgard: Use ralloc on ctx/blocks

This will allow us to get some level of automatic memory management.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Shrink successors[] to 2 length
Alyssa Rosenzweig [Thu, 15 Aug 2019 15:00:04 +0000 (08:00 -0700)]
pan/midgard: Shrink successors[] to 2 length

A block can't have more.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir: Add missing dependency in Android.nir.gen.mk
Roman Stratiienko [Wed, 14 Aug 2019 08:38:43 +0000 (11:38 +0300)]
nir: Add missing dependency in Android.nir.gen.mk

Fixes incremental build with Android

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agomeson: build lima tools as part of 'all' tools
Erico Nunes [Fri, 16 Aug 2019 13:19:59 +0000 (15:19 +0200)]
meson: build lima tools as part of 'all' tools

This is primarily so that this build gets tested in CI and we don't
break it again.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
5 years agoac/nir: Fix store_scratch with a non-full writemask
Connor Abbott [Fri, 16 Aug 2019 10:46:27 +0000 (12:46 +0200)]
ac/nir: Fix store_scratch with a non-full writemask

By adding one more helper to ac_llvm_build, we can also easily keep
vector stores together.

Fixes the
tests/spec/glsl-1.30/execution/fs-large-local-array-vec4.shader_test
piglit test.

Fixes: 74470baebbd ("ac/nir: Lower large indirect variables to scratch")
Reviewed-by: Marek Olšák <marek.olsak@amd.com
5 years agoglsl/standalone: init shader stage in init_gl_program()
Vasily Khoruzhick [Fri, 16 Aug 2019 05:17:26 +0000 (22:17 -0700)]
glsl/standalone: init shader stage in init_gl_program()

Otherwise lima standalone compiler fails when trying to compile fragment
shader with:

lima_compiler: ../src/compiler/nir/nir.c:55: nir_shader_create: Assertion `si->stage == stage' failed

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
5 years agoiris: Only request an input mask if the shader needs it
Jason Ekstrand [Fri, 16 Aug 2019 22:48:53 +0000 (17:48 -0500)]
iris: Only request an input mask if the shader needs it

Fixes: aebca3961b "iris: Fix handling of SIMD32 fragment shaders"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agogallium: add back YVU support
Xiong, James [Thu, 15 Aug 2019 17:02:52 +0000 (10:02 -0700)]
gallium: add back YVU support

PIPE_FORMAT_YV12 is not handled so switching to PIPE_FORMAT_IYUV and
adding back YVU support.

Signed-off-by: James Xiong <james.xiong@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agolima: actually wait for bo in lima_bo_wait
Erico Nunes [Wed, 14 Aug 2019 20:39:33 +0000 (22:39 +0200)]
lima: actually wait for bo in lima_bo_wait

PIPE_TIMEOUT_INFINITE is unsigned and gets assigned to signed fields
where it ends up as -1. When this reaches the kernel as a timeout it
gets translated as no timeout, which cause the waiting functions to
return immediately and not actually wait for a completion.

This seems to cause unstable results with lima where even piglit tests
randomly fail.

Handle this by setting the signed max value in case of infinite timeout.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
5 years agonir/algebraic: add a few masking-before-unpack optimizations
Rhys Perry [Thu, 11 Jul 2019 14:31:50 +0000 (15:31 +0100)]
nir/algebraic: add a few masking-before-unpack optimizations

Helps some Dawn of War 3 and F1 2017 shaders with ACO:
Totals from affected shaders:
SGPRS: 2136 -> 2128 (-0.37 %)
VGPRS: 1624 -> 1628 (0.25 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 168068 -> 164332 (-2.22 %) bytes
LDS: 44 -> 44 (0.00 %) blocks
Max Waves: 222 -> 221 (-0.45 %)
Wait states: 0 -> 0 (0.00 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agolima: fix compilation of standalone compiler
Vasily Khoruzhick [Thu, 15 Aug 2019 05:08:50 +0000 (22:08 -0700)]
lima: fix compilation of standalone compiler

Fixes: e0aeee946004("lima: add summary report for shader-db")
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
5 years agoRevert "radv/gfx10: Enable DCC for storage images."
Bas Nieuwenhuizen [Thu, 15 Aug 2019 23:13:00 +0000 (01:13 +0200)]
Revert "radv/gfx10: Enable DCC for storage images."

Quite useless without DCC for LAYOUT_GENERAL.

Fixes: b4dad3afaa0 Revert "radv: Do not decompress on LAYOUT_GENERAL."
Acked-by: Dave Airlie <airlied@redhat.com>
5 years agoRevert "radv: Do not decompress on LAYOUT_GENERAL."
Bas Nieuwenhuizen [Thu, 15 Aug 2019 23:06:55 +0000 (01:06 +0200)]
Revert "radv: Do not decompress on LAYOUT_GENERAL."

Causes issues with a bunch of games with DXVK.

Fixes: 50add1b33ae "radv: Do not decompress on LAYOUT_GENERAL."
Acked-by: Dave Airlie <airlied@redhat.com>
5 years agomesa: add support for CET to x86/x86-64 asm files.
Dave Airlie [Fri, 9 Aug 2019 03:25:56 +0000 (13:25 +1000)]
mesa: add support for CET to x86/x86-64 asm files.

Control-flow enforcement technology is a new instructions on x86
processors to denote where indirect jumps can land. Gcc auto adds
the instruction (which encodes as a NOP on older CPUs) to entrypoints
but assembler files need manual adding. This adds it to all the
entry points in the mesa x86/x86-64 assembler files.

This will only happen if mesa is built with the -fcf-protection flag
to gcc as some distros are wanting to do.

Acked-by: Eric Anholt <eric@anholt.net>
5 years agopan/bifrost: Manually constant fold register class
Alyssa Rosenzweig [Thu, 15 Aug 2019 14:03:35 +0000 (07:03 -0700)]
pan/bifrost: Manually constant fold register class

Fixes errors for some people building Mesa:

../src/panfrost/bifrost/bifrost_sched.c:32:31: error: initializer
element is not constant
 const unsigned max_vec2_reg = max_primary_reg / 2;

../src/panfrost/bifrost/bifrost_sched.c:33:31: error: initializer
element is not constant
 const unsigned max_vec3_reg = max_primary_reg / 4; // XXX: Do we need
to align vec3 to vec4 boundary?

../src/panfrost/bifrost/bifrost_sched.c:34:31: error: initializer
element is not constant
 const unsigned max_vec4_reg = max_primary_reg / 4;

../src/panfrost/bifrost/bifrost_sched.c:35:32: error: initializer
element is not constant
 const unsigned max_registers = max_primary_reg +

../src/panfrost/bifrost/bifrost_sched.c:40:28: error: initializer
element is not constant
 const unsigned vec2_base = primary_base + max_primary_reg;

../src/panfrost/bifrost/bifrost_sched.c:41:28: error: initializer
element is not constant
 const unsigned vec3_base = vec2_base + max_vec2_reg;

../src/panfrost/bifrost/bifrost_sched.c:42:28: error: initializer
element is not constant
 const unsigned vec4_base = vec3_base + max_vec3_reg;

../src/panfrost/bifrost/bifrost_sched.c:43:27: error: initializer
element is not constant
 const unsigned vec4_end = vec4_base + max_vec4_reg;

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agogallium/util: widen type before multiplication
Erik Faye-Lund [Tue, 13 Aug 2019 11:02:24 +0000 (13:02 +0200)]
gallium/util: widen type before multiplication

This method returns size_t, but the multiplication multiplies two
integers, leading to overflow rather than type widening.

Noticed by compiling with MSVC, which emits a warning.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agomesa: avoid warning on Windows
Erik Faye-Lund [Tue, 13 Aug 2019 11:01:42 +0000 (13:01 +0200)]
mesa: avoid warning on Windows

On Windows, p_atomic_inc_return returns an unsigned long long rather
than the type the pointer refers to, so let's make sure we cast the
result to the right type. Otherwise, we'll trigger a warning about
the wrong format-string for the type.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agowin32: unify strcasecmp definitions
Erik Faye-Lund [Thu, 8 Aug 2019 12:08:16 +0000 (14:08 +0200)]
win32: unify strcasecmp definitions

There was two incompatible definitions of strcasecmp, which lead to a
compiler warning. Let's clean this up by only leaving one of them, and
using that one all the time.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agomesa/main: avoid warning when casting offset to pointer
Erik Faye-Lund [Thu, 8 Aug 2019 12:01:57 +0000 (14:01 +0200)]
mesa/main: avoid warning when casting offset to pointer

This generates a warning on some 64-bit systems, so let's cast to a
properly sized integer first.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agonir: avoid warning when casting bogus pointer
Erik Faye-Lund [Thu, 8 Aug 2019 11:59:44 +0000 (13:59 +0200)]
nir: avoid warning when casting bogus pointer

This intentionally-bogus pointer generates a warning on some 64-bit
systems, so let's cast to a properly-sized integer first.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agoglsl: fixup u64-warning
Erik Faye-Lund [Mon, 5 Aug 2019 15:37:15 +0000 (17:37 +0200)]
glsl: fixup u64-warning

Similarly to the unsigned-version, we need to first cast the result to a
suiting integer before negating the number, otherwise we'll trigger a
warning.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agoisl: Enable Unorm Path in Color Pipe
Kenneth Graunke [Wed, 14 Aug 2019 20:54:55 +0000 (13:54 -0700)]
isl: Enable Unorm Path in Color Pipe

Improves performance on my Icelake 8x8 locked to 700Mhz.  For example,
some GfxBench5 subtests have the following results:

- [i965] gl_manhattan: ................ 7.01119% +/- 0.180971% (n=5)
- [i965] gl_4 (Car Chase):              4.24351% +/- 0.175622% (n=5)
- [i965] gl_blending:  ................ 3.36327% +/- 0.180267% (n=5)
- [i965] gl_5_normal (Aztec Ruins):     1.67962% +/- 0.243534% (n=10)
- [iris] gl_manhattan: ................ 3.92357% +/- 0.073965% (n=25)
- [iris] gl_4 (Car Chase):              2.17746% +/- 0.0826858% (n=5)
- [iris] gl_blending:  ................ 2.79599% +/- 0.803652% (n=15)
- [iris] gl_5_normal (Aztec Ruins):     1.30930% +/- 0.106523% (n=25)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agoanv: Properly initialize device->slice_hash.
Rafael Antognolli [Wed, 14 Aug 2019 22:13:55 +0000 (15:13 -0700)]
anv: Properly initialize device->slice_hash.

When subslices_delta == 0 and we take the early return,
device->slice_hash is not initialized on GEN11. It then causes a
segfault when going through anv_DestroyDevice, if compiled with
valgrind.

Fixes: 7bc022b4bbc ("anv/gen11: Emit SLICE_HASH_TABLE when pipes are
                    unbalanced.)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agointel/compiler: Fix resource leak in error path
Danylo Piliaiev [Tue, 13 Aug 2019 08:25:03 +0000 (11:25 +0300)]
intel/compiler: Fix resource leak in error path

CID: 1452261

Fixes: 04a99515 "intel/compiler: add ability to override shader's assembly"
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agopanfrost: Implement native RECT textures
Alyssa Rosenzweig [Wed, 14 Aug 2019 15:44:40 +0000 (08:44 -0700)]
panfrost: Implement native RECT textures

We started honouring the normalized_coords flag in the texture
descriptor, but a bisection revealed that broke RECT textures -- since
we were *also* lowering them in the shader. So just remove the
shader-based lowering, use native RECT textures, and enjoy the nominal
reduction in complexity and performance boost.

Fixes: 3e47a1181b7 ("panfrost: Add MALI_SAMP_NORM_COORDS flag")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Add R10G10B10A2_SSCALED vertex format
Alyssa Rosenzweig [Tue, 13 Aug 2019 17:27:09 +0000 (10:27 -0700)]
panfrost: Add R10G10B10A2_SSCALED vertex format

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Disassemble UBO index explicitly
Alyssa Rosenzweig [Tue, 13 Aug 2019 18:10:06 +0000 (11:10 -0700)]
pan/midgard: Disassemble UBO index explicitly

It's a bit of a special case but that's fine.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Account for unaligned UBOs when promoting uniforms
Alyssa Rosenzweig [Tue, 13 Aug 2019 16:27:43 +0000 (09:27 -0700)]
pan/midgard: Account for unaligned UBOs when promoting uniforms

We only know how to promote aligned accesses, although theoretically we
should be able to promote unaligned to swizzles in the future. Check
this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add mir_ubo_shift helper
Alyssa Rosenzweig [Tue, 13 Aug 2019 16:27:16 +0000 (09:27 -0700)]
pan/midgard: Add mir_ubo_shift helper

Different UBO reads have different shift requirements.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Address emit_ubo_read offset in bytes
Alyssa Rosenzweig [Tue, 13 Aug 2019 16:13:31 +0000 (09:13 -0700)]
pan/midgard: Address emit_ubo_read offset in bytes

We'll want to be smarter about unaligned reads, so let's get this code
all in one place.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Wire writemask into UBO reads
Alyssa Rosenzweig [Tue, 13 Aug 2019 16:11:48 +0000 (09:11 -0700)]
pan/midgard: Wire writemask into UBO reads

Helps the disassembly be clearer and maybe regalloc be smarter.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Identify UBO/SSBO op symmetry
Alyssa Rosenzweig [Tue, 13 Aug 2019 15:51:40 +0000 (08:51 -0700)]
pan/midgard: Identify UBO/SSBO op symmetry

It's the same thing, just shifted.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Extend blending to MRT
Alyssa Rosenzweig [Mon, 12 Aug 2019 23:14:03 +0000 (16:14 -0700)]
panfrost: Extend blending to MRT

Our hardware supports independent (per-RT) blending, but we need to
route those settings through from Gallium.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Emit store_output branch just-in-time
Alyssa Rosenzweig [Mon, 12 Aug 2019 19:36:46 +0000 (12:36 -0700)]
pan/midgard: Emit store_output branch just-in-time

We'll need multiple branches for MRT, so we can't defer. Also, we need
to track dependencies to ensure r0 is set to the correct value for each
store_output.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Add dont_eliminate flag
Alyssa Rosenzweig [Mon, 12 Aug 2019 22:29:03 +0000 (15:29 -0700)]
pan/midgard: Add dont_eliminate flag

We need to treat fragment writes specially.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/mfbd: Stuff in RT count
Alyssa Rosenzweig [Fri, 9 Aug 2019 22:12:30 +0000 (15:12 -0700)]
pan/mfbd: Stuff in RT count

Fixes DATA_INVALID_FAULTs with multiple render targets.

We do always allocate space for 4 cbufs just to keep things sane. This
may not be strictly necessary.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/decode: Dump FBD tagged pointer
Alyssa Rosenzweig [Mon, 12 Aug 2019 18:07:00 +0000 (11:07 -0700)]
pan/decode: Dump FBD tagged pointer

Turns out the rt count is stuffed in here..

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/decode: Decode invalid access type upon fault
Alyssa Rosenzweig [Fri, 9 Aug 2019 23:04:24 +0000 (16:04 -0700)]
pan/decode: Decode invalid access type upon fault

We don't have a good way to confirm this, but it parallels the kernel
definitons for MMU faults nicely.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/decode: Fix duplicate heap_end property
Alyssa Rosenzweig [Fri, 9 Aug 2019 21:56:30 +0000 (14:56 -0700)]
pan/decode: Fix duplicate heap_end property

This was supposed to read heap_start. It's the same value but still,
better get this right.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Note "MFBD preload disable" bit
Alyssa Rosenzweig [Wed, 14 Aug 2019 23:01:38 +0000 (16:01 -0700)]
panfrost: Note "MFBD preload disable" bit

It's a chicken bit, as far as I can tell. Buck buck.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Link in compiler
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:48:04 +0000 (12:48 -0700)]
pan/bifrost: Link in compiler

We enable the standalone compiler, build the new files, and let it
blast.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Check in remainder of the Bifrost compiler
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:46:35 +0000 (12:46 -0700)]
pan/bifrost: Check in remainder of the Bifrost compiler

What it says on the tin.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Add bifrost_print.c/h
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:36:30 +0000 (12:36 -0700)]
pan/bifrost: Add bifrost_print.c/h

IR printers.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Style format the disassembler
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:28:01 +0000 (12:28 -0700)]
pan/bifrost: Style format the disassembler

   $ astyle *.c *.h --style=linux -s8

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Stub out standalone compiler
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:21:23 +0000 (12:21 -0700)]
pan/bifrost: Stub out standalone compiler

We don't actually have a standalone compiler in-tree yet, but let's get
prepared for when we do.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/bifrost: Sync disassembler with Ryan's tree
Alyssa Rosenzweig [Wed, 14 Aug 2019 19:19:01 +0000 (12:19 -0700)]
pan/bifrost: Sync disassembler with Ryan's tree

The disassembler was updated to move common code with the compiler into
a shared header. Additional, some new ops and control registers relating
to rounding were added.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Remove standalone pandecode tool
Alyssa Rosenzweig [Wed, 14 Aug 2019 21:46:21 +0000 (14:46 -0700)]
panfrost: Remove standalone pandecode tool

Now that panwrap has gained the ability to trace directly without
dumping to the filesystem, there's no need to lug around this tool.

I can assure you nobody will miss it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Fix disassembly termination condition
Alyssa Rosenzweig [Wed, 14 Aug 2019 21:42:07 +0000 (14:42 -0700)]
pan/midgard: Fix disassembly termination condition

Fixes: 863bdd1f8dc ("pan/midgard: Break, not return, in disassembler")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Ensure we upload at least 1 blend RT
Alyssa Rosenzweig [Wed, 14 Aug 2019 21:41:49 +0000 (14:41 -0700)]
panfrost: Ensure we upload at least 1 blend RT

Otherwise we'll get memory junk.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Zero tripipe on initialize
Alyssa Rosenzweig [Wed, 14 Aug 2019 21:21:02 +0000 (14:21 -0700)]
panfrost: Zero tripipe on initialize

I don't think the hardware cares, but this adds a lot of noise to traces
that we would rather not need to look at.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Improve disassembler robustness
Alyssa Rosenzweig [Wed, 14 Aug 2019 21:11:54 +0000 (14:11 -0700)]
pan/midgard: Improve disassembler robustness

Some memory corruption / etc issues let to an accidental "fuzzing" of
the disassembler ;) This uncovered some issues leading to a disassembler
hang, so let's fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/decode: Split public.h out
Alyssa Rosenzweig [Wed, 14 Aug 2019 20:52:03 +0000 (13:52 -0700)]
pan/decode: Split public.h out

We want a defined ABI for tracing; this set of functions should be as
small as strictly necessary to minimize panwrap shenanigans.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/decode: Prefer uint64_t to mali_ptr
Alyssa Rosenzweig [Wed, 14 Aug 2019 20:21:21 +0000 (13:21 -0700)]
pan/decode: Prefer uint64_t to mali_ptr

This removes an unwanted dependency on panfrost-job.h

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Allocate spill_slot once
Alyssa Rosenzweig [Tue, 13 Aug 2019 22:59:41 +0000 (15:59 -0700)]
pan/midgard: Allocate spill_slot once

Multiple spill moves share a single spill slot. Issue found in Krita.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Use hint on midgard_instruction for spill_move
Alyssa Rosenzweig [Tue, 13 Aug 2019 22:58:49 +0000 (15:58 -0700)]
pan/midgard: Use hint on midgard_instruction for spill_move

This allows us to have multiple spill moves, whereas otherwise for N
spill moves, the first N-1 would be clobbered. Issue found in Krita.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopanfrost: Remove panfrost_add_dependency asserts
Alyssa Rosenzweig [Tue, 13 Aug 2019 20:08:52 +0000 (13:08 -0700)]
panfrost: Remove panfrost_add_dependency asserts

It doesn't... make a ton of sense to need to assert and this routine is
hotter than you might expect. Doesn't matter for release builds, of
course.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agoradeonsi: add support for Renoir
Marek Olšák [Wed, 2 Jan 2019 20:50:13 +0000 (15:50 -0500)]
radeonsi: add support for Renoir

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agomeson: add nir tests to the compiler/nir test suite
Eric Engestrom [Fri, 19 Jul 2019 23:42:13 +0000 (00:42 +0100)]
meson: add nir tests to the compiler/nir test suite

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agoEGL: sync headers with Khronos
Eric Engestrom [Thu, 8 Aug 2019 10:13:43 +0000 (11:13 +0100)]
EGL: sync headers with Khronos

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agorelnotes: Add new ext on etnaviv for 19.2.
Christian Gmeiner [Wed, 14 Aug 2019 07:37:35 +0000 (09:37 +0200)]
relnotes: Add new ext on etnaviv for 19.2.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoetnaviv: fix weird indentation
Christian Gmeiner [Wed, 14 Aug 2019 13:23:15 +0000 (15:23 +0200)]
etnaviv: fix weird indentation

Fixes: 797a2e4fd03 ("etnaviv: update logic to determine uniform limits")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agonir/algebraic: Reassociate shift-by-constant of shift-by-constant
Ian Romanick [Tue, 6 Aug 2019 20:11:56 +0000 (13:11 -0700)]
nir/algebraic: Reassociate shift-by-constant of shift-by-constant

v2: After some review discussion with Alyssa, the replacements now
correct account for cases where (b+c) >= bitsize.

v3: Use a temporary to simplify the Python code quite a bit.  Suggested
by Jason.

Haswell and all Gen8+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 16251155 -> 16249576 (<.01%)
instructions in affected programs: 232627 -> 231048 (-0.68%)
helped: 547
HURT: 1
helped stats (abs) min: 1 max: 15 x̄: 2.89 x̃: 3
helped stats (rel) min: 0.04% max: 7.84% x̄: 1.14% x̃: 1.06%
HURT stats (abs)   min: 2 max: 2 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 0.12% max: 0.12% x̄: 0.12% x̃: 0.12%
95% mean confidence interval for instructions value: -3.12 -2.65
95% mean confidence interval for instructions %-change: -1.20% -1.06%
Instructions are helped.

total cycles in shared programs: 365924392 -> 365372103 (-0.15%)
cycles in affected programs: 59207053 -> 58654764 (-0.93%)
helped: 497
HURT: 34
helped stats (abs) min: 1 max: 29300 x̄: 1118.16 x̃: 16
helped stats (rel) min: <.01% max: 10.59% x̄: 1.82% x̃: 1.82%
HURT stats (abs)   min: 2 max: 424 x̄: 101.03 x̃: 63
HURT stats (rel)   min: 0.07% max: 46.17% x̄: 4.72% x̃: 2.06%
95% mean confidence interval for cycles value: -1426.41 -653.77
95% mean confidence interval for cycles %-change: -1.66% -1.15%
Cycles are helped.

total spills in shared programs: 8870 -> 8871 (0.01%)
spills in affected programs: 104 -> 105 (0.96%)
helped: 0
HURT: 1

Ivy Bridge and all pre-Gen7 platforms had similar results. (Ivy Bridge shown)
total instructions in shared programs: 11956236 -> 11955635 (<.01%)
instructions in affected programs: 94110 -> 93509 (-0.64%)
helped: 106
HURT: 0
helped stats (abs) min: 1 max: 14 x̄: 5.67 x̃: 4
helped stats (rel) min: 0.12% max: 4.71% x̄: 1.96% x̃: 0.76%
95% mean confidence interval for instructions value: -6.62 -4.72
95% mean confidence interval for instructions %-change: -2.27% -1.64%
Instructions are helped.

total cycles in shared programs: 179296340 -> 178788044 (-0.28%)
cycles in affected programs: 51009603 -> 50501307 (-1.00%)
helped: 82
HURT: 7
helped stats (abs) min: 5 max: 27820 x̄: 6199.00 x̃: 16
helped stats (rel) min: 0.30% max: 8.16% x̄: 2.58% x̃: 3.11%
HURT stats (abs)   min: 2 max: 8 x̄: 3.14 x̃: 2
HURT stats (rel)   min: 0.02% max: 1.40% x̄: 0.34% x̃: 0.10%
95% mean confidence interval for cycles value: -7649.38 -3773.00
95% mean confidence interval for cycles %-change: -2.71% -1.99%
Cycles are helped.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> [v2]
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir/algebraic: Reassociate add-and-shift to be shift-and-add
Ian Romanick [Wed, 10 Jul 2019 23:28:38 +0000 (16:28 -0700)]
nir/algebraic: Reassociate add-and-shift to be shift-and-add

A common thing in many shaders:

    uniform vs { vec4 bones[...]; };

    ...

    x = some_calculation(bones[i + 0]);
    y = some_calculation(bones[i + 1]);
    z = some_calculation(bones[i + 2]);

This turns into stuff like

    vec1 32 ssa_12 = iadd ssa_11, ssa_0
    vec1 32 ssa_13 = ishl ssa_12, ssa_3
    vec1 32 ssa_14 = intrinsic load_ssbo (ssa_7, ssa_13) (16, 4, 0)
    vec1 32 ssa_15 = iadd ssa_11, ssa_1
    vec1 32 ssa_16 = ishl ssa_15, ssa_3
    vec1 32 ssa_17 = intrinsic load_ssbo (ssa_7, ssa_16) (16, 4, 0)
    vec1 32 ssa_18 = iadd ssa_11, ssa_2
    vec1 32 ssa_19 = ishl ssa_18, ssa_3
    vec1 32 ssa_20 = intrinsic load_ssbo (ssa_7, ssa_19) (16, 4, 0)

By reassociating the shift and the add, we can reduce this to

    vec1 32 ssa_12 = ishl ssa_11, ssa_3
    vec1 32 ssa_13 = iadd ssa_12, ssa_0
    vec1 32 ssa_14 = intrinsic load_ssbo (ssa_7, ssa_13) (16, 4, 0)
    vec1 32 ssa_16 = iadd ssa_12, ssa_1
    vec1 32 ssa_17 = intrinsic load_ssbo (ssa_7, ssa_16) (16, 4, 0)
    vec1 32 ssa_19 = iadd ssa_12, ssa_2
    vec1 32 ssa_20 = intrinsic load_ssbo (ssa_7, ssa_19) (16, 4, 0)

v2: Add some commentary from Rhys Perry's nearly identical patch.

All Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 16277758 -> 16250704 (-0.17%)
instructions in affected programs: 1440284 -> 1413230 (-1.88%)
helped: 4920
HURT: 6
helped stats (abs) min: 1 max: 69 x̄: 5.50 x̃: 4
helped stats (rel) min: 0.10% max: 18.33% x̄: 2.21% x̃: 1.79%
HURT stats (abs)   min: 1 max: 12 x̄: 4.50 x̃: 3
HURT stats (rel)   min: 0.18% max: 3.23% x̄: 1.91% x̃: 2.55%
95% mean confidence interval for instructions value: -5.67 -5.31
95% mean confidence interval for instructions %-change: -2.26% -2.16%
Instructions are helped.

total cycles in shared programs: 367118526 -> 365895358 (-0.33%)
cycles in affected programs: 93504145 -> 92280977 (-1.31%)
helped: 2754
HURT: 1269
helped stats (abs) min: 1 max: 47039 x̄: 460.66 x̃: 16
helped stats (rel) min: <.01% max: 34.93% x̄: 3.77% x̃: 1.12%
HURT stats (abs)   min: 1 max: 1500 x̄: 35.85 x̃: 9
HURT stats (rel)   min: 0.01% max: 17.35% x̄: 2.18% x̃: 0.75%
95% mean confidence interval for cycles value: -387.31 -220.78
95% mean confidence interval for cycles %-change: -2.11% -1.68%
Cycles are helped.

LOST:   1
GAINED: 1

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir/find_array_copies: Reject copies with mismatched lengths
Andrii Simiklit [Wed, 7 Aug 2019 10:56:38 +0000 (13:56 +0300)]
nir/find_array_copies: Reject copies with mismatched lengths

copy_deref for wildcard dereferences requires the same
arrays lengths otherwise it leads to a crash in optimizations
like 'nir_opt_copy_prop_vars' because these optimizations expect
'copy_deref' just for arrays with the same lengths.

v2: check was moved to 'try_match_deref' to fix aoa cases
                 (Jason Ekstrand <jason@jlekstrand.net>)
v3: -fixed comment
    -the condition merged with other one
                 (Jason Ekstrand <jason@jlekstrand.net>)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111286
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
5 years agopan/midgard: Prefix blobber-db output for grepping
Alyssa Rosenzweig [Wed, 14 Aug 2019 16:19:54 +0000 (09:19 -0700)]
pan/midgard: Prefix blobber-db output for grepping

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agopan/midgard: Implement blobber-db
Alyssa Rosenzweig [Wed, 14 Aug 2019 16:11:55 +0000 (09:11 -0700)]
pan/midgard: Implement blobber-db

We wire through some shader-db-style stats on the current shader in the
disassemble so we can get a quick estimate of shader complexity from a
trace.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Rob Clark <robdclark@chromium.org>
5 years agopan/midgard: Break, not return, in disassembler
Alyssa Rosenzweig [Wed, 14 Aug 2019 16:11:17 +0000 (09:11 -0700)]
pan/midgard: Break, not return, in disassembler

We'll want to dump some stats after the shader, and I refuse to use one
teensy little goto.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
5 years agonir/range-analysis: Fail gracefully on non-SSA sources
Ian Romanick [Mon, 12 Aug 2019 22:47:35 +0000 (15:47 -0700)]
nir/range-analysis: Fail gracefully on non-SSA sources

Tested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agoetnaviv: split destroy_shader
Christian Gmeiner [Mon, 12 Aug 2019 16:40:17 +0000 (18:40 +0200)]
etnaviv: split destroy_shader

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoetnaviv: split link_shader
Christian Gmeiner [Mon, 12 Aug 2019 13:18:20 +0000 (15:18 +0200)]
etnaviv: split link_shader

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoetnaviv: split dump_shader
Christian Gmeiner [Wed, 14 Aug 2019 08:06:17 +0000 (10:06 +0200)]
etnaviv: split dump_shader

Also this adds the missing impl for etna_dump_shader_nir(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoetnaviv: mv etnaviv_compiler.c etnaviv_compiler_tgsi.c
Christian Gmeiner [Wed, 14 Aug 2019 08:00:27 +0000 (10:00 +0200)]
etnaviv: mv etnaviv_compiler.c etnaviv_compiler_tgsi.c

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
5 years agoetnaviv: correct PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE handling
Christian Gmeiner [Wed, 14 Aug 2019 09:56:02 +0000 (11:56 +0200)]
etnaviv: correct PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE handling

Have a correct answer to GL_MAX_FRAGMENT_UNIFORM_VECTORS and
GL_MAX_VERTEX_UNIFORM_VECTORS.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach l.stach@pengutronix.de
5 years agoetnaviv: update logic to determine uniform limits
Christian Gmeiner [Wed, 14 Aug 2019 09:39:13 +0000 (11:39 +0200)]
etnaviv: update logic to determine uniform limits

Taken 1:1 from the header file.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach l.stach@pengutronix.de
5 years agoetnaviv: put uniform limit determination into own function
Christian Gmeiner [Wed, 14 Aug 2019 09:32:50 +0000 (11:32 +0200)]
etnaviv: put uniform limit determination into own function

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach l.stach@pengutronix.de
5 years agoetnaviv: Use reentrant screen lock around flush
Marek Vasut [Mon, 3 Jun 2019 22:22:49 +0000 (00:22 +0200)]
etnaviv: Use reentrant screen lock around flush

The flush callback may be called on the same pipe context, and thus
the same stream, from two different threads of execution. However,
etna_cmd_stream_flush{,2}() must not be called on the same stream
from two different threads of execution as that would mess up the
etna_bo refcounting and likely have other ugly side effects.

Fix this by using a reentrant screen lock around the flush callback.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: Add valgrind support
Marek Vasut [Sat, 8 Jun 2019 22:18:29 +0000 (00:18 +0200)]
etnaviv: Add valgrind support

Add Valgrind support for etnaviv to track BO leaks.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: Use hash table to track BO indexes
Marek Vasut [Mon, 3 Jun 2019 17:49:14 +0000 (19:49 +0200)]
etnaviv: Use hash table to track BO indexes

Use hash table instead of ad-hoc arrays.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agoetnaviv: Fix double-free in etna_bo_cache_free()
Marek Vasut [Sat, 1 Jun 2019 23:07:28 +0000 (01:07 +0200)]
etnaviv: Fix double-free in etna_bo_cache_free()

The following situation can happen in a multithreaded OpenGL application.
A BO is submitted from etna_cmd_stream #1 with flags set for read.
A BO is submitted from etna_cmd_stream #2 with flags set for write.
This triggers a flush on stream #1 and clears the BO's current_stream
pointer. If at this point, stream #2 attempts to queue BO again, which
does happen, the BO will be added to the submit list twice. The Linux
kernel driver correctly detects this and warns about it with "BO at
index %u already on submit list" kernel message.

However, when cleaning the BO cache in etna_bo_cache_free(), the BO
which was submitted twice will also be free()d twice, this triggering
a glibc double free detector.

The fix is easy, even if the BO does not have current_stream set,
iterate over current streams' list of BOs before adding the BO to it
and verify that the BO is not yet there.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
5 years agokmsro: Add missing definitions to Android.mk
Roman Stratiienko [Tue, 6 Aug 2019 10:29:06 +0000 (13:29 +0300)]
kmsro: Add missing definitions to Android.mk

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
Reviewed-by: Rob Herring robh@kernel.org
5 years agosoftpipe: Add support for ARB_derivative_control
Gert Wollny [Tue, 13 Aug 2019 16:08:34 +0000 (18:08 +0200)]
softpipe: Add support for ARB_derivative_control

Enables and passes piglits:

spec/ARB_drivative_control/
        dfdx-coarse
        dfdx-dfdy
        dfdx-fine
        dfdy-coarse
        dfdy-fine

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agolima/ppir: print srcs and dests in ppir_node_print_prog()
Vasily Khoruzhick [Fri, 2 Aug 2019 04:27:17 +0000 (21:27 -0700)]
lima/ppir: print srcs and dests in ppir_node_print_prog()

Now we have an accessors for ppir src, so it's possible to easily
print all srcs and dests while dumping ppir representation.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
5 years agolima/ppir: use src accessors in ppir regalloc
Vasily Khoruzhick [Fri, 2 Aug 2019 05:04:34 +0000 (22:04 -0700)]
lima/ppir: use src accessors in ppir regalloc

Get rid of most switch/case by using src accessors

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
5 years agolima/ppir: add ppir_node to ppir_src
Vasily Khoruzhick [Wed, 24 Jul 2019 22:29:34 +0000 (15:29 -0700)]
lima/ppir: add ppir_node to ppir_src

We'll need it if we want to walk through node sources

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>