mesa.git
5 years agomeson: disable graw tests on mingw
Dylan Baker [Wed, 23 May 2018 00:22:45 +0000 (17:22 -0700)]
meson: disable graw tests on mingw

I can't figure out why symbols are being exposed that shouldn't.

v2: - change comment to FIXME

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: don't build gallium trivial tests on windows
Dylan Baker [Wed, 23 May 2018 00:06:35 +0000 (17:06 -0700)]
meson: don't build gallium trivial tests on windows

They require the pipe-loaders, which require xmlconfig, which doesn't
build with msvc.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Set visibility and compat args for graw
Dylan Baker [Wed, 23 May 2018 00:06:09 +0000 (17:06 -0700)]
meson: Set visibility and compat args for graw

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Add msvc compat args to util/tests
Dylan Baker [Tue, 22 May 2018 22:00:35 +0000 (15:00 -0700)]
meson: Add msvc compat args to util/tests

To keep this building with msvc

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Add idep_getopt for tests
Dylan Baker [Tue, 22 May 2018 21:57:14 +0000 (14:57 -0700)]
meson: Add idep_getopt for tests

There are quite a few tests that require getopt, when using MSVC we need
to use the bundled version of getopt since there isn't a system version.

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: don't define USE_ELF_TLS for windows
Dylan Baker [Tue, 22 May 2018 21:08:36 +0000 (14:08 -0700)]
meson: don't define USE_ELF_TLS for windows

Because the macros for exporting dll symbols and using TLS are mutually
exclusive.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: add switches for SWR with MSVC
Dylan Baker [Tue, 22 May 2018 17:54:12 +0000 (10:54 -0700)]
meson: add switches for SWR with MSVC

This makes two changes for SWR,

The first is that it reorders the arguments to try to put the ICL ones
first. This is required to support older versions of meson that don't
add enough "error in this case" switches to ICL, which causes it to
happy accept -mavx (for example) even though it doesn't support them,
resulting in compilation failures.

The second is to fix the names of the libraries, setting the soversion
to '' will result in <lib>.dll, instead of <lib>-0.dll. Since these are
not versioned dll's, but implement an internal API we should communicate
that. It's also what scons does.

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: disable sse4.1 optimizations with msvc
Dylan Baker [Thu, 17 May 2018 21:45:10 +0000 (14:45 -0700)]
meson: disable sse4.1 optimizations with msvc

There isn't an obvious command line switch here, /arch:AVX *might* be
the right thing, but meson doesn't know what to do here either and
leaves the -msse4.1 and -mstackrealign.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: force inclusion of inttypes.h for glcpp with msvc
Dylan Baker [Wed, 23 May 2018 17:05:20 +0000 (10:05 -0700)]
meson: force inclusion of inttypes.h for glcpp with msvc

Because we provide a copy if MSVC doesn't, and we need it to make flex
do what we want.

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Add support for using win_flex and win_bison on windows
Dylan Baker [Thu, 17 May 2018 20:42:50 +0000 (13:42 -0700)]
meson: Add support for using win_flex and win_bison on windows

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: don't look for rt on windows
Dylan Baker [Thu, 17 May 2018 20:32:12 +0000 (13:32 -0700)]
meson: don't look for rt on windows

v6: - Minor refactor

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: fix pipe-loader compilation for windows
Dylan Baker [Thu, 17 May 2018 18:52:26 +0000 (11:52 -0700)]
meson: fix pipe-loader compilation for windows

v2: - Add missing D to pound define
    - Simply define the variable rather than set it to 1 (mirrors
      android.mk not scons)

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoutil/xmlconfig: include strndup.h for windows
Dylan Baker [Thu, 17 May 2018 18:33:35 +0000 (11:33 -0700)]
util/xmlconfig: include strndup.h for windows

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Don't check for posix_memalign on windows
Dylan Baker [Wed, 18 Apr 2018 20:54:12 +0000 (13:54 -0700)]
meson: Don't check for posix_memalign on windows

There's a mingw bug for this, it exports __builtin_posix_memalign but
not posix_memalign, so the check will succeed, but compiling will fail.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: fix gallium-osmesa to build for windows
Dylan Baker [Wed, 18 Apr 2018 20:29:26 +0000 (13:29 -0700)]
meson: fix gallium-osmesa to build for windows

v2: - set so_version to '' (only affects windows)
    - always set lib prefix to 'lib', even on msvc
v5: - key NO_EXPORTS on shared glapi instead of gles.

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: build graw-gdi target
Dylan Baker [Wed, 18 Apr 2018 20:29:04 +0000 (13:29 -0700)]
meson: build graw-gdi target

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: build libgl-gdi target
Dylan Baker [Wed, 18 Apr 2018 20:28:38 +0000 (13:28 -0700)]
meson: build libgl-gdi target

v4: - Fix check for broken mingw (should be for x86 not x86_64)
    - Add comment about why check is needed

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: build wgl state tracker
Dylan Baker [Wed, 18 Apr 2018 20:28:04 +0000 (13:28 -0700)]
meson: build wgl state tracker

v4: - Handle enable gles properly
    - Add comments about what various #defines do
v5: - key NO_EXPORTS on shared glapi instead of gles.

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: build gallium gdi winsys
Dylan Baker [Wed, 18 Apr 2018 20:27:13 +0000 (13:27 -0700)]
meson: build gallium gdi winsys

v6: - use null_dep instead of []

Reviewed-by: Eric Anholt <eric@anholt.net> (v5)
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Add necessary defines for mesa_gallium on windows
Dylan Baker [Wed, 18 Apr 2018 20:23:48 +0000 (13:23 -0700)]
meson: Add necessary defines for mesa_gallium on windows

v4: - Retain scons comments for windows specific defines
v5: - key GLAPI_NO_EXPORTS off of shared-glapi instead of gles

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agomeson: Add windows defines to glapi
Dylan Baker [Wed, 18 Apr 2018 20:22:35 +0000 (13:22 -0700)]
meson: Add windows defines to glapi

These are needed to control the export or symbols due to differences
between the way windows and *nix handle symbol exports.

Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
v5: - key NO_EXPORT off of shared-glapi instead of gles

5 years agomeson: add windows compiler checks and libraries
Dylan Baker [Wed, 18 Apr 2018 20:19:54 +0000 (13:19 -0700)]
meson: add windows compiler checks and libraries

v4: - Fix typo in warning code (4246 -> 4267)
    - Copy comments from scons for what MSVC warnings codes do
    - Merge linker argument changes into this commit
v5: - Add /GR- on windows if LLVM is build without rtti (equivalent to
      GCc's -fno-rtti')
    - Add /wd4291, which is catching the same hting that
    -Wno-non-virtual-dtor is on GCC/Clang

Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agoutil: use _WIN32 instead of WIN32
Dylan Baker [Thu, 19 Sep 2019 18:04:21 +0000 (11:04 -0700)]
util: use _WIN32 instead of WIN32

MinGW defines only _WIN32, but doesn't have fcntl, so we need to use the
windows path.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
5 years agofreedreno/ir3: handle multi component alu src when propagating shifts
Rob Clark [Wed, 9 Oct 2019 16:47:13 +0000 (09:47 -0700)]
freedreno/ir3: handle multi component alu src when propagating shifts

Signed-off-by: Rob Clark <robdclark@chromium.org>
5 years agofreedreno/ir3: drop unused param
Rob Clark [Wed, 9 Oct 2019 16:15:45 +0000 (09:15 -0700)]
freedreno/ir3: drop unused param

Signed-off-by: Rob Clark <robdclark@chromium.org>
5 years agoclover: fix the nir_serialize build failure
Marek Olšák [Thu, 10 Oct 2019 22:43:47 +0000 (18:43 -0400)]
clover: fix the nir_serialize build failure

Fixes: dd4cc56ebd0 "nir: add a strip parameter to nir_serialize"
5 years agollvmpipe/draw: handle UBOs that are < 16 bytes.
Dave Airlie [Wed, 9 Oct 2019 05:11:14 +0000 (15:11 +1000)]
llvmpipe/draw: handle UBOs that are < 16 bytes.

Not sure if this is a bug in the user or not, but some CTS
tests fail due to using an 8 byte constant buffer.

Fixes: KHR-GLES31.core.layout_binding.block_layout_binding_block_VertexShader
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agollvmpipe/draw: fix image sizes for vertex/geometry shaders.
Dave Airlie [Wed, 9 Oct 2019 04:13:19 +0000 (14:13 +1000)]
llvmpipe/draw: fix image sizes for vertex/geometry shaders.

since images are a single level, minify before passing the w/h
to draw.

Fixes: KHR-GLES31.core.shader_image_size.basic-nonMS-vs-*
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agollvmpipe: make texture buffer offset alignment == 16
Dave Airlie [Sun, 1 Sep 2019 23:52:55 +0000 (09:52 +1000)]
llvmpipe: make texture buffer offset alignment == 16

Due to use vmovdqa instructions in the asm, which require 16-byte
aligned buffers.

This fixes a crash in
KHR-GLES31.core.texture_buffer.texture_buffer_texture_buffer_range

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agomeson: skip installation of GLVND-provided headers
Eric Engestrom [Mon, 30 Sep 2019 13:08:29 +0000 (14:08 +0100)]
meson: skip installation of GLVND-provided headers

Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1846
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agomeson: split Mesa headers as a separate installation
Eric Engestrom [Mon, 30 Sep 2019 13:06:07 +0000 (14:06 +0100)]
meson: split Mesa headers as a separate installation

Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agomeson: split headers one per line
Eric Engestrom [Mon, 30 Sep 2019 13:00:51 +0000 (14:00 +0100)]
meson: split headers one per line

Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agomeson: move a couple of include installs around
Eric Engestrom [Mon, 30 Sep 2019 12:40:22 +0000 (13:40 +0100)]
meson: move a couple of include installs around

Preparation for a later commit.

Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agomeson: rename `glvnd_missing_pc_files` to `not glvnd_has_headers_and_pc_files`
Eric Engestrom [Mon, 30 Sep 2019 09:26:43 +0000 (10:26 +0100)]
meson: rename `glvnd_missing_pc_files` to `not glvnd_has_headers_and_pc_files`

This reflects better what is provided by glvnd or not.

Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoGL: drop symbols mangling support
Eric Engestrom [Thu, 10 Oct 2019 15:26:52 +0000 (16:26 +0100)]
GL: drop symbols mangling support

SCons and Meson have never supported that feature, and Autotools was
deleted over 6 months ago and no-one complained yet, so it's pretty
obvious nobody cares about it.

Fixes: 95aefc94a941701616fd ("Delete autotools")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoaco: update print_ir
Rhys Perry [Thu, 10 Oct 2019 11:17:04 +0000 (12:17 +0100)]
aco: update print_ir

Mostly adds GFX10 stuff.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoaco: rework scratch resource code
Rhys Perry [Thu, 10 Oct 2019 11:15:49 +0000 (12:15 +0100)]
aco: rework scratch resource code

Fix compute, cleanup and add GFX10 support.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoaco/gfx10: disable GFX9 1D texture workarounds
Rhys Perry [Thu, 10 Oct 2019 11:13:28 +0000 (12:13 +0100)]
aco/gfx10: disable GFX9 1D texture workarounds

Navi added back support for 1D textures.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoaco/gfx10: fix inline uniform blocks
Rhys Perry [Thu, 10 Oct 2019 11:12:29 +0000 (12:12 +0100)]
aco/gfx10: fix inline uniform blocks

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoradv/aco: disable NGG when ACO is used
Rhys Perry [Thu, 10 Oct 2019 11:10:15 +0000 (12:10 +0100)]
radv/aco: disable NGG when ACO is used

Note that radv_device.c still has to be modified to use ACO with Navi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoac/nir: add back nir_op_fmod
Marek Olšák [Tue, 8 Oct 2019 04:08:19 +0000 (00:08 -0400)]
ac/nir: add back nir_op_fmod

radeonsi doesn't lower it for doubles.

This partially reverts commit d861401554b52b2c2fc6721c69bdfe1697ee608f.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agogallium: remove PIPE_SHADER_CAP_SCALAR_ISA
Marek Olšák [Tue, 8 Oct 2019 02:50:36 +0000 (22:50 -0400)]
gallium: remove PIPE_SHADER_CAP_SCALAR_ISA

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agotgsi_to_nir: use nir_shader_compiler_options::lower_to_scalar
Marek Olšák [Tue, 8 Oct 2019 02:48:41 +0000 (22:48 -0400)]
tgsi_to_nir: use nir_shader_compiler_options::lower_to_scalar

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agost/mesa: use nir_shader_compiler_options::lower_to_scalar
Marek Olšák [Tue, 8 Oct 2019 02:47:23 +0000 (22:47 -0400)]
st/mesa: use nir_shader_compiler_options::lower_to_scalar

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: add nir_shader_compiler_options::lower_to_scalar
Marek Olšák [Tue, 8 Oct 2019 02:46:00 +0000 (22:46 -0400)]
nir: add nir_shader_compiler_options::lower_to_scalar

This will replace PIPE_SHADER_CAP_SCALAR_ISA.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agotgsi_to_nir: add #ifdef header guards
Marek Olšák [Thu, 26 Sep 2019 23:34:31 +0000 (19:34 -0400)]
tgsi_to_nir: add #ifdef header guards

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir/drawpixels: fix what appears to be a copy-paste bug in get_texcoord_const
Marek Olšák [Tue, 1 Oct 2019 02:16:55 +0000 (22:16 -0400)]
nir/drawpixels: fix what appears to be a copy-paste bug in get_texcoord_const

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir/drawpixels: handle load_color0, load_input, load_interpolated_input
Marek Olšák [Tue, 1 Oct 2019 01:29:11 +0000 (21:29 -0400)]
nir/drawpixels: handle load_color0, load_input, load_interpolated_input

for radeonsi

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agonir: move gl_nir_opt_access from glsl directory
Marek Olšák [Fri, 27 Sep 2019 20:43:31 +0000 (16:43 -0400)]
nir: move gl_nir_opt_access from glsl directory

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: add a strip parameter to nir_serialize
Marek Olšák [Wed, 9 Oct 2019 17:27:07 +0000 (13:27 -0400)]
nir: add a strip parameter to nir_serialize

so that drivers don't have to call nir_strip manually.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
5 years agoradv: Enable VK_ANDROID_external_memory_android_hardware_buffer.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 17:44:01 +0000 (19:44 +0200)]
radv: Enable VK_ANDROID_external_memory_android_hardware_buffer.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Check the size of the imported buffer.
Bas Nieuwenhuizen [Tue, 8 Oct 2019 21:24:02 +0000 (23:24 +0200)]
radv: Check the size of the imported buffer.

This is a security feature to disallow malicious apps from passing
a buffer that is too small.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Expose image handle compat types for Android handles.
Bas Nieuwenhuizen [Tue, 8 Oct 2019 20:15:43 +0000 (22:15 +0200)]
radv: Expose image handle compat types for Android handles.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Allow Android image binding.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 17:42:49 +0000 (19:42 +0200)]
radv: Allow Android image binding.

Using delayed layout of images.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv/android: Add android hardware buffer import/export.
Bas Nieuwenhuizen [Wed, 10 Jul 2019 12:45:01 +0000 (14:45 +0200)]
radv/android: Add android hardware buffer import/export.

Support does not include images yet.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Deal with Android external formats.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 14:33:39 +0000 (16:33 +0200)]
radv: Deal with Android external formats.

To abstract things a bit, this adds a helper function in radv_android.c.
However, this means we have to link in radv_android.c on non-android as
well, which means some scaffolding changes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Derive android usage from create flags.
Bas Nieuwenhuizen [Mon, 8 Jul 2019 13:33:06 +0000 (15:33 +0200)]
radv: Derive android usage from create flags.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Disallow sparse shared images.
Bas Nieuwenhuizen [Tue, 8 Oct 2019 20:14:44 +0000 (22:14 +0200)]
radv: Disallow sparse shared images.

Since we really cannot share them ever.

Also remove an unused switch.

Fixes: b70829708ac "radv: Implement VK_KHR_external_memory"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv/android: Add android hardware buffer queries.
Bas Nieuwenhuizen [Tue, 25 Jun 2019 09:42:03 +0000 (11:42 +0200)]
radv/android: Add android hardware buffer queries.

Derived from the Intel code.

For the internal format we just use the internal Vulkan format,
as we have Vulkan formats for all android formats we care about.

For the ycbcr properties we just do something. I do not have a real
clue what would be recommended.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv/android: Add android hardware buffer field to device memory.
Bas Nieuwenhuizen [Wed, 10 Jul 2019 12:27:37 +0000 (14:27 +0200)]
radv/android: Add android hardware buffer field to device memory.

You cannot go from BO to Android hardware buffer, so for export we
have to remember it.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Add VK_ANDROID_external_memory_android_hardware_buffer.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 11:56:05 +0000 (13:56 +0200)]
radv: Add VK_ANDROID_external_memory_android_hardware_buffer.

Still disabled but now we can add entrypoints.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Unset vk_info in radv_image_create_layout.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 11:42:31 +0000 (13:42 +0200)]
radv: Unset vk_info in radv_image_create_layout.

For better test coverage of this corner case.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Handle slightly different image dimensions.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 11:23:36 +0000 (13:23 +0200)]
radv: Handle slightly different image dimensions.

The minigbm comment really says it all. We should
fix minigbm as well, but for now this is the more
robust solution.

Note that this only changes width and height for
the surface creation, not for the image and hence
also not for the sampler, where it would wreak
havoc due to the normalized coords.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Delay patching for imported images until layout time.
Bas Nieuwenhuizen [Mon, 23 Sep 2019 14:42:39 +0000 (16:42 +0200)]
radv: Delay patching for imported images until layout time.

We want this flexibility because in GFX10 we lose any stride fields,
so we have to make sure our width/height are in alignment with
the external image we import.

Furthermore, we need the ability to inject tiling modifiers on import
time which is strictly after create time for Android. So, with the
layout & patch functions being fully independent of pCreateInfo, we
can delay it until import/bind time.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Split out layout code from image creation.
Bas Nieuwenhuizen [Mon, 23 Sep 2019 14:14:50 +0000 (16:14 +0200)]
radv: Split out layout code from image creation.

So we can delay the layout until later in some import cases.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Handle device memory alloc failure with normal free.
Bas Nieuwenhuizen [Wed, 10 Jul 2019 12:21:11 +0000 (14:21 +0200)]
radv: Handle device memory alloc failure with normal free.

Less duplication/complexity.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Cleanup buffer_from_fd.
Bas Nieuwenhuizen [Tue, 24 Sep 2019 15:26:41 +0000 (17:26 +0200)]
radv: Cleanup buffer_from_fd.

Unused stride/offset args.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agogitlab-ci/lava: Test Lima driver with dEQP
Tomeu Vizoso [Sun, 6 Oct 2019 15:49:56 +0000 (08:49 -0700)]
gitlab-ci/lava: Test Lima driver with dEQP

Run dEQP on boards with Mali 400 and 450 in Baylibre's lab.

There's lots of skipped tests because of crashes and undetermined
behavior. May be a good idea to run the tests with valgrind and fix any
issues found.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agogitlab-ci/lava: Use files to list tests to skip
Tomeu Vizoso [Sun, 6 Oct 2019 22:21:39 +0000 (15:21 -0700)]
gitlab-ci/lava: Use files to list tests to skip

As the non-LAVA runner script does, have per-GPU version files listing
the tests that are to be skipped, due to being very slow, unstable, etc.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agointel/tools: Support multiple contexts in intel_dump_gpu.
Rafael Antognolli [Mon, 16 Sep 2019 16:07:26 +0000 (09:07 -0700)]
intel/tools: Support multiple contexts in intel_dump_gpu.

Create basic aub_context on GEM_CONTEXT_CREATE.

Set it up and submit a context + ring + pphwsp during execbuf
submission, if it has not been initialized yet.

v2: Write the HWSP only once per engine (Lionel).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agointel/tools: Add basic aub_context code and helpers.
Rafael Antognolli [Fri, 13 Sep 2019 22:13:31 +0000 (15:13 -0700)]
intel/tools: Add basic aub_context code and helpers.

v2:
 - Only dump context if there were no erros (Lionel).
 - Store counter for context handles in aub_file (Lionel).
v3:
 - Add a comment about aub_context -> GEM context (Lionel).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agointel/tools: Use common code for GGTT address allocation.
Rafael Antognolli [Tue, 17 Sep 2019 01:12:02 +0000 (18:12 -0700)]
intel/tools: Use common code for GGTT address allocation.

We want to be able to create contexts on demand, and increase the GGTT
as needed for that. Use the aub_map_ggtt() function for that.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agointel/tools: Factor out GGTT allocation.
Rafael Antognolli [Mon, 9 Sep 2019 21:24:41 +0000 (14:24 -0700)]
intel/tools: Factor out GGTT allocation.

We want to reuse it in execlists_setup().

v2: Rename it to write_ggtt_ptes() (Lionel).
v3: Rename it to aub_map_ggtt() (Lionel).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agoradv: Implement & enable VK_EXT_texel_buffer_alignment.
Bas Nieuwenhuizen [Thu, 10 Oct 2019 09:40:27 +0000 (11:40 +0200)]
radv: Implement & enable VK_EXT_texel_buffer_alignment.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: use a compute shader for copying timestamp query results
Samuel Pitoiset [Wed, 9 Oct 2019 11:34:52 +0000 (13:34 +0200)]
radv: use a compute shader for copying timestamp query results

When the timestamp is not ready (ie. UINT64_MAX), the availabily bit
should be zero. The previous code used to copy the timestamp value
as the availabily bit and that's completely wrong.

Because it's not that simple to emit a conditional with the CP, the
driver now uses a compute shader for copying timestamp query results.

Fixes dEQP-VK.pipeline.timestamp.misc_tests.reset_query_before_copy.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: sync before resetting query pools if timestamps have been written
Samuel Pitoiset [Wed, 9 Oct 2019 12:30:49 +0000 (14:30 +0200)]
radv: sync before resetting query pools if timestamps have been written

Otherwise, the GPU might write timestamp queries after the reset
operation. This is similar to other query operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoaco: Clean up usages of PhysReg::reg from aco_assembler.
Timur Kristóf [Wed, 9 Oct 2019 08:40:24 +0000 (10:40 +0200)]
aco: Clean up usages of PhysReg::reg from aco_assembler.

These are not needed anymore, since PhyReg has an implicit
conversion operator that can convert it to unsigned int,
which is equivalent to accessing this field.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Add extra assertion for number of FS input VGPRs.
Timur Kristóf [Thu, 3 Oct 2019 17:32:48 +0000 (19:32 +0200)]
aco: Add extra assertion for number of FS input VGPRs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Fix s_dcache_wb on GFX10.
Timur Kristóf [Tue, 17 Sep 2019 17:59:17 +0000 (19:59 +0200)]
aco: Fix s_dcache_wb on GFX10.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Have s_waitcnt_vscnt write to NULL.
Rhys Perry [Thu, 12 Sep 2019 14:28:49 +0000 (15:28 +0100)]
aco: Have s_waitcnt_vscnt write to NULL.

Not sure if this instruction actually writes anything, but LLVM
disassembles a destination and sets it to NULL.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Use the VOP3-only add/sub GFX10 instructions if needed.
Rhys Perry [Thu, 12 Sep 2019 12:25:18 +0000 (13:25 +0100)]
aco: Use the VOP3-only add/sub GFX10 instructions if needed.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Initial work to avoid GFX10 hazards.
Rhys Perry [Thu, 12 Sep 2019 15:42:17 +0000 (17:42 +0200)]
aco: Initial work to avoid GFX10 hazards.

Currently just breaks up SMEM groups and fixes
FeatureVMEMtoScalarWriteHazard (name from LLVM).

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: pad code with s_code_end on GFX10
Rhys Perry [Tue, 8 Oct 2019 12:47:00 +0000 (14:47 +0200)]
aco: pad code with s_code_end on GFX10

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: workaround GFX10 0x3f branch bug
Rhys Perry [Tue, 10 Sep 2019 17:11:13 +0000 (18:11 +0100)]
aco: workaround GFX10 0x3f branch bug

According to LLVM, branches with an offset of 0x3f are buggy.

v2: (by Timur Kristóf)
- extract the GFX10 specific part to its own function

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Fix VS input VGPRs on GFX10.
Timur Kristóf [Tue, 27 Aug 2019 14:27:41 +0000 (16:27 +0200)]
aco: Fix VS input VGPRs on GFX10.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Assemble opsel in VOP3 instructions.
Rhys Perry [Thu, 12 Sep 2019 18:55:12 +0000 (19:55 +0100)]
aco: Assemble opsel in VOP3 instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Allow literals on VOP3 instructions.
Rhys Perry [Thu, 12 Sep 2019 18:55:36 +0000 (19:55 +0100)]
aco: Allow literals on VOP3 instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
5 years agoaco: Support subvector loops in aco_assembler.
Timur Kristóf [Tue, 8 Oct 2019 12:43:43 +0000 (14:43 +0200)]
aco: Support subvector loops in aco_assembler.

These are currently not used, but could be useful later.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Set GFX10 dimensionality on the instructions that need it.
Timur Kristóf [Tue, 8 Oct 2019 12:42:52 +0000 (14:42 +0200)]
aco: Set GFX10 dimensionality on the instructions that need it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Use ac_get_sampler_dim, delete duplicate code.
Timur Kristóf [Fri, 4 Oct 2019 13:12:21 +0000 (15:12 +0200)]
aco: Use ac_get_sampler_dim, delete duplicate code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Set GFX10 DLC bit properly.
Timur Kristóf [Thu, 26 Sep 2019 15:53:17 +0000 (17:53 +0200)]
aco: Set GFX10 DLC bit properly.

The DLC bit is now set to 1 for all loads when GLC is also set,
but cleared to 0 for all stores (otherwise it causes issues),
and also cleared to 0 for atomics.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 VOP3 and VOP1 as VOP3 in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:51:51 +0000 (17:51 +0200)]
aco: Support GFX10 VOP3 and VOP1 as VOP3 in aco_assembler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 EXP in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:50:48 +0000 (17:50 +0200)]
aco: Support GFX10 EXP in aco_assembler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Fix GFX9 FLAT, SCRATCH, GLOBAL instructions, add GFX10 support.
Timur Kristóf [Thu, 26 Sep 2019 15:50:06 +0000 (17:50 +0200)]
aco: Fix GFX9 FLAT, SCRATCH, GLOBAL instructions, add GFX10 support.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 MIMG and GFX9 D16 in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:48:55 +0000 (17:48 +0200)]
aco: Support GFX10 MIMG and GFX9 D16 in aco_assembler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 MTBUF in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:48:08 +0000 (17:48 +0200)]
aco: Support GFX10 MTBUF in aco_assembler.

Also remove img_format from aco_ir, since it can be calculated
from dfmt and nfmt. So only the assember needs to deal with it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Link ACO with amd/common.
Timur Kristóf [Fri, 27 Sep 2019 07:26:40 +0000 (09:26 +0200)]
aco: Link ACO with amd/common.

We'd like to use some functions, for example some
ac_shader_util functions in ACO, so we need to link
ACO to AC.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoamd/common: Add extern "C" to some headers that were missing it.
Timur Kristóf [Fri, 27 Sep 2019 07:26:14 +0000 (09:26 +0200)]
amd/common: Add extern "C" to some headers that were missing it.

We'd like to include some of these in C++ code later.
Specifically, ACO is written in C++ and we would like to use
some of this code in ACO in order to avoid code duplication.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 MUBUF in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:47:51 +0000 (17:47 +0200)]
aco: Support GFX10 MUBUF in aco_assembler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
5 years agoaco: Support GFX10 DS in aco_assembler.
Timur Kristóf [Thu, 26 Sep 2019 15:47:30 +0000 (17:47 +0200)]
aco: Support GFX10 DS in aco_assembler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>