platform/upstream/mesa.git
4 years agonir: Add ability to count emitted GS vertices per primitive.
Timur Kristóf [Tue, 16 Jun 2020 16:58:39 +0000 (18:58 +0200)]
nir: Add ability to count emitted GS vertices per primitive.

Add an option to nir_lower_gs_intrinsics so that it can also track
the number of emitted vertices per primitive, not just the total
vertex count.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>

4 years agonir: Add ability to count emitted GS primitives.
Timur Kristóf [Mon, 8 Jun 2020 10:16:13 +0000 (12:16 +0200)]
nir: Add ability to count emitted GS primitives.

Add an option to nir_lower_gs_intrinsics which tells it to track
the number of emitted primitives, not just vertices. Additionally,
also make it per-stream.

Also rename the set_vertex_count intrinsic to
set_vertex_and_primitive_count.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>

4 years agoradv,anv: use CLOCK_MONOTONIC_FAST when CLOCK_MONOTONIC_RAW is undefined
Greg V [Tue, 30 Oct 2018 17:38:03 +0000 (20:38 +0300)]
radv,anv: use CLOCK_MONOTONIC_FAST when CLOCK_MONOTONIC_RAW is undefined

CLOCK_MONOTONIC_FAST is a similar clock from FreeBSD.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6995>

4 years agoutil/os_misc: os_get_available_system_memory() for FreeBSD
Emmanuel Vadot [Sun, 4 Oct 2020 09:00:49 +0000 (11:00 +0200)]
util/os_misc: os_get_available_system_memory() for FreeBSD

Based on the OpenBSD variant.
The only difference between those two system is the sysctl mib.

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6995>

4 years agoradv: use the same NIR compiler options for both compiler backends
Samuel Pitoiset [Wed, 30 Sep 2020 13:26:41 +0000 (15:26 +0200)]
radv: use the same NIR compiler options for both compiler backends

No changes, they are already similar.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6938>

4 years agoradv/llvm: do not lower sub
Samuel Pitoiset [Wed, 30 Sep 2020 13:19:59 +0000 (15:19 +0200)]
radv/llvm: do not lower sub

To match ACO.

Totals from 268 (0.20% of 136420) affected shaders:
CodeSize: 1214060 -> 1214096 (+0.00%); split: -0.05%, +0.06%

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6938>

4 years agolima/parser: Fix varyings decoding in RSW
Andreas Baierl [Wed, 7 Oct 2020 11:44:09 +0000 (13:44 +0200)]
lima/parser: Fix varyings decoding in RSW

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7044>

4 years agoaco: dump the program if the disassembler failed
Samuel Pitoiset [Fri, 2 Oct 2020 09:06:50 +0000 (11:06 +0200)]
aco: dump the program if the disassembler failed

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6979>

4 years agoclover: don't call validate spirv at all if not needed
Dave Airlie [Wed, 7 Oct 2020 20:11:35 +0000 (06:11 +1000)]
clover: don't call validate spirv at all if not needed

Suggested on irc seems like a good plan.

Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7051>

4 years agoutil/disk_cache: remove unused function param
Timothy Arceri [Thu, 8 Oct 2020 01:45:31 +0000 (12:45 +1100)]
util/disk_cache: remove unused function param

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7059>

4 years agoswr/rasterizer: Remove BuilderGfxMem member mpTrackMemAccessFuncTy.
Vinson Lee [Wed, 30 Sep 2020 00:48:31 +0000 (17:48 -0700)]
swr/rasterizer: Remove BuilderGfxMem member mpTrackMemAccessFuncTy.

mpTrackMemAccessFuncTy is not used anywhere.

Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member mpTrackMemAccessFuncTy is not
initialized in this constructor nor in any functions that it calls.

Suggested-by: Jan Zielinski <jan.zielinski@intel.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6930>

4 years agomeson: Use more portable compiler option -std.
Vinson Lee [Tue, 6 Oct 2020 07:04:57 +0000 (00:04 -0700)]
meson: Use more portable compiler option -std.

GCC and Clang support --std and -std options but Intel C++
Compiler only supports -std.

icpc: command line warning #10159: invalid argument for option '--std'

Fixes: 8a05d6ffc65d ("driconf: Make the driver's declarations be structs instead of XML.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7020>

4 years agoturnip: Add support for GetSwapchainGrallocUsage2ANDROID().
Eric Anholt [Tue, 22 Sep 2020 18:05:14 +0000 (11:05 -0700)]
turnip: Add support for GetSwapchainGrallocUsage2ANDROID().

This is lifted straight from anv, which seems like a reasonable way to go.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7015>

4 years agoturnip: Detect Qualcomm gralloc and its UBWC flag on gralloc surfaces.
Eric Anholt [Mon, 5 Oct 2020 21:54:52 +0000 (14:54 -0700)]
turnip: Detect Qualcomm gralloc and its UBWC flag on gralloc surfaces.

And document where to find information on qcom gralloc's private handle
layout.  I chose not to #include the gralloc_priv because it seems that
there's not much we need yet, and I'm hoping we can avoid the build-time
dependency on the specific platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7015>

4 years agoturnip/kgsl: Add support for importing dma-bufs.
Eric Anholt [Tue, 22 Sep 2020 17:33:32 +0000 (10:33 -0700)]
turnip/kgsl: Add support for importing dma-bufs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7015>

4 years agoturnip/kgsl: Fix last minute breakage of the build.
Eric Anholt [Mon, 5 Oct 2020 23:02:05 +0000 (16:02 -0700)]
turnip/kgsl: Fix last minute breakage of the build.

Need to land KGSL in CI!

Fixes: 8163c818e32e ("turnip: implement timestamp fences/semaphores for kgsl backend")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7015>

4 years agoRevert "anv: Add driconf option to disable compression for 16bpp format"
Nanley Chery [Wed, 7 Oct 2020 21:27:57 +0000 (14:27 -0700)]
Revert "anv: Add driconf option to disable compression for 16bpp format"

This reverts commit bcfec61d1ee2675b8aaaf3adec8109ce6fa6c003.

The previous patch fixed the underlying issue that the above commit was
actually working around. It turns out that the previously observed
performance regression was due to invalid aux-map entries for
multi-layer HiZ+CCS buffers.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7046>

4 years agoanv: Enable multi-layer aux-map init for HIZ+CCS
Nanley Chery [Wed, 7 Oct 2020 15:36:28 +0000 (08:36 -0700)]
anv: Enable multi-layer aux-map init for HIZ+CCS

Fixes rendering corruption in the shadowmappingcascade Sascha Willems
Vulkan demo. To see the corruption, I adjusted the demo options as
follows:

 1. Enable "Display depth map"
 2. Set "Split lambda" to 0.100
 3. Make "Cascade" non-zero.

Fixes: 80ffbe915fe ("anv: Add support for HiZ+CCS")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7046>

4 years agofreedreno/ir3: Don't leave holes the UBO upload plan.
Eric Anholt [Tue, 6 Oct 2020 20:39:32 +0000 (13:39 -0700)]
freedreno/ir3: Don't leave holes the UBO upload plan.

Shaders may not use a particular region of a UBO in a given shader (think
UBOs shared between stages, or between shaders), and by just always
extending the existing range for a given UBO, we'd waste bandwidth
uploading it, and also waste our precious const space in storing the
unused data.

Instead, only upload exactly the ranges we can use, and merge ranges when
they're neighbors.  We may end up with more upload packets, but the
bandwidth savings is surely going to be worth it (and if find we want a
distance threshold for merging with nearby uploads, that would be easy to
add).

total instructions in shared programs: 9266114 -> 9255092 (-0.12%)
total full in shared programs: 343162 -> 341709 (-0.42%)
total constlen in shared programs: 1454368 -> 1275236 (-12.32%)
total cat6 in shared programs: 93073 -> 82589 (-11.26%)
total (ss) in shared programs: 212402 -> 206404 (-2.82%)
total (sy) in shared programs: 122905 -> 114007 (-7.24%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7036>

4 years agofreedreno/ir3: Clean up the UBO upload plan setup.
Eric Anholt [Tue, 6 Oct 2020 20:06:13 +0000 (13:06 -0700)]
freedreno/ir3: Clean up the UBO upload plan setup.

No more start > end for signaling that the slot isn't used, no more funny
setup of num_enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7036>

4 years agoci/softpipe: Add another flaky GS test to the skips list.
Eric Anholt [Thu, 8 Oct 2020 16:57:06 +0000 (09:57 -0700)]
ci/softpipe: Add another flaky GS test to the skips list.

We've seen the new GS flake once or twice a week for a long time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7070>

4 years agoutil/hash_table: add function for reserving size in a hash table
Mike Blumenkrantz [Tue, 6 Oct 2020 20:30:47 +0000 (16:30 -0400)]
util/hash_table: add function for reserving size in a hash table

rehashing a populated hash table is very expensive, so for the case where
the maximum/likely table size is already known, this function allows for
pre-sizing the table to avoid ever needing a rehash

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7037>

4 years agonir/opt_deref: Fix the vector bitcast optimization
Jason Ekstrand [Thu, 8 Oct 2020 14:57:14 +0000 (09:57 -0500)]
nir/opt_deref: Fix the vector bitcast optimization

It assumes the parent is a vector or scalar so we need to fail if it
isn't.

Fixes: 9190f82d573c "nir/opt_deref: Add an optimization for bitcasts"
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7064>

4 years agoclover: Stop leaking NIR shaders
Jason Ekstrand [Thu, 8 Oct 2020 15:41:31 +0000 (10:41 -0500)]
clover: Stop leaking NIR shaders

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7068>

4 years agoutil/xmlconfig: eliminate memory leak
Andrii Simiklit [Tue, 6 Oct 2020 07:04:55 +0000 (10:04 +0300)]
util/xmlconfig: eliminate memory leak

It fixes coverity issue: CID 1467703: (RESOURCE_LEAK):
`Variable "cp" going out of scope leaks the storage it points to.`

Fixes: 23c3eb1fe16 ("driconf: Delete disjoint range support")
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7021>

4 years agoradv/llvm: remove dead code for 64-bit GS inputs
Samuel Pitoiset [Mon, 5 Oct 2020 12:57:15 +0000 (14:57 +0200)]
radv/llvm: remove dead code for 64-bit GS inputs

64-bit IO are lowered with NIR.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7008>

4 years agoradv/llvm: do not lower nir_op_fsat
Samuel Pitoiset [Mon, 5 Oct 2020 11:09:58 +0000 (13:09 +0200)]
radv/llvm: do not lower nir_op_fsat

To match ACO.

fossilds-db (Navi10):
Totals from 20869 (15.30% of 136420) affected shaders:
SGPRs: 1851128 -> 1851920 (+0.04%); split: -0.41%, +0.46%
VGPRs: 1607360 -> 1608212 (+0.05%); split: -0.20%, +0.25%
SpillSGPRs: 267331 -> 261350 (-2.24%); split: -3.67%, +1.43%
CodeSize: 155460104 -> 155303508 (-0.10%); split: -0.21%, +0.11%
MaxWaves: 179156 -> 178928 (-0.13%); split: +0.48%, -0.60%

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6932>

4 years agoac/nir: implement nir_op_fsat
Samuel Pitoiset [Wed, 30 Sep 2020 08:48:29 +0000 (10:48 +0200)]
ac/nir: implement nir_op_fsat

With fmed3 if available, otherwise fallback to fmin/fmax.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6932>

4 years agoci: Disable pm_runtime and max clocks in LAVA jobs
Tomeu Vizoso [Mon, 5 Oct 2020 13:57:58 +0000 (15:57 +0200)]
ci: Disable pm_runtime and max clocks in LAVA jobs

To get more consistent performance and results, use the performance
devfreq governor and disable PM runtime.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7011>

4 years agoci: Test Panfrost on Khadas VIM3 boards
Tomeu Vizoso [Mon, 5 Oct 2020 13:57:05 +0000 (15:57 +0200)]
ci: Test Panfrost on Khadas VIM3 boards

For testing Panfrost on Bifrost GPUs, add a job for dEQP GLES2 testing.

Right now almost all tests are skipped, but as we make progress and
things show stable, we'll be running more and more tests.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7011>

4 years agoci: Update kernel for LAVA
Tomeu Vizoso [Mon, 5 Oct 2020 07:14:11 +0000 (09:14 +0200)]
ci: Update kernel for LAVA

Update to v5.9-rc5-based drm-misc-for-next, so we can run jobs on
machines with Bifrost GPUs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7011>

4 years agofreedreno/a6xx: Support PIPE_FORMAT_R8_G8B8_420_UNORM for texturing
Kristian H. Kristensen [Mon, 28 Sep 2020 20:21:49 +0000 (20:21 +0000)]
freedreno/a6xx: Support PIPE_FORMAT_R8_G8B8_420_UNORM for texturing

This makes freedreno advertise support for
PIPE_FORMAT_R8_G8B8_420_UNORM on a6xx, which enables lowering NV12 to
this format.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693>

4 years agofreedreno/a6xx: Generalize pointers in struct fd6_pipe_sampler_view
Kristian H. Kristensen [Wed, 7 Oct 2020 21:33:57 +0000 (21:33 +0000)]
freedreno/a6xx: Generalize pointers in struct fd6_pipe_sampler_view

Add resource pointers ptr1 and ptr2 and offsets offset1 and offset2,
and just emit relocs if the pointers are non-NULL.  This lets us move
a little more logic to the CSO building.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693>

4 years agost/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM
Kristian H. Kristensen [Mon, 28 Sep 2020 20:11:18 +0000 (20:11 +0000)]
st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM

Some GPUs can sample biplanar formats like NV12 natively, returning
the YUV values. Add a lowering type that uses that for sampling and
relies on existing colorspace conversions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693>

4 years agoutil/formats: Add PIPE_FORMAT_R8_G8B8_420_UNORM
Kristian H. Kristensen [Mon, 28 Sep 2020 15:34:07 +0000 (15:34 +0000)]
util/formats: Add PIPE_FORMAT_R8_G8B8_420_UNORM

This is a planar, subsampled format. It's basically NV12, but without
colorspace conversion.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693>

4 years agoiris: Use the data cache for indirect UBO pulls
Jason Ekstrand [Sat, 22 Feb 2020 05:38:58 +0000 (23:38 -0600)]
iris: Use the data cache for indirect UBO pulls

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agoanv: Use the data cache for indirect UBO pulls on Gen8+
Jason Ekstrand [Fri, 21 Feb 2020 17:45:37 +0000 (11:45 -0600)]
anv: Use the data cache for indirect UBO pulls on Gen8+

On Gen7, the data cache is pretty terrible so we'd rather avoid it
there.  On Gen8+, it should be fine and is less likely to conflict with
texturing so we should get less cache thrashing there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agoanv: Plumb the device into *bits_for_access_flags
Jason Ekstrand [Mon, 24 Feb 2020 21:51:41 +0000 (15:51 -0600)]
anv: Plumb the device into *bits_for_access_flags

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agoanv: Use format_for_descriptor_type for descriptor buffers
Jason Ekstrand [Fri, 21 Feb 2020 18:36:41 +0000 (12:36 -0600)]
anv: Use format_for_descriptor_type for descriptor buffers

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agoanv: Add a device parameter to format_for_descriptor_type
Jason Ekstrand [Fri, 21 Feb 2020 18:35:27 +0000 (12:35 -0600)]
anv: Add a device parameter to format_for_descriptor_type

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agointel/fs: Add an option to use dataport messages for UBOs
Jason Ekstrand [Fri, 21 Feb 2020 17:29:06 +0000 (11:29 -0600)]
intel/fs: Add an option to use dataport messages for UBOs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agointel/fs: Add an alignment to VARYING_PULL_CONSTANT_LOAD_LOGICAL
Jason Ekstrand [Fri, 21 Feb 2020 16:59:38 +0000 (10:59 -0600)]
intel/fs: Add an alignment to VARYING_PULL_CONSTANT_LOAD_LOGICAL

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agoi965: Take an isl_format in emit_buffer_surface_state
Jason Ekstrand [Thu, 20 Feb 2020 22:51:35 +0000 (16:51 -0600)]
i965: Take an isl_format in emit_buffer_surface_state

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>

4 years agointel/dev: fix 32bit build issue
Lionel Landwerlin [Wed, 7 Oct 2020 19:21:23 +0000 (22:21 +0300)]
intel/dev: fix 32bit build issue

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7049>

4 years agointel/nir: Lower load_global_constant in lower_mem_access_bit_sizes
Jason Ekstrand [Tue, 6 Oct 2020 17:31:52 +0000 (12:31 -0500)]
intel/nir: Lower load_global_constant in lower_mem_access_bit_sizes

It's identical to nir_intrinsic_load_global except that it works on data
that's guaranteed to be constant throughout the shader invocation.

Fixes: ff2f44d86585 "intel/fs: Implement nir_intrinsic_load_global_constant"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6872>

4 years agointel/nir: Don't try to emit vector load_scratch instructions
Jason Ekstrand [Thu, 24 Sep 2020 21:28:56 +0000 (16:28 -0500)]
intel/nir: Don't try to emit vector load_scratch instructions

In 53bfcdeecf4c9, we added load/store_scratch instructions which deviate
a little bit from most memory load/store instructions in that we can't
use the normal untyped read/write instructions which can read and write
up to a vec4 at a time.  Instead, we have to use the DWORD scattered
read/write instructions which are scalar.  To handle this, we added code
to brw_nir_lower_mem_access_bit_sizes to cause them to be scalarized.
However, one case was missing: the load-as-larger-vector case.  In this
case, we take small bit-sized constant-offset loads replace it with a
32-bit load and shuffle the result around as needed.

For scratch, this case is much trickier to get right because it often
emits vec2 or wider which we would then have to lower again.  We did
this for other load and store ops because, for lower bit-sizes we have
to scalarize thanks to the byte scattered read/write instructions being
scalar.  However, for scratch we're not losing as much because we can't
vectorize 32-bit loads and stores either.  It's easier to just disallow
it whenever we have to scalarize.

Fixes: 53bfcdeecf4c9 "intel/fs: Implement the new load/store_scratch..."
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6872>

4 years agoci: enable piglit testing of clover/llvmpipe.
Dave Airlie [Mon, 28 Sep 2020 22:40:13 +0000 (08:40 +1000)]
ci: enable piglit testing of clover/llvmpipe.

This adds support for building clover/llvmpipe and running the
piglit CL tests on it.

It uses the gl testing container, and add builds the libclc
spirv libraries as part of that which requires the llvm spirv
translator in the build container.

It also builds the llvm spirv translator as part of the build
root and creates a mesa build that builds clover for testing
against it. It uses llvm 10 as the baseline.

This drops bswap as it has an oob memory access with llvmpipe
which cause flaky test results. phatk also seems flaky

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6901>

4 years agoCI: Don't run pixmark-piano twice on radeonsi
Daniel Stone [Wed, 7 Oct 2020 22:05:10 +0000 (23:05 +0100)]
CI: Don't run pixmark-piano twice on radeonsi

For some reason, the radeonsi Tracie definition had the piano traces
listed twice.

Noted by @airlied

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7052>

4 years agospirv: Move nir_lower_libclc to src/compiler/spirv
Jason Ekstrand [Wed, 7 Oct 2020 03:14:59 +0000 (22:14 -0500)]
spirv: Move nir_lower_libclc to src/compiler/spirv

This puts it in a shared place where everyone can get at it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoclover: Use core libclc loader
Dave Airlie [Tue, 6 Oct 2020 23:01:43 +0000 (09:01 +1000)]
clover: Use core libclc loader

v2 (Jason Ekstrand):
 - Use the newly added nir_can_find_libclc() helper

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agospirv: Add a shared libclc loader
Jason Ekstrand [Tue, 6 Oct 2020 16:26:07 +0000 (11:26 -0500)]
spirv: Add a shared libclc loader

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agomeson: generalize libclc usage
Dylan Baker [Tue, 6 Oct 2020 17:28:34 +0000 (10:28 -0700)]
meson: generalize libclc usage

So that it's not tied directly to clover.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoclover/meson: use dep.get_variable instead of deprecated get_pkgconfig_variable
Dylan Baker [Tue, 6 Oct 2020 17:25:18 +0000 (10:25 -0700)]
clover/meson: use dep.get_variable instead of deprecated get_pkgconfig_variable

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoutil/xxd.py: Add an option for binary files
Jason Ekstrand [Wed, 7 Oct 2020 17:40:42 +0000 (12:40 -0500)]
util/xxd.py: Add an option for binary files

If -b is specified, we don't add a null to the end of the char array.
If -b is not specified, we assert that there are no nulls in the middle.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoutil: Make xxd.py output char array instead of string
Jesse Natalie [Tue, 31 Mar 2020 21:51:26 +0000 (14:51 -0700)]
util: Make xxd.py output char array instead of string

This keeps us from hitting the 65k string limit on MSVC

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoutil: Move xxd.py to util
Jesse Natalie [Tue, 31 Mar 2020 21:05:59 +0000 (14:05 -0700)]
util: Move xxd.py to util

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agoglsl/xxd.py: fix imports
Dylan Baker [Tue, 6 Oct 2020 17:25:46 +0000 (10:25 -0700)]
glsl/xxd.py: fix imports

sys and string are unused, os is needed but not imported

fixes: 412472da5cb30b603e218b34893936cc70039ded
       ("glsl: Add utility to convert text files to C strings")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7034>

4 years agogallium/pipe: Add a GALLIUM_PIPE_SEARCH_DIR override env var
Jason Ekstrand [Tue, 18 Aug 2020 16:59:19 +0000 (11:59 -0500)]
gallium/pipe: Add a GALLIUM_PIPE_SEARCH_DIR override env var

This can be useful if you rsync an install between two machines and the
paths don't perfectly match up.  OpenGL drivers already work fine but
anything which uses pipe-loader has a compile-time path.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>

4 years agoiris: Fill out compute caps and enable clover support
Jason Ekstrand [Thu, 20 Aug 2020 22:10:59 +0000 (17:10 -0500)]
iris: Fill out compute caps and enable clover support

This commit enables clover support for iris.  It is intended as a
compiler developer tool and not as a new OpenCL implementation from
Intel.  If you want competent OpenCL, we have a different open-source
driver for that built on our LLVM-based IGC compiler stack.  However,
using clover with iris is becoming increasingly useful as a compiler
development tool and I'm getting tired of carrying the patches in a
private branch.

By default, clover will not initialize on iris.  To enable clover, set
the IRIS_ENABLE_CLOVER environment variable to "1" or "true".  As we've
done with the semi-sketchy platform support in ANV, it dumps a very loud
WARNING to stderr when enabled.  Use at your own risk.

NOTE: To anyone intending to benchmark this, the performance is going to
be terrible and that is expected.  This is in no way representative of
the Intel/NIR compiler stack.  As it currently stands, clover passes
-O0 to clang when compiling OpenCL C to make SPIRV-LLVM-Transator work.
When compiling the SPIR-V, clover currently doesn't run any NIR
optimizations before it lowers memory access so any NIR optimizations
iris attempts to do are severely hampered.  One day, clover will get a
NIR optimization loop or the ability to hand things off to the driver
per-lowering but today is not that day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>

4 years agoiris: Add support for load_work_dim as a system value
Jason Ekstrand [Tue, 6 Oct 2020 23:06:05 +0000 (18:06 -0500)]
iris: Add support for load_work_dim as a system value

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>

4 years agoiris: Handle runtime-specified local memory size
Jason Ekstrand [Tue, 6 Oct 2020 20:57:21 +0000 (15:57 -0500)]
iris: Handle runtime-specified local memory size

The value specified in pipe_compute_state is in addition to the implicit
value computed by NIR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>

4 years agoiris: Add pipe-loader support
Jason Ekstrand [Mon, 10 Aug 2020 23:33:46 +0000 (18:33 -0500)]
iris: Add pipe-loader support

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7047>

4 years agobroadcom/compiler: add V3D_DEBUG_RA option
Alejandro Piñeiro [Fri, 2 Oct 2020 12:20:07 +0000 (14:20 +0200)]
broadcom/compiler: add V3D_DEBUG_RA option

To ask to debug a registr allocation failure
(V3D_DEBUG_REGISTER_ALLOCATION seemed too long to me).

When a fallback register allocation algorithm was added, if the
register allocation fails, it only dumpg the current vir with the
register pressure info with the failed fallback. But if we want do
debug the problem, we would be interested on both.

Additionally, it was strange that we got the full vir dump with the
failure even if no debug option was set.

Additionally we add shaderdb like stats for those failures, to make
easier to compare one and the other.

v2: keep a small warning message in case both register allocation
    algorithms fails (Neil)

Reviewed-by: Neil Roberts <nroberts@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6999>

4 years agobroadcom/common: increase V3D_MAX_TEXTURE_SAMPLERS, add specific OpenGL limit
Alejandro Piñeiro [Thu, 20 Aug 2020 09:51:41 +0000 (11:51 +0200)]
broadcom/common: increase V3D_MAX_TEXTURE_SAMPLERS, add specific OpenGL limit

This is needed due Vulkan because by spec (31.1. Limit Requirements)
the minimum value for the following limits are the following ones:
  maxPerStageDescriptorSampledImages 16
  maxPerStageDescriptorStorageImages  4
  maxPerStageDescriptorInputAttachments 4

And we are using v3d textures for all of them, so current limit would
not be enough for some cases.

Note that as the current comment explains there is not exactly a HW
limit for it, so we could bump to 32 for example, but let's just be
conservative and ask the minimum required.

It is worth to note that we needed to maintain the same value for the
OpenGL case, as it gets a register allocation failure on some GL
cases. We tried to fix that with small changes on the nir scheduler,
but we found that it would require some non-trivial effort to get it
done (that eventually we would need to).

Fixes tests like:
dEQP-VK.binding_model.descriptorset_random.sets16.constant.ubolimitlow.sbolimitlow.imglimitlow.noiub.uab.comp.noia.0

v2: keep the previous limit for Opengl (Eric)

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6999>

4 years agoaco/isel: Fix out-of-bounds write in visit_load_input
Tony Wasserka [Mon, 14 Sep 2020 17:39:43 +0000 (19:39 +0200)]
aco/isel: Fix out-of-bounds write in visit_load_input

Shaders may read out components past the attributes provided by the
application, so the read mask can indicate a larger component count than
were actually reserved in the array.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agoradv: Respect alignment requirements in descriptor set layouts
Tony Wasserka [Fri, 11 Sep 2020 15:50:00 +0000 (17:50 +0200)]
radv: Respect alignment requirements in descriptor set layouts

Previously, ycbcr samplers were tightly packed with 4-byte alignment,
but the structure requires 8-byte alignment. These samplers are now padded
to 8-byte boundaries instead.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agoradv: Clean up CreateDescriptorSetLayout
Tony Wasserka [Wed, 2 Sep 2020 11:56:12 +0000 (13:56 +0200)]
radv: Clean up CreateDescriptorSetLayout

"max_bindings + 1" was repeatedly used throughout this function,
so talking about the binding *count* is more natural here.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agoradv: Fix unaligned memory access when writing specialization map entries
Tony Wasserka [Tue, 15 Sep 2020 11:13:34 +0000 (13:13 +0200)]
radv: Fix unaligned memory access when writing specialization map entries

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agoradv: Avoid calling memcpy with null pointers
Tony Wasserka [Tue, 15 Sep 2020 11:07:16 +0000 (13:07 +0200)]
radv: Avoid calling memcpy with null pointers

Vulkan allows for these input pointers to be null when the respective
object count is zero. Calling memcpy with null pointers is undefined,
so they are guarded with a check for the legit use pattern now.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agonir: Fix unaligned pointer access
Tony Wasserka [Tue, 15 Sep 2020 10:26:34 +0000 (12:26 +0200)]
nir: Fix unaligned pointer access

This was observed with the intel vulkan driver when running
dEQP-VK.spirv_assembly.instruction.compute.float32.comparison_1.modfstruct
with ubsan enabled.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agonir: Fix undefined behavior due to signed integer multiplication overflows
Tony Wasserka [Wed, 9 Sep 2020 10:22:44 +0000 (12:22 +0200)]
nir: Fix undefined behavior due to signed integer multiplication overflows

Notably this happened when applying constant folding on the intermediate
computations generated from nir_lower_idiv.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6728>

4 years agoci: move to using clang 10 for meson + clover
Dave Airlie [Tue, 6 Oct 2020 00:49:00 +0000 (10:49 +1000)]
ci: move to using clang 10 for meson + clover

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7017>

4 years agost/mesa: pass inlinable uniforms to drivers if they requested it
Marek Olšák [Tue, 29 Sep 2020 21:36:57 +0000 (17:36 -0400)]
st/mesa: pass inlinable uniforms to drivers if they requested it

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6955>

4 years agogallium: add pipe_context::set_inlinable_constants
Marek Olšák [Tue, 29 Sep 2020 21:35:47 +0000 (17:35 -0400)]
gallium: add pipe_context::set_inlinable_constants

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6955>

4 years agonir: add new helper passes that lower uniforms to literals
Marek Olšák [Tue, 29 Sep 2020 21:34:28 +0000 (17:34 -0400)]
nir: add new helper passes that lower uniforms to literals

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6955>

4 years agoutil: add _mesa_set_create_u32_keys where keys are not pointers
Marek Olšák [Tue, 29 Sep 2020 21:29:09 +0000 (17:29 -0400)]
util: add _mesa_set_create_u32_keys where keys are not pointers

the only limitation is that key=0 is not allowed

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6955>

4 years agopanfrost: Fix fixed-function blend on Mali v6
Boris Brezillon [Wed, 7 Oct 2020 12:37:56 +0000 (14:37 +0200)]
panfrost: Fix fixed-function blend on Mali v6

Mali v6 (G72) doesn't support constants in blend equations, let's use
a shader in that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: XML-ify the blend descriptors
Boris Brezillon [Wed, 16 Sep 2020 11:31:37 +0000 (13:31 +0200)]
panfrost: XML-ify the blend descriptors

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Rework the render target layout to use overlapping structs
Boris Brezillon [Tue, 15 Sep 2020 23:06:28 +0000 (01:06 +0200)]
panfrost: Rework the render target layout to use overlapping structs

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Rework fixed-function blending
Boris Brezillon [Wed, 16 Sep 2020 08:26:06 +0000 (10:26 +0200)]
panfrost: Rework fixed-function blending

The fixed-function blend logic uses the following equation: A + B x C.
A, B and C are configurable and can be complemented with negation (for
A and B) or inversion (for C) modifiers. Let's rework the blending
code to take that into account.

Note that we need to update the checksum of a few traces because the
equations we use have changed, leading to small deviations on the
final images. Indeed, there are several valid options for a given GL
blend equation, but the operand selection probably has an impact on the
rounding, leading to those mismatch.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: gen_pack: Add a no-direct-packing attribute
Boris Brezillon [Wed, 16 Sep 2020 07:16:04 +0000 (09:16 +0200)]
panfrost: gen_pack: Add a no-direct-packing attribute

To signify when a struct is not meant to be packed directly but should
instead be embedded in another struct.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: gen_pack: Support overlapping structs
Boris Brezillon [Tue, 15 Sep 2020 16:27:18 +0000 (18:27 +0200)]
panfrost: gen_pack: Support overlapping structs

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: gen_pack: Drop support for opaque structs
Boris Brezillon [Tue, 15 Sep 2020 16:11:29 +0000 (18:11 +0200)]
panfrost: gen_pack: Drop support for opaque structs

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Drop the with_opaque specifier on midgard blend desc
Boris Brezillon [Tue, 15 Sep 2020 16:07:42 +0000 (18:07 +0200)]
panfrost: Drop the with_opaque specifier on midgard blend desc

While at it, we also split the midgard and bifrost handling since
there's not much to share.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Get rid of the with_opaque qualifier on the renderer state desc
Boris Brezillon [Tue, 15 Sep 2020 15:03:28 +0000 (17:03 +0200)]
panfrost: Get rid of the with_opaque qualifier on the renderer state desc

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Adjust the renderer state definition
Boris Brezillon [Tue, 29 Sep 2020 13:47:04 +0000 (15:47 +0200)]
panfrost: Adjust the renderer state definition

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Adjust the primitive desc definition
Boris Brezillon [Tue, 29 Sep 2020 09:21:33 +0000 (11:21 +0200)]
panfrost: Adjust the primitive desc definition

Add missing fields and rename some of the existing ones.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agopanfrost: Adjust the draw descriptor definition
Boris Brezillon [Tue, 29 Sep 2020 08:45:23 +0000 (10:45 +0200)]
panfrost: Adjust the draw descriptor definition

Add missing fields, and rename some of the existing fields.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6980>

4 years agonir/algebraic: always lower idiv to shifts if bitops are allowed
Marek Olšák [Thu, 1 Oct 2020 15:32:45 +0000 (11:32 -0400)]
nir/algebraic: always lower idiv to shifts if bitops are allowed

why would you want anything else

The only platform significantly affected by this is Intel where `lower_idiv`
is not set today but neither is `lower_bitops`.  There it seems to still be
a boon over-all.

Shader-db results on Ice Lake:

    total instructions in shared programs: 19719051 -> 19735766 (0.08%)
    instructions in affected programs: 106992 -> 123707 (15.62%)
    helped: 0
    HURT: 445
    HURT stats (abs)   min: 3 max: 295 x̄: 37.56 x̃: 44
    HURT stats (rel)   min: 0.16% max: 33.33% x̄: 19.60% x̃: 19.38%
    95% mean confidence interval for instructions value: 33.60 41.53
    95% mean confidence interval for instructions %-change: 18.97% 20.23%
    Instructions are HURT.

    total loops in shared programs: 5973 -> 5973 (0.00%)
    loops in affected programs: 0 -> 0
    helped: 0
    HURT: 0

    total cycles in shared programs: 489405810 -> 486917482 (-0.51%)
    cycles in affected programs: 4759097 -> 2270769 (-52.29%)
    helped: 406
    HURT: 34
    helped stats (abs) min: 2 max: 64661 x̄: 6291.95 x̃: 3126
    helped stats (rel) min: 0.02% max: 79.42% x̄: 43.32% x̃: 55.83%
    HURT stats (abs)   min: 2 max: 29376 x̄: 1947.12 x̃: 30
    HURT stats (rel)   min: 0.04% max: 23.82% x̄: 4.66% x̃: 1.33%
    95% mean confidence interval for cycles value: -6753.06 -4557.52
    95% mean confidence interval for cycles %-change: -42.60% -36.63%
    Cycles are helped.

    total spills in shared programs: 12481 -> 12482 (<.01%)
    spills in affected programs: 47 -> 48 (2.13%)
    helped: 0
    HURT: 1

    total fills in shared programs: 12816 -> 12819 (0.02%)
    fills in affected programs: 71 -> 74 (4.23%)
    helped: 0
    HURT: 1

    total sends in shared programs: 1010124 -> 1010124 (0.00%)
    sends in affected programs: 0 -> 0
    helped: 0
    HURT: 0

    LOST:   1
    GAINED: 0

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6963>

4 years agoglthread: handle glInterleavedArrays
Marek Olšák [Sat, 26 Sep 2020 00:14:53 +0000 (20:14 -0400)]
glthread: handle glInterleavedArrays

We need to enable and bind everything on the glthread side too.
The behavior was copied from _mesa_InterleavedArrays.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>

4 years agomesa: remove api_loopback to remove call indirections
Marek Olšák [Sat, 26 Sep 2020 09:21:03 +0000 (05:21 -0400)]
mesa: remove api_loopback to remove call indirections

This is an optimization for SPECviewperf.

The increase in lines of code is only 14%.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>

4 years agomesa: don't use GET_DISPATCH because it doesn't work with glthread
Marek Olšák [Sat, 26 Sep 2020 00:44:10 +0000 (20:44 -0400)]
mesa: don't use GET_DISPATCH because it doesn't work with glthread

GET_DISPATCH returns CurrentClientDispatch, which invokes glthread if
it's enabled. GL function implementations should never call back to
glthread.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>

4 years agoclover: move tokenize function to algorithm
Serge Martin [Sun, 27 Sep 2020 12:12:46 +0000 (14:12 +0200)]
clover: move tokenize function to algorithm

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover/spirv: support CL_KERNEL_COMPILE_WORK_GROUP_SIZE
Karol Herbst [Sun, 23 Aug 2020 14:46:05 +0000 (16:46 +0200)]
clover/spirv: support CL_KERNEL_COMPILE_WORK_GROUP_SIZE

Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover/spirv: parse arg_info
Karol Herbst [Sun, 23 Aug 2020 11:26:12 +0000 (13:26 +0200)]
clover/spirv: parse arg_info

Reviewed-by: Serge Martin <edb@sigluy.net>
Acked-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover: avoid adding an extra space to compiler options
Serge Martin [Sun, 21 Jun 2020 15:08:51 +0000 (17:08 +0200)]
clover: avoid adding an extra space to compiler options

This make CTS test_compiler happier

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover: implements notification callback on program builds
Serge Martin [Mon, 18 May 2020 17:59:13 +0000 (19:59 +0200)]
clover: implements notification callback on program builds

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover: implements clGetKernelWorkGroupInfo CL_KERNEL_COMPILE_WORK_GROUP_SIZE
Serge Martin [Sun, 27 Sep 2020 13:45:33 +0000 (15:45 +0200)]
clover: implements clGetKernelWorkGroupInfo CL_KERNEL_COMPILE_WORK_GROUP_SIZE

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover: add CL_KERNEL_ATTRIBUTES for clGetKernelInfo
Serge Martin [Sun, 23 Aug 2020 06:50:54 +0000 (08:50 +0200)]
clover: add CL_KERNEL_ATTRIBUTES for clGetKernelInfo

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>

4 years agoclover: bind sampler_t type to module::argument::sampler
Serge Martin [Sat, 9 May 2020 22:02:14 +0000 (00:02 +0200)]
clover: bind sampler_t type to module::argument::sampler

Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4974>