mesa.git
2 years agoutil: skip AltiVec detection if built with -maltivec
Jan Beich [Mon, 16 Sep 2019 11:26:24 +0000 (11:26 +0000)]
util: skip AltiVec detection if built with -maltivec

Helps platforms where runtime detection isn't implemented.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
2 years agoutil: detect NEON at runtime on FreeBSD
Jan Beich [Mon, 16 Sep 2019 11:34:28 +0000 (11:34 +0000)]
util: detect NEON at runtime on FreeBSD

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
2 years agoutil: skip NEON detection if built with -mfpu=neon
Jan Beich [Mon, 16 Sep 2019 11:26:24 +0000 (11:26 +0000)]
util: skip NEON detection if built with -mfpu=neon

Helps platforms where runtime detection isn't implemented.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
2 years agoegl: Make native display detection work more than once
Adam Jackson [Wed, 9 Oct 2019 00:20:36 +0000 (20:20 -0400)]
egl: Make native display detection work more than once

eglGetDisplay is awful because you have to inspect the pointer you're
given and guess what type of native display it corresponds to. We make
it worse by caching the type of the first such display we detect, so if
the second call to eglGetDisplay is to a different display type, kaboom.

Fortunately this is a problem that can be solved with the delete key.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/156
2 years agoaco: enable nir_opt_sink
Rhys Perry [Wed, 18 Sep 2019 19:39:41 +0000 (20:39 +0100)]
aco: enable nir_opt_sink

SGPRS: 880272 -> 838936 (-4.70 %)
VGPRS: 705316 -> 680988 (-3.45 %)
Spilled SGPRs: 1032 -> 832 (-19.38 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 252 -> 252 (0.00 %) dwords per thread
Code Size: 55150788 -> 55172436 (0.04 %) bytes
LDS: 451 -> 451 (0.00 %) blocks
Max Waves: 66178 -> 68706 (3.82 %)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2 years agonir/sink: Don't sink load_ubo to outside of its defining loop
Connor Abbott [Wed, 25 Sep 2019 12:17:23 +0000 (14:17 +0200)]
nir/sink: Don't sink load_ubo to outside of its defining loop

Previously, this could have made the resource divergent in code like
that which is genereated by nir_lower_non_uniform_access.

Fixes: da8ed68a ('nir: replace nir_move_load_const() with nir_opt_sink()')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2 years agonir/sink: Rewrite loop handling logic
Connor Abbott [Wed, 25 Sep 2019 12:02:48 +0000 (14:02 +0200)]
nir/sink: Rewrite loop handling logic

Previously, for code like:
loop {
    loop {
        a = load_ubo()
    }
    use(a)
}
adjust_block_for_loops() would return the block before the first loop.
Now we compute the range of allowed blocks and then walk the dominance
tree directly, guaranteeing directly that we always choose a block that
dominates all the uses and is dominated by the definition.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2 years agoamd: don't use AMD_FAMILY definitions from amdgpu_drm.h
Marek Olšák [Wed, 9 Oct 2019 16:25:10 +0000 (12:25 -0400)]
amd: don't use AMD_FAMILY definitions from amdgpu_drm.h

use the ones from addrlib

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2 years agodocs: update calendar, add news item, and link release notes for 19.2.1
Dylan Baker [Wed, 9 Oct 2019 17:25:17 +0000 (10:25 -0700)]
docs: update calendar, add news item, and link release notes for 19.2.1

2 years agodocs: Add SHA256 sum for 19.2.1
Dylan Baker [Wed, 9 Oct 2019 17:19:16 +0000 (10:19 -0700)]
docs: Add SHA256 sum for 19.2.1

2 years agodocs: Add relnotes for 19.2.1
Dylan Baker [Wed, 9 Oct 2019 16:42:37 +0000 (09:42 -0700)]
docs: Add relnotes for 19.2.1

2 years agoaco: move s_andn2_b64 instructions out of the p_discard_if
Rhys Perry [Tue, 8 Oct 2019 12:40:17 +0000 (13:40 +0100)]
aco: move s_andn2_b64 instructions out of the p_discard_if

And use a new p_discard_early_exit instruction. This fixes some cases
where a definition having the same register as an operand causes issues.

v2: rename instruction to p_exit_early_if
v2: modify the existing instruction instead of creating a new one
v3: merge the "i == num - 1" IFs

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2 years agoaco: don't reorder instructions in order to lower boolean phis
Daniel Schürmann [Mon, 7 Oct 2019 00:52:55 +0000 (02:52 +0200)]
aco: don't reorder instructions in order to lower boolean phis

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
2 years agoaco: re-use existing phi instruction when lowering boolean phis
Daniel Schürmann [Mon, 7 Oct 2019 00:32:54 +0000 (02:32 +0200)]
aco: re-use existing phi instruction when lowering boolean phis

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
2 years agoaco: Cleanup insert_before_logical_end
Michael Schellenberger Costa [Mon, 12 Aug 2019 18:40:37 +0000 (20:40 +0200)]
aco: Cleanup insert_before_logical_end

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
2 years agolima/ppir: don't clone texture loads
Vasily Khoruzhick [Tue, 8 Oct 2019 03:11:46 +0000 (20:11 -0700)]
lima/ppir: don't clone texture loads

Cloning texture loads isn't a good idea since we may move it into
a block that is not shared between all the invocations of the shader.
We'd like to avoid that since it may result in undefined behavior.

Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2 years agogitlab-ci/lava: Add needs: for container image to test jobs
Michel Dänzer [Tue, 8 Oct 2019 15:50:07 +0000 (17:50 +0200)]
gitlab-ci/lava: Add needs: for container image to test jobs

Without this, the test jobs could spuriously run after the container
job failed or was cancelled, even if the build job didn't run at all.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2 years agoradv: bump minTexelBufferOffsetAlignment to 4
Samuel Pitoiset [Wed, 9 Oct 2019 08:37:04 +0000 (10:37 +0200)]
radv: bump minTexelBufferOffsetAlignment to 4

The spec has probably been misinterpreted during RADV bringup.

This fixes GPU hangs with dEQP-VK.binding_model.*offset_nonzero*.

Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2 years agometa: leak of shader program when decompressing tex-images
Sergii Romantsov [Thu, 18 Jul 2019 12:43:59 +0000 (15:43 +0300)]
meta: leak of shader program when decompressing tex-images

CC: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
2 years agomesa/main: prefer R8-textures instead of A8 for glBitmap in display lists
Erik Faye-Lund [Mon, 15 Jul 2019 10:03:43 +0000 (12:03 +0200)]
mesa/main: prefer R8-textures instead of A8 for glBitmap in display lists

This allows drivers to communicate that they prefer R8 textures rather
than A8 for glBitmap usage.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2 years agost/mesa: Prefer R8 for bitmap textures
Dave Airlie [Thu, 4 Oct 2018 01:41:26 +0000 (02:41 +0100)]
st/mesa: Prefer R8 for bitmap textures

If it's not available, we fall back to A8. This should work on all drivers,
because we depend on it in the display-list code already.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2 years agodrirc: enable vk_x11_override_min_image_count for DOOM
Samuel Pitoiset [Tue, 8 Oct 2019 08:30:03 +0000 (10:30 +0200)]
drirc: enable vk_x11_override_min_image_count for DOOM

DOOM fails to handle more images than expected when the adaptative
sync mode is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1902
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2 years agoradv: implement VK_KHR_shader_clock
Samuel Pitoiset [Mon, 7 Oct 2019 08:26:22 +0000 (10:26 +0200)]
radv: implement VK_KHR_shader_clock

NIR->LLVM and ACO already support nir_intrinsic_shader_clock.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2 years agoiris: Implement the Broadwell NP Z PMA Stall Fix
Kenneth Graunke [Wed, 25 Sep 2019 07:31:07 +0000 (00:31 -0700)]
iris: Implement the Broadwell NP Z PMA Stall Fix

This should help avoid stalls in the pixel mask array in certain
non-promoted depth cases.  It especially helps for Z16, as each bit
in the PMA corresponds to two pixels when using Z16, as opposed to
the usual one pixel.

Improves performance in GFXBench5 TRex by 22% (n=1).

2 years agodocs: Update recently enabled VK extensions on Intel
Caio Marcelo de Oliveira Filho [Tue, 8 Oct 2019 22:52:04 +0000 (15:52 -0700)]
docs: Update recently enabled VK extensions on Intel

2 years agoanv: Enable VK_EXT_shader_subgroup_{ballot,vote}
Caio Marcelo de Oliveira Filho [Thu, 22 Aug 2019 19:30:43 +0000 (12:30 -0700)]
anv: Enable VK_EXT_shader_subgroup_{ballot,vote}

Anvil now supports and passes Vulkan CTS tests matching

    dEQP-VK.subgroups.*.ext_shader_subgroup_ballot.*
    dEQP-VK.subgroups.*.ext_shader_subgroup_vote.*

and crucible tests matching

    func.shader-ballot.*
    func.shader-subgroup-vote.*

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agost/mesa: Fix inverted polygon stipple condition
Kenneth Graunke [Tue, 8 Oct 2019 22:20:19 +0000 (15:20 -0700)]
st/mesa: Fix inverted polygon stipple condition

Fixes Piglit's gl-2.1-polygon-stipple-fs on iris.

Fixes: 63f24c3c016 ("gallium: Enable MESA_framebuffer_flip_y")
Reviewed-by: Fritz Koenig <frkoenig@google.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2 years agogallium: Enable MESA_framebuffer_flip_y
Fritz Koenig [Tue, 30 Jul 2019 21:40:33 +0000 (14:40 -0700)]
gallium: Enable MESA_framebuffer_flip_y

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2 years agomesa: Allow MESA_framebuffer_flip_y for GLES 3
Fritz Koenig [Tue, 30 Jul 2019 21:53:30 +0000 (14:53 -0700)]
mesa: Allow MESA_framebuffer_flip_y for GLES 3

Implement glFramebufferParameteriMESA on GLES 3 so
that the extension is not dependant on GLES 3.1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2 years agomesa: GetFramebufferParameteriv spelling
Fritz Koenig [Mon, 7 Oct 2019 18:15:03 +0000 (11:15 -0700)]
mesa: GetFramebufferParameteriv spelling

GetFramebufferParameteriv was incorrectly spelled as
GetFramebufferParameteri.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2 years agoinclude/GLES2: Sync GLES2 headers with Khronos
Fritz Koenig [Mon, 7 Oct 2019 18:33:59 +0000 (11:33 -0700)]
include/GLES2: Sync GLES2 headers with Khronos

Bring in glFramebufferParameteriMESA/glGetFramebufferParameterivMESA

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2 years agoradeonsi: enable zerovram for Rocket League
Clément Guérin [Sat, 5 Oct 2019 03:05:09 +0000 (20:05 -0700)]
radeonsi: enable zerovram for Rocket League

Fixes corruption on game startup.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1888
Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
2 years agoiris: Properly unreference extra VBOs for draw parameters
Kenneth Graunke [Tue, 8 Oct 2019 17:11:52 +0000 (10:11 -0700)]
iris: Properly unreference extra VBOs for draw parameters

bound_vertex_buffers doesn't include extra draw parameters buffers.
Tracking this correctly is kind of complicated, and iris_destroy_state
isn't exactly in a hot path, so just loop over all VBO bindings.

Fixes: 4122665dd90 (iris: Enable ARB_shader_draw_parameters support)
Reported-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
2 years agomeson: fix sys/mkdev.h detection on Solaris
Eric Engestrom [Sat, 14 Sep 2019 21:18:32 +0000 (22:18 +0100)]
meson: fix sys/mkdev.h detection on Solaris

On Solaris, sys/sysmacros.h has long-deprecated copies of major() & minor()
but not makedev().
sys/mkdev.h has all three and is the preferred choice.

Let's make sure we check for all 3 major(), minor() and makedev().

Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2 years agoinclude: update drm-uapi
Eric Engestrom [Sat, 5 Oct 2019 07:30:44 +0000 (08:30 +0100)]
include: update drm-uapi

`drm.h` was missing a `#include <stdint.h>`, which was completely
breaking the non-linux builds after 272f9cfe6a19212354c8 ("dri: Use DRM_FORMAT_*
instead of defining our own copy.") started making use of it.

Fixes: 272f9cfe6a19212354c8 ("dri: Use DRM_FORMAT_* instead of defining our own copy.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/950
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoloader: Simplify handling of the radeonsi driver
Michel Dänzer [Mon, 7 Oct 2019 10:02:14 +0000 (12:02 +0200)]
loader: Simplify handling of the radeonsi driver

The list of AMD/ATI devices supported by radeon/r200/r300/r600 is
complete, so anything else must use radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2 years agoamd/llvm: Fix warning due to asserted-only variable.
Bas Nieuwenhuizen [Tue, 8 Oct 2019 01:41:50 +0000 (03:41 +0200)]
amd/llvm: Fix warning due to asserted-only variable.

[212/893] Compiling C object 'src/amd/llvm/ce8261c@@amd_common_llvm@sta/ac_nir_to_llvm.c.o'.
../mesa/src/amd/llvm/ac_nir_to_llvm.c: In function ‘visit_image_atomic’:
../mesa/src/amd/llvm/ac_nir_to_llvm.c:2636:17: warning: unused variable ‘format’ [-Wunused-variable]
 2636 |    const GLenum format = nir_intrinsic_format(instr);
      |                 ^~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2 years agopanfrost: Draw the wallpaper when only depth/stencil bufs are cleared
Boris Brezillon [Fri, 20 Sep 2019 06:55:54 +0000 (08:55 +0200)]
panfrost: Draw the wallpaper when only depth/stencil bufs are cleared

When only the depth/stencil bufs are cleared, we should make sure the
color content is reloaded into the tile buffers if we want to preserve
their content.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2 years agopanfrost: Make sure a clear does not re-use a pre-existing batch
Boris Brezillon [Thu, 19 Sep 2019 13:52:02 +0000 (15:52 +0200)]
panfrost: Make sure a clear does not re-use a pre-existing batch

glClear()s are expected to be the first thing GL apps do before drawing
new things. If there's already an existing batch targetting the same
FBO that has draws attached to it, we should make sure the new clear
gets a new batch assigned to guaranteed that the FB content is actually
cleared with the requested color/depth/stencil values.

We create a panfrost_get_fresh_batch_for_fbo() helper for that and
call it from panfrost_clear().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2 years agoiris: Update comment about 3-component formats and buffer textures
Kenneth Graunke [Mon, 7 Oct 2019 23:03:14 +0000 (16:03 -0700)]
iris: Update comment about 3-component formats and buffer textures

You can't render to PIPE_BUFFER so there's no reason to prefer RGBX.
PBO upload would like to use proper RGB textures as source data.

2 years agoiris: Allow packed RGB pbo uploads
Chris Wilson [Wed, 10 Jul 2019 19:18:38 +0000 (20:18 +0100)]
iris: Allow packed RGB pbo uploads

Hitting any fallback path on Broxton as we require clflushing the whole
buffer even for an upload of a subtexture. However, since gallium
provides a pbo upload path, allow it to sample packed RGB if supported.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoanv/android: fix images created with external format support
Tapani Pälli [Mon, 7 Oct 2019 06:07:48 +0000 (09:07 +0300)]
anv/android: fix images created with external format support

This fixes a case where user first creates image and then later binds it
with memory created from AHW buffer.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agomeson: Always add LLVM coroutines module.
Bas Nieuwenhuizen [Mon, 7 Oct 2019 15:34:22 +0000 (17:34 +0200)]
meson: Always add LLVM coroutines module.

It gets used by the gallium auxiliary draw module, which gets used
pretty much always when LLVM is used as JIT.

At the same time most builds don't hit the issue here because the
shared library of LLVM contains all modules.

Fixes: d32690b43c91 ("gallivm: add coroutine pass manager support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/951
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
2 years agoamd: Move all amd/common code that depends on LLVM to amd/llvm.
Timur Kristóf [Fri, 27 Sep 2019 08:29:51 +0000 (10:29 +0200)]
amd: Move all amd/common code that depends on LLVM to amd/llvm.

This commit is a step towards the goal of being able to build RADV
without LLVM. In the future we would like to offer the option to
use RADV solely with ACO. There is still a need for the common AMD
code located in amd/common but the LLVM specific parts need to be
separated.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2 years agonvc0: add support for GL_EXT_demote_to_helper_invocation
Ilia Mirkin [Wed, 2 Oct 2019 23:47:00 +0000 (19:47 -0400)]
nvc0: add support for GL_EXT_demote_to_helper_invocation

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2 years agogallium/tgsi: add support for DEMOTE and READ_HELPER opcodes
Ilia Mirkin [Wed, 2 Oct 2019 23:39:30 +0000 (19:39 -0400)]
gallium/tgsi: add support for DEMOTE and READ_HELPER opcodes

This mirrors the intrinsics in the GLSL IR. One could imagine an
alternate definition where reading the semantic would account for the
READ_HELPER functionality, but that feels potentially dodgy and could be
subject to CSE unpleasantness.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2 years agoradeonsi: use simple_mtx_t instead of mtx_t
Marek Olšák [Thu, 26 Sep 2019 17:37:45 +0000 (13:37 -0400)]
radeonsi: use simple_mtx_t instead of mtx_t

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agost/mesa: use simple_mtx_t instead of mtx_t
Marek Olšák [Thu, 26 Sep 2019 17:37:45 +0000 (13:37 -0400)]
st/mesa: use simple_mtx_t instead of mtx_t

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agogallium: add PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE to skip util_range lock
Marek Olšák [Thu, 26 Sep 2019 01:38:40 +0000 (21:38 -0400)]
gallium: add PIPE_RESOURCE_FLAG_SINGLE_THREAD_USE to skip util_range lock

u_upload_mgr sets it, so that util_range_add can skip the lock.

The time spent in tc_transfer_flush_region decreases from 0.8% to 0.2%
in torcs on radeonsi.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoutil: use simple_mtx_t for util_range
Marek Olšák [Thu, 26 Sep 2019 01:22:45 +0000 (21:22 -0400)]
util: use simple_mtx_t for util_range

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agowinsys/radeon: initialize SIMD properties in radeon_info
Marek Olšák [Mon, 30 Sep 2019 19:14:11 +0000 (15:14 -0400)]
winsys/radeon: initialize SIMD properties in radeon_info

This was missed when I added them.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1839
Fixes: 0692ae34e93 ("ac: move ac_get_num_physical_sgprs into radeon_info")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
2 years agoiris: Drop vtbl usage for some load_register calls
Kenneth Graunke [Mon, 7 Oct 2019 20:20:36 +0000 (13:20 -0700)]
iris: Drop vtbl usage for some load_register calls

We can just call the actual functions directly.

2 years agoiris/state: Move reg/mem load/store functions earlier in file
Jordan Justen [Fri, 4 Oct 2019 08:21:45 +0000 (01:21 -0700)]
iris/state: Move reg/mem load/store functions earlier in file

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2 years agomeson: drop unused inc_nir
Eric Engestrom [Tue, 24 Sep 2019 23:43:48 +0000 (00:43 +0100)]
meson: drop unused inc_nir

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: drop duplicate inc_nir from spirv2nir
Eric Engestrom [Tue, 24 Sep 2019 23:43:29 +0000 (00:43 +0100)]
meson: drop duplicate inc_nir from spirv2nir

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: drop duplicate inc_nir from libglsl
Eric Engestrom [Tue, 24 Sep 2019 23:43:13 +0000 (00:43 +0100)]
meson: drop duplicate inc_nir from libglsl

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: drop duplicate inc_nir from libiris
Eric Engestrom [Tue, 24 Sep 2019 23:39:22 +0000 (00:39 +0100)]
meson: drop duplicate inc_nir from libiris

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: rename libnir to _libnir to make it clear it's not meant to be used anywhere...
Eric Engestrom [Tue, 24 Sep 2019 23:44:21 +0000 (00:44 +0100)]
meson: rename libnir to _libnir to make it clear it's not meant to be used anywhere else

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: use idep_nir instead of libnir in pipe-loader
Eric Engestrom [Tue, 24 Sep 2019 23:38:02 +0000 (00:38 +0100)]
meson: use idep_nir instead of libnir in pipe-loader

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: use idep_nir instead of libnir in haiku softpipe
Eric Engestrom [Tue, 24 Sep 2019 23:37:20 +0000 (00:37 +0100)]
meson: use idep_nir instead of libnir in haiku softpipe

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: use idep_nir instead of libnir in gallium nine
Eric Engestrom [Tue, 24 Sep 2019 23:37:00 +0000 (00:37 +0100)]
meson: use idep_nir instead of libnir in gallium nine

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: use idep_nir instead of libnir in libclnir
Eric Engestrom [Tue, 24 Sep 2019 23:35:49 +0000 (00:35 +0100)]
meson: use idep_nir instead of libnir in libclnir

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: use idep_nir instead of libnir in libnouveau
Eric Engestrom [Tue, 24 Sep 2019 23:35:07 +0000 (00:35 +0100)]
meson: use idep_nir instead of libnir in libnouveau

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson: add missing idep_nir_headers in iris_gen_libs
Eric Engestrom [Wed, 25 Sep 2019 06:58:07 +0000 (07:58 +0100)]
meson: add missing idep_nir_headers in iris_gen_libs

Fixes: 4929f020c37eac5b07f9 ("iris: better SBE")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agoscript: drop get_reviewer.pl
Eric Engestrom [Mon, 30 Sep 2019 21:29:55 +0000 (22:29 +0100)]
script: drop get_reviewer.pl

This script doesn't make sense anymore in the age of GitLab.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agomeson/loader: drop unneeded *.h file
Eric Engestrom [Wed, 2 Oct 2019 12:43:21 +0000 (13:43 +0100)]
meson/loader: drop unneeded *.h file

Meson automatically tracks any file included by a file it already tracks,
and `pci_id_driver_map.h` & `loader.h` are included by `loader.c`, while
`loader_dri3_helper.h` is included by `loader_dri3_helper.c`.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoloader: use ARRAY_SIZE instead of NULL sentinel
Eric Engestrom [Wed, 2 Oct 2019 12:42:14 +0000 (13:42 +0100)]
loader: use ARRAY_SIZE instead of NULL sentinel

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoloader: s/int/bool/ for predicate result
Eric Engestrom [Wed, 2 Oct 2019 19:09:50 +0000 (20:09 +0100)]
loader: s/int/bool/ for predicate result

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoloader: replace int/1/0 with bool/true/false
Eric Engestrom [Wed, 2 Oct 2019 12:39:30 +0000 (13:39 +0100)]
loader: replace int/1/0 with bool/true/false

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoegl: replace MESA_EGL_NO_X11_HEADERS hack with upstream EGL_NO_X11
Eric Engestrom [Wed, 4 Sep 2019 12:19:32 +0000 (13:19 +0100)]
egl: replace MESA_EGL_NO_X11_HEADERS hack with upstream EGL_NO_X11

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2 years agoiris: Drop bonus parameters from iris_init_*_context()
Kenneth Graunke [Wed, 2 Oct 2019 14:25:17 +0000 (10:25 -0400)]
iris: Drop bonus parameters from iris_init_*_context()

Nothing uses vtbl or dbg, and screen is available from the batch.

2 years agonir/constant_folding: fold load_constant intrinsics
Rhys Perry [Wed, 4 Sep 2019 16:03:18 +0000 (17:03 +0100)]
nir/constant_folding: fold load_constant intrinsics

These can appear after loop unrolling.

v2: stylistic changes
v2: replace state->mem_ctx with state->shader
v2: add bounds checking
v3: use nir_intrinsic_range() for bounds checking
v3: fix issue where partially out-of-bounds reads are replaced with undefs
v4: fix merge conflicts during rebase
v5: split into two commits
v6: set constant_data to NULL after freeing (fixes nir_sweep()/Iris)
v7: don't remove the constant data if there are no constant loads

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (v6)
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2 years agonir/constant_folding: add back and use constant_fold_state
Rhys Perry [Thu, 26 Sep 2019 10:19:07 +0000 (11:19 +0100)]
nir/constant_folding: add back and use constant_fold_state

Useful for load_constant folding.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2 years agoanv: Implement VK_KHR_shader_clock
Caio Marcelo de Oliveira Filho [Fri, 19 Apr 2019 19:18:02 +0000 (12:18 -0700)]
anv: Implement VK_KHR_shader_clock

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agospirv: Implement SPV_KHR_shader_clock
Caio Marcelo de Oliveira Filho [Fri, 19 Apr 2019 19:15:16 +0000 (12:15 -0700)]
spirv: Implement SPV_KHR_shader_clock

We only have the subgroup variant in NIR (equivalent to clockARB), so
only support that for now.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agovulkan: Update the XML and headers to 1.1.124
Caio Marcelo de Oliveira Filho [Mon, 7 Oct 2019 15:19:20 +0000 (08:19 -0700)]
vulkan: Update the XML and headers to 1.1.124

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agoRevert "iris: Hack up a SKL/Gen9LP PS push constant fifo depth workaround"
Kenneth Graunke [Mon, 7 Oct 2019 16:08:41 +0000 (09:08 -0700)]
Revert "iris: Hack up a SKL/Gen9LP PS push constant fifo depth workaround"

This reverts commit 4f857423b3c095516e553b976b41969c2b9721fa.

It caused GPU hangs on all affected platforms, in e.g.
Piglit bin/stencil-twoside -auto -fbo.

2 years agogitlab-ci/lava: Fix image to use in test jobs
Tomeu Vizoso [Sun, 6 Oct 2019 16:12:00 +0000 (09:12 -0700)]
gitlab-ci/lava: Fix image to use in test jobs

In the test stage, we can use any of the two container images as we
arent going to do anything architecture-dependent when submitting the
jobs to LAVA.

But if we are in a pipeline in which the images need to be rebuilt and
one finishes much earlier than the other, it could happen that the test
job that executes first fails to find the container image.

To avoid that, have each job in the test stage to use the image that has
been already implicitly built by depending on the build job for the
given arch.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2 years agoRevert "Revert "st/dri2: Implement DRI2bufferDamageExtension""
Boris Brezillon [Mon, 7 Oct 2019 10:24:51 +0000 (12:24 +0200)]
Revert "Revert "st/dri2: Implement DRI2bufferDamageExtension""

This reverts commit 19546108d3dd5541a189e36df4ea83b3f519e48f.
This commit breaks the build because lima implements
->set_damage_region(). I guess we'll need more discussion before
removing the ->set_damage_region() hook.

2 years agoRevert "st/dri2: Implement DRI2bufferDamageExtension"
Boris Brezillon [Tue, 1 Oct 2019 14:24:27 +0000 (16:24 +0200)]
Revert "st/dri2: Implement DRI2bufferDamageExtension"

This reverts commit 492ffbed63a2a62759224b1c7d45aa7923d8f542.

BACK_LEFT attachment can be outdated when the user calls
KHR_partial_update(), leading to a damage region update on the
wrong pipe_resource object.
Let's not expose the ->set_damage_region() method until the core is
fixed to handle that properly.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
2 years agogitlab-ci: Move LAVA-related files into top-level ci dir
Tomeu Vizoso [Wed, 18 Sep 2019 14:43:30 +0000 (16:43 +0200)]
gitlab-ci: Move LAVA-related files into top-level ci dir

In preparation for testing drivers other than Panfrost in LAVA labs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2 years agogitlab-ci: Run dEQP on devices with Panfrost
Tomeu Vizoso [Wed, 18 Sep 2019 14:03:36 +0000 (16:03 +0200)]
gitlab-ci: Run dEQP on devices with Panfrost

Include Panfrost's gitlab.ci.yml file from Mesa's main .gitlab-ci.yml so
we test on devices with Panfrost.

This uses LAVA to schedule jobs in the devices and will be the base for
testing Etnaviv, Lima, etc.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2 years agoiris: Hack up a SKL/Gen9LP PS push constant fifo depth workaround
Kenneth Graunke [Sat, 5 Oct 2019 19:02:28 +0000 (15:02 -0400)]
iris: Hack up a SKL/Gen9LP PS push constant fifo depth workaround

This is a port of Nanley's 904c2a617d86944fbdc2c955f327aacd0b3df318
from i965 to iris.

One concern is that iris uses larger batches, and also emits far fewer
commands, so we may come closer to the 500 limit within a batch, and
could need to supplement this with actual counting.  Manhattan 3.0 had
239 3DSTATE_CONSTANT_PS packets in a batch,  Unigine Valley had 155.
So it seems like we're still in the realm of safety.

2 years agoiris: Refactor push constant allocation so we can reuse it
Kenneth Graunke [Sat, 5 Oct 2019 18:48:46 +0000 (14:48 -0400)]
iris: Refactor push constant allocation so we can reuse it

We'll need this for a workaround shortly.  While refactoring, also
improve the comment slightly.

2 years agointel/isl: set vertical surface alignment on null surfaces
Lionel Landwerlin [Fri, 4 Oct 2019 12:51:54 +0000 (15:51 +0300)]
intel/isl: set vertical surface alignment on null surfaces

Just following the spec. Somewhat unclear whether this applies to NULL
surfaces.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agointel/isl: set surface array appropriately
Lionel Landwerlin [Fri, 4 Oct 2019 12:47:49 +0000 (15:47 +0300)]
intel/isl: set surface array appropriately

This doesn't seem to affect anything.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agointel/isl: Set null surface format to R32_UINT
Lionel Landwerlin [Fri, 4 Oct 2019 10:12:44 +0000 (13:12 +0300)]
intel/isl: Set null surface format to R32_UINT

It appears we never had a test in piglit or deqp sampling from a null
surface...

It turns out this triggers a hang on IVB only. Updating the null
surface format to R32_UINT fixes the hang on ivb and doesn't affect
other platforms, so set it by default for all platforms.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1872
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoetnaviv: set texture INT_FILTER bit
Jonathan Marek [Thu, 12 Sep 2019 20:49:59 +0000 (16:49 -0400)]
etnaviv: set texture INT_FILTER bit

This should improve texture sampling performance on GC3000.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2 years agoetnaviv: implement texture comparator
Jonathan Marek [Thu, 12 Sep 2019 20:46:02 +0000 (16:46 -0400)]
etnaviv: implement texture comparator

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2 years agoetnaviv: update headers from rnndb
Jonathan Marek [Thu, 12 Sep 2019 20:41:22 +0000 (16:41 -0400)]
etnaviv: update headers from rnndb

Update to etna_viv commit 7ff8029.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2 years agointel: fix subslice computation from topology data
Lionel Landwerlin [Fri, 4 Oct 2019 16:37:14 +0000 (19:37 +0300)]
intel: fix subslice computation from topology data

We're missing the offset of the slice in the subslice mask...

This worked for most platforms that don't have first slice fused off
because we would reread the same mask from slice0 again and again...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c1900f5b0f ("intel: devinfo: add helper functions to fill fusing masks values")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1869
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
2 years agodri: Avoid swapbuffer throttling in glXCopySubBufferMESA
Kenneth Graunke [Thu, 3 Oct 2019 16:16:50 +0000 (12:16 -0400)]
dri: Avoid swapbuffer throttling in glXCopySubBufferMESA

We were supplying __DRI2_THROTTLE_SWAPBUFFER, rather than the obvious
choice of __DRI2_THROTTLE_COPYSUBBUFFER.  This meant that we hit the
swap-based frame throttling.  glXCopySubBuffer doesn't seem like it's
intended to be a frame boundary, so we'd like to avoid this throttling.

Tested-by: Michel Dänzer <mdaenzer@redhat.com> # DRI3 only
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2 years agost/dri: Perform MSAA downsampling for __DRI2_THROTTLE_COPYSUBBUFFER
Kenneth Graunke [Thu, 3 Oct 2019 16:11:22 +0000 (12:11 -0400)]
st/dri: Perform MSAA downsampling for __DRI2_THROTTLE_COPYSUBBUFFER

glXCopySubBufferMESA copies data from the back buffer to the front,
so it needs to perform a MSAA downsampling operation just like
glXSwapBuffers would.

Currently, the CopySubBuffer implementations supply a throttle reason
of __DRI2_THROTTLE_SWAPBUFFERS, so they hit this path and work today.
But we'd like to avoid swapbuffer throttling in this case, so the next
patch will change that reason.

Tested-by: Michel Dänzer <mdaenzer@redhat.com> # DRI3 only
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2 years agoscons/MSYS2-MinGW-W64: Fix build options defaults
Prodea Alexandru-Liviu [Sat, 5 Oct 2019 08:43:13 +0000 (08:43 +0000)]
scons/MSYS2-MinGW-W64: Fix build options defaults
Signed-off-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
When building in a MSYS2 Mingw-w64 environment Mesa3D sets wrong default build options which inevitably lead to build failure.

2 years agointel/error2aub: add support for platforms without PPGTT
Lionel Landwerlin [Thu, 3 Oct 2019 09:21:47 +0000 (12:21 +0300)]
intel/error2aub: add support for platforms without PPGTT

Not much to do to enable this, just make sure to always write to the
GGTT :)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoaco: fix load_constant with multiple arrays
Rhys Perry [Sat, 21 Sep 2019 15:36:32 +0000 (16:36 +0100)]
aco: fix load_constant with multiple arrays

I thought I fixed this, but I guess I must have broken it again.

Fixes various dEQP-VK.draw.* tests

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
2 years agonir: Fix some wonky whitespace in nir_search.h.
Eric Anholt [Mon, 16 Sep 2019 22:18:28 +0000 (15:18 -0700)]
nir: Fix some wonky whitespace in nir_search.h.

Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2 years agonir: Factor out most of the algebraic passes C code to .c/.h.
Eric Anholt [Mon, 23 Sep 2019 21:36:32 +0000 (14:36 -0700)]
nir: Factor out most of the algebraic passes C code to .c/.h.

Working on the algebraic implementation, I was being driven nuts by my
editor not highlighting and handling indentation for the C code.  It turns
out that it's basically not pass-specific code, and we can move it over to
the relevant .c file.  Replaces 30KB of code with 34KB of data on my i965
build.  No perf diff on shader-db (n=3)

Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2 years agonir: Keep the range analysis HT around intra-pass until we make a change.
Eric Anholt [Mon, 23 Sep 2019 22:40:46 +0000 (15:40 -0700)]
nir: Keep the range analysis HT around intra-pass until we make a change.

This lets us memoize range analysis work across instructions.  Reduces
runtime of shader-db on Intel by -30.0288% +/- 2.1693% (n=3).

Fixes: 405de7ccb6cb ("nir/range-analysis: Rudimentary value range analysis pass")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2 years agonir: Skip emitting no-op movs from the builder.
Eric Anholt [Mon, 16 Sep 2019 21:34:20 +0000 (14:34 -0700)]
nir: Skip emitting no-op movs from the builder.

Having passes generate these is just making more work for copy
propagation (and thus probably calling more optimization passes)
later.  Noticed while trying to debug nir_opt_algebraic()
top-to-bottom having O(n^2) behavior due to not finding new matches in
replacement code.

Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>