platform/upstream/mesa.git
13 months agointel: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 13:38:39 +0000 (15:38 +0200)]
intel: use imm-helpers

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

13 months agovc4: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 13:28:17 +0000 (15:28 +0200)]
vc4: use imm-helpers

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agoradeonsi: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 13:23:33 +0000 (15:23 +0200)]
radeonsi: use imm-helpers

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

13 months agod3d12: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 13:08:45 +0000 (15:08 +0200)]
d3d12: use imm-helpers

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agor600/sfn: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 13:21:45 +0000 (15:21 +0200)]
r600/sfn: use imm-helpers

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agofreedreno: use imm-helpers
Erik Faye-Lund [Fri, 16 Jun 2023 12:35:12 +0000 (14:35 +0200)]
freedreno: use imm-helpers

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

13 months agopan: use imm-helpers
Erik Faye-Lund [Thu, 15 Jun 2023 18:20:41 +0000 (20:20 +0200)]
pan: use imm-helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agov3dv: use imm-helpers
Erik Faye-Lund [Thu, 15 Jun 2023 14:26:12 +0000 (16:26 +0200)]
v3dv: use imm-helpers

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agobroadcom/compiler: use imm-helpers
Erik Faye-Lund [Thu, 15 Jun 2023 14:16:33 +0000 (16:16 +0200)]
broadcom/compiler: use imm-helpers

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agovulkan: avoid needless constant-folding
Erik Faye-Lund [Fri, 16 Jun 2023 10:51:36 +0000 (12:51 +0200)]
vulkan: avoid needless constant-folding

While we're at it, also switch to the nir_f{add,mul}_imm helpers.

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

13 months agomesa/st: use nir_ineg
Erik Faye-Lund [Fri, 16 Jun 2023 13:51:26 +0000 (15:51 +0200)]
mesa/st: use nir_ineg

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agomicrosoft/compiler: use nir_imm_zero
Erik Faye-Lund [Thu, 15 Jun 2023 19:34:07 +0000 (21:34 +0200)]
microsoft/compiler: use nir_imm_zero

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

13 months agomapi: Remove dead struct _glapi_function in glapi/glapi_getproc.c
Yonggang Luo [Sun, 25 Jun 2023 02:06:37 +0000 (10:06 +0800)]
mapi: Remove dead struct _glapi_function in glapi/glapi_getproc.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>

13 months agomapi: Merge get_static_proc_address into _glapi_get_proc_address
Yonggang Luo [Sun, 25 Jun 2023 02:04:42 +0000 (10:04 +0800)]
mapi: Merge get_static_proc_address into _glapi_get_proc_address

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>

13 months agomapi: Style fixes in glapi/glapi_getproc.c
Yonggang Luo [Fri, 23 Jun 2023 04:50:35 +0000 (12:50 +0800)]
mapi: Style fixes in glapi/glapi_getproc.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>

13 months agoutil: sizeof bucket are always 32bit width, use align instead align64
Yonggang Luo [Mon, 19 Jun 2023 19:36:31 +0000 (03:36 +0800)]
util: sizeof bucket are always 32bit width, use align instead align64

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agoutil: Do not use align64 over unsigned int in register_allocate.c
Yonggang Luo [Mon, 19 Jun 2023 19:37:04 +0000 (03:37 +0800)]
util: Do not use align64 over unsigned int in register_allocate.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agoutil: Replace the usage of redundant u_align_u32 with align and remove u_align_u32
Yonggang Luo [Mon, 19 Jun 2023 19:12:51 +0000 (03:12 +0800)]
util: Replace the usage of redundant u_align_u32 with align and remove u_align_u32

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agoutil: Getting align and align64 consistence with ALIGN
Yonggang Luo [Mon, 19 Jun 2023 19:11:40 +0000 (03:11 +0800)]
util: Getting align and align64 consistence with ALIGN

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agoutil: use uint32_t instead of unsigned in bitscan.h
Yonggang Luo [Tue, 20 Jun 2023 01:49:10 +0000 (09:49 +0800)]
util: use uint32_t instead of unsigned in bitscan.h

uint32_t is more exact than unsigned for these functions

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agoutil: Add function util_is_power_of_two_nonzero64 in bitscan.h
Yonggang Luo [Tue, 20 Jun 2023 01:48:26 +0000 (09:48 +0800)]
util: Add function util_is_power_of_two_nonzero64 in bitscan.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>

13 months agopvr: Rename rogue_fw.xml -> rogue_kmd_stream.xml.
Donald Robson [Fri, 12 May 2023 08:35:12 +0000 (09:35 +0100)]
pvr: Rename rogue_fw.xml -> rogue_kmd_stream.xml.

The UMD does not care if firmware is used, and the current name isn't
very informative either.

Signed-off-by: Donald Robson <donald.robson@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

13 months agopvr: Rename transfer 3D heap to transfer frag heap
Matt Coster [Thu, 18 Aug 2022 15:21:38 +0000 (16:21 +0100)]
pvr: Rename transfer 3D heap to transfer frag heap

This better matches the naming throughout the rest of the driver.

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

13 months agopvr: Merge main and extension command streams
Sarah Walker [Fri, 14 Oct 2022 13:06:15 +0000 (14:06 +0100)]
pvr: Merge main and extension command streams

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

13 months agopvr: Rename heap reserved area to static data carveout
Sarah Walker [Tue, 18 Oct 2022 13:20:52 +0000 (14:20 +0100)]
pvr: Rename heap reserved area to static data carveout

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

13 months agopvr: use pvr_csb_pack() to setup CR_FB_CDC_ZLS
Sarah Walker [Tue, 30 Aug 2022 14:23:47 +0000 (15:23 +0100)]
pvr: use pvr_csb_pack() to setup CR_FB_CDC_ZLS

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

13 months agopvr: Fragment register fb_cdc_zls is feature dependent
Sarah Walker [Tue, 23 Aug 2022 09:50:37 +0000 (10:50 +0100)]
pvr: Fragment register fb_cdc_zls is feature dependent

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23872>

13 months agomicrosoft/clc: Don't build compiler test if build-tests is false
Prodea Alexandru-Liviu [Tue, 27 Jun 2023 17:32:57 +0000 (17:32 +0000)]
microsoft/clc: Don't build compiler test if build-tests is false

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8161

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23890>

13 months agod3d12: Fix usage of D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG, was using D3D12_VIDEO_ENCO...
Sil Vilerino [Wed, 28 Jun 2023 15:22:11 +0000 (11:22 -0400)]
d3d12: Fix usage of D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG, was using D3D12_VIDEO_ENCODER_SUPPORT_FLAG wrongly instead

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

13 months agod3d12: Only set reduced_tx_set when supported by D3D12 caps (no libva caps for reduce...
Sil Vilerino [Wed, 28 Jun 2023 14:14:11 +0000 (10:14 -0400)]
d3d12: Only set reduced_tx_set when supported by D3D12 caps (no libva caps for reduced_tx_set to map to)

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

13 months agod3d12: Correct tx_mode_support reporting as specified in libva spec
Sil Vilerino [Wed, 28 Jun 2023 13:48:18 +0000 (09:48 -0400)]
d3d12: Correct tx_mode_support reporting as specified in libva spec

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

13 months agocompiler: set alignment=1 by default for handling empty struct/interface in glsl_type...
Yonggang Luo [Fri, 23 Jun 2023 12:31:00 +0000 (20:31 +0800)]
compiler: set alignment=1 by default for handling empty struct/interface in glsl_types.cpp

When there is no elements in struct/interface, the alignment of it should be 1 instead of 0.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23841>

13 months agoradv: Do not enable robustness for push constants with robustBufferAccess2
Joshua Ashton [Tue, 27 Jun 2023 16:02:09 +0000 (17:02 +0100)]
radv: Do not enable robustness for push constants with robustBufferAccess2

There is no spec text requiring this behaviour, it is only for buffers.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23885>

13 months agonir/print: Print more representations in load_const
Caio Oliveira [Wed, 21 Jun 2023 23:58:00 +0000 (16:58 -0700)]
nir/print: Print more representations in load_const

In addition to the hexadecimal and float (when applicable), print the
signed and unsigned representations.  Representations may be omitted based
on information about the value:

- If gather types has unambiguous information, we use it;
- Float is omitted for 8 bit values;
- Signed decimal is omitted for positive values;
- Unsigned decimal is omitted for small values (representation is same as hex);

Note for now the "terse form" that appear in SSA uses is unchaged.

Based on a patch by Mike Blumenkrantz.

Examples:

```
// Just used as float. Omitted decimals.
vec4 32 ssa_81 = load_const (0x3f800000, 0x3f800000, 0x3e4ccccd, 0x3f800000) = (1.000000, 1.000000, 0.200000, 1.000000)
vec1 32 ssa_28 = load_const (0x3e4ccccd = 0.200000)

// Just a small integer. Omitted float and decimal.
vec1 32 ssa_45 = load_const (0x00000001)

// Larger positive integers. Omitted float.
vec1 32 ssa_39 = load_const (0x00002000 = 8192)
vec1 32 ssa_30 = load_const (0x000000ff = 255)
vec1 32 ssa_28 = load_const (0x00000010 = 16)

// Integers with negative values.
load_const (0xff = -1 = 255)
load_const (0xff80 = -128 = 65408)
load_const (0xffff = -1 = 65535)

// Same value, in the first case we know is used as an integer.
load_const (0xffffffe0 = -32 = 4294967264)
load_const (0xffffffe0 = -nan = -32 = 4294967264)
```

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir/print: Use src_type when printing consts in SSA uses
Caio Oliveira [Tue, 13 Jun 2023 04:59:34 +0000 (21:59 -0700)]
nir/print: Use src_type when printing consts in SSA uses

If the src_type is not available, untie by looking at the results from
nir_gather_ssa_types(). If that is ambiguous, just pick uint.

Now in print_const_from_load() when the type is invalid, print the full
constant form (with both padded hex and float); when the passed type
is valid, print the terse form based on it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir: Extract logic to get dest and srcs types from intrinsic
Caio Oliveira [Tue, 13 Jun 2023 04:58:19 +0000 (21:58 -0700)]
nir: Extract logic to get dest and srcs types from intrinsic

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir: Make a const-friendly way to get the offset_src and arrayed_io_src from intrinsic
Caio Oliveira [Tue, 13 Jun 2023 04:58:43 +0000 (21:58 -0700)]
nir: Make a const-friendly way to get the offset_src and arrayed_io_src from intrinsic

The existing helper returns a `nir_src *` so expects a non-const instr.

We plan to use this function in queries that don't modify the shader, so
create (and use internally) a variant that returns the index instead.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir/print: Make NIR_DEBUG=print_consts behavior the default
Caio Oliveira [Sat, 10 Jun 2023 02:55:49 +0000 (19:55 -0700)]
nir/print: Make NIR_DEBUG=print_consts behavior the default

Now there's a NIR_DEBUG=print_no_inline_consts to omit them.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir/print: Improve NIR_PRINT=print_consts by using nir_gather_ssa_types()
Caio Oliveira [Sat, 10 Jun 2023 00:40:58 +0000 (17:40 -0700)]
nir/print: Improve NIR_PRINT=print_consts by using nir_gather_ssa_types()

The two representations are *always* used for `load_const`, but when
inlining the value as SSA source, use just a single terse
representation.

The choice between integer or float is based on the result of
nir_gather_ssa_types(), with a bias for integer when in doubt.

Also remove extra comment `/* */` syntax since the value is already
enclosed by parenthesis.

---

For illustration, here's some instructions from crucible test
func.shader.averageRounded.uint64_t with NIR_DEBUG=print_consts:

BEFORE:

```
vec1 32 con ssa_23 = load_const (0xfffffffc = -nan)
vec1 32 div ssa_24 = iand ssa_13, ssa_23 /*(0xfffffffc = -nan)*/
vec1 32 con ssa_25 = load_const (0x00000024 = 0.000000)
vec1 32 con ssa_26 = intrinsic load_ubo (ssa_1 /*(0x00000002 = 0.000000)*/, ssa_25 /*(0x00000024 = 0.000000)*/) (access=0, align_mul=1073741824, align_offset=36, range_base=0, range=-1)
vec1 32 con ssa_27 = load_const (0x00000008 = 0.000000)
vec1 32 con ssa_28 = load_const (0x00000007 = 0.000000)
vec1 32 con ssa_29 = iand ssa_4.y, ssa_1 /*(0x00000002 = 0.000000)*/
vec1 32 con ssa_30 = ishl ssa_29, ssa_28 /*(0x00000007 = 0.000000)*/
vec1 32 con ssa_31 = load_const (0x7b000808 = 664776890994587263929995856502063104.000000)
vec1 32 con ssa_32 = ior ssa_31 /*(0x7b000808 = 664776890994587263929995856502063104.000000)*/, ssa_30
```

AFTER:

```
vec1 32 con ssa_23 = load_const (0xfffffffc = -nan)
vec1 32 div ssa_24 = iand ssa_13, ssa_23 (0xfffffffc)
vec1 32 con ssa_25 = load_const (0x00000024 = 0.000000)
vec1 32 con ssa_26 = intrinsic load_ubo (ssa_1 (0x2), ssa_25 (0x24)) (access=0, align_mul=1073741824, align_offset=36, range_base=0, range=-1)
vec1 32 con ssa_27 = load_const (0x00000008 = 0.000000)
vec1 32 con ssa_28 = load_const (0x00000007 = 0.000000)
vec1 32 con ssa_29 = iand ssa_4.y, ssa_1 (0x2)
vec1 32 con ssa_30 = ishl ssa_29, ssa_28 (0x7)
vec1 32 con ssa_31 = load_const (0x7b000808 = 664776890994587263929995856502063104.000000)
vec1 32 con ssa_32 = ior ssa_31 (0x7b000808), ssa_30
```

and some instructions from crucible test func.gs.basic with NIR_DEBUG=print_consts,
now showing float representation being selected:

BEFORE:

```
vec4 32 ssa_10 = load_const (0x3e4ccccd, 0x3e4ccccd, 0x00000000, 0x00000000) = (0.200000, 0.200000, 0.000000, 0.000000)
vec4 32 ssa_9 = intrinsic load_deref (ssa_42) (access=0)
vec4 32 ssa_11 = fadd ssa_9, ssa_10 /*(0x3e4ccccd, 0x3e4ccccd, 0x00000000, 0x00000000) = (0.200000, 0.200000, 0.000000, 0.000000)*/
```

AFTER:

```
vec4 32 ssa_10 = load_const (0x3e4ccccd, 0x3e4ccccd, 0x00000000, 0x00000000) = (0.200000, 0.200000, 0.000000, 0.000000)
vec4 32 ssa_9 = intrinsic load_deref (ssa_42) (access=0)
vec4 32 ssa_11 = fadd ssa_9, ssa_10 (0.200000, 0.200000, 0.000000, 0.000000)
```

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agonir: Allow nir_gather_ssa_types() to ignore regs instead of assert
Caio Oliveira [Sat, 10 Jun 2023 02:18:03 +0000 (19:18 -0700)]
nir: Allow nir_gather_ssa_types() to ignore regs instead of assert

If we infer a type for a reg, just ignore and keep going.  This will allow
to use this pass even when registers are present.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23562>

13 months agoradv/rt: Hash stages using radv_hash_shaders
Konstantin Seurer [Tue, 20 Jun 2023 14:52:50 +0000 (16:52 +0200)]
radv/rt: Hash stages using radv_hash_shaders

The hash also depends on the radv_pipeline_key as well as the flags. The
pipeline layout will also play a role when we implement inline
descriptor sets and push constants.

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

13 months agoradv/rt: Fix caching non-recursive stages
Konstantin Seurer [Tue, 20 Jun 2023 14:39:41 +0000 (16:39 +0200)]
radv/rt: Fix caching non-recursive stages

The hash used for insertion is calculated in a different way than the
hash used for lookup.

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

13 months agoutil: Do not include immintrin.h in half_float.h
Konstantin Seurer [Tue, 27 Jun 2023 11:24:08 +0000 (13:24 +0200)]
util: Do not include immintrin.h in half_float.h

The files included are extremely large and hurt compile time of
everything that inludes half_float.h directly or indirectly.

Compile time of a fresh RADV build:
before 32.477s 32.661s 32.625s
after  25.116s 24.928s 25.114s

v2: Include xmmintrin instead (Marek Olšák)
after  25.552s 25.811s 25.678s

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

13 months agoamd/ci: add another dEQP-VK.multiview.renderpass2.multisample.* flake
Eric Engestrom [Wed, 28 Jun 2023 16:13:52 +0000 (17:13 +0100)]
amd/ci: add another dEQP-VK.multiview.renderpass2.multisample.* flake

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/44557372

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23910>

13 months agovulkan/wsi: check for dri3 buffer initialization failure
Kiskae [Wed, 17 May 2023 15:17:54 +0000 (15:17 +0000)]
vulkan/wsi: check for dri3 buffer initialization failure

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8427
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23081>

13 months agofreedreno/registers: add bitfield for DSI wide bus enablement
Dmitry Baryshkov [Fri, 23 Jun 2023 11:31:07 +0000 (14:31 +0300)]
freedreno/registers: add bitfield for DSI wide bus enablement

Add a bitfield controlling wide bus enablement for DPU<->DSI interface.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23829>

13 months agodraw/i915: move hwfmt array to i915 specific struct
Erik Faye-Lund [Fri, 23 Jun 2023 13:49:38 +0000 (15:49 +0200)]
draw/i915: move hwfmt array to i915 specific struct

There's no point in bloating the vertex_info struct everywhere with
information that's only used by i915 in a single place. Let's explicitly
store the hwinfo when needed, instead of piggy-backing on vertex_info.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23851>

13 months agoradv: inline more values in radv_emit_fb_ds_state()
Samuel Pitoiset [Tue, 27 Jun 2023 16:18:56 +0000 (18:18 +0200)]
radv: inline more values in radv_emit_fb_ds_state()

These are no longer adjusted.

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

13 months agoradv: stop emitting TILE_SURFACE_ENABLE for the ZRANGE_PRECISION workaround
Samuel Pitoiset [Tue, 27 Jun 2023 16:12:05 +0000 (18:12 +0200)]
radv: stop emitting TILE_SURFACE_ENABLE for the ZRANGE_PRECISION workaround

The only case that matters is when the fb is emitted, but HTILE is
already disabled there using DB_RENDER_CONTROL.

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

13 months agod3d12: Fixes unused-variable compile error
Yonggang Luo [Wed, 28 Jun 2023 09:42:49 +0000 (17:42 +0800)]
d3d12: Fixes unused-variable compile error

The compile error message is:
../../src/gallium/drivers/d3d12/d3d12_video_screen.cpp:481:70: error: unused variable ‘sliceData’ [-Werror=unused-variable]
  481 |    D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES sliceData = { };
      |                                                                      ^~~~~~~~~
cc1plus: all warnings being treated as errors

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23900>

13 months agopvr: Setup ZLS depth and stencil load/store separately
Karmjit Mahil [Tue, 13 Jun 2023 10:20:08 +0000 (11:20 +0100)]
pvr: Setup ZLS depth and stencil load/store separately

Previously the code assumed that you could only have depth-stencil
attachments so no stencil only or depth only, for ZLS load/stores.
This isn't true as we can have stencil only attachments so the
ZLS depth and stencil store/load enable have to be set separately.

Other ZLSCTL setup has also been adjusted for separate depth-stencil.
E.g. the z{load,store}format, and {load,store}twiddled.

Co-Authored-By: Soroush Kashani <soroush.kashani@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23830>

13 months agov3dv: add a linear images to buffer copy codepath
Alejandro Piñeiro [Mon, 26 Jun 2023 08:48:31 +0000 (10:48 +0200)]
v3dv: add a linear images to buffer copy codepath

Called copy_image_to_buffer_texel_buffer, that reuses
copy_image_linear_texel_buffer, by setting up a image destination from
the buffer destination.

This fixes new ycbcr tests added recently (1.3.6.0) like:
dEQP-VK.ycbcr.copy.*.*.*buffer*

that were failing due lack of a codepath handling them.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23864>

13 months agov3dv: refactor copy_image_to_buffer_blit
Alejandro Piñeiro [Mon, 26 Jun 2023 08:48:20 +0000 (10:48 +0200)]
v3dv: refactor copy_image_to_buffer_blit

In order to have common code to create a image from a buffer, that we
plan to use later on a new codepath.

This refactor adds three new methods:
 * One that gathers all the info required to create the structures and
   implement the operation
 * One that creates the image from the buffer, based on that info
 * One that creates a BlitRegion from that info

This seems like too much splitting, but we needed to do it in this
way, because we can't ensure that future uses of this common code
would use a BlitRegion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23864>

13 months agoradv: allow NV_device_generated_commands with RADV_DEBUG=noibs
Samuel Pitoiset [Thu, 22 Jun 2023 07:10:21 +0000 (09:10 +0200)]
radv: allow NV_device_generated_commands with RADV_DEBUG=noibs

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

13 months agoradv/amdgpu: add support for executing DGC cmdbuf with RADV_DEBUG=noibs
Samuel Pitoiset [Tue, 27 Jun 2023 14:06:38 +0000 (16:06 +0200)]
radv/amdgpu: add support for executing DGC cmdbuf with RADV_DEBUG=noibs

This contains some preliminary work to be able to execute DGC cmdbuf
on the compute queue because IB2 doesn't exist.

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

13 months agoradv/amdgpu: add more small helpers for managing CS
Samuel Pitoiset [Thu, 22 Jun 2023 07:20:39 +0000 (09:20 +0200)]
radv/amdgpu: add more small helpers for managing CS

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

13 months agoCI/windows: Update headers and Agility redist to 1.711.3-preview
Sil Vilerino [Wed, 21 Jun 2023 22:05:15 +0000 (15:05 -0700)]
CI/windows: Update headers and Agility redist to 1.711.3-preview

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

13 months agod3d12: AV1 Encode
Sil Vilerino [Tue, 20 Dec 2022 18:29:47 +0000 (13:29 -0500)]
d3d12: AV1 Encode

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

13 months agofrontends/va: Extend AV1 Encode params
Sil Vilerino [Tue, 20 Dec 2022 18:29:29 +0000 (13:29 -0500)]
frontends/va: Extend AV1 Encode params

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23811>

13 months agonir: Convert to nir_foreach_function_impl
Alyssa Rosenzweig [Thu, 22 Jun 2023 17:27:59 +0000 (13:27 -0400)]
nir: Convert to nir_foreach_function_impl

Done by hand at each call site but going very quickly with funny Vim motions and
common regexes. This is a very common idiom in NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23807>

13 months agonir: Add nir_foreach_function_impl helper
Alyssa Rosenzweig [Thu, 22 Jun 2023 16:38:16 +0000 (12:38 -0400)]
nir: Add nir_foreach_function_impl helper

Most users of nir_foreach_function actually want the nir_function_impl, not the
nir_function, and want to skip empty functions (though some graphics-specific
passes sometimes fail to do that part). Add a nir_foreach_function_impl macro
to make that case more ergonomic.

   nir_foreach_function_impl(impl, shader) {
      ...
      foo(impl)
   }

is equivalent to:

   nir_foreach_function(func, shader) {
      if (func->impl) {
         ...
         foo(func->impl);
      }
   }

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23807>

13 months agodocs/rusticl: add Enabling section
Karol Herbst [Mon, 26 Jun 2023 14:34:14 +0000 (16:34 +0200)]
docs/rusticl: add Enabling section

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23859>

13 months agodocs/rusticl: mark building section as such
Karol Herbst [Mon, 26 Jun 2023 12:48:52 +0000 (14:48 +0200)]
docs/rusticl: mark building section as such

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23859>

13 months agointel/devinfo/i915: Set has_set_pat_uapi for MTL+
Jordan Justen [Tue, 2 May 2023 07:41:12 +0000 (03:41 -0400)]
intel/devinfo/i915: Set has_set_pat_uapi for MTL+

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoanv: Use set PAT extension on BO creation for MTL
Jordan Justen [Mon, 3 Apr 2023 16:51:22 +0000 (12:51 -0400)]
anv: Use set PAT extension on BO creation for MTL

Reworks:
 * Drop local pat_index var (suggested by José)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoiris: Use set PAT extension on BO creation for MTL
Jordan Justen [Mon, 3 Apr 2023 08:19:00 +0000 (04:19 -0400)]
iris: Use set PAT extension on BO creation for MTL

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agodrm-uapi/i915_drm.h: Update from drm-next (2023-06-09)
Jordan Justen [Fri, 23 Jun 2023 04:20:29 +0000 (21:20 -0700)]
drm-uapi/i915_drm.h: Update from drm-next (2023-06-09)

git://anongit.freedesktop.org/drm/drm 2222dcb0775d36de28992f56455ab3967b30d380

The motivation for this change in to get the uapi changes from:

commit 81b1b599dfd71c958418dad586fa72c8d30d1065
Author: Fei Yang <fei.yang@intel.com>
Date:   Tue Jun 6 12:00:42 2023 +0200

    drm/i915: Allow user to set cache at BO creation

Specifically, the I915_GEM_CREATE_EXT_SET_PAT extension.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoanv: Swap ordering of memory types on non-LLC platforms to work around application...
Francisco Jerez [Tue, 13 Jun 2023 00:53:35 +0000 (20:53 -0400)]
anv: Swap ordering of memory types on non-LLC platforms to work around application bugs.

The Vulkan specification indicates that if memory types have
properties which are a strict subset of another type's, then they
should appear before that memory type.  Otherwise the specification
does not require a specific ordering of memory types.

But, it appears that Aztec Ruins and the Vulkan CTS make an assumption
that the first host-accessible memory type is host-coherent and select
it when they expect data written by the CPU to become visible without
calling vkFlushMappedMemoryRanges(), even though flushing is required
by the spec, which leads to misrendering and hangs on MTL platforms.

We found that other drivers also put a host-coherent, but not cached
memory type as the first host-accessible memory type, so let's do the
same in order to match the expectations of such broken applications.

Host-coherent uncached memory types are currently implemented with a
WC CPU map on non-LLC platforms, so there shouldn't be a huge
performance penalty from this: If an application intends to do heavy
R/W CPU access on a memory range it's expected to loop over the
available memory types and select one marked as host-cached -- If an
application fails to do that and simply selects the first available
type it seems more robust to stay on the safe side and give them a
host-coherent type rather than a cached one.

Rework:
 * Jordan: Add initial explanation to body of commmit message.
 * Curro: Add additional comments to commit message.

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

13 months agoiris: Map aux-map with WC on MTL+ (has_set_pat_uapi)
Jordan Justen [Fri, 7 Apr 2023 21:51:53 +0000 (17:51 -0400)]
iris: Map aux-map with WC on MTL+ (has_set_pat_uapi)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoiris/bufmgr: Skip bucket allocation if not using writeback cache PAT index
Jordan Justen [Wed, 10 May 2023 16:56:58 +0000 (09:56 -0700)]
iris/bufmgr: Skip bucket allocation if not using writeback cache PAT index

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoiris/bufmgr: Add iris_pat_index_for_bo_flags()
Jordan Justen [Wed, 10 May 2023 16:50:54 +0000 (09:50 -0700)]
iris/bufmgr: Add iris_pat_index_for_bo_flags()

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agointel/devinfo: Define PAT indices used on MTL
Jordan Justen [Thu, 4 May 2023 06:19:06 +0000 (02:19 -0400)]
intel/devinfo: Define PAT indices used on MTL

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agointel/devinfo: Add has_set_pat_uapi
Jordan Justen [Tue, 2 May 2023 07:41:12 +0000 (03:41 -0400)]
intel/devinfo: Add has_set_pat_uapi

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agoiris: Allocate coherent buffers for resources flagged as persistent/coherent
Kenneth Graunke [Wed, 5 Apr 2023 22:41:05 +0000 (15:41 -0700)]
iris: Allocate coherent buffers for resources flagged as persistent/coherent

If the application requests a coherent resource, we should honor that.
We technically don't need to ensure coherency for persistent mappings,
but we would have to handle PIPE_BARRIER_MAPPED_BUFFER to ensure that
data became visible at the right times. Instead, we just opt for the
easy plan and mark them coherent too.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22878>

13 months agointel/dev: update mesa_defs.json from defect database
Mark Janes [Mon, 26 Jun 2023 22:53:58 +0000 (15:53 -0700)]
intel/dev: update mesa_defs.json from defect database

These modifications represent:

 * changes to defects made since May 24, 2023
 * changes to handling of defects which were manually cloned

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

13 months agodzn: VK_EXT_external_memory_host
Jesse Natalie [Fri, 5 May 2023 20:02:41 +0000 (13:02 -0700)]
dzn: VK_EXT_external_memory_host

When ID3D12Device13 is available, we can support importing host memory.
Imported host memory can be used to back buffers and linear textures.

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

13 months agoanv: Flush untyped dataport cache DC flush is requested on compute
Jordan Justen [Mon, 15 May 2023 18:53:03 +0000 (14:53 -0400)]
anv: Flush untyped dataport cache DC flush is requested on compute

Although the following is based on this observations for OpenGL, we
probably need this for Vulkan as well.

KHR-GL46.texture_buffer.texture_buffer_operations_ssbo_writes writes
to an SSBO in a compute program, then issues a memory-barrier, which
causes us to add a DC-flush. Then a second compute program samples
from the SSBO written by the first compute program.

Although we expected the DC-flush to make the writes available to the
second compute program, on MTL this wasn't the case. Adding the
"Untyped Data-Port Cache Flush" fixes this.

The PRM indicates that compute programs must set "Untyped Data-Port
Cache Flush" to flush some LSC writes when flushing HDC. Although we
are setting DC-flush, and not HDC-flush, it does appear that the
following reference might also apply to DC-flush.

In the Intel(R) Arc(tm) A-Series Graphics and Intel Data Center GPU
Flex Series Open-Source Programmer's Reference Manual, Vol 2a: Command
Reference: Instructions, PIPE_CONTROL, HDC Pipeline Flush (DWord 0,
Bit 9), there is a programming note:

> When the "Pipeline Select" mode is set to "GPGPU", the LSC Untyped
> L1 cache flush is controlled by "Untyped Data-Port Cache Flush" bit
> in the PIPE_CONTROL command.

Ref: a8108f1d444 ("anv: Add missing untyped data port flush on PIPELINE_SELECT")
Ref: bd8e8d204db ("iris: Add missing untyped data port flush on PIPELINE_SELECT")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23176>

13 months agoanv: Flush untyped dataport cache when HDC flush is requested on compute
Jordan Justen [Mon, 15 May 2023 18:53:03 +0000 (14:53 -0400)]
anv: Flush untyped dataport cache when HDC flush is requested on compute

In the Intel(R) Arc(tm) A-Series Graphics and Intel Data Center GPU
Flex Series Open-Source Programmer's Reference Manual, Vol 2a: Command
Reference: Instructions, PIPE_CONTROL, HDC Pipeline Flush (DWord 0,
Bit 9), there is a programming note:

> When the "Pipeline Select" mode is set to "GPGPU", the LSC Untyped
> L1 cache flush is controlled by "Untyped Data-Port Cache Flush" bit
> in the PIPE_CONTROL command.

Ref: a8108f1d444 ("anv: Add missing untyped data port flush on PIPELINE_SELECT")
Ref: bd8e8d204db ("iris: Add missing untyped data port flush on PIPELINE_SELECT")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23176>

13 months agoanv: Clear untyped dataport cache flush bit if not in GPGPU mode
Jordan Justen [Thu, 22 Jun 2023 21:44:20 +0000 (14:44 -0700)]
anv: Clear untyped dataport cache flush bit if not in GPGPU mode

This should be equivalent, but refactoring the code will allow the
next two patches to use an else block for this check.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23176>

13 months agoiris: Flush untyped dataport cache DC flush is requested on compute
Jordan Justen [Mon, 15 May 2023 18:53:03 +0000 (14:53 -0400)]
iris: Flush untyped dataport cache DC flush is requested on compute

KHR-GL46.texture_buffer.texture_buffer_operations_ssbo_writes writes
to an SSBO in a compute program, then issues a memory-barrier, which
causes us to add a DC-flush. Then a second compute program samples
from the SSBO written by the first compute program.

Although we expected the DC-flush to make the writes available to the
second compute program, on MTL this wasn't the case. Adding the
"Untyped Data-Port Cache Flush" fixes this.

The PRM indicates that compute programs must set "Untyped Data-Port
Cache Flush" to flush some LSC writes when flushing HDC. Although we
are setting DC-flush, and not HDC-flush, it does appear that the
following reference might also apply to DC-flush.

In the Intel(R) Arc(tm) A-Series Graphics and Intel Data Center GPU
Flex Series Open-Source Programmer's Reference Manual, Vol 2a: Command
Reference: Instructions, PIPE_CONTROL, HDC Pipeline Flush (DWord 0,
Bit 9), there is a programming note:

> When the "Pipeline Select" mode is set to "GPGPU", the LSC Untyped
> L1 cache flush is controlled by "Untyped Data-Port Cache Flush" bit
> in the PIPE_CONTROL command.

Ref: bd8e8d204db ("iris: Add missing untyped data port flush on PIPELINE_SELECT")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23176>

13 months agoiris: Flush untyped dataport cache when HDC flush is requested on compute
Jordan Justen [Mon, 15 May 2023 18:53:03 +0000 (14:53 -0400)]
iris: Flush untyped dataport cache when HDC flush is requested on compute

In the Intel(R) Arc(tm) A-Series Graphics and Intel Data Center GPU
Flex Series Open-Source Programmer's Reference Manual, Vol 2a: Command
Reference: Instructions, PIPE_CONTROL, HDC Pipeline Flush (DWord 0,
Bit 9), there is a programming note:

> When the "Pipeline Select" mode is set to "GPGPU", the LSC Untyped
> L1 cache flush is controlled by "Untyped Data-Port Cache Flush" bit
> in the PIPE_CONTROL command.

Ref: bd8e8d204db ("iris: Add missing untyped data port flush on PIPELINE_SELECT")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23176>

13 months agoci: Testing -D shared-glapi=disabled with debian-clang-release
Yonggang Luo [Sat, 3 Jun 2023 04:17:55 +0000 (12:17 +0800)]
ci: Testing -D shared-glapi=disabled with debian-clang-release

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

13 months agomapi: Hide OpenGL functions to be exported when shared-glapi is disabled
Yonggang Luo [Mon, 5 Jun 2023 15:59:53 +0000 (23:59 +0800)]
mapi: Hide OpenGL functions to be exported when shared-glapi is disabled

Fixes the following test error:
135/154 mesa:gallium / osmesa-symbols-check                                                                       FAIL             0.07s   exit status 1

```
src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glAreTexturesResidentEXT
src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glDeleteTexturesEXT
src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glGenTexturesEXT
src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glIsTextureEXT
```
The build options is:
```
-D glx=xlib -D gles1=disabled -D gles2=disabled -D shared-glapi=disabled
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23409>

13 months agointel/aubinator_error_decode: add ccs support
Lionel Landwerlin [Tue, 27 Jun 2023 05:41:35 +0000 (08:41 +0300)]
intel/aubinator_error_decode: add ccs support

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

13 months agogenxml: enable decoding on compute engine
Lionel Landwerlin [Mon, 26 Jun 2023 18:32:48 +0000 (21:32 +0300)]
genxml: enable decoding on compute engine

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

13 months agoradv: use nir_opt_intrinsics
Rhys Perry [Tue, 13 Jun 2023 13:09:26 +0000 (14:09 +0100)]
radv: use nir_opt_intrinsics

No fossil-db changes (navi21).

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

13 months agonir/opt_intrinsic: optimize quad vote
Rhys Perry [Tue, 13 Jun 2023 13:07:53 +0000 (14:07 +0100)]
nir/opt_intrinsic: optimize quad vote

Optimizes a quadAll()/quadAny() pattern created by dxil-spirv:
https://github.com/HansKristian-Work/dxil-spirv/commit/7adc87d4deaba8078bcdef8dfbebdda0165cd7bc

dxil-spirv can't use clustered reductions because they are not guaranteed
to include helper invocations.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

13 months agonir,aco: add INCLUDE_HELPERS index to reduce intrinsic
Rhys Perry [Tue, 13 Jun 2023 14:27:26 +0000 (15:27 +0100)]
nir,aco: add INCLUDE_HELPERS index to reduce intrinsic

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

13 months agoaco: include helpers in emit_uniform_{reduce,scan}
Rhys Perry [Tue, 13 Jun 2023 14:25:08 +0000 (15:25 +0100)]
aco: include helpers in emit_uniform_{reduce,scan}

Found by inspection.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

13 months agonir/peephole_select: allow some invocation broadcast intrinsics
Rhys Perry [Tue, 13 Jun 2023 11:35:34 +0000 (12:35 +0100)]
nir/peephole_select: allow some invocation broadcast intrinsics

fossil-db (navi21):
Totals from 3 (0.00% of 133428) affected shaders:
Instrs: 2074 -> 2083 (+0.43%)
CodeSize: 10596 -> 10692 (+0.91%)
Latency: 75754 -> 75946 (+0.25%)
InvThroughput: 16900 -> 16975 (+0.44%)
Copies: 312 -> 309 (-0.96%)
Branches: 150 -> 132 (-12.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23621>

13 months agotreewide: Remove unused builders
Alyssa Rosenzweig [Mon, 26 Jun 2023 15:39:28 +0000 (11:39 -0400)]
treewide: Remove unused builders

-Wunused-variables kicks in now that it can see through the init.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860>

13 months agotreewide: Use nir_builder_create more
Alyssa Rosenzweig [Mon, 26 Jun 2023 14:42:47 +0000 (10:42 -0400)]
treewide: Use nir_builder_create more

perl -p0e 's/nir_builder_init\(&([^,]*), /\1 = nir_builder_create(/g' -i $(git grep -l nir_builder_init)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860>

13 months agonir: Use nir_builder_create
Alyssa Rosenzweig [Mon, 26 Jun 2023 14:42:29 +0000 (10:42 -0400)]
nir: Use nir_builder_create

perl -p0e 's/nir_builder ([^;]*);\s*nir_builder_init\(&\1, /nir_builder \1 = nir_builder_create(/g' -i $(git grep -l nir_builder_init)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860>

13 months agonir: Add nir_builder_create returning nir_builder
Alyssa Rosenzweig [Mon, 26 Jun 2023 14:20:04 +0000 (10:20 -0400)]
nir: Add nir_builder_create returning nir_builder

More ergonomic.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23860>

13 months agonir/builder_opcodes: Remove nir_build_ prefixed helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:23:08 +0000 (14:23 +0200)]
nir/builder_opcodes: Remove nir_build_ prefixed helpers

This patch decreases the size of nir_builder_opcodes.h from 14292 loc to
13763 loc.

nir_build_ versions are still needed if the nir_ is a custom helper.
Intrinsics which need such a helper have to be added to
build_prefixed_intrinsics.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>

13 months agonir: Use nir_ instead of nir_build_ helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:18:20 +0000 (14:18 +0200)]
nir: Use nir_ instead of nir_build_ helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>

13 months agovtn: Use nir_ instead of nir_build_ helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:17:56 +0000 (14:17 +0200)]
vtn: Use nir_ instead of nir_build_ helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>

13 months agofreedreno: Use nir_ instead of nir_build_ helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:17:14 +0000 (14:17 +0200)]
freedreno: Use nir_ instead of nir_build_ helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>

13 months agointel: Use nir_ instead of nir_build_ helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:16:51 +0000 (14:16 +0200)]
intel: Use nir_ instead of nir_build_ helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>

13 months agomicrosoft: Use nir_ instead of nir_build_ helpers
Konstantin Seurer [Mon, 26 Jun 2023 12:16:17 +0000 (14:16 +0200)]
microsoft: Use nir_ instead of nir_build_ helpers

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23858>