platform/upstream/mesa.git
3 years agovenus: get rid of #ifdef's in vn_CreateImage
Chia-I Wu [Wed, 12 May 2021 20:50:56 +0000 (13:50 -0700)]
venus: get rid of #ifdef's in vn_CreateImage

No real change after compiler optimizations.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10779>

3 years agointel/fs: use the final destination type for regioning restrictions
Lionel Landwerlin [Wed, 12 May 2021 08:24:12 +0000 (11:24 +0300)]
intel/fs: use the final destination type for regioning restrictions

This is most likely a rebase mistake :(

Fixes: f3e5cd813ae6a8 ("intel/fs: Handle regioning restrictions of split FP/DP pipelines.")
Ref: aa53665fda6348 ("intel/fs/copy_prop: check stride constraints with actual final type")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10764>

3 years agopanfrost: Add GPU IDs for G52 1-Core-2EE (RK3568/RK3566)
Ezequiel Garcia [Tue, 11 May 2021 19:57:25 +0000 (16:57 -0300)]
panfrost: Add GPU IDs for G52 1-Core-2EE (RK3568/RK3566)

Rockchip SoCs RK3566 and RK3568 have a Gondul with
one shader core and two execution engines, with product ID 0x7402.

Quoting the datasheet:

Mali-G52 1-Core-2EE
* Support 1600Mpix/s fill rate when 800MHz clock frequency
* Support 38.4GLOPs when 800MHz clock frequency

To distinguish it from other variants of G52, we agreed
to call this "G52L", L is for Little.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10771>

3 years agopan/mdg: Use smaller LD_UNIFORM instructions
Alyssa Rosenzweig [Wed, 12 May 2021 17:22:24 +0000 (13:22 -0400)]
pan/mdg: Use smaller LD_UNIFORM instructions

If we only read 8 bytes from a UBO, we need to use LD_UNIFORM.64 as
opposed to LD_UNIFORM.128. In addition to probably being faster, this
fixes a buffer overrun manifesting as MMU faults with source ID
0x500/0x600/0x700, visible in WebGL Aquarium.

This is essentially the same patch as 616394cf31c ("pan/mdg: Use
appropriate sizes for global loads/stores"), only this is for UBOs where
that was for SSBOs.

Before enabling PACKED_UNIFORMS, this bug was not visible since we could
guarantee the UBO size was a multiple of 16. We no longer have that
invariant, and in rare cases the last 8 bytes of the last 16-byte slot
of a mapped uniform buffer would overrun the BO and trigger a fault,
even if the result is unused.

Fixes: 24d7c413fe7 ("panfrost: Enable packed uniforms.")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10772>

3 years agopanfrost: Don't upload empty push uniform table
Alyssa Rosenzweig [Wed, 12 May 2021 17:21:40 +0000 (13:21 -0400)]
panfrost: Don't upload empty push uniform table

Instead zero out the pointer in this case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10772>

3 years agopanfrost: Clean up cases for emit_fbd
Alyssa Rosenzweig [Wed, 12 May 2021 16:17:28 +0000 (12:17 -0400)]
panfrost: Clean up cases for emit_fbd

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10774>

3 years agopanfrost: Remove spurious assignment
Alyssa Rosenzweig [Wed, 12 May 2021 16:13:37 +0000 (12:13 -0400)]
panfrost: Remove spurious assignment

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10774>

3 years agopanfrost: Don't translate compare funcs
Alyssa Rosenzweig [Wed, 12 May 2021 14:41:09 +0000 (10:41 -0400)]
panfrost: Don't translate compare funcs

Matches Gallium.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10774>

3 years agopanfrost: Hide CAP_INT16 behind is_deqp
Alyssa Rosenzweig [Wed, 12 May 2021 19:08:19 +0000 (15:08 -0400)]
panfrost: Hide CAP_INT16 behind is_deqp

The GLSL precision lowering is still buggy (see !10729), no other driver
enables all the CAPs yet. I don't know enough GLSL IR to be the one to
fix this. In the mean time, this is a hotfix to expose the same set of
CAPs that radeonsi does.

By keeping it with is_deqp, we still get CI coverage of int16.

Closes: #4759
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10777>

3 years agofreedreno/ir3: Don't force RTNE if rounding mode is undefined
Rob Clark [Wed, 12 May 2021 17:15:03 +0000 (10:15 -0700)]
freedreno/ir3: Don't force RTNE if rounding mode is undefined

Forcing round-to-nearest-even results in loss of opportunities for
conversion folding, causing a regression in gfxbench gl_alu2.

Fixes: de195671bdb ("ir3: nir_op_f2f16 should round to even")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10773>

3 years agofrontends/va: fix multi planes for external memeory type
Leo Liu [Sun, 9 May 2021 15:58:55 +0000 (11:58 -0400)]
frontends/va: fix multi planes for external memeory type

For the multi planes case, only the first plane is required with the
template buffer formats, and shouldn't fail for other planes.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10751>

3 years agogallium/u_threaded: Add call logging
Rob Clark [Tue, 11 May 2021 15:44:42 +0000 (08:44 -0700)]
gallium/u_threaded: Add call logging

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

3 years agogallium/u_threaded: Add to_call() helper
Rob Clark [Tue, 11 May 2021 15:24:47 +0000 (08:24 -0700)]
gallium/u_threaded: Add to_call() helper

Add helper for casting the call, which when asserts are enabled will
sanity check the call size to detect corruption.

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

3 years agoci: Uprev piglit to 3351e8952 ("max-texture-size: report merged results")
Erik Faye-Lund [Tue, 11 May 2021 08:58:58 +0000 (10:58 +0200)]
ci: Uprev piglit to 3351e8952 ("max-texture-size: report merged results")

This pulls in a fix for the max-texture-size test using piglit-runner,
among other things.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10749>

3 years agogallium/u_threaded: fix 32-bit breakage due to incorrect pointer arithmetic
Marek Olšák [Tue, 11 May 2021 10:46:26 +0000 (06:46 -0400)]
gallium/u_threaded: fix 32-bit breakage due to incorrect pointer arithmetic

Fixes: 1233c90ab4a - gallium/u_threaded: rewrite slot layout to reduce wasted space
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4755
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4758
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10746>

3 years agoaco: fix additional register requirements for spilling
Daniel Schürmann [Tue, 11 May 2021 20:58:27 +0000 (22:58 +0200)]
aco: fix additional register requirements for spilling

It could happen that VGPR spilling without SGPR spilling
calculated a negative spills_to_vgpr number and then
increasing the VGPR target demand above the limit.

Cc: mesa-stable
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10756>

3 years agoradv: Use new NIR lowering of NGG GS when ACO is used.
Timur Kristóf [Thu, 22 Apr 2021 12:44:28 +0000 (14:44 +0200)]
radv: Use new NIR lowering of NGG GS when ACO is used.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoac: Add NIR lowering for NGG GS.
Timur Kristóf [Thu, 22 Apr 2021 12:43:54 +0000 (14:43 +0200)]
ac: Add NIR lowering for NGG GS.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoradv: Use new NGG NIR lowering for VS/TES when ACO is used.
Timur Kristóf [Thu, 15 Apr 2021 15:21:57 +0000 (17:21 +0200)]
radv: Use new NGG NIR lowering for VS/TES when ACO is used.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoac: Add new NIR pass to lower NGG VS/TES.
Timur Kristóf [Fri, 9 Apr 2021 14:56:57 +0000 (16:56 +0200)]
ac: Add new NIR pass to lower NGG VS/TES.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoaco: Implement new NGG specific NIR intrinsics.
Timur Kristóf [Fri, 9 Apr 2021 14:59:30 +0000 (16:59 +0200)]
aco: Implement new NGG specific NIR intrinsics.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoradv: Gather NGG info sooner.
Timur Kristóf [Thu, 22 Apr 2021 12:24:48 +0000 (14:24 +0200)]
radv: Gather NGG info sooner.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoradv: Fill shader info earlier.
Timur Kristóf [Thu, 15 Apr 2021 15:02:57 +0000 (17:02 +0200)]
radv: Fill shader info earlier.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoaco: Split ngg_emit_sendmsg_gs_alloc_req from the wave0 check.
Timur Kristóf [Thu, 15 Apr 2021 14:51:45 +0000 (16:51 +0200)]
aco: Split ngg_emit_sendmsg_gs_alloc_req from the wave0 check.

This allows us to emit the gs_alloc_req independently of the
wave ID check, which is what the NIR lowering will need.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoaco: Fixup the NIR metadata after sanitize_cf_list.
Timur Kristóf [Thu, 22 Apr 2021 12:11:39 +0000 (14:11 +0200)]
aco: Fixup the NIR metadata after sanitize_cf_list.

sanitize_cf_list can in fact invalidate the dominance metadata,
which we need to use eg. nir_unsigned_upper_bound.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agoaco: Allow workgroup barrier and shared scope for NGG shaders.
Timur Kristóf [Wed, 21 Apr 2021 12:20:45 +0000 (14:20 +0200)]
aco: Allow workgroup barrier and shared scope for NGG shaders.

NGG already needs to use workgroup barriers, but this commit allows
them to come from NIR as opposed to just emitting it in ACO
instruction selection.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agonir: Add AMD specific intrinsics for merged shaders and NGG.
Timur Kristóf [Tue, 4 May 2021 11:40:28 +0000 (13:40 +0200)]
nir: Add AMD specific intrinsics for merged shaders and NGG.

These intrinsics represent what the hardware can actually do.
Lowering our shaders to use these intrinsics will allow us to
deal with mapping the classic VS, TES, GS (and the future MS)
stages to the hardware capabilities using NIR, which makes our
backend compilers simpler.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agonir: Allow load_primitive_id in VS in nir_divergence_analysis.
Timur Kristóf [Mon, 10 May 2021 20:37:46 +0000 (22:37 +0200)]
nir: Allow load_primitive_id in VS in nir_divergence_analysis.

The lowered NIR code of NGG VS shaders uses this intrinsic
when the VS has to export the primitive ID.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agonir: Support upper bound of unsigned bit size conversions.
Timur Kristóf [Fri, 23 Apr 2021 06:48:46 +0000 (08:48 +0200)]
nir: Support upper bound of unsigned bit size conversions.

These allow us to generate slightly better code in some cases,
eg. multiplications in ACO.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agonir: Support upper bound of subgroup_id/num_subgroups for non-compute.
Timur Kristóf [Fri, 23 Apr 2021 06:46:18 +0000 (08:46 +0200)]
nir: Support upper bound of subgroup_id/num_subgroups for non-compute.

These intrinsics will be used when lowering NGG shaders, including
currently supported stages like VS, TES, GS and also by mesh shaders
in the future.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10740>

3 years agopanfrost: Implement framebuffer invalidation
Alyssa Rosenzweig [Tue, 11 May 2021 19:39:21 +0000 (15:39 -0400)]
panfrost: Implement framebuffer invalidation

The strategy is lifted from Freedreno. The trick is to remove buffers
from the resolve set, rather than add buffers to a discard set (as you
would naively try). The latter is wrong -- draws after the
glInvalidateFramebuffer() still need to be respected.

glmark2 -btexture on-screen with sway on Mali T860 from 1393fps to
1998fps

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

3 years agopanfrost: Set discard based on the resolve set
Alyssa Rosenzweig [Tue, 11 May 2021 19:38:52 +0000 (15:38 -0400)]
panfrost: Set discard based on the resolve set

This is a bit simpler and will allow resolve to be disabled
independently.

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

3 years agopanfrost: Track buffers needing resolve
Alyssa Rosenzweig [Tue, 11 May 2021 19:38:23 +0000 (15:38 -0400)]
panfrost: Track buffers needing resolve

This is a subset of the buffers cleared or drawed.

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

3 years agonir: handle float atomics in nir_lower_memory_model
Marcin Ślusarz [Thu, 12 Nov 2020 19:13:26 +0000 (20:13 +0100)]
nir: handle float atomics in nir_lower_memory_model

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 2adb337256f ("nir,radv/aco: add and use pass to lower make available/visible barriers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10766>

3 years agonir: handle float atomics in nir_gather_info
Marcin Ślusarz [Thu, 12 Nov 2020 19:13:18 +0000 (20:13 +0100)]
nir: handle float atomics in nir_gather_info

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10766>

3 years agotranslate: assert that nr_elements is in range
Erik Faye-Lund [Mon, 10 May 2021 15:47:47 +0000 (17:47 +0200)]
translate: assert that nr_elements is in range

This just ensures that we don't end up reading/writing outside of the
space reserved in the key. This would have made it easier to to track
down the issue in the previous commit faster.

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

3 years agotranslate: reserve more vertex-shader outputs
Erik Faye-Lund [Mon, 10 May 2021 15:46:28 +0000 (17:46 +0200)]
translate: reserve more vertex-shader outputs

It's not just position that's special here, we also need space for
other special vertex-shader outputs.

This fixes a crash with Zink on Lavapipe, because Zink always emits
psize to avoid some shader-keys. While this might not be ideal, it's not
illegal. So we need to handle it.

But it seems we're missing more, and this list is taken from
compute_vertex_info() in lp_state_derived.c.

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

3 years agolavapipe: correct reported number of UBOs
Erik Faye-Lund [Mon, 10 May 2021 16:15:57 +0000 (18:15 +0200)]
lavapipe: correct reported number of UBOs

When emitting the state we add one to the UBO index, so we have to
subtract one from the number of UBOs that we support. This is still
fine, because Vulkan only requires 14 UBOs to be supported, and LLVMpipe
supports 16.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10731>

3 years agopanfrost: Flag indirect draw/dispatch shaders as internal
Boris Brezillon [Tue, 11 May 2021 10:40:33 +0000 (12:40 +0200)]
panfrost: Flag indirect draw/dispatch shaders as internal

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

3 years agopanfrost: Expose the DRAW_PARAMETERS cap on Bifrost
Boris Brezillon [Tue, 11 May 2021 10:24:45 +0000 (12:24 +0200)]
panfrost: Expose the DRAW_PARAMETERS cap on Bifrost

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

3 years agopan/bi: Add support for gl_DrawID
Boris Brezillon [Tue, 11 May 2021 10:21:52 +0000 (12:21 +0200)]
pan/bi: Add support for gl_DrawID

We simply pass the drawid as a sysval.

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

3 years agopan/bi: Add support for gl_{BaseVertex,BaseInstance}
Boris Brezillon [Tue, 11 May 2021 09:16:46 +0000 (11:16 +0200)]
pan/bi: Add support for gl_{BaseVertex,BaseInstance}

Extend the VERTEX_INSTANCE_OFFSETS sysval to pass
BaseVertex/BaseInstance information to the shader.

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

3 years agopan/bi: Add first_vertex to vertex ID
Alyssa Rosenzweig [Thu, 22 Apr 2021 23:35:56 +0000 (19:35 -0400)]
pan/bi: Add first_vertex to vertex ID

Apparently r61 is zero based.

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

3 years agopanfrost: Split the indexed and !indexed indirect draw info structs
Boris Brezillon [Tue, 11 May 2021 09:01:20 +0000 (11:01 +0200)]
panfrost: Split the indexed and !indexed indirect draw info structs

Some fields are overlapping, so let's just split those structs to
avoid confusion.

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

3 years agoiris/ci: enable intel devices automatically in MR pipelines
Gustavo Padovan [Fri, 30 Apr 2021 15:02:39 +0000 (12:02 -0300)]
iris/ci: enable intel devices automatically in MR pipelines

After a period of stabilization it is now time to move them
to be part of the MR pipelines. We will still watch the
behavior and look for any issue that arises.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10550>

3 years agoiris/ci: disable failing gimark test for now
Gustavo Padovan [Fri, 30 Apr 2021 10:07:16 +0000 (07:07 -0300)]
iris/ci: disable failing gimark test for now

In order to enable the intel devices to automatically be part of
Marge pipelines we need it to be fully passing all tests. We will
remove the gimark tests temporaly to achieve that.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10550>

3 years agonv50/ir: Initialize GCRA::RIG_Node members.
Vinson Lee [Sat, 8 May 2021 23:59:15 +0000 (16:59 -0700)]
nv50/ir: Initialize GCRA::RIG_Node members.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member degree is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member degreeLimit is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member maxReg is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member f is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member reg is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member weight is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10714>

3 years agoturnip: Implement VK_KHR_timeline_semaphore.
Hyunjun Ko [Thu, 6 May 2021 05:05:39 +0000 (05:05 +0000)]
turnip: Implement VK_KHR_timeline_semaphore.

Implements non-shareable timelines using legacy syncobjs,
inspired by anv/radv implementation.

v1. Avoid memcpy in/out_syncobjs and fix some mistakes.
v2.
 - Handle vkQueueWaitIdle.
 - Add enum tu_semaphore_type.
 - Fix to handle VK_SEMAPHORE_WAIT_ANY_BIT_KHR correctly.
 - Fix a crash of dEQP-VK.synchronization.timeline_semaphore.device_host.misc.max_difference_value.

v3. Avoid indefinite waiting in vkQueueWaitIdle by calling
tu_device_submit_deferred_locked itself.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10126>

3 years agoturnip: prep work for timeline semaphore support
Hyunjun Ko [Thu, 8 Apr 2021 05:05:32 +0000 (05:05 +0000)]
turnip: prep work for timeline semaphore support

Small refactor to classify semphore types, currently only binary
syncobj is being used though.

v1. Fix a crash of dEQP-VK.api.null_handle.destroy_semaphore

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10126>

3 years agozink: pop descriptor refs when invalidating sets
Mike Blumenkrantz [Thu, 1 Apr 2021 18:52:21 +0000 (14:52 -0400)]
zink: pop descriptor refs when invalidating sets

this avoids memory ballooning, mainly for samplers, when a descriptorset
component has refs for a very, very large number of sets

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: remove screen param from zink_descriptors_update()
Mike Blumenkrantz [Thu, 1 Apr 2021 19:16:35 +0000 (15:16 -0400)]
zink: remove screen param from zink_descriptors_update()

this was redundant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: make zink_context_update_descriptor_states() static
Mike Blumenkrantz [Thu, 1 Apr 2021 19:13:18 +0000 (15:13 -0400)]
zink: make zink_context_update_descriptor_states() static

this is no longer used externally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: call invalidate on invalid descriptor sets during recycle
Mike Blumenkrantz [Thu, 1 Apr 2021 18:51:53 +0000 (14:51 -0400)]
zink: call invalidate on invalid descriptor sets during recycle

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: use better iterating for buffer rebinds
Mike Blumenkrantz [Thu, 1 Apr 2021 18:48:58 +0000 (14:48 -0400)]
zink: use better iterating for buffer rebinds

now that the number of descriptors for a given type is known, we can iterate
over all bound descriptors for the type instead of relying on shader usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: add slot params to zink_context_invalidate_descriptor_state
Mike Blumenkrantz [Thu, 1 Apr 2021 18:45:51 +0000 (14:45 -0400)]
zink: add slot params to zink_context_invalidate_descriptor_state

allow more precision with invalidation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: track number of tbos in shader data
Mike Blumenkrantz [Thu, 1 Apr 2021 18:21:34 +0000 (14:21 -0400)]
zink: track number of tbos in shader data

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: track max slot idx for descriptor types
Mike Blumenkrantz [Tue, 26 Jan 2021 14:34:13 +0000 (09:34 -0500)]
zink: track max slot idx for descriptor types

this will be useful when restoring states across renderpasses

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: don't track sampler states onto buffer sampler sets
Mike Blumenkrantz [Sat, 3 Apr 2021 16:40:11 +0000 (12:40 -0400)]
zink: don't track sampler states onto buffer sampler sets

this should always just be a null pointer to reduce overhead

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: update samplerview descriptor layouts when image binds are set
Mike Blumenkrantz [Fri, 5 Mar 2021 14:31:51 +0000 (09:31 -0500)]
zink: update samplerview descriptor layouts when image binds are set

for this case it's important to match the GENERAL layout in sampler bindings
if the resource is also being used as a shader image

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: track bind counts for descriptors
Mike Blumenkrantz [Tue, 12 Jan 2021 22:53:47 +0000 (17:53 -0500)]
zink: track bind counts for descriptors

* for samplers this is a per-stage slot mask that will be used for fast layout updates
* images get a count for gfx and compute usage
* any writable descriptor bind gets its own gfx/compute counter
* all descriptor binds are now counted

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: unify resource rebinding
Mike Blumenkrantz [Wed, 13 Jan 2021 19:12:45 +0000 (14:12 -0500)]
zink: unify resource rebinding

this improves handling for shader images

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: add context-based descriptor info tracking infrastructure
Mike Blumenkrantz [Fri, 22 Jan 2021 20:46:00 +0000 (15:46 -0500)]
zink: add context-based descriptor info tracking infrastructure

this maintains the exact structs needed to update descriptor states

it's incomplete at this moment due to lacking shader image rebinds, but
it's also not yet being used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agozink: stop invalidating descriptor sets on pool destroy
Mike Blumenkrantz [Wed, 12 May 2021 02:38:20 +0000 (22:38 -0400)]
zink: stop invalidating descriptor sets on pool destroy

this was debug code I was using for testing pool validity, but it
stopped being useful and just crashes sometimes now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>

3 years agovirgl: do not use winsys info for guest storage of classic resource
Yiwei Zhang [Tue, 11 May 2021 21:31:19 +0000 (21:31 +0000)]
virgl: do not use winsys info for guest storage of classic resource

winsys_stride is the stride of the host storage of the classic resource,
and using that breaks the readback on the guest storage.

v2: move the scrubbing to virgl_resource_from_handle
The returned modifier also points directly to the host driver's real
modifier but not a virtualized one. Leave plane_offset as zero here
matches the prior behavior before introducing winsys info.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v1)
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10757>

3 years agoiris: Use const uploader for user index data
Mark Janes [Tue, 25 Aug 2020 22:40:27 +0000 (15:40 -0700)]
iris: Use const uploader for user index data

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoiris: Use const uploader for draw parameters
Mark Janes [Tue, 25 Aug 2020 22:38:47 +0000 (15:38 -0700)]
iris: Use const uploader for draw parameters

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoiris: Use const uploader for blorp vertex data
Mark Janes [Tue, 25 Aug 2020 22:37:46 +0000 (15:37 -0700)]
iris: Use const uploader for blorp vertex data

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoiris: Use const_uploader for iris_create_stream_output_target
Mark Janes [Tue, 25 Aug 2020 22:27:07 +0000 (15:27 -0700)]
iris: Use const_uploader for iris_create_stream_output_target

This data is written and read by the GPU, and does not need to be in
system memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoiris: Upload constant resources for efficient GPU access
Mark Janes [Mon, 17 Aug 2020 21:37:03 +0000 (14:37 -0700)]
iris: Upload constant resources for efficient GPU access

Re-using the stream_uploader for constant data hurts performance on
DG1.  Constant data like uniform buffers should reside in local
memory for faster GPU access.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoiris: Increase the size of upload buffers
Mark Janes [Tue, 25 Aug 2020 22:29:20 +0000 (15:29 -0700)]
iris: Increase the size of upload buffers

Smaller sizes may generate CPU overhead while saving negligible
memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10759>

3 years agoci/iris: Add some more traces to replay.
Emma Anholt [Thu, 15 Apr 2021 22:46:16 +0000 (15:46 -0700)]
ci/iris: Add some more traces to replay.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>

3 years agoci/panfrost: Add some more traces to replay.
Emma Anholt [Thu, 15 Apr 2021 22:40:10 +0000 (15:40 -0700)]
ci/panfrost: Add some more traces to replay.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>

3 years agoci: Switch to apitraces for glmark2
Emma Anholt [Thu, 15 Apr 2021 19:18:26 +0000 (12:18 -0700)]
ci: Switch to apitraces for glmark2

This brings in upstream mediump fixes, and should also replay faster than
.rdc files.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>

3 years agoci: Remove the need for an empty Piglit results file
Tomeu Vizoso [Tue, 11 May 2021 14:10:10 +0000 (16:10 +0200)]
ci: Remove the need for an empty Piglit results file

Just create such an empty file if there isn't already.

So drivers that are expected to pass all tests don't need to commit an
empty results file.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10295>

3 years agozink/ntv: Don't call free() on ralloc'd memory
Adam Jackson [Tue, 11 May 2021 15:07:20 +0000 (11:07 -0400)]
zink/ntv: Don't call free() on ralloc'd memory

Caught this with an LTO build:

[1465/1465] Linking target src/gallium/targets/dri/libgallium_dri.so
In function ‘spirv_shader_delete’,
    inlined from ‘nir_to_spirv’ at ../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3907:7:
../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c:3916:4: warning: ‘free’ called on pointer ‘block_1394’ with nonzero offset 48 [-Wfree-nonheap-object]
 3916 |    FREE(s);
      |    ^
../src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c: In function ‘nir_to_spirv’:
../src/util/ralloc.c:133:18: note: returned from ‘malloc’
  133 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Since s->words is allocated on the same ralloc context we can simplify
further by freeing the context all at once.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10754>

3 years agoiris: refcount separate screen objects for resource tracking
Mike Blumenkrantz [Tue, 4 May 2021 19:08:07 +0000 (15:08 -0400)]
iris: refcount separate screen objects for resource tracking

this screen object can never, ever be accessed like this in a resource,
as it may have previously been replaced by a wrapper (e.g., driver trace)
which will then explode when it is accessed directly

instead, keep a separate screen ref on the resource which is known to be
the actual driver object and not a wrapper

Fixes: 0a497eb1303 ("iris: make resources take a ref on the screen object")

Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10632>

3 years agoturnip: Drop fail annotation for driver_properties.
Emma Anholt [Mon, 10 May 2021 18:44:16 +0000 (11:44 -0700)]
turnip: Drop fail annotation for driver_properties.

These subtests weren't run in CI, and the whole set is skipped since
dropping to 1.1.

Fixes: 7bcda2144107 ("turnip: Demote API version to 1.1.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10734>

3 years agoci/turnip: Add some links to issues and MRs for some test failures.
Emma Anholt [Mon, 10 May 2021 18:42:24 +0000 (11:42 -0700)]
ci/turnip: Add some links to issues and MRs for some test failures.

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

3 years agoci/turnip: Clean up some stale fail annotations.
Emma Anholt [Mon, 10 May 2021 17:15:56 +0000 (10:15 -0700)]
ci/turnip: Clean up some stale fail annotations.

This test group was fixed in the deqp 1.2.6.0 uprev, but we do a
fractional run that didn't include these tests.

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

3 years agogallivm: Fix a signature mismatch warning
Adam Jackson [Mon, 10 May 2021 16:26:48 +0000 (12:26 -0400)]
gallivm: Fix a signature mismatch warning

gcc 11 says:

../src/gallium/auxiliary/gallivm/lp_bld_format_soa.c:84:49: warning: argument 3 of type ‘struct LLVMOpaqueValue * const*’ declared as a pointer [-Warray-parameter=]
   84 |                             const LLVMValueRef *unswizzled,
      |                             ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from ../src/gallium/auxiliary/gallivm/lp_bld_format_soa.c:42:
../src/gallium/auxiliary/gallivm/lp_bld_format.h:126:48: note: previously declared as an array ‘struct LLVMOpaqueValue * const[4]’
  126 |                             const LLVMValueRef unswizzled[4],
      |                             ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10738>

3 years agoturnip: copy all layers specified in vkCmdCopyImage
Danylo Piliaiev [Mon, 10 May 2021 17:52:53 +0000 (20:52 +0300)]
turnip: copy all layers specified in vkCmdCopyImage

When copying layered images we ignored .layerCount parameter.

Fixes mis-rendering of walls in D3D11 game "Company Of Heroes 2".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10736>

3 years agobroadcom/compiler: clarify PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR setting
Iago Toral Quiroga [Tue, 11 May 2021 09:59:56 +0000 (11:59 +0200)]
broadcom/compiler: clarify PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR setting

We enabled this in the past to fix some register allocation issues we
faced with geometry shaders but we didn't document why it is safe for
us to do this, which is not immediately obvious.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10745>

3 years agov3d: disable GLSL loop unrolling again
Iago Toral Quiroga [Mon, 10 May 2021 07:30:54 +0000 (09:30 +0200)]
v3d: disable GLSL loop unrolling again

We had re-enabled this because of some test regressions:

KHR-GLES31.core.geometry_shader.limits.max_input_components and
ext_transform_feedback-max-varyings failed to register allocate,
but now that we support indirect indexing on vertex shader outputs natively
this is no longer an issue.

Piglit's max-samplers tests failed. These tests use indirect indexing
on samplers which is not supported and fail to link with this error message:
"Failed to link: error: sampler arrays indexed with non-constant expressions
is forbidden in GLSL  110". This is expected. The reason these were passing
before is that loop unrolling was able to turn indirect indexing into
direct indexing. We add them to the expected fail list.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: don't unroll due to indirect indexing of outputs
Iago Toral Quiroga [Mon, 10 May 2021 07:18:38 +0000 (09:18 +0200)]
broadcom/compiler: don't unroll due to indirect indexing of outputs

We can handle this natively now, so there is no point.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agov3dv: don't lower indirect derefs on output variables
Iago Toral Quiroga [Mon, 10 May 2021 07:14:37 +0000 (09:14 +0200)]
v3dv: don't lower indirect derefs on output variables

Our backend compiler can handle this for all supported shader stages now.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: don't use nir_src_is_dynamically_uniform
Iago Toral Quiroga [Tue, 11 May 2021 07:56:24 +0000 (09:56 +0200)]
broadcom/compiler: don't use nir_src_is_dynamically_uniform

Now that we have divergence analysis we should use that.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroacom/compiler: enable PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR
Iago Toral Quiroga [Mon, 10 May 2021 07:08:48 +0000 (09:08 +0200)]
broacom/compiler: enable PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR

We have been able to to handle indirect offsets on GS outputs for
a while and we have just implemented this for VS, so we can enable
this capability and avoid the horrible if-ladder code to convert
indirect output indices to constant indices.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: make vir_VPM_WRITE_indirect handle non-uniform offsets
Iago Toral Quiroga [Mon, 10 May 2021 07:06:54 +0000 (09:06 +0200)]
broadcom/compiler: make vir_VPM_WRITE_indirect handle non-uniform offsets

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: implement non-uniform offset on vertex outputs
Iago Toral Quiroga [Mon, 10 May 2021 07:02:10 +0000 (09:02 +0200)]
broadcom/compiler: implement non-uniform offset on vertex outputs

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: move vertex shader output handling to its own function
Iago Toral Quiroga [Mon, 10 May 2021 06:50:04 +0000 (08:50 +0200)]
broadcom/compiler: move vertex shader output handling to its own function

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10723>

3 years agobroadcom/compiler: fix dynamic-stack-buffer-overflow error
Juan A. Suarez Romero [Fri, 30 Apr 2021 16:44:02 +0000 (18:44 +0200)]
broadcom/compiler: fix dynamic-stack-buffer-overflow error

When spilling a register, the number of temps can be increased when
introducing a temporal variable.

Those nodes are not elegible to be spilled, but we need to take care of
no accessing out-of-bounds of the arrays defined with a size equal to
the original number of temps.

Fixes address sanitizer error on
KHR-GLES3.shaders.uniform_block.random.all_shared_buffer.14 (and many
others).

v2 (Iago):
 - Add clarification in assertion.
 - Use `vir_get_temp` to increase num_temps.

v3 (Iago):
 - Update clarification

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10643>

3 years agost/mesa: fix pipe resource leak
Juan A. Suarez Romero [Fri, 30 Apr 2021 10:58:22 +0000 (12:58 +0200)]
st/mesa: fix pipe resource leak

When switching from a normal texture to a texture storage, unreference
the old one to avoid leaking it.

v2 (Emma):
 - Update commit message

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10643>

3 years agov3d: fix resource leak in error path
Juan A. Suarez Romero [Fri, 30 Apr 2021 10:49:59 +0000 (12:49 +0200)]
v3d: fix resource leak in error path

Do not leak pipe resource if scanout resource creation fails.

Fixes: bf6973199d1 ("v3d: Allow the UIF modifier with renderonly.")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10643>

3 years agoegl/x11: don't forget to exit the attrib list loop
Eric Engestrom [Sun, 9 May 2021 16:10:32 +0000 (18:10 +0200)]
egl/x11: don't forget to exit the attrib list loop

Without this check, if we receive any attribs from the client, we either
find an X11/XCB screen fd in there, or we keep going until we end up in
random bits of memory and crash.

Fixes: 4aebd86f9a1b0db0ebcc ("egl/x11: pick the user requested screen")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10717>

3 years agozink: use DONTCARE renderpass when a new scanout fb attachment is set
Mike Blumenkrantz [Tue, 12 Jan 2021 17:29:25 +0000 (12:29 -0500)]
zink: use DONTCARE renderpass when a new scanout fb attachment is set

using DONTCARE for the loadOp is more optimal for this case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10698>

3 years agofreedreno: Update editorconfig and emacs settings for freedreno reformat.
Emma Anholt [Mon, 10 May 2021 22:10:05 +0000 (15:10 -0700)]
freedreno: Update editorconfig and emacs settings for freedreno reformat.

Fixes: 2d439343ea1a ("freedreno: Re-indent")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10742>

3 years agodocs: Simplify now that kmsro is autoenabled
Alyssa Rosenzweig [Mon, 10 May 2021 15:07:56 +0000 (11:07 -0400)]
docs: Simplify now that kmsro is autoenabled

Since 70813c1c13b ("meson: Remove kmsro from gallium-drivers"), it is no
longer necessary to include kmsro in the gallium-drivers list; kmsro
will be automatically enabled if it may be required. Simplify the docs
for lima and panfrost accordingly to reflect the change.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10727>

3 years agoci: skip glsl-uniform-interstage-limits tests for softpipe jobs
Mike Blumenkrantz [Fri, 7 May 2021 17:53:47 +0000 (13:53 -0400)]
ci: skip glsl-uniform-interstage-limits tests for softpipe jobs

these tests take over 5 minutes just locally, and the codepaths are mostly
shared with llvmpipe in the draw module, so there's not much point in running
them given that other drivers are more likely to catch any issues here over
softpipe, which is only more likely to catch timeouts

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10708>

3 years agoturnip: Claim 2 discrete queue priorities.
Eric Anholt [Mon, 26 Apr 2021 18:12:19 +0000 (11:12 -0700)]
turnip: Claim 2 discrete queue priorities.

The spec requires at least 2, but says "No specific guarantees are made
about higher priority queues receiving more processing time or better
quality of service than lower priority queues."  So, we can just leave the
priorities as a stub.

Fixes dEQP-VK.info.device_properties

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

3 years agoturnip: Drop wideLines properties since we don't support wide lines.
Eric Anholt [Mon, 26 Apr 2021 18:08:20 +0000 (11:08 -0700)]
turnip: Drop wideLines properties since we don't support wide lines.

The blob doesn't expose wideLines either, and
dEQP-VK.info.device_properties fails if you claim wide line properties
without it.

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