platform/upstream/mesa.git
2 years agoradv: ignore dynamic line stipple if line stipple isn't enabled
Mike Blumenkrantz [Fri, 27 Aug 2021 18:02:46 +0000 (14:02 -0400)]
radv: ignore dynamic line stipple if line stipple isn't enabled

==244108== Conditional jump or move depends on uninitialised value(s)
==244108==    at 0x48498D5: bcmp (vg_replace_strmem.c:1129)
==244108==    by 0x1C37B7DD: radv_bind_dynamic_state (radv_cmd_buffer.c:237)
==244108==    by 0x1C388027: radv_CmdBindPipeline (radv_cmd_buffer.c:4794)
==244108==    by 0x14E9C01E: bool update_gfx_pipeline<true>(zink_context*, zink_batch_state*, pipe_prim_type) (zink_draw.cpp:406)
==244108==    by 0x14E9AAB9: void zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)1, (zink_dynamic_state2)1, (zink_dynamic_vertex_input)1, true>(pipe_cont>
==244108==    by 0x14B017EB: tc_call_draw_single (u_threaded_context.c:3033)
==244108==    by 0x14AF9C0E: tc_batch_execute (u_threaded_context.c:190)
==244108==    by 0x14AFA24F: _tc_sync (u_threaded_context.c:341)
==244108==    by 0x14B006E7: tc_texture_subdata (u_threaded_context.c:2549)
==244108==    by 0x14238F8C: st_TexSubImage (st_cb_texture.c:2134)
==244108==    by 0x14239931: st_TexImage (st_cb_texture.c:2363)
==244108==    by 0x1453698A: teximage (teximage.c:3154)
==244108==    by 0x1453698A: teximage_err (teximage.c:3181)
==244108==    by 0x145388BD: _mesa_TexImage2D (teximage.c:3252)
==244108==    by 0x5E88D4: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x5E9527: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x5E9B72: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x5F1092: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x5F10AC: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x48CC66: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x48DDC7: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x40D525: ??? (in /home/zmike/src/piglit/tesseract/bin_unix/linux_64_client)
==244108==    by 0x4FF7B74: (below main) (in /usr/lib64/libc-2.33.so)
==244108==  Uninitialised value was created by a stack allocation
==244108==    at 0x14ECDF55: zink_create_gfx_pipeline (zink_pipeline.c:53)

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

2 years agoradv: use pool stride when copying single query results
Mike Blumenkrantz [Mon, 30 Aug 2021 14:31:15 +0000 (10:31 -0400)]
radv: use pool stride when copying single query results

the specified stride is irrelevant for this case since there's only one
result to write

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

2 years agoradv: advertise VK_EXT_primitive_topology_list_restart
Samuel Pitoiset [Fri, 27 Aug 2021 15:16:55 +0000 (17:16 +0200)]
radv: advertise VK_EXT_primitive_topology_list_restart

Everything should be already supported, except patch list.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12611>

2 years agovulkan: Update the XML and headers to 1.2.190
Samuel Pitoiset [Fri, 27 Aug 2021 15:13:13 +0000 (17:13 +0200)]
vulkan: Update the XML and headers to 1.2.190

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12611>

2 years agosvga/drm: use pb_usage_flags instead of pipe_map_flags in vmw_svga_winsys_buffer_map
Neha Bhende [Fri, 27 Aug 2021 20:04:20 +0000 (13:04 -0700)]
svga/drm: use pb_usage_flags instead of pipe_map_flags in vmw_svga_winsys_buffer_map

This patch basically maps pipe_map_flags to pb_flags. Since we are mapping it,
STATIC_ASSERTS won't be required.

Fixes: 00c30dad78b0 ("gallium: renumber PIPE_MAP_* enums to remove holes")

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12606>

2 years agoradv: add support for clearing multi layers with normal gfx clear path
Samuel Pitoiset [Wed, 25 Aug 2021 10:45:18 +0000 (12:45 +0200)]
radv: add support for clearing multi layers with normal gfx clear path

Allow to clear range of layers with vkCmdClear{Color,DepthStencil}Image().

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/12557>

2 years agoci: Fix a minor issue in prepare-artifacts.sh script
Rohan Garg [Thu, 26 Aug 2021 13:00:40 +0000 (15:00 +0200)]
ci: Fix a minor issue in prepare-artifacts.sh script

bash is whitespace sensitive.
https://github.com/koalaman/shellcheck/wiki/SC1020

This was noticed from the logs of a CI job
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/13158779
There was no fallout from this bug as not having this variable defined
leads to the right behavior, and defining it to 1 leads to a error
which consequently also leads to the right behaviour.

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

2 years agoaco: include utility in isel
Rhys Perry [Mon, 30 Aug 2021 09:42:34 +0000 (10:42 +0100)]
aco: include utility in isel

For std::exchange().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: c1d11bb92c9 ("aco: Add loop creation helpers.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5301
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12614>

2 years agonir: Fix local_invocation_index upper bound for non-compute-like stages.
Timur Kristóf [Thu, 26 Aug 2021 11:32:51 +0000 (13:32 +0200)]
nir: Fix local_invocation_index upper bound for non-compute-like stages.

The lowered LS and NGG stages use local_invocation_index and they
can benefit from the unsigned upper bound because they can emit a
less expensive integer multiplication instruction.
This was working in the past, but accidentally borked by a refactor.

Fossil DB changes on Sienna Cichlid:

Totals from 956 (0.74% of 128647) affected shaders:
CodeSize: 2354172 -> 2344712 (-0.40%)
Instrs: 434359 -> 434327 (-0.01%)
Latency: 1883949 -> 1876814 (-0.38%)
InvThroughput: 762638 -> 757405 (-0.69%)

Fossil DB changes on Sienna Cichlid (with NGGC enabled):

Totals from 57873 (44.99% of 128647) affected shaders:
CodeSize: 155844192 -> 155607064 (-0.15%)
Instrs: 29799184 -> 29799152 (-0.00%)
Latency: 130959764 -> 130814224 (-0.11%); split: -0.11%, +0.00%
InvThroughput: 21100300 -> 20928635 (-0.81%); split: -0.81%, +0.00%

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

2 years agonir: Add unsigned upper bound for extract opcodes.
Timur Kristóf [Thu, 26 Aug 2021 09:18:23 +0000 (11:18 +0200)]
nir: Add unsigned upper bound for extract opcodes.

This helps with some cases of extract, such as:
- Emitting more optimal integer multiplications
- Better address calculation
- Possibly others

Fossil DB results on Sienna Cichlid:

Totals from 4064 (3.16% of 128647) affected shaders:
VGPRs: 262040 -> 262032 (-0.00%)
CodeSize: 28856648 -> 28811892 (-0.16%); split: -0.18%, +0.02%
Instrs: 5370279 -> 5367827 (-0.05%); split: -0.08%, +0.04%
Latency: 74230112 -> 74016671 (-0.29%); split: -0.29%, +0.01%
InvThroughput: 12082532 -> 12036365 (-0.38%); split: -0.39%, +0.01%
VClause: 108506 -> 108721 (+0.20%); split: -0.03%, +0.22%
SClause: 217731 -> 216602 (-0.52%); split: -0.67%, +0.15%
Copies: 265689 -> 270811 (+1.93%); split: -0.26%, +2.19%
PreSGPRs: 201982 -> 204907 (+1.45%); split: -0.01%, +1.46%
PreVGPRs: 236099 -> 236079 (-0.01%)

Fossil DB results on Sienna Cichlid with NGGC enabled:

Totals from 60375 (46.93% of 128647) affected shaders:
VGPRs: 2212576 -> 2212568 (-0.00%)
CodeSize: 180870420 -> 179684816 (-0.66%); split: -0.66%, +0.00%
Instrs: 34386715 -> 34213682 (-0.50%); split: -0.51%, +0.01%
Latency: 199676290 -> 198987998 (-0.34%); split: -0.35%, +0.00%
InvThroughput: 32288299 -> 31736433 (-1.71%); split: -1.71%, +0.00%
VClause: 621521 -> 621743 (+0.04%); split: -0.00%, +0.04%
SClause: 900447 -> 899392 (-0.12%); split: -0.16%, +0.04%
Copies: 3439529 -> 3445305 (+0.17%); split: -0.02%, +0.19%
PreSGPRs: 2216297 -> 2219220 (+0.13%); split: -0.00%, +0.13%
PreVGPRs: 1842887 -> 1842867 (-0.00%)

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

2 years agoaco: Unset 16 and 24-bit flags from operands in apply_extract.
Timur Kristóf [Thu, 26 Aug 2021 08:47:10 +0000 (10:47 +0200)]
aco: Unset 16 and 24-bit flags from operands in apply_extract.

Consider the following sequence in a shader:
b = p_extract a
c = v_mad_u32_u16 b, X, 0

The optimizer applies extract, resulting in:
c = v_mad_u32_u16 a, X, 0 (correct)

Then it mistakenly turns that into:
c = v_mul_u32_u24 a, X, 0 (incorrect)

In this case, the p_extract is applied to v_mad_u32_u16 by
apply_extract. After this, we can no longer be sure that
the operands are still 16 or 24-bit, so we have to remove
this flag.

No Fossil DB changes.

Fixes: 54292e99c7844500314bfd623469c65adef954c5
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12558>

2 years agozink: implement PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY when resizable bar not present
Mike Blumenkrantz [Fri, 30 Jul 2021 13:20:10 +0000 (09:20 -0400)]
zink: implement PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY when resizable bar not present

this helps in some cases to avoid allocating and mapping large staging resources

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12579>

2 years agozink: determine whether the gpu has a resizable BAR at startup
Mike Blumenkrantz [Fri, 30 Jul 2021 13:18:54 +0000 (09:18 -0400)]
zink: determine whether the gpu has a resizable BAR at startup

this can be used to make different allocation and mapping decisions

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12579>

2 years agopanvk/ci: Build-test panvk
Tomeu Vizoso [Mon, 30 Aug 2021 07:26:19 +0000 (09:26 +0200)]
panvk/ci: Build-test panvk

We still need to implement quite some functionality before it would make
sense to run dEQP in CI, but it will be already useful to build-test it.

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

2 years agoradv: do not allocate a clear value for images that support comp-to-single
Samuel Pitoiset [Thu, 26 Aug 2021 15:56:53 +0000 (17:56 +0200)]
radv: do not allocate a clear value for images that support comp-to-single

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/12565>

2 years agoradv: do not load/store the clear value for comp-to-single images
Samuel Pitoiset [Thu, 26 Aug 2021 16:00:39 +0000 (18:00 +0200)]
radv: do not load/store the clear value for comp-to-single images

Images that are fast cleared with the comp-to-single mode clears DCC
to 0x10 which tells the hardware to get the clear value from the
main surface instead of the reg.

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/12565>

2 years agoradv: disable DCC image stores on Navi12-14 for displayable DCC corruption
Samuel Pitoiset [Tue, 24 Aug 2021 14:52:50 +0000 (16:52 +0200)]
radv: disable DCC image stores on Navi12-14 for displayable DCC corruption

DCC image stores require 128B but 64B is used for displayable DCC.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5265
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5106
Cc: 21.2 mesa-stable
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/12521>

2 years agovulkan/wsi/sw: add mit-shm support for pixmap allocation
Dave Airlie [Mon, 23 Aug 2021 00:10:37 +0000 (10:10 +1000)]
vulkan/wsi/sw: add mit-shm support for pixmap allocation

This allocate the mit-shm pixmap instead of dri3 pixmaps and
uses the present paths when mit-shm is enabled

Acked-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12482>

2 years agovulkan/wsi/sw: add support for using host_ptr for shm pixmaps.
Dave Airlie [Mon, 23 Aug 2021 00:03:20 +0000 (10:03 +1000)]
vulkan/wsi/sw: add support for using host_ptr for shm pixmaps.

This pipes the allocation of the MIT-SHM pixmap into the wsi common
code to callback to the x11 path to allocate things in the right place.

Acked-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12482>

2 years agovulkan/wsi: add support for detecting mit-shm pixmaps.
Dave Airlie [Mon, 23 Aug 2021 00:00:29 +0000 (10:00 +1000)]
vulkan/wsi: add support for detecting mit-shm pixmaps.

This just adds the xcb bits to detect is the host supports shared
shm pixmaps or whether the old paths should be used.

shm pixmaps will only be used if dri3 is available

Acked-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12482>

2 years agofreedreno/ci: Take fd farm offline for moving day
Rob Clark [Fri, 27 Aug 2021 17:08:14 +0000 (10:08 -0700)]
freedreno/ci: Take fd farm offline for moving day

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12602>

2 years agofreedreno/ci: Add a status variable for CI farm
Rob Clark [Fri, 27 Aug 2021 17:06:16 +0000 (10:06 -0700)]
freedreno/ci: Add a status variable for CI farm

Make it a one-line change to disable freedreno CI jobs if the farm is
offline.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12602>

2 years agospirv: Implement non-Multiview parts of SPV_NV_mesh_shader
Caio Marcelo de Oliveira Filho [Thu, 29 Apr 2021 22:06:29 +0000 (15:06 -0700)]
spirv: Implement non-Multiview parts of SPV_NV_mesh_shader

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir: Allow Task/Mesh to lower compute system values
Caio Marcelo de Oliveira Filho [Wed, 25 Aug 2021 21:40:13 +0000 (14:40 -0700)]
nir: Allow Task/Mesh to lower compute system values

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir: Don't lower Task/Mesh I/O to temporaries
Caio Marcelo de Oliveira Filho [Fri, 30 Apr 2021 07:01:28 +0000 (00:01 -0700)]
nir: Don't lower Task/Mesh I/O to temporaries

These won't work since a workgroup can span more than one thread, and
the temporaries are not shared memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir/divergence_analysis: Handle Task/Mesh shaders
Caio Marcelo de Oliveira Filho [Thu, 26 Aug 2021 18:26:04 +0000 (11:26 -0700)]
nir/divergence_analysis: Handle Task/Mesh shaders

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir/lower_io: Identify Mesh output as arrayed
Caio Marcelo de Oliveira Filho [Fri, 30 Apr 2021 07:01:07 +0000 (00:01 -0700)]
nir/lower_io: Identify Mesh output as arrayed

Mesh shader outputs are either:

- non-array builtins
- array builtins that are either per-primitive or per-vertex
- user-defined outputs that must be either per-primitive or per-vertex

So we can identify any array output as "arrayed" for the purposes of
I/O lowering.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agocompiler: Add Task/Mesh to shader_info
Caio Marcelo de Oliveira Filho [Thu, 29 Apr 2021 20:48:33 +0000 (13:48 -0700)]
compiler: Add Task/Mesh to shader_info

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agocompiler: Add new non-Multiview Task/Mesh builtins
Caio Marcelo de Oliveira Filho [Thu, 29 Apr 2021 20:45:56 +0000 (13:45 -0700)]
compiler: Add new non-Multiview Task/Mesh builtins

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir: Add per-primitive I/O intrinsics
Caio Marcelo de Oliveira Filho [Mon, 3 May 2021 19:04:01 +0000 (12:04 -0700)]
nir: Add per-primitive I/O intrinsics

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir: Add a way to identify per-primitive variables
Caio Marcelo de Oliveira Filho [Thu, 29 Apr 2021 18:51:57 +0000 (11:51 -0700)]
nir: Add a way to identify per-primitive variables

Per-primitive is similar to per-vertex attributes, but applies to all
fragments of the primitive without any interpolation involved.

Because they are regular input and outputs, keep track in shader_info
of which I/O is per-primitive so we can distinguish them after deref
lowering.  These fields can be used combined with the regular
`inputs_read`, `outputs_written` and `outputs_read`.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agonir: Update documentation for location to mention Task/Mesh
Caio Marcelo de Oliveira Filho [Thu, 29 Apr 2021 20:47:50 +0000 (13:47 -0700)]
nir: Update documentation for location to mention Task/Mesh

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10600>

2 years agoisl/docs/tiling: Add Tile4 docs
Jason Ekstrand [Thu, 1 Jul 2021 19:06:34 +0000 (14:06 -0500)]
isl/docs/tiling: Add Tile4 docs

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12550>

2 years agoaco: Emit zero for the derivatives of uniforms.
Timur Kristóf [Thu, 26 Aug 2021 14:36:28 +0000 (16:36 +0200)]
aco: Emit zero for the derivatives of uniforms.

Observed in a shader from Resident Evil Village.
This also helps prevent emitting invalid IR.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12599>

2 years agozink: only update inlinable constants when they change
Mike Blumenkrantz [Fri, 30 Jul 2021 17:14:20 +0000 (13:14 -0400)]
zink: only update inlinable constants when they change

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12577>

2 years agoaco/optimizer: combine v_pk_mul_u16 + v_pk_add_u16 -> v_pk_mad_u16
Daniel Schürmann [Thu, 5 Aug 2021 13:52:08 +0000 (15:52 +0200)]
aco/optimizer: combine v_pk_mul_u16 + v_pk_add_u16 -> v_pk_mad_u16

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

2 years agoaco/optimizer: fuse v_mul_f64 + v_add_f64 -> v_fma_f64
Daniel Schürmann [Wed, 30 Jun 2021 17:20:49 +0000 (19:20 +0200)]
aco/optimizer: fuse v_mul_f64 + v_add_f64 -> v_fma_f64

No fossil-db changes.

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

2 years agoaco/optimizer: combine v_mul_lo_u16 + v_add_u16 -> v_mad_u16
Daniel Schürmann [Thu, 1 Jul 2021 16:48:09 +0000 (18:48 +0200)]
aco/optimizer: combine v_mul_lo_u16 + v_add_u16 -> v_mad_u16

Totals from 192 (0.13% of 150170) affected shaders: (GFX10.3)
CodeSize: 1027224 -> 1019872 (-0.72%)
Instrs: 174784 -> 173863 (-0.53%)
Latency: 4235742 -> 4232177 (-0.08%); split: -0.11%, +0.03%
InvThroughput: 1777026 -> 1775945 (-0.06%); split: -0.09%, +0.03%
Copies: 34098 -> 34099 (+0.00%); split: -0.03%, +0.03%
PreVGPRs: 4920 -> 4850 (-1.42%)

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

2 years agoaco: refactor nir_op_imul selection
Daniel Schürmann [Thu, 1 Jul 2021 10:42:08 +0000 (12:42 +0200)]
aco: refactor nir_op_imul selection

Previously, the optimization to use v_mul_lo_u16 for
32bit multiplications was done in instruction_selection.
This was moved to the optimizer to ease some case distinctions.

The mixed results are due to increased use of SDWA.

Totals from 2616 (1.74% of 150170) affected shaders: (GFX10.3)
VGPRs: 143888 -> 143872 (-0.01%); split: -0.02%, +0.01%
CodeSize: 5604032 -> 5604080 (+0.00%); split: -0.01%, +0.01%
Instrs: 1086798 -> 1083915 (-0.27%); split: -0.27%, +0.01%
Latency: 8215793 -> 8213023 (-0.03%); split: -0.10%, +0.07%
InvThroughput: 20765157 -> 20773766 (+0.04%); split: -0.02%, +0.06%
VClause: 35256 -> 35260 (+0.01%); split: -0.02%, +0.03%
SClause: 29021 -> 29024 (+0.01%); split: -0.00%, +0.01%
Copies: 74163 -> 74306 (+0.19%); split: -0.05%, +0.24%

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

2 years agoaco: only apply extract if not used more than 4 times
Daniel Schürmann [Thu, 1 Jul 2021 13:03:36 +0000 (15:03 +0200)]
aco: only apply extract if not used more than 4 times

Totals from 61 (0.04% of 150170) affected shaders: (GFX10.3)
CodeSize: 1087732 -> 1087380 (-0.03%); split: -0.22%, +0.18%
Instrs: 192343 -> 192205 (-0.07%); split: -0.16%, +0.09%
Latency: 7231670 -> 7148073 (-1.16%); split: -1.19%, +0.04%
InvThroughput: 3436715 -> 3394926 (-1.22%); split: -1.25%, +0.04%
VClause: 4831 -> 4833 (+0.04%)
Copies: 50130 -> 49934 (-0.39%); split: -0.67%, +0.28%
Branches: 5945 -> 5948 (+0.05%)
PreSGPRs: 3486 -> 3472 (-0.40%)
PreVGPRs: 5154 -> 5152 (-0.04%)

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

2 years agofreedreno: ci updates
Mike Blumenkrantz [Fri, 27 Aug 2021 17:23:34 +0000 (13:23 -0400)]
freedreno: ci updates

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

2 years agofreedreno: remove primconvert
Mike Blumenkrantz [Fri, 27 Aug 2021 14:54:44 +0000 (10:54 -0400)]
freedreno: remove primconvert

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

2 years agofreedreno: export supported primtypes
Mike Blumenkrantz [Fri, 27 Aug 2021 14:54:35 +0000 (10:54 -0400)]
freedreno: export supported primtypes

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

2 years agoFix building AMD MM/GL with EL7
Jeremy Newton [Wed, 25 Aug 2021 21:03:23 +0000 (17:03 -0400)]
Fix building AMD MM/GL with EL7

This partially reverts commit 4d9acfa5331be6140e84badff7a232dbf07b69b4.

The original patch said:

"Python 3 handles unicode strings by default, so we can drop all that."

But this breaks building on RHEL 7 (or similiar) since python3 support
on is much more limited than newer distros. Backporting all the needed
python 3 libraries to EL7 is a pretty big task, and isn't very easy to
maintain.

For workstation purposes, we need the AMD MM/GL driver building on RHEL
7, so only src/util/driconf_static.py needs to be reverted.

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

2 years agozink: avoid generating nonsensical code
Erik Faye-Lund [Wed, 25 Aug 2021 19:51:44 +0000 (21:51 +0200)]
zink: avoid generating nonsensical code

With this code, we end up generating code such as:

if (!strcmp(extensions[i].extensionName, "VK_KHR_maintenance1")) {
   if (VK_MAKE_VERSION(1,2,0) >= screen->vk_version) {
      info->have_KHR_maintenance1 = true;
   } else {
      info->have_KHR_maintenance1 = true;
   }
}

That's clearly nonsense, as it does the same thing in the true and false
case. So let's instead try to walk the Vulkan versions up to the one
we're using in a separate pass, and add all extensions that were made core
in that version.

CID: 1473289

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12593>

2 years agozink: reduce scope of version-struct hack
Erik Faye-Lund [Wed, 25 Aug 2021 21:46:18 +0000 (23:46 +0200)]
zink: reduce scope of version-struct hack

Without this, we'll end up checking against the wrong version when
enabling core features in the next commit.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12593>

2 years agozink: clean up const-value handling for get_ssbo_size
Erik Faye-Lund [Thu, 26 Aug 2021 09:12:23 +0000 (11:12 +0200)]
zink: clean up const-value handling for get_ssbo_size

nir_src_as_const_value can return null pointers, and in other places we
at least assert for this. So let's do that here as well, which makes
Coverity a bit less paranoid.

While we're at it, avoid duplicating the nir_src_as_const_value call to
the same source.

CID: 1444291

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

2 years agozink: remove incorrect ASSERTED macro
Erik Faye-Lund [Thu, 26 Aug 2021 09:07:38 +0000 (11:07 +0200)]
zink: remove incorrect ASSERTED macro

The documentation for ASSERTED in macros.h says:

> Use ASSERTED to indicate that an identifier is unused outside of an `assert()`,
> so that assert-free builds don't get "unused variable" warnings.

We're using this variable outside of assert, so this shouldn't apply
here.

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

2 years agozink: remove needless scope
Erik Faye-Lund [Thu, 26 Aug 2021 09:03:25 +0000 (11:03 +0200)]
zink: remove needless scope

There's no variables declared in here, so there's no point in having
this slightly awkward scope here.

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

2 years agozink: give each major intrinsic it's own emit function
Erik Faye-Lund [Thu, 26 Aug 2021 08:24:30 +0000 (10:24 +0200)]
zink: give each major intrinsic it's own emit function

It's so much easier to follow this code if there's not any big blocks of
emitting in the middle of the code that figures out exactly what to do.

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

2 years agozink: avoid checking if src is const twice
Erik Faye-Lund [Wed, 25 Aug 2021 21:55:46 +0000 (23:55 +0200)]
zink: avoid checking if src is const twice

nir_src_as_const_value also checks if the src is const, and not
checking that it returned null makes Coverity go paranoid thinking we
could dereference a null-pointer. But because it's slightly better to
check once than to check twice, let's rewrite this to avoid the
double-check, making it obvious what's going on here.

CID: 1485624

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

2 years agozink: avoid memcmping null pointers
Erik Faye-Lund [Thu, 26 Aug 2021 09:36:21 +0000 (11:36 +0200)]
zink: avoid memcmping null pointers

memcmping NULL pointers is not allowed, and would lead to a crash here.
So let's check that the first isn't NULL; we've already checked that
they're not *both* NULL, so checking one is enough.

CID: 1484801, 1484810

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

2 years agozink: remove needless NULL-check
Erik Faye-Lund [Thu, 26 Aug 2021 09:27:33 +0000 (11:27 +0200)]
zink: remove needless NULL-check

This NULL-check makes Coverity paranoid because we just dereferenced the
pointer a few lines above.

But we never call this function with a NULL-pointer here, so the NULL
check isn't needed. Let's just remove it, to calm Coverity down a bit.

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

2 years agozink: return false on failure
Erik Faye-Lund [Thu, 26 Aug 2021 09:24:37 +0000 (11:24 +0200)]
zink: return false on failure

We do this in the other pipe_buffer_map_range failure case, so it makes
sense that we need to do it here as well. If we don't, we'll end up
taking a crash in the check_query_results function, which will
dereference that pointer.

We also need to unmap the buffer if we fail, otherwise we'll leak.

CID: 1475925

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

2 years agozink: pctx can't be null here
Erik Faye-Lund [Thu, 26 Aug 2021 09:17:21 +0000 (11:17 +0200)]
zink: pctx can't be null here

We're checking if pctx is null here, but that can't be true. If it
could, then the code that follows would have immediately crashed.

A quick peek at other drivers seems to indicate that this is a safe
assumption.

CID: 1474410, 1474554

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

2 years agozink: do not dereference null-pointer
Erik Faye-Lund [Wed, 25 Aug 2021 22:09:44 +0000 (00:09 +0200)]
zink: do not dereference null-pointer

The "locations" pointer can be null here, and memcpying from a null
pointer is not okay.

CID: 1485978

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

2 years agozink: do not try to dereference null-key
Erik Faye-Lund [Wed, 25 Aug 2021 22:02:11 +0000 (00:02 +0200)]
zink: do not try to dereference null-key

We can't do any of this logic if key is NULL, because that means we'll
dereference memory close to a NULL-pointer.

While we're at it, add some asserts to the zink_fs_key and zink_vs_key
functions who would otherwise be responsible for giving us invalid
non-null pointers out of null-pointers.

CID: 1475973, 1475983

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

2 years agozink: avoid overflow when calculating size
Erik Faye-Lund [Wed, 25 Aug 2021 19:44:46 +0000 (21:44 +0200)]
zink: avoid overflow when calculating size

If we multiply before we (implicitly) cast the result to the target
type, we needlessly risk overflowing the result.

CID: 1490790, 1475922

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

2 years agozink: initialize pQueueFamilyIndices
Erik Faye-Lund [Wed, 25 Aug 2021 19:38:17 +0000 (21:38 +0200)]
zink: initialize pQueueFamilyIndices

This silences a Coverity warning about an uninitialized variable.

CID: 1490800

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

2 years agozink: do not warn about rare features until used
Erik Faye-Lund [Fri, 27 Aug 2021 08:05:52 +0000 (10:05 +0200)]
zink: do not warn about rare features until used

We currently cause the following scary warning to be printed on
start-up for *every* application regardless if that feature is being
used or not when run on top of ANV:

> WARNING: Some incorrect rendering might occur because the selected
> Vulkan device (Intel(R) UHD Graphics 620 (KBL GT2)) doesn't support
> base Zink requirements: line_rast_feats.stippledRectangularLines
> line_rast_feats.stippledSmoothLines

There's no need to scare the users about this, as most applications
don't care about these combinational features. So let's instead emit a
warning when these features are attempted (but failed) to be used
instead.

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

2 years agoRevert "zink: always init bordercolor value for sampler"
Erik Faye-Lund [Fri, 27 Aug 2021 08:32:41 +0000 (10:32 +0200)]
Revert "zink: always init bordercolor value for sampler"

This reverts commit 336dea90f09c5cefc46de5240da28950fdca0723.

This change was incorrect for two reasons:

1. We already initialize this field on line 334
2. Unconditionally setting this to
   VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK breaks rendering with e.g
   opaque white borders, because we've already matched those to a
   non-custom enum value first.

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

2 years agoi965: Enable RGBX8888_SRGB format.
Lepton Wu [Sat, 14 Aug 2021 22:52:47 +0000 (15:52 -0700)]
i965: Enable RGBX8888_SRGB format.

This is required by Android. Some Android games like nier reincarnation
show a black screen without this.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12393>

2 years agoaco: Consider maximum number of workgroups per CU/WGP on Navi.
Timur Kristóf [Tue, 24 Aug 2021 06:57:39 +0000 (08:57 +0200)]
aco: Consider maximum number of workgroups per CU/WGP on Navi.

No Fossil DB changes.

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/12517>

2 years agoaco: Consider LDS usage by PS inputs in MaxWaves calculation.
Timur Kristóf [Tue, 24 Aug 2021 06:44:54 +0000 (08:44 +0200)]
aco: Consider LDS usage by PS inputs in MaxWaves calculation.

Before PS waves are launched, PS inputs are moved from PC to LDS
and the corresponding part of the PC is deallocated.
Each PS input occupies 3 * vec4 (3 * 16 = 48 bytes) of LDS space.
See Figure 10.3 in the GCN3 ISA manual.

These limit occupancy the same way as other stages' LDS usage does.
Note that PS can request additional LDS space via EXTRA_LDS_SIZE,
so that also must be taken into account here.

No Fossil DB changes.

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/12517>

2 years agozink: remove extra program ref from cached descriptor updates
Mike Blumenkrantz [Fri, 6 Aug 2021 14:54:05 +0000 (10:54 -0400)]
zink: remove extra program ref from cached descriptor updates

this happens in draw/compute now

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12582>

2 years agozink: avoid pulling in unused push descriptors for cached ubo0
Mike Blumenkrantz [Fri, 6 Aug 2021 14:52:25 +0000 (10:52 -0400)]
zink: avoid pulling in unused push descriptors for cached ubo0

instead of just reading the template bufferinfo data, ensure that only
buffers which will be read are added to the set to avoid stale cache entries

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12582>

2 years agoiris/ci: Correctly set freq governors to max
Tomeu Vizoso [Fri, 27 Aug 2021 14:55:22 +0000 (16:55 +0200)]
iris/ci: Correctly set freq governors to max

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12598>

2 years agofreedreno/ci: Correctly set freq governors to max
Tomeu Vizoso [Fri, 27 Aug 2021 14:55:07 +0000 (16:55 +0200)]
freedreno/ci: Correctly set freq governors to max

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12598>

2 years agopanvk: Fix panvk_copy_fb_desc()
Boris Brezillon [Fri, 27 Aug 2021 11:00:20 +0000 (13:00 +0200)]
panvk: Fix panvk_copy_fb_desc()

We should not skip the copy when the batch is attached a framebuffer
descriptor, quite the opposite. Let's drop the check instead of reversing
it since we are guaranteed to have an FB attached when
panvk_copy_fb_desc() is called.

Fixes: 792a0ab0b146 ("panvk: Prepare per-gen split")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12590>

2 years agopanvk: Make the per-arch static lib depend on panvk_entrypoints.h
Boris Brezillon [Fri, 27 Aug 2021 08:30:38 +0000 (10:30 +0200)]
panvk: Make the per-arch static lib depend on panvk_entrypoints.h

The panvk_entrypoints.h header is included by all panvk_vX_xxx.c
source files, without this dependency the build can fail.

Fixes: 792a0ab0b146 ("panvk: Prepare per-gen split")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Fabio Pedretti <pedretti.fabio@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12590>

2 years agozink: more effectively utilize batch_usage for query destruction
Mike Blumenkrantz [Mon, 2 Aug 2021 17:44:30 +0000 (13:44 -0400)]
zink: more effectively utilize batch_usage for query destruction

there's no need to track the number of batches that a query is referenced on,
as all the tracking is already done by the batch_usage mechanism, so this
can be simplified to manage destruction based on whether batch_usage exists

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>

2 years agozink: don't try to sync previous timestamp query qbo values
Mike Blumenkrantz [Mon, 2 Aug 2021 14:52:20 +0000 (10:52 -0400)]
zink: don't try to sync previous timestamp query qbo values

this makes no sense, so don't explode the qbo by trying

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>

2 years agozink: move time query ending out to zink_end_query
Mike Blumenkrantz [Mon, 2 Aug 2021 14:51:15 +0000 (10:51 -0400)]
zink: move time query ending out to zink_end_query

time queries only need to be ended when the api ends them, not per-cmdbuf

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>

2 years agozink: improve threadsafe qbo access
Mike Blumenkrantz [Mon, 2 Aug 2021 16:01:54 +0000 (12:01 -0400)]
zink: improve threadsafe qbo access

these should be staging resources since they're being read from often,
and this allows dropping the UNSYNCHRONIZED flag from map since it should
be inferred

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12578>

2 years agozink: make zink_gfx_pipeline_state::vertices_per_patch a bitfield
Mike Blumenkrantz [Tue, 15 Jun 2021 15:52:20 +0000 (11:52 -0400)]
zink: make zink_gfx_pipeline_state::vertices_per_patch a bitfield

this is clamped to MAX_PATCH_VERTICES

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

2 years agozink: repack zink_gfx_pipeline_state
Mike Blumenkrantz [Tue, 15 Jun 2021 15:52:08 +0000 (11:52 -0400)]
zink: repack zink_gfx_pipeline_state

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

2 years agozink: convert rasterizer pipeline components to bitfield
Mike Blumenkrantz [Tue, 15 Jun 2021 15:35:02 +0000 (11:35 -0400)]
zink: convert rasterizer pipeline components to bitfield

this reduces the hashed pipeline key size by 53 bits

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

2 years agozink: steal a bit from rast_samples in pipeline state
Mike Blumenkrantz [Thu, 15 Jul 2021 13:20:27 +0000 (09:20 -0400)]
zink: steal a bit from rast_samples in pipeline state

zink only handles values up to 64, so this still has an extra bit

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

2 years agozink: add clip_halfz to rasterizer hw state
Mike Blumenkrantz [Fri, 18 Jun 2021 16:47:29 +0000 (12:47 -0400)]
zink: add clip_halfz to rasterizer hw state

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

2 years agozink: repack zink_rasterizer_hw_state
Mike Blumenkrantz [Tue, 15 Jun 2021 14:23:38 +0000 (10:23 -0400)]
zink: repack zink_rasterizer_hw_state

this is now 11 bits

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

2 years agozink: zero viewport and scissor count in pipeline with dynamic state1
Mike Blumenkrantz [Tue, 15 Jun 2021 13:51:13 +0000 (09:51 -0400)]
zink: zero viewport and scissor count in pipeline with dynamic state1

this is illegal

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

2 years agozink: move viewport count into dynamic state1 part of pipeline hash
Mike Blumenkrantz [Tue, 15 Jun 2021 13:50:26 +0000 (09:50 -0400)]
zink: move viewport count into dynamic state1 part of pipeline hash

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

2 years agozink: move dynamic state1 pipeline members into substruct
Mike Blumenkrantz [Tue, 15 Jun 2021 13:47:50 +0000 (09:47 -0400)]
zink: move dynamic state1 pipeline members into substruct

this is a bit easier to manage

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

2 years agopanfrost: v7 does not support RGB32_UNORM textures
Boris Brezillon [Tue, 18 May 2021 14:03:29 +0000 (16:03 +0200)]
panfrost: v7 does not support RGB32_UNORM textures

Cc: mesa-stable
Fixes: c6bdd976e611 ("panfrost: Split out v6/v7 format tables")
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/12588>

2 years agoiris: fix layer calculation for TEXTURE_3D ReadPixels() on mip-level>0
Yevhenii Kharchenko [Mon, 22 Feb 2021 22:15:15 +0000 (00:15 +0200)]
iris: fix layer calculation for TEXTURE_3D ReadPixels() on mip-level>0

Fixes assert when ReadPixels() called to read from FBO to
GL_PIXEL_PACK_BUFFER, on mip-level > 0, since num_layers
wasn't properly calculated with mip-level.

v2: patched 'iris_create_sampler_view' function instead of
'resolve_sampler_views'. Just like it was suggested in this
function's comment.
The logic of fix is similar to one in 'update_image_surface' function
of i965 driver, which is introduced in commit
f9fd0cf4790cb2a530e75d1a2206dbb9d8af7cb2.
With a slight change: setting array_len=1, like it was done in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5808 ,
since minifying depth fails KHR-GLES2.texture_3d.filtering tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4145
Fixes: 3c979b0e ('iris: add some draw resolve hooks')

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9253>

2 years agoradv: remove unecessary radv_finishme() for invalid color formats
Samuel Pitoiset [Thu, 26 Aug 2021 09:00:33 +0000 (11:00 +0200)]
radv: remove unecessary radv_finishme() for invalid color formats

Something really bad happen (likely driver bug) if this is triggered.
Replace with some assertions to catch an eventual issue in debug build.

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/12556>

2 years agoradv: remove useless check about number of samples in the HW resolve path
Samuel Pitoiset [Thu, 26 Aug 2021 08:56:04 +0000 (10:56 +0200)]
radv: remove useless check about number of samples in the HW resolve path

Although this can likely hang, this is invalid and should be caught
by the validation layers. There is many ways to hang the GPU with VK,
this check alone is useless.

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/12556>

2 years agoradv: remove outdated radv_finishme() in the HW resolve path
Samuel Pitoiset [Thu, 26 Aug 2021 08:54:53 +0000 (10:54 +0200)]
radv: remove outdated radv_finishme() in the HW resolve path

Resolving layered MSAA images is actually implemented by the HW
resolve path but never used because the driver uses the compute path.

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/12556>

2 years agozink: set primitive restart with extended dynamic state2
Mike Blumenkrantz [Fri, 11 Jun 2021 15:20:30 +0000 (11:20 -0400)]
zink: set primitive restart with extended dynamic state2

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

2 years agozink: bump dynamic pipeline state count
Mike Blumenkrantz [Fri, 11 Jun 2021 14:04:24 +0000 (10:04 -0400)]
zink: bump dynamic pipeline state count

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

2 years agozink: template for VK_EXT_extended_dynamic_state2
Mike Blumenkrantz [Fri, 11 Jun 2021 14:04:17 +0000 (10:04 -0400)]
zink: template for VK_EXT_extended_dynamic_state2

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

2 years agozink: hook up VK_EXT_extended_dynamic_state2
Mike Blumenkrantz [Fri, 11 Jun 2021 14:03:59 +0000 (10:03 -0400)]
zink: hook up VK_EXT_extended_dynamic_state2

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

2 years agozink: no-op prim changes for pipeline recalc
Mike Blumenkrantz [Mon, 14 Jun 2021 18:24:32 +0000 (14:24 -0400)]
zink: no-op prim changes for pipeline recalc

this is no longer part of pipeline hash since we're using dynamic state

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

2 years agozink: consolidate pipeline hash tables
Mike Blumenkrantz [Mon, 14 Jun 2021 18:23:05 +0000 (14:23 -0400)]
zink: consolidate pipeline hash tables

with dynamic prim type, pipelines can now be grouped by base prim type
instead of requiring a different pipeline for overall prim type

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

2 years agozink: use dynamic prim type
Mike Blumenkrantz [Mon, 14 Jun 2021 18:21:39 +0000 (14:21 -0400)]
zink: use dynamic prim type

this is part of dynamic state but wasn't used since it required
actual work to effectively make use of it

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

2 years agozink: batch mem barrier hooks
Mike Blumenkrantz [Fri, 16 Jul 2021 13:44:51 +0000 (09:44 -0400)]
zink: batch mem barrier hooks

memory barriers are redundant, so batch them and apply based on actual
usage to be slightly more efficient

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

2 years agozink: slim down streamout component of mem barrier hook
Mike Blumenkrantz [Thu, 15 Jul 2021 18:26:04 +0000 (14:26 -0400)]
zink: slim down streamout component of mem barrier hook

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

2 years agozink: remove query flush from memory barrier hook
Mike Blumenkrantz [Thu, 15 Jul 2021 14:42:39 +0000 (10:42 -0400)]
zink: remove query flush from memory barrier hook

qbos are separate buffers with their own barriers, so this just stalls
pointlessly

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

2 years agozink: use ctx gfx prim mode for draw comparisons
Mike Blumenkrantz [Fri, 11 Jun 2021 13:50:09 +0000 (09:50 -0400)]
zink: use ctx gfx prim mode for draw comparisons

just being consistent

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

2 years agozink: init ctx->gfx_prim_mode to nonzero value to trigger pipeline changes
Mike Blumenkrantz [Fri, 25 Jun 2021 13:32:44 +0000 (09:32 -0400)]
zink: init ctx->gfx_prim_mode to nonzero value to trigger pipeline changes

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