platform/upstream/mesa.git
16 months agotreewide: style fixes after replace the usage of ubyte/ushort with uint8_t/uint16_t
Yonggang Luo [Thu, 22 Jun 2023 16:52:16 +0000 (00:52 +0800)]
treewide: style fixes after replace the usage of ubyte/ushort with uint8_t/uint16_t

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agotreewide: Replace the usage of ubyte/ushort with uint8_t/uint16_t
Yonggang Luo [Thu, 22 Jun 2023 16:35:04 +0000 (00:35 +0800)]
treewide: Replace the usage of ubyte/ushort with uint8_t/uint16_t

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agotreewide: Replace the usage of TRUE/FALSE with true/false
Yonggang Luo [Thu, 22 Jun 2023 15:58:38 +0000 (23:58 +0800)]
treewide: Replace the usage of TRUE/FALSE with true/false

this is a separate patch as it's won't affect the code style

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agotreewide: style fixes after replace usage of boolean to bool
Yonggang Luo [Thu, 22 Jun 2023 15:32:13 +0000 (23:32 +0800)]
treewide: style fixes after replace usage of boolean to bool

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agotreewide: replace usage of boolean to bool
Yonggang Luo [Thu, 22 Jun 2023 16:24:20 +0000 (00:24 +0800)]
treewide: replace usage of boolean to bool

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agollvmpipe: altivec.h inclusion in -std=c++98..11 causes bool to be redefined
Yonggang Luo [Sun, 11 Jun 2023 18:59:59 +0000 (02:59 +0800)]
llvmpipe: altivec.h inclusion in -std=c++98..11 causes bool to be redefined

So we carefully include altivec.h in lp_setup_tri.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agogallium/draw: Replace the usage of ushort to uint16_t in files that can not found...
Yonggang Luo [Sun, 11 Jun 2023 17:21:53 +0000 (01:21 +0800)]
gallium/draw: Replace the usage of ushort to uint16_t in files that can not found by tools

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agohud: Use bool/true/false to replace boolean/TRUE/FALSE in hud/hud_context.c
Yonggang Luo [Sun, 11 Jun 2023 17:04:44 +0000 (01:04 +0800)]
hud: Use bool/true/false to replace boolean/TRUE/FALSE in hud/hud_context.c

auto tools can not find and replace
```
#define HUD_DEFAULT_VISIBILITY TRUE
```
So did the of this line manually,

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>

16 months agoaux/indices: use stdint.h types
Erik Faye-Lund [Fri, 23 Jun 2023 14:38:10 +0000 (16:38 +0200)]
aux/indices: use stdint.h types

These generated sources uses older, less portable types such as ubyte,
ushort and uint. But we have stdint.h everywhere now, so let's use those
types instead.

To stay consistent, let's talk about UINT8 etc instead of UBYTE for the
entirety of the u_indices infrastructure.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23853>

16 months agoetnaviv: linker: add fallback lookup to VARYING_SLOT_BFC[n]
Christian Gmeiner [Thu, 22 Jun 2023 18:56:30 +0000 (20:56 +0200)]
etnaviv: linker: add fallback lookup to VARYING_SLOT_BFC[n]

There are valid NIR shaders pairs where the vertex shader has
a VARYING_SLOT_BFC0 shader_out and the corresponding framgent
shader has a VARYING_SLOT_COL0 shader_in.
So at link time if there is no matching VARYING_SLOT_BFC[n],
we must map VARYING_SLOT_BFC0[n] to VARYING_SLOT_COL[n].

Example shader pair from 'spec@!opengl 2.0@vertex-program-two-side back':

shader: MESA_SHADER_VERTEX
source_sha1: {0xf916f77d, 0xffa6ab5e, 0x160976a7, 0xb59fe59c, 0x92e8f3f6}
name: GLSL3
internal: false
stage: 0
next_stage: 4
inputs_read: 0
outputs_written: 0,13
subgroup_size: 1
bit_sizes_float: 0x20
bit_sizes_int: 0x20
first_ubo_is_default_ubo: true
flrp_lowered: true
inputs: 1
outputs: 2
uniforms: 0
decl_var shader_in INTERP_MODE_NONE vec4 gl_Vertex (VERT_ATTRIB_POS.xyzw, 0, 0)
decl_var shader_out INTERP_MODE_NONE vec4 gl_Position (VARYING_SLOT_POS.xyzw, 0, 0)
decl_var shader_out INTERP_MODE_NONE vec4 gl_BackColor (VARYING_SLOT_BFC0.xyzw, 1, 0)
decl_function main (0 params)

impl main {
        block block_0:
        /* preds: */
        vec1 32 ssa_0 = deref_var &gl_Vertex (shader_in vec4)
        vec4 32 ssa_1 = intrinsic load_deref (ssa_0) (access=0)
        vec4 32 ssa_2 = load_const (0x00000000, 0x00000000, 0x3f000000, 0x00000000) = (0.000000, 0.000000, 0.500000, 0.000000)
        vec1 32 ssa_5 = deref_var &gl_BackColor (shader_out vec4)
        vec4 32 ssa_11 = mov ssa_2
        vec4 32 ssa_13 = fsat ssa_11
        intrinsic store_deref (ssa_5, ssa_13) (wrmask=xyzw, access=0)
        vec1 32 ssa_7 = deref_var &gl_Position (shader_out vec4)
        vec4 32 ssa_12 = mov ssa_1
        intrinsic store_deref (ssa_7, ssa_12) (wrmask=xyzw, access=0)
        /* succs: block_1 */
        block block_1:
}

shader: MESA_SHADER_FRAGMENT
source_sha1: {0x5059da66, 0x00c609e5, 0x5329c39a, 0x13e2fc88, 0x8e68cb71}
name: GLSL3
internal: false
stage: 4
next_stage: 4
inputs_read: 1
outputs_written: 2
subgroup_size: 1
first_ubo_is_default_ubo: true
flrp_lowered: true
inputs: 1
outputs: 1
uniforms: 0
decl_var shader_in INTERP_MODE_NONE vec4 gl_Color (VARYING_SLOT_COL0.xyzw, 0, 0)
decl_var shader_out INTERP_MODE_NONE vec4 gl_FragColor (FRAG_RESULT_COLOR.xyzw, 0, 0)
decl_function main (0 params)

impl main {
        block block_0:
        /* preds: */
        vec1 32 ssa_0 = deref_var &gl_Color (shader_in vec4)
        vec4 32 ssa_1 = intrinsic load_deref (ssa_0) (access=0)
        vec1 32 ssa_2 = deref_var &gl_FragColor (shader_out vec4)
        intrinsic store_deref (ssa_2, ssa_1) (wrmask=xyzw, access=0)
        /* succs: block_1 */
        block block_1:
}

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23850>

16 months agoetnaviv: nir: call nir_remove_dead_variables(..) before linking setup
Christian Gmeiner [Wed, 14 Jun 2023 19:19:45 +0000 (21:19 +0200)]
etnaviv: nir: call nir_remove_dead_variables(..) before linking setup

There are cases where there is a chain to an unused nir variable that get removed
by nir_opt_dce. This breaks our current linker as the variable can still be accessed
via nir_foreach_shader_in_variable(..) macro.

So lets call nir_remove_dead_variables(..) just before we setup our linking.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23673>

16 months agoir3/analyze_ubo_ranges: Move IR3_DBG_NOUBOOPT check
Christian Gmeiner [Mon, 26 Jun 2023 08:53:58 +0000 (10:53 +0200)]
ir3/analyze_ubo_ranges: Move IR3_DBG_NOUBOOPT check

There is no need to walk the hole nir shader if IR3_DBG_NOUBOOPT
is used.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23854>

16 months agov3dv: don't use the TLB path if we might be copying partial tiles
Iago Toral Quiroga [Tue, 20 Jun 2023 07:47:57 +0000 (09:47 +0200)]
v3dv: don't use the TLB path if we might be copying partial tiles

With TLB paths we are always storing full tiles, so we can't use it
if the regions we store are not a multiple of the tile size (or the
full image).

Unfortunately, at the point we call this we don't usually have the
tile size yet so for now we skip the path if we are not copying
full mip levels.

Fixes various CTS fails in:
dEQP-VK.ycbcr.copy.*.optimal*buffer_optimal*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23739>

16 months agov3dv: fix slice size for miplevels >= 2
Iago Toral Quiroga [Thu, 22 Jun 2023 06:18:35 +0000 (08:18 +0200)]
v3dv: fix slice size for miplevels >= 2

We want to store the slice size in pixels not the level size
after padding to a power of 2 we use miplevels >= 2.

Fixes: 1cb2d2a5ee ('v3dv: store slice dimensions in pixels')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23739>

16 months agodocs: Update envvars used for tracing
Konstantin Seurer [Sat, 20 May 2023 18:21:50 +0000 (20:21 +0200)]
docs: Update envvars used for tracing

Updates the environment variables reference to document the new common
tracing infrastructure.

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

16 months agovulkan/rmv,radv: Use common trace trigger
Konstantin Seurer [Sat, 14 Jan 2023 14:18:09 +0000 (15:18 +0100)]
vulkan/rmv,radv: Use common trace trigger

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

16 months agoradv/rgp: Use common trace trigger
Konstantin Seurer [Sun, 8 Jan 2023 20:29:33 +0000 (21:29 +0100)]
radv/rgp: Use common trace trigger

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

16 months agoradv/rra: Use common trace trigger
Konstantin Seurer [Sun, 8 Jan 2023 20:25:59 +0000 (21:25 +0100)]
radv/rra: Use common trace trigger

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

16 months agovulkan/wsi/x11: Capture traces using a hotkey
Konstantin Seurer [Sun, 8 Jan 2023 15:46:13 +0000 (16:46 +0100)]
vulkan/wsi/x11: Capture traces using a hotkey

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

16 months agoradv: Add radv_trace_mode
Konstantin Seurer [Wed, 10 May 2023 17:21:09 +0000 (19:21 +0200)]
radv: Add radv_trace_mode

...and add the RADV specific trace modes to the VK instance.

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

16 months agovulkan: Common trace capturing infrastructure
Konstantin Seurer [Sun, 8 Jan 2023 15:44:57 +0000 (16:44 +0100)]
vulkan: Common trace capturing infrastructure

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

16 months agomeson: Add a xcb-keysyms dependency
Konstantin Seurer [Sun, 8 Jan 2023 15:44:12 +0000 (16:44 +0100)]
meson: Add a xcb-keysyms dependency

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

16 months agoradv: Call radv_pipeline_init_scratch per shader
Konstantin Seurer [Thu, 22 Jun 2023 20:22:34 +0000 (22:22 +0200)]
radv: Call radv_pipeline_init_scratch per shader

Compute pipelines only have one shader, which was not handled correctly
in the case of ray tracing pipelines. Adding radv_shader as an argument
allows us to handle the ray tracing prolog. The original loop is inlined
into its only user (radv_pipeline_graphics.c).

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23812>

16 months agointel/ds: Track CCS cache flush bit
Sagar Ghuge [Thu, 22 Jun 2023 17:46:22 +0000 (10:46 -0700)]
intel/ds: Track CCS cache flush bit

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoiris: implement recommended flush/wait of AUX-TT invalidation
Sagar Ghuge [Wed, 21 Jun 2023 17:13:15 +0000 (10:13 -0700)]
iris: implement recommended flush/wait of AUX-TT invalidation

This patch implements the recommended flush/wait of AUX-TT invalidation
according to per command streamer (engine).

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoiris: Fix AUX-TT invalidation
Sagar Ghuge [Wed, 21 Jun 2023 05:05:08 +0000 (22:05 -0700)]
iris: Fix AUX-TT invalidation

In order to make sure RCS engine is idle, we need to add
DC flush + CS stall + Render target Cache flush + Depth Cache
on Gfx 12 and additional CCS cache flush on Gfx12.5.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoiris: Add CCS cache flush bits
Sagar Ghuge [Wed, 21 Jun 2023 04:35:07 +0000 (21:35 -0700)]
iris: Add CCS cache flush bits

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoanv: implement recommended flush/wait of AUX-TT invalidation on compute
Sagar Ghuge [Wed, 21 Jun 2023 19:17:20 +0000 (12:17 -0700)]
anv: implement recommended flush/wait of AUX-TT invalidation on compute

This patch implements the recommended flush/wait of AUX-TT invalidation
for compute/render command streamer.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoanv: Fix AUX-TT invalidation
Sagar Ghuge [Wed, 21 Jun 2023 04:48:44 +0000 (21:48 -0700)]
anv: Fix AUX-TT invalidation

In order to make sure RCS engine is idle, we need to add
DC flush + CS stall + Render target Cache flush + Depth Cache
on Gfx 12 and additional CCS cache flush on Gfx12.5.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agoanv: Add CCS cache flush bits to anv_pipe_bits
Sagar Ghuge [Wed, 21 Jun 2023 04:09:26 +0000 (21:09 -0700)]
anv: Add CCS cache flush bits to anv_pipe_bits

This will help us to flush the entries out of the CCS cache.

v2:
- Move enum value close to HW bits section (Lionel)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agointel/genxml: Add Compute/Blitter CCS aux invalidation register
Sagar Ghuge [Wed, 21 Jun 2023 16:46:37 +0000 (09:46 -0700)]
intel/genxml: Add Compute/Blitter CCS aux invalidation register

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agointel/genxml: Add CCS cache flush field to PIPE_CONTROL
Sagar Ghuge [Wed, 21 Jun 2023 03:45:26 +0000 (20:45 -0700)]
intel/genxml: Add CCS cache flush field to PIPE_CONTROL

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23786>

16 months agovc4/v3d/ci: update expected results
Juan A. Suarez Romero [Mon, 26 Jun 2023 16:40:59 +0000 (18:40 +0200)]
vc4/v3d/ci: update expected results

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23862>

16 months agoradv: Enable VK_EXT_fragment_shader_interlock
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:50:12 +0000 (22:50 +0300)]
radv: Enable VK_EXT_fragment_shader_interlock

ACO only currently - not available in LLVM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agozink/ci: Add broken fragment shader interlock test to RADV flakes
Vitaliy Triang3l Kuzmin [Sat, 24 Jun 2023 12:25:40 +0000 (15:25 +0300)]
zink/ci: Add broken fragment shader interlock test to RADV flakes

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Disable VRS forcing with Primitive Ordered Pixel Shading
Vitaliy Triang3l Kuzmin [Fri, 7 Apr 2023 14:31:04 +0000 (17:31 +0300)]
radv: Disable VRS forcing with Primitive Ordered Pixel Shading

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Apply the POPS missed overlap hardware bug workaround
Vitaliy Triang3l Kuzmin [Thu, 27 Apr 2023 11:40:48 +0000 (14:40 +0300)]
radv: Apply the POPS missed overlap hardware bug workaround

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoac/gpu_info: Check whether the device has the POPS missed overlap bug
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:40:33 +0000 (22:40 +0300)]
ac/gpu_info: Check whether the device has the POPS missed overlap bug

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Handle Primitive Ordered Pixel Shading in DB_SHADER_CONTROL
Vitaliy Triang3l Kuzmin [Sat, 13 May 2023 21:23:16 +0000 (00:23 +0300)]
radv: Handle Primitive Ordered Pixel Shading in DB_SHADER_CONTROL

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Enable the null export workaround with POPS
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:23:11 +0000 (22:23 +0300)]
radv: Enable the null export workaround with POPS

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Enable POPS collision wave ID shader argument
Vitaliy Triang3l Kuzmin [Fri, 2 Jun 2023 19:58:47 +0000 (22:58 +0300)]
radv: Enable POPS collision wave ID shader argument

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Declare POPS collision wave ID shader argument
Vitaliy Triang3l Kuzmin [Fri, 2 Jun 2023 19:55:48 +0000 (22:55 +0300)]
radv: Declare POPS collision wave ID shader argument

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Ensure 1x1 shading rate on GFX10.3 with interlock execution mode
Vitaliy Triang3l Kuzmin [Fri, 2 Jun 2023 21:29:31 +0000 (00:29 +0300)]
radv: Ensure 1x1 shading rate on GFX10.3 with interlock execution mode

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Detect the use of Primitive Ordered Pixel Shading
Vitaliy Triang3l Kuzmin [Fri, 2 Jun 2023 21:26:31 +0000 (00:26 +0300)]
radv: Detect the use of Primitive Ordered Pixel Shading

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradv: Remove unconditional POPS_DRAIN_PS_ON_OVERLAP setting
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:15:37 +0000 (22:15 +0300)]
radv: Remove unconditional POPS_DRAIN_PS_ON_OVERLAP setting

This hardware hang workaround (PAL waMiscPopsMissedOverlap) is needed only
on some Vega chips, and only for 8 or more samples per pixel. It has a
significant performance cost (around 1.5x-2x in
nvpro-samples/vk_order_independent_transparency), so it should be precisely
configured when setting up Primitive Ordered Pixel Shading.

It was added in 47b780be21d917eaa6a6a6c9e30ba9fba52d9acd, when POPS was not
used in Mesa, with the change being described as "this may not be needed
yet, but let's set it now".

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoradeonsi: Remove unconditional POPS_DRAIN_PS_ON_OVERLAP setting
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:14:39 +0000 (22:14 +0300)]
radeonsi: Remove unconditional POPS_DRAIN_PS_ON_OVERLAP setting

This hardware hang workaround (PAL waMiscPopsMissedOverlap) is needed only
on some Vega chips, and only for 8 or more samples per pixel. It has a
significant performance cost (around 1.5x-2x in
nvpro-samples/vk_order_independent_transparency), so it should be precisely
configured when setting up Primitive Ordered Pixel Shading.

It was added in 47b780be21d917eaa6a6a6c9e30ba9fba52d9acd, when POPS was not
used in Mesa, with the change being described as "this may not be needed
yet, but let's set it now".

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Implement fragment shader interlock intrinsics
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:54:38 +0000 (21:54 +0300)]
aco: Implement fragment shader interlock intrinsics

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Add Primitive Ordered Pixel Shading waitcnt rules
Vitaliy Triang3l Kuzmin [Thu, 6 Apr 2023 20:09:35 +0000 (23:09 +0300)]
aco: Add Primitive Ordered Pixel Shading waitcnt rules

When letting the overlapping waves enter their ordered sections, there must
be no memory accesses to resources which need primitive-ordered access that
are still pending, or there would be a race between the current wave and
the overlapping waves.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Send MSG_ORDERED_PS_DONE where necessary
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:18:21 +0000 (21:18 +0300)]
aco: Send MSG_ORDERED_PS_DONE where necessary

If the wave has set the Primitive Ordered Pixel Shading packer ID hardware
register, it must send MSG_ORDERED_PS_DONE once before the program ends.
It's also safe to send the message if the packer ID register hasn't been
set yet, therefore the message may be sent conservatively. For simplicity,
to ensure that it's sent on all execution paths after setting the packer ID
register, always sending it from a top-level block. This is required for
GFX9-10.3 POPS.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Add Primitive Ordered Pixel Shading scheduling rules
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:27:47 +0000 (21:27 +0300)]
aco: Add Primitive Ordered Pixel Shading scheduling rules

Implementing the acquire/release semantics of fragment shader interlock
ordered section in Vulkan, and preventing reordering of memory accesses
requiring primitive ordering out of the ordered section.

Also, the ordered section should be as short as possible, so not reordering
the instructions awaiting overlapped waves upwards, and the exit from the
ordered section downwards.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Skip waitcnt insertion in the discard early exit block
Vitaliy Triang3l Kuzmin [Sat, 15 Apr 2023 18:45:12 +0000 (21:45 +0300)]
aco: Skip waitcnt insertion in the discard early exit block

Waits are needed for early exits from inside a Primitive Ordered Pixel
Shading ordered section, but that code doesn't insert them reliably anyway
because it doesn't obtain the counters for the exact locations of the
jumps, which may be anywhere inside the predecessor blocks.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Add Primitive Ordered Pixel Shading pseudo-instructions
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:22:02 +0000 (21:22 +0300)]
aco: Add Primitive Ordered Pixel Shading pseudo-instructions

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Add s_wait_event argument bit definitions
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:09:34 +0000 (21:09 +0300)]
aco: Add s_wait_event argument bit definitions

A wait for export_ready (if the corresponding bit is not set in the
instruction) is done to enter the Primitive Ordered Pixel Shading ordered
section on GFX11.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoac: Define POPS collision wave ID argument SGPR
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 18:08:15 +0000 (21:08 +0300)]
ac: Define POPS collision wave ID argument SGPR

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoaco: Support pops_exiting_wave_id PhysReg usage
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 17:50:41 +0000 (20:50 +0300)]
aco: Support pops_exiting_wave_id PhysReg usage

pops_exiting_wave_id is a volatile ALU source operand containing the ID of
the latest wave that hasn't exited yet, for comparing with the newest
overlapped wave ID in overlapping waves.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agoac/nir: Support Primitive Ordered Pixel Shading in lower_ps
Vitaliy Triang3l Kuzmin [Wed, 26 Apr 2023 18:09:48 +0000 (21:09 +0300)]
ac/nir: Support Primitive Ordered Pixel Shading in lower_ps

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agodocs/amd: Document Primitive Ordered Pixel Shading
Vitaliy Triang3l Kuzmin [Sun, 23 Apr 2023 20:12:58 +0000 (23:12 +0300)]
docs/amd: Document Primitive Ordered Pixel Shading

Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22250>

16 months agogallivm: Use NIR_PASS macros
Alyssa Rosenzweig [Thu, 22 Jun 2023 15:08:19 +0000 (11:08 -0400)]
gallivm: Use NIR_PASS macros

These run nir_validate in debug builds, which will avoid bugs slipping in. It's
not enough that llvmpipe doesn't mind illegal NIR, these passes are well within
their rights to fail spectacularly if the NIR wouldn't validate. So validate so
we catch issues early.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23804>

16 months agonir/lower_locals_to_regs: Add bool bitsize knob
Alyssa Rosenzweig [Thu, 22 Jun 2023 20:12:40 +0000 (16:12 -0400)]
nir/lower_locals_to_regs: Add bool bitsize knob

GLSL booleans (and hence bool derefs) may be translated either as 1-bit or
32-bit NIR registers, depending whether the backend uses nir_lower_bool_to_int32
or not. Add a knob for this and choose the right type for different backends.

Fixes nir_validate failure on
dEQP-VK.subgroups.ballot_broadcast.graphics.subgroupbroadcast_bvec3 run under
lavapipe. That test indexes into a bvec3 array, and gallivm first lowers bools
and then lowers derefs to registers, resulting in random 1-bit booleans mixed in
with 32-bit bools.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23804>

16 months agonir/lower_bool_to_int32: Fix progress reporting
Alyssa Rosenzweig [Thu, 22 Jun 2023 16:24:28 +0000 (12:24 -0400)]
nir/lower_bool_to_int32: Fix progress reporting

If we only lower parameters, that's still progress. Technically.

Fixes: 6a29cb2654f ("nir/lower_bool_to_int32: add support for lowering functions.")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23804>

16 months agorusticl/api: Wire up CL_DEVICE_PROFILING_TIMER_RESOLUTION
Dr. David Alan Gilbert [Sun, 25 Jun 2023 16:22:29 +0000 (17:22 +0100)]
rusticl/api: Wire up CL_DEVICE_PROFILING_TIMER_RESOLUTION

Wire up the CL_DEVICE_PROFILING_TIMER_RESOLUTION from the PIPE_CAP.
While here, also set CL_PLATFORM_HOST_TIMER_RESOLUTION to 1;
that's bogus since we're using the same value as for device, but
at this point we don't have a device to ask.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23639>

16 months agorusticl/api: Implement get_{device_and_}host_timer
Dr. David Alan Gilbert [Wed, 14 Jun 2023 00:31:29 +0000 (01:31 +0100)]
rusticl/api: Implement get_{device_and_}host_timer

Use the get_timestamp as both the device_timestamp in
get_device_and_host_timer and host_timestamp in that
and get_host_timer.

Having eliminited most other clock sources, discussions
on previous versions have concluded it's best to use the
same timer as the 'host_timestamp' since the main requirements
are that it must be one that's a time seen by the device and
that it's very closely coupled.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23639>

16 months agorusticl/device: Stash timestamp availability
Dr. David Alan Gilbert [Sat, 24 Jun 2023 21:03:02 +0000 (22:03 +0100)]
rusticl/device: Stash timestamp availability

Check if the device claims to have timestamps and a valid resolution
and stash it in the device.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23639>

16 months agorusticl/screen: Wrap get_timestamp
Dr. David Alan Gilbert [Tue, 13 Jun 2023 00:48:34 +0000 (01:48 +0100)]
rusticl/screen: Wrap get_timestamp

Add a wrapper on our screen type to call get_timestamp.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23639>

16 months agodraw: use unsigned instead of uint
Erik Faye-Lund [Fri, 23 Jun 2023 12:21:20 +0000 (14:21 +0200)]
draw: use unsigned instead of uint

uint isn't a standard type, just something we accidentally get from some
other headers.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: match type of pipe_draw_start_count_bias::count
Erik Faye-Lund [Fri, 23 Jun 2023 13:35:51 +0000 (15:35 +0200)]
draw: match type of pipe_draw_start_count_bias::count

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agocso: use unsigned instead of uint
Erik Faye-Lund [Fri, 23 Jun 2023 12:09:27 +0000 (14:09 +0200)]
cso: use unsigned instead of uint

uint isn't a standard type, just something we accidentally get from some
other headers.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: use stdint.h types
Erik Faye-Lund [Fri, 23 Jun 2023 13:29:54 +0000 (15:29 +0200)]
draw: use stdint.h types

Here, we want explicitly sized types, not just types that happen to be
of the right size.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: track vertices and vertex_ptr as byte-pointers
Erik Faye-Lund [Fri, 23 Jun 2023 12:52:13 +0000 (14:52 +0200)]
draw: track vertices and vertex_ptr as byte-pointers

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: use enum for primitive-type
Erik Faye-Lund [Fri, 23 Jun 2023 12:47:19 +0000 (14:47 +0200)]
draw: use enum for primitive-type

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: use uint32_t instead of uint
Erik Faye-Lund [Fri, 23 Jun 2023 12:36:29 +0000 (14:36 +0200)]
draw: use uint32_t instead of uint

In these cases we actually want uint32_t, because we're doing 32-bit
things to them.

The hwinfo-bit is only being used by i915, and should probably be
moved to i915 instead. But it shoukd *also* be converted, so let's do
that now.

While we're at it, fixup the bit-setting as well.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agodraw: use enum for tgsi-semantic
Erik Faye-Lund [Fri, 23 Jun 2023 12:17:28 +0000 (14:17 +0200)]
draw: use enum for tgsi-semantic

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agocso: use enum for render-conditions
Erik Faye-Lund [Fri, 23 Jun 2023 12:07:51 +0000 (14:07 +0200)]
cso: use enum for render-conditions

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23833>

16 months agoradv/amdgpu: add a helper to get a new IB
Samuel Pitoiset [Wed, 21 Jun 2023 11:45:01 +0000 (13:45 +0200)]
radv/amdgpu: add a helper to get a new IB

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

16 months agoradv/amdgpu: rename old_ib_buffers to ib_buffers
Samuel Pitoiset [Wed, 21 Jun 2023 11:44:37 +0000 (13:44 +0200)]
radv/amdgpu: rename old_ib_buffers to ib_buffers

No need to prefix with 'old' actually because this is just an array
of IB buffers.

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

16 months agoradv/amdgpu: use cs_finalize() when growing a CS
Samuel Pitoiset [Wed, 21 Jun 2023 11:44:09 +0000 (13:44 +0200)]
radv/amdgpu: use cs_finalize() when growing a CS

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

16 months agoradv/amdgpu: use the array of IB buffers for the chained IB path
Samuel Pitoiset [Wed, 21 Jun 2023 11:43:44 +0000 (13:43 +0200)]
radv/amdgpu: use the array of IB buffers for the chained IB path

For executing IB on the compute queue (ie. IB2 isn't supported), we
will need to break chaining, this is a first step towards this.

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

16 months agoradv/amdgpu: do not set the IB size when ending a CS with RADV_DEBUG=noibs
Samuel Pitoiset [Wed, 21 Jun 2023 11:43:22 +0000 (13:43 +0200)]
radv/amdgpu: do not set the IB size when ending a CS with RADV_DEBUG=noibs

This was only necessary for preambles/postambles, let's clarify this
by determining the IB info from the first IB in the array instead.

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

16 months agoradv/amdgpu: rework growing a CS with the chained IB path slightly
Samuel Pitoiset [Wed, 21 Jun 2023 11:43:01 +0000 (13:43 +0200)]
radv/amdgpu: rework growing a CS with the chained IB path slightly

This should allow us to use cs_finalize().

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

16 months agoradv/amdgpu: use the correct IB size when growing a CS with RADV_DEBUG=noibs
Samuel Pitoiset [Wed, 21 Jun 2023 11:42:41 +0000 (13:42 +0200)]
radv/amdgpu: use the correct IB size when growing a CS with RADV_DEBUG=noibs

The current IB size is copied when radv_amdgpu_cs_add_old_ib_buffer()
is called, which might not be the real IB size because we might still
pad the CS with NOP packets after.

Found by inspection.

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

16 months agopvr: Advance entry pointer in pvr_setup_vertex_buffers()
Matt Coster [Thu, 22 Jun 2023 08:59:48 +0000 (09:59 +0100)]
pvr: Advance entry pointer in pvr_setup_vertex_buffers()

Fixes: dEQP-VK.robustness.robustness1_vertex_access
  .out_of_bounds_stride_0
  .out_of_bounds_stride_16_single_buffer
  .out_of_bounds_stride_30_middle_of_buffer
  .out_of_bounds_stride_8_middle_of_buffer_separate

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23834>

16 months agocompiler: Allow the explicit_stride of aoa types to be zero
Corentin Noël [Wed, 14 Jun 2023 15:00:22 +0000 (17:00 +0200)]
compiler: Allow the explicit_stride of aoa types to be zero

The explicit stride doesn't have to be defined to aoa and therefore can be
zero in some cases, like in arrays of arrays of uniform blocks.

Resolves crash with spec@arb_gl_spirv@execution@ubo@aoa-2.shader_test piglit test for virgl.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23648>

16 months agoanv: fix to set predicted weight tables correctly.
Hyunjun Ko [Fri, 16 Jun 2023 05:54:21 +0000 (14:54 +0900)]
anv: fix to set predicted weight tables correctly.

Fixes: 8d519eb5f ("anv: add initial video decode support for h265")
Closes: mesa/mesa#9214

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23790>

16 months agointel/genxml: changes the type for predicted weight to unsigned.
Hyunjun Ko [Fri, 16 Jun 2023 05:50:24 +0000 (14:50 +0900)]
intel/genxml: changes the type for predicted weight to unsigned.

Turned out to be unsigned here after some experiments.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23790>

16 months agovulkan/video: keep delta weight and offsets of predicted weight tables in h265 slice...
Hyunjun Ko [Fri, 16 Jun 2023 05:40:23 +0000 (14:40 +0900)]
vulkan/video: keep delta weight and offsets of predicted weight tables in h265 slice parsing

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23790>

16 months agovulkan: Update XML and headers to 1.3.255
Caio Oliveira [Fri, 23 Jun 2023 17:59:54 +0000 (10:59 -0700)]
vulkan: Update XML and headers to 1.3.255

Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23837>

16 months agovulkan: Add NV suffix to VK_NV_cooperative_matrix feature names
Caio Oliveira [Wed, 17 May 2023 18:35:55 +0000 (11:35 -0700)]
vulkan: Add NV suffix to VK_NV_cooperative_matrix feature names

In the new Vulkan Headers, VK_KHR_cooperative_matrix gets added and the feature
names are the same.

Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23837>

16 months agorusticl/program: skip linking compiled binaries
Karol Herbst [Sat, 24 Jun 2023 22:41:00 +0000 (00:41 +0200)]
rusticl/program: skip linking compiled binaries

Applications can do their own caching, but are in any case required to
properly "compiler" the binaries via clBuildProgram or clCompileProgram +
clLinkPrograms.

In any case, there is no point building something if we already have the
result.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23847>

16 months agorusticl: bump bindgen requirement
Karol Herbst [Fri, 23 Jun 2023 20:11:16 +0000 (22:11 +0200)]
rusticl: bump bindgen requirement

Apparently on some ARM systems any older bindgen version crashes.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23840>

16 months agonir: Add function nir_function_set_impl
Yonggang Luo [Fri, 23 Jun 2023 03:57:47 +0000 (11:57 +0800)]
nir: Add function nir_function_set_impl

This function is added for create strong relationship between
nir_function_impl and nir_function.

So that nir_function->impl->function == nir_function is always true when
(nir_function->impl != NULL && nir_function->impl != NIR_SERIALIZE_FUNC_HAS_IMPL)

And indeed this invariant is already done in functions validate_function and validate_function_impl
of nir_validate

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23820>

16 months agovtn: Do not assign main_entry_point->impl twice
Yonggang Luo [Fri, 23 Jun 2023 03:52:07 +0000 (11:52 +0800)]
vtn: Do not assign main_entry_point->impl twice

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23820>

16 months agodraw: Update the comment and function name to match the type
Yonggang Luo [Sat, 24 Jun 2023 05:42:10 +0000 (13:42 +0800)]
draw: Update the comment and function name to match the type

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23845>

16 months agodraw: Replace usage of ubyte/ushort/uint with uint8_t/uint16_t/uint32_t in draw_pt_vs...
Yonggang Luo [Sat, 24 Jun 2023 05:38:18 +0000 (13:38 +0800)]
draw: Replace usage of ubyte/ushort/uint with uint8_t/uint16_t/uint32_t in draw_pt_vsplit.c

This can not be done with tools, so do it manually

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23845>

16 months agodraw: Replace usage of boolean/TRUE/FALSE with bool/true/false in draw_pt_vsplit*
Yonggang Luo [Thu, 22 Jun 2023 10:38:10 +0000 (18:38 +0800)]
draw: Replace usage of boolean/TRUE/FALSE with bool/true/false in draw_pt_vsplit*

These change can not be done with tools, so do it manually

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23845>

16 months agorusticl/mesa: create proper build-id hash for the disk cache
Karol Herbst [Tue, 28 Feb 2023 23:39:25 +0000 (00:39 +0100)]
rusticl/mesa: create proper build-id hash for the disk cache

Without generating a proper timestamp for the disk cache, we pull old
binaries out of the disk cache, potentially being buggy or simply
outdated.

Once meson 1.2 lands we can easily pull in LLVM functions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21612>

16 months agorusticl/meson: extract common bindgen rust args
Karol Herbst [Sat, 24 Jun 2023 08:59:16 +0000 (10:59 +0200)]
rusticl/meson: extract common bindgen rust args

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21612>

16 months agorusticl: generate bindings for build-id stuff
Karol Herbst [Tue, 28 Feb 2023 23:38:50 +0000 (00:38 +0100)]
rusticl: generate bindings for build-id stuff

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21612>

16 months agorusticl: structurize and reorder mesa binding args
Karol Herbst [Tue, 28 Feb 2023 21:22:18 +0000 (22:22 +0100)]
rusticl: structurize and reorder mesa binding args

It became quite a mess, I had enough 🙃

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21612>

16 months agov3dv: replace boolean and uint with bool and size_t
Eric Engestrom [Thu, 22 Jun 2023 11:12:44 +0000 (12:12 +0100)]
v3dv: replace boolean and uint with bool and size_t

There's no reason to use the gallium `p_compiler.h` types in vulkan code.

Inspired by https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577,
but using `size_t` for `ulist_data_size` because its two users are
`blob_read_bytes()` and `memcpy()`, both of which expect a `size_t`.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23795>

16 months agodocs/coding-style: add pre-commit hook fallback for clang-format
Eric Engestrom [Mon, 19 Jun 2023 22:46:26 +0000 (23:46 +0100)]
docs/coding-style: add pre-commit hook fallback for clang-format

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23722>