platform/upstream/mesa.git
2 years agointel/dev: fix ppipe_mask computation
Lionel Landwerlin [Wed, 19 Jan 2022 09:03:39 +0000 (11:03 +0200)]
intel/dev: fix ppipe_mask computation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e86ce98c6a08 ("intel/devinfo: deal with i915 topology query change")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14608>

2 years agomeson: add check kwarg to run_command
Thomas H.P. Andersen [Tue, 18 Jan 2022 23:59:39 +0000 (00:59 +0100)]
meson: add check kwarg to run_command

run_command will change the default for the check arg to true
in the future. If it is true then meson will exit if the command
fails. It must be false here as we check the return code to
provide a meaningful error message.

With meson 0.61 we get the following warning:

WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300

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

2 years agozink: add deqp ci baseline for nv
Mike Blumenkrantz [Tue, 18 Jan 2022 20:28:07 +0000 (15:28 -0500)]
zink: add deqp ci baseline for nv

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

2 years agozink: update nv ci baseline
Mike Blumenkrantz [Tue, 18 Jan 2022 20:27:19 +0000 (15:27 -0500)]
zink: update nv ci baseline

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

2 years agolavapipe: replace hard pointer calcs in push descriptors with ptralloc
Mike Blumenkrantz [Thu, 4 Nov 2021 16:33:45 +0000 (12:33 -0400)]
lavapipe: replace hard pointer calcs in push descriptors with ptralloc

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

2 years agolavapipe: replace hard pointer calcs in dynamic render with ptralloc
Mike Blumenkrantz [Thu, 4 Nov 2021 16:33:45 +0000 (12:33 -0400)]
lavapipe: replace hard pointer calcs in dynamic render with ptralloc

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

2 years agoutil: add ptralloc
Mike Blumenkrantz [Thu, 4 Nov 2021 16:23:05 +0000 (12:23 -0400)]
util: add ptralloc

many times it will be the case that an allocation for a block of data
needs to be done in one alloc() call such that the members of a struct as well
as some extra trailing data are all in the same allocation like

```
struct Test {
  unsigned a[4];
  unsigned c;
};
unsigned *b; //ptr to uint[8]
```

should be allocated as a single block of (13 * sizeof(unsigned)) memory using
C pointer offsets to allocate the memory as

```
| Test | b |
```

with something like

```
struct Test *t = malloc(sizeof(struct Test) + (8 * sizeof(unsigned)));
```

and then set `b` with

```
t->b = ((uint8_t*)t) + sizeof(struct Test);
```

this is annoying, awful to read, and (at least for dum-dums like me) prone to errors,
however, so having some utility functions which can deliver the same
functionality with better readability helps out this case by transforming it to

```
unsigned *b;
void **ptrs[] = {(void*)&b};
size_t sizes[] = {8 * sizeof(unsigned));
struct Test *t = ptralloc(sizeof(struct Test), 1, sizes, ptrs);
```

where `b` is now set to the appropriate offset in memory

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

2 years agoiris: Do primitive ID overrides in 3DSTATE_SBE not SBE_SWIZ
Kenneth Graunke [Tue, 14 Dec 2021 23:25:26 +0000 (15:25 -0800)]
iris: Do primitive ID overrides in 3DSTATE_SBE not SBE_SWIZ

Broadwell introduced new fields in 3DSTATE_SBE which allow us to ask
the hardware to override Primitive ID for us, rather than requiring us
to turn on attribute swizzling and specify per-attribute overrides in
3DSTATE_SBE_SWIZ.  We unconditionally enable attribute swizzling today,
but this is a step toward letting us think about disabling it in the
future.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14210>

2 years agoiris: Use prog_data->inputs rather than shader info in SBE code.
Kenneth Graunke [Wed, 15 Dec 2021 08:53:49 +0000 (00:53 -0800)]
iris: Use prog_data->inputs rather than shader info in SBE code.

This should be the same thing, but requires looking up less data.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14210>

2 years agointel/fs: Reuse the same FS input slot for VUE header fields.
Kenneth Graunke [Wed, 15 Dec 2021 08:35:40 +0000 (00:35 -0800)]
intel/fs: Reuse the same FS input slot for VUE header fields.

VARYING_SLOT_{VIEWPORT,LAYER,PSIZ} all live in the same VUE header slot,
and the FS is already set up to read the x/y/z/w component of that vec4.

However, we were setting up the SBE to pass each of those items as a
separate FS input, so hypothetically if a shader read all three, we
would burn 3 FS inputs with redundant data.  Not only was this passing
extra data to the FS, but it would count as extra input slots for the
"Do we have 16 or fewer attributes?" check for using SBE swizzling to
rearrange them in a convenient manner.

Now we make them share a single FS attribute and only count them once.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14210>

2 years agor300: Add consts (uniforms) count to the shader-db output.
Emma Anholt [Sun, 26 Dec 2021 17:23:39 +0000 (09:23 -0800)]
r300: Add consts (uniforms) count to the shader-db output.

This is one of the critical metrics for this driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14600>

2 years agor300: Drop unused r300_get_stats() call.
Emma Anholt [Sun, 26 Dec 2021 17:20:17 +0000 (09:20 -0800)]
r300: Drop unused r300_get_stats() call.

Unused since we switched to shader-db.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14600>

2 years agointel/gem: Return length from intel_i915_query_alloc
Jordan Justen [Sat, 30 Oct 2021 10:25:09 +0000 (03:25 -0700)]
intel/gem: Return length from intel_i915_query_alloc

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Recalculate max_cs_threads after applying hwconfig changes
Jordan Justen [Fri, 7 Jan 2022 01:30:21 +0000 (17:30 -0800)]
intel/dev: Recalculate max_cs_threads after applying hwconfig changes

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Apply settings from hwconfig if devinfo::apply_hwconfig is set
Jordan Justen [Sat, 30 Oct 2021 20:41:38 +0000 (13:41 -0700)]
intel/dev: Apply settings from hwconfig if devinfo::apply_hwconfig is set

During debug builds, if apply_hwconfig is not set, then the devinfo
value will be compared with the hwconfig value. If they don't match
then a warning message will be logged to stderr.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Set intel_device_info::apply_hwconfig for DG2
Jordan Justen [Sat, 8 Jan 2022 08:13:34 +0000 (00:13 -0800)]
intel/dev: Set intel_device_info::apply_hwconfig for DG2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Add intel_device_info::apply_hwconfig
Jordan Justen [Sat, 8 Jan 2022 08:01:55 +0000 (00:01 -0800)]
intel/dev: Add intel_device_info::apply_hwconfig

This will be used to conditionally use hwconfig values to update
intel_device_info at runtime.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Print urb size with intel_dev_info
Jordan Justen [Fri, 7 Jan 2022 01:25:46 +0000 (17:25 -0800)]
intel/dev: Print urb size with intel_dev_info

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Add intel_print_hwconfig_table()
Jordan Justen [Sat, 30 Oct 2021 20:41:38 +0000 (13:41 -0700)]
intel/dev: Add intel_print_hwconfig_table()

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Add intel_hwconfig_types.h from random post on the internet
Jordan Justen [Sat, 30 Oct 2021 10:25:09 +0000 (03:25 -0700)]
intel/dev: Add intel_hwconfig_types.h from random post on the internet

There is no spec for any of this, but we'll need this to interpret a
blob that the kernel is giving us.

Ref: https://lists.freedesktop.org/archives/intel-gfx/2021-September/277488.html
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agoanv,blorp,crocus,i965,iris: Use devinfo->max_threads_per_psd for gfx8+
Jordan Justen [Tue, 2 Nov 2021 00:22:51 +0000 (17:22 -0700)]
anv,blorp,crocus,i965,iris: Use devinfo->max_threads_per_psd for gfx8+

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agointel/dev: Add max_threads_per_psd field to devinfo for gfx8+
Jordan Justen [Tue, 2 Nov 2021 00:20:20 +0000 (17:20 -0700)]
intel/dev: Add max_threads_per_psd field to devinfo for gfx8+

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>

2 years agor300: fix translate_LRP
Pavel Ondračka [Tue, 18 Jan 2022 15:58:36 +0000 (16:58 +0100)]
r300: fix translate_LRP

This was broken by 7daba1fe6544309b02d09e0710a9159049fb8cfa

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14596>

2 years agosvga: enable GL43 on SVGA GL43 capable device
Neha Bhende [Thu, 16 Dec 2021 23:33:25 +0000 (15:33 -0800)]
svga: enable GL43 on SVGA GL43 capable device

This patch enables GL43 feature for VMware's future GL43 capable
SVGA device.

Tested with various GL43 apps.

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

2 years agosvga: add GL43 resource validation at draw time
Neha Bhende [Thu, 16 Dec 2021 23:07:58 +0000 (15:07 -0800)]
svga: add GL43 resource validation at draw time

This patch adds GL43 tracked states stack and supports GL43 resource
validation at draw time. This patch is squash of in house patches
to support GL43 on VMware driver.

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

2 years agosvga: shader translation for compute, image views and shader buffers
Neha Bhende [Thu, 16 Dec 2021 22:52:26 +0000 (14:52 -0800)]
svga: shader translation for compute, image views and shader buffers

This patch handles shader translation for compute, image views and shader
buffers and updates the corresponding shader compile keys.
It also includes support of using shader raw buffer for shader buffer used
as constant buffer.
This patch is squash of numerous in house patches.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
v2: As pointed out by Thomas, fix revert of 64292c0f caused by this patch.

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

2 years agosvga: Add support for compute shader, shader buffers and image views
Neha Bhende [Thu, 16 Dec 2021 00:36:39 +0000 (16:36 -0800)]
svga: Add support for compute shader, shader buffers and image views

This commit is squash of commits which handles resource creation and management
for compute shader, shader buffers and image views. It creates uavs for shader
buffers and image views.

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

2 years agotgsi: Add hw_atomic_declared in tgsi_info
Neha Bhende [Thu, 16 Dec 2021 01:01:56 +0000 (17:01 -0800)]
tgsi: Add hw_atomic_declared in tgsi_info

This patch also adds hw_atomic_declared info in tgsi_info.

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

2 years agosvga: Add utility to check for GL43 support
Neha Bhende [Thu, 16 Dec 2021 00:44:44 +0000 (16:44 -0800)]
svga: Add utility to check for GL43 support

GL43 support in SVGA driver requires vmwgfx kernel version 2.20 and
GL43 capable SVGA device.

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

2 years agosvga: Add GL43 commands support
Neha Bhende [Thu, 16 Dec 2021 00:40:01 +0000 (16:40 -0800)]
svga: Add GL43 commands support

This patch updates SVGA header files and adds support for uav related commands.

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

2 years agozink: enable EXT_external_objects pipe caps
Mike Blumenkrantz [Tue, 11 Jan 2022 18:58:44 +0000 (13:58 -0500)]
zink: enable EXT_external_objects pipe caps

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

2 years agozink: implement external memory object resource handling
Mike Blumenkrantz [Tue, 11 Jan 2022 18:57:59 +0000 (13:57 -0500)]
zink: implement external memory object resource handling

this is super simple and can almost fully reuse the existing codepaths

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

2 years agozink: implement GL semaphores
Mike Blumenkrantz [Tue, 11 Jan 2022 18:57:00 +0000 (13:57 -0500)]
zink: implement GL semaphores

this is basically just a wrapper around vulkan semaphores, so it maps
fairly well

the existing fence function was a big ??? and should never have been triggered
like it was

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

2 years agozink: add driver/device uuid screen hooks
Mike Blumenkrantz [Tue, 11 Jan 2022 18:56:03 +0000 (13:56 -0500)]
zink: add driver/device uuid screen hooks

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

2 years agozink: add VK_KHR_external_memory_capabilities to instance exts
Mike Blumenkrantz [Tue, 11 Jan 2022 18:55:21 +0000 (13:55 -0500)]
zink: add VK_KHR_external_memory_capabilities to instance exts

the props for this are weird so they have to be fetched "manually"

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

2 years agozink: add VK_KHR_external_semaphore_fd to device exts
Mike Blumenkrantz [Tue, 11 Jan 2022 18:54:49 +0000 (13:54 -0500)]
zink: add VK_KHR_external_semaphore_fd to device exts

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

2 years agoiris: Use mi_builder for load/store reg/mem/imm functions
Jordan Justen [Fri, 5 Nov 2021 07:18:35 +0000 (00:18 -0700)]
iris: Use mi_builder for load/store reg/mem/imm functions

Ref: 06cf838cbdc ("intel/mi_builder: Support gen11 command-streamer based register offsets")
Ref: 6ffdcc335ee ("iris: Use mi_builder in iris_load_indirect_location()")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14340>

2 years agoiris: Use mi_builder to set 3DPRIM registers for draws
Jordan Justen [Fri, 5 Nov 2021 06:07:26 +0000 (23:07 -0700)]
iris: Use mi_builder to set 3DPRIM registers for draws

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14340>

2 years agocrocus: only clamp point size on last stage.
Dave Airlie [Thu, 30 Dec 2021 23:42:11 +0000 (09:42 +1000)]
crocus: only clamp point size on last stage.

This fixes a regression in tests that pass unclamped point size
values between stages.

This keeps xfb broken since the real way it should work is to have
the hw clamp after xfb, but this seems the least evil path.

Fixes: 3077d9685682 ("crocus: Clamp VS point sizes to the HW limits as required.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14359>

2 years agointel/compiler: add clamp_pointside to vs/tcs/tes keys.
Dave Airlie [Thu, 30 Dec 2021 23:41:33 +0000 (09:41 +1000)]
intel/compiler: add clamp_pointside to vs/tcs/tes keys.

This will be used by crocus and iris to clamp pointsizes only
on the last stage of the shader compile.

Fixes: 3077d9685682 ("crocus: Clamp VS point sizes to the HW limits as required.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14359>

2 years agomesa/st: get rid of ST_CALLOC_STRUCT use CALLOC_STRUCT
Dave Airlie [Wed, 29 Dec 2021 00:34:45 +0000 (10:34 +1000)]
mesa/st: get rid of ST_CALLOC_STRUCT use CALLOC_STRUCT

Just tie in the CALLOC_STRUCT/FREE mechanism.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14325>

2 years agomesa/st/perfmon: rebalance CALLOC_STRUCT/FREE
Dave Airlie [Tue, 28 Dec 2021 23:41:01 +0000 (09:41 +1000)]
mesa/st/perfmon: rebalance CALLOC_STRUCT/FREE

this was using FREE but ST_CALLOC_STRUCT, so fix the other way.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14325>

2 years agomesa: rebalance the CALLOC_STRUCT/FREE force.
Dave Airlie [Tue, 28 Dec 2021 23:37:37 +0000 (09:37 +1000)]
mesa: rebalance the CALLOC_STRUCT/FREE force.

There were some CALLOC_STRUCT that were using free, rebalance this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14325>

2 years agomesa/program: don't use CALLOC_STRUCT for instructions.
Dave Airlie [Tue, 28 Dec 2021 23:36:56 +0000 (09:36 +1000)]
mesa/program: don't use CALLOC_STRUCT for instructions.

Figuring out the frees here was too much for me.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14325>

2 years agofreedreno/ci: Fix dEQP tests expectations on A530
Cristian Ciocaltea [Tue, 18 Jan 2022 08:14:47 +0000 (10:14 +0200)]
freedreno/ci: Fix dEQP tests expectations on A530

Add a new entry to the 'fails' list.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agopanfrost/ci: Fix piglit tests expectations on G52
Cristian Ciocaltea [Tue, 18 Jan 2022 07:48:28 +0000 (09:48 +0200)]
panfrost/ci: Fix piglit tests expectations on G52

Remove the successful tests from the 'fails' list.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agoiris/ci: Fix piglit tests expectations on amly
Cristian Ciocaltea [Tue, 18 Jan 2022 07:43:15 +0000 (09:43 +0200)]
iris/ci: Fix piglit tests expectations on amly

Found two tests that started to show a flaky behavior, although they are
not detected as such by the test runner. Depending on their presence in
the 'fails' list, they are reported as "UnexpectedPass" or "Fail".

Let's fix this by moving them to the 'flaky' list.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agoiris/ci: Fix whl dEQP expectations
Cristian Ciocaltea [Mon, 17 Jan 2022 22:25:56 +0000 (00:25 +0200)]
iris/ci: Fix whl dEQP expectations

Remove the successful tests from the 'fails' list.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agovirgl/ci: Fix identification of dEQP binary paths
Cristian Ciocaltea [Tue, 4 Jan 2022 21:15:19 +0000 (23:15 +0200)]
virgl/ci: Fix identification of dEQP binary paths

In some cases the file paths passed to crosvm for execution do not point
to dEQP binaries, but can be wrapper scripts, like deqp-runner.sh.

Detect such cases and skip changing the working directory.

Additionally, use the POSIX compliant command substitution syntax
instead of the obsolete variant based on backquotes.

Fixes: 81f25d8f276 ("virgl/ci: Run each dEQP instance in its own VM")

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

2 years agovirgl/ci: Do not hide crosvm output messages
Cristian Ciocaltea [Tue, 4 Jan 2022 16:56:46 +0000 (18:56 +0200)]
virgl/ci: Do not hide crosvm output messages

In some corner cases like the kernel oops, we do not get the relevant
log messages from crosvm process to help with debugging.

Note there is currently a double redirection of its stdout stream, but
the content eventually ends up in /dev/null.

Let's fix this by redirecting both stdout and stderr streams to a
dedicated file, to avoid clobbering the output from the script/program
running inside crosvm. This is particularly required for the scenario
that involves deqp-runner starting crosvm via a *.toml suite.

Additionally, drop the unnecessary usage of 'stdbuf' and set the 'quiet'
kernel command-line parameter to get rid of the noise generated during
crosvm boot process.

Although not directly related, do some cleanup by removing the
temporary folder on script exit.

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

2 years agovirgl/ci: Prevent static link of virglrenderer inside crosvm
Cristian Ciocaltea [Tue, 4 Jan 2022 11:20:59 +0000 (13:20 +0200)]
virgl/ci: Prevent static link of virglrenderer inside crosvm

Ensure virglrenderer library is built before crosvm in order to allow
dynamic linking. This is needed for the scenarios where a different
virglrenderer library must be provided before launching crosvm, e.g.:
the upcoming Virgl CI solution that shares Mesa CI containers.

Additionally, this provides the virgl_test_server binary which is
required by piglit-runner.sh and deqp-runner.sh scripts when using
the virpipe Gallium driver.

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

2 years agovirgl/ci: Force crosvm error when exit code file is missing
Cristian Ciocaltea [Tue, 4 Jan 2022 10:39:14 +0000 (12:39 +0200)]
virgl/ci: Force crosvm error when exit code file is missing

crosvm-runner.sh doesn't correctly report the script execution status
if the exit code file is missing.

Fix this by returning 1 when there is no exit code available from the
script that was executed.

Fixes: 81f25d8f276 ("virgl/ci: Run each dEQP instance in its own VM")

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

2 years agoci: Create results folder before starting virgl_test_server
Cristian Ciocaltea [Sun, 2 Jan 2022 23:11:20 +0000 (01:11 +0200)]
ci: Create results folder before starting virgl_test_server

Move the statement responsible for creating the results output path
before 'virgl_test_server' is started in 'piglit-runner.sh' script.

This ensures the server log file will be available in the pipeline job
artifacts archive.

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

2 years agoci: Do not remove cmake
Cristian Ciocaltea [Fri, 31 Dec 2021 12:41:41 +0000 (14:41 +0200)]
ci: Do not remove cmake

In order to enable container reuse in Virgl CI, keep 'cmake' in the
container.

Additionally, provide the 'check' utility.

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

2 years agoci: Support building and installing deqp-runner from source
Cristian Ciocaltea [Thu, 30 Dec 2021 20:55:33 +0000 (22:55 +0200)]
ci: Support building and installing deqp-runner from source

Add support for building and installing deqp-runner from a git source
repository to facilitate further development & testing of new features
or simply making use of the latest upstream changes which were not
already tagged as a new package version.

The git revision to be built must be specified by setting
'DEQP_RUNNER_GIT_REV' env variable. To specify a git tag name instead,
'DEQP_RUNNER_GIT_TAG' variable must be used. It is also possible to
indicate a custom git repository via 'DEQP_RUNNER_GIT_URL'.

If neither a git revision or tag name has been set, deqp-runner is
installed from the rust package registry (the default behavior).

v2: Make use of '--git' and '--rev' cargo args to automate the git
checkout operation (Rohan).

v3: Allow Git URL override by using the hardcoded URL only when
DEQP_RUNNER_GIT_URL is not already set.

v4: Override 'EXTRA_CARGO_ARGS' to optimize the script and avoid a
second call to 'cargo install'. Additionally, add support for
indicating git tags (Rohan).

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

2 years agoci: Uprev deqp-runner to 0.11.0
Cristian Ciocaltea [Fri, 31 Dec 2021 00:51:38 +0000 (02:51 +0200)]
ci: Uprev deqp-runner to 0.11.0

The updated version offers, among others, improved logging support to
help debugging failing tests.

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

2 years agoci/piglit: Start vtest server if driver is set to virpipe
Rohan Garg [Mon, 13 Sep 2021 20:55:48 +0000 (22:55 +0200)]
ci/piglit: Start vtest server if driver is set to virpipe

This allows for running of piglit tests with vtest.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agoci: Do not remove wget
Rohan Garg [Tue, 9 Nov 2021 22:55:52 +0000 (00:55 +0200)]
ci: Do not remove wget

Keep wget for reuse by Virgl CI downstream

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
[cristian: Fix conflicts while rebasing on latest main]

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agoci: Move common variables out into a separate file
Rohan Garg [Tue, 9 Nov 2021 21:38:33 +0000 (23:38 +0200)]
ci: Move common variables out into a separate file

Moving common variables out allows for other projects like virglrenderer
to be able to reuse Mesa CI's containers

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
[cristian: fixed conflicts while rebasing on latest main; updated tags]

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agoci: Do not remove libgbm-dev
Rohan Garg [Wed, 8 Sep 2021 10:49:31 +0000 (12:49 +0200)]
ci: Do not remove libgbm-dev

In order to enable container reuse in Virgl CI, keep libgbm-dev in the
container.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
[cristian: discarded the update of MESA_IMAGE_TAG in debian/x86_build]

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14413>

2 years agozink: Enable VK_KHR_image_format_list for VK_KHR_imageless_framebuffer
Charles Baker [Thu, 9 Dec 2021 20:22:28 +0000 (09:22 +1300)]
zink: Enable VK_KHR_image_format_list for VK_KHR_imageless_framebuffer

Validation layer reports that VK_KHR_imageless_framebuffer depends on
VK_KHR_image_format_list and that the latter must be enabled explicitly
with the former.

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

2 years agoRevert "zink: update gfx_pipeline_state.vertex_strides when necessary"
Mike Blumenkrantz [Tue, 18 Jan 2022 14:46:25 +0000 (09:46 -0500)]
Revert "zink: update gfx_pipeline_state.vertex_strides when necessary"

This reverts commit a21d2bfd771ae44bdb4c997e6dce746bf65d66fa.

my brain was still on vacation and this doesn't do anything

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

2 years agonir: Reorder ffma and fsub combining
Connor Abbott [Fri, 14 Jan 2022 12:49:44 +0000 (13:49 +0100)]
nir: Reorder ffma and fsub combining

It's relatively common to do something like "a * b - c", which on most
GPUs can be implemented in a single instruction. Before
opt_algebraic_late this will be something like
"fadd(fmul(a, b), fneg(c))", and we want to turn it info
"ffma(a, b, fneg(c))". But because the fsub pattern was first we
instead turned it into "fsub(fmul(a, b), c)". Fix this by reordering
them.

Selected shader-db results on freedreno:

total instructions in shared programs: 1561330 -> 1551619 (-0.62%)
instructions in affected programs: 780272 -> 770561 (-1.24%)
helped: 1941
HURT: 491
helped stats (abs) min: 1 max: 147 x̄: 7.98 x̃: 4
helped stats (rel) min: 0.07% max: 30.77% x̄: 4.36% x̃: 3.17%
HURT stats (abs)   min: 1 max: 307 x̄: 11.76 x̃: 5
HURT stats (rel)   min: 0.09% max: 18.71% x̄: 2.26% x̃: 1.38%
95% mean confidence interval for instructions value: -4.57 -3.41
95% mean confidence interval for instructions %-change: -3.21% -2.84%
Instructions are helped.

total nops in shared programs: 358926 -> 356263 (-0.74%)
nops in affected programs: 167116 -> 164453 (-1.59%)
helped: 1395
HURT: 859
helped stats (abs) min: 1 max: 108 x̄: 6.80 x̃: 3
helped stats (rel) min: 0.17% max: 100.00% x̄: 19.15% x̃: 10.57%
HURT stats (abs)   min: 1 max: 307 x̄: 7.95 x̃: 3
HURT stats (rel)   min: 0.00% max: 381.82% x̄: 20.04% x̃: 10.00%
95% mean confidence interval for nops value: -1.77 -0.59
95% mean confidence interval for nops %-change: -5.55% -2.87%
Nops are helped.

total non-nops in shared programs: 1202404 -> 1195356 (-0.59%)
non-nops in affected programs: 496682 -> 489634 (-1.42%)
helped: 1951
HURT: 265
helped stats (abs) min: 1 max: 39 x̄: 4.02 x̃: 3
helped stats (rel) min: 0.07% max: 15.38% x̄: 2.97% x̃: 1.96%
HURT stats (abs)   min: 1 max: 22 x̄: 2.97 x̃: 2
HURT stats (rel)   min: 0.05% max: 10.00% x̄: 1.14% x̃: 0.75%
95% mean confidence interval for non-nops value: -3.38 -2.99
95% mean confidence interval for non-nops %-change: -2.60% -2.36%
Non-nops are helped.

total systall in shared programs: 288317 -> 292975 (1.62%)
systall in affected programs: 87876 -> 92534 (5.30%)
helped: 388
HURT: 431
helped stats (abs) min: 1 max: 214 x̄: 14.39 x̃: 8
helped stats (rel) min: 0.25% max: 100.00% x̄: 22.12% x̃: 11.96%
HURT stats (abs)   min: 1 max: 232 x̄: 23.77 x̃: 7
HURT stats (rel)   min: 0.00% max: 1300.00% x̄: 51.71% x̃: 17.30%
95% mean confidence interval for systall value: 3.07 8.30
95% mean confidence interval for systall %-change: 9.49% 23.97%
Systall are HURT.

(The systall hurt is probably just due to having having fewer
instructions to hide latency with.)

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14554>

2 years agozink: check EXT_image_drm_format_modifier for dmabuf support
Mike Blumenkrantz [Tue, 18 Jan 2022 15:26:59 +0000 (10:26 -0500)]
zink: check EXT_image_drm_format_modifier for dmabuf support

probably fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/5836

cc: mesa-stable

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

2 years agov3d: keep clear color untouched
Juan A. Suarez Romero [Thu, 13 Jan 2022 17:42:09 +0000 (18:42 +0100)]
v3d: keep clear color untouched

When invoking TLB clear, the color to clear could require
swapping and clamping.

Do the changes in a copy and leave the original color untouched, as it
is passed as constant.

This fixes local outside scope issues with Coverity.

Fixes: 54cba7d2 ("v3d: clamp clear color")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14534>

2 years agoradeonsi: determine MEM_ORDERED after generating a shader variant
Marek Olšák [Thu, 13 Jan 2022 07:02:45 +0000 (02:02 -0500)]
radeonsi: determine MEM_ORDERED after generating a shader variant

because si_get_nir_shader runs NIR passes and some of them can introduce
new loads.

Fixes: 3fb77ef2e0f - radeonsi: do opt_large_constants & lower_indirect_derefs after uniform inlining

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

2 years agoradeonsi: apply fbfetch/indirect_descriptor to uses_vmem_load_other earlier
Marek Olšák [Thu, 13 Jan 2022 03:58:32 +0000 (22:58 -0500)]
radeonsi: apply fbfetch/indirect_descriptor to uses_vmem_load_other earlier

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

2 years agoradeonsi: rename uses_vmem_* flags
Marek Olšák [Thu, 13 Jan 2022 03:45:53 +0000 (22:45 -0500)]
radeonsi: rename uses_vmem_* flags

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

2 years agoradeonsi: enable ARB_sparse_texture2
Qiang Yu [Tue, 28 Dec 2021 02:44:40 +0000 (10:44 +0800)]
radeonsi: enable ARB_sparse_texture2

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoradeonsi: enable multi sample sparse texture support
Qiang Yu [Thu, 30 Dec 2021 07:09:04 +0000 (15:09 +0800)]
radeonsi: enable multi sample sparse texture support

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agogallium: add multi_sample parameter to get_sparse_texture_virtual_page_size
Qiang Yu [Thu, 30 Dec 2021 07:03:57 +0000 (15:03 +0800)]
gallium: add multi_sample parameter to get_sparse_texture_virtual_page_size

Instead of using actual sample count as parameter, we only use a bool
to indicate if the target is multi sample. This is because we don't
know the sample count when glGetInternalformativ() case.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agomesa/main: export _is_multisample_target for external usage
Qiang Yu [Thu, 30 Dec 2021 07:02:31 +0000 (15:02 +0800)]
mesa/main: export _is_multisample_target for external usage

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agomesa/main: allow multi sample sparse texture
Qiang Yu [Thu, 30 Dec 2021 07:54:25 +0000 (15:54 +0800)]
mesa/main: allow multi sample sparse texture

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoradeonsi: lower nir_intrinsic_is_sparse_texels_resident
Qiang Yu [Wed, 12 Jan 2022 06:58:32 +0000 (14:58 +0800)]
radeonsi: lower nir_intrinsic_is_sparse_texels_resident

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl/nir: convert is_sparse_texels_resident to nir
Qiang Yu [Wed, 29 Dec 2021 07:26:09 +0000 (15:26 +0800)]
glsl/nir: convert is_sparse_texels_resident to nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add sparseTexelsResidentARB builtin function
Qiang Yu [Wed, 29 Dec 2021 07:12:22 +0000 (15:12 +0800)]
glsl: add sparseTexelsResidentARB builtin function

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl/nir: adjust sparse texture nir_variable
Qiang Yu [Tue, 28 Dec 2021 13:11:07 +0000 (21:11 +0800)]
glsl/nir: adjust sparse texture nir_variable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl/nir: convert sparse image load to nir
Qiang Yu [Tue, 28 Dec 2021 06:58:52 +0000 (14:58 +0800)]
glsl/nir: convert sparse image load to nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl/nir: convert sparse ir_texture to nir
Qiang Yu [Tue, 28 Dec 2021 05:52:36 +0000 (13:52 +0800)]
glsl/nir: convert sparse ir_texture to nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add vec5 glsl types
Qiang Yu [Thu, 23 Dec 2021 02:43:40 +0000 (10:43 +0800)]
glsl: add vec5 glsl types

Used by nir_variable holds sparse texture output which is
up to vec5 size.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Singed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add sparse texture image load builtin functions
Qiang Yu [Fri, 24 Dec 2021 08:59:10 +0000 (16:59 +0800)]
glsl: add sparse texture image load builtin functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add _texelFetch related sparse texture builtin function
Qiang Yu [Fri, 24 Dec 2021 06:35:46 +0000 (14:35 +0800)]
glsl: add _texelFetch related sparse texture builtin function

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add _textureCubeArrayShadow related sparse texture builtin func
Qiang Yu [Fri, 24 Dec 2021 06:16:06 +0000 (14:16 +0800)]
glsl: add _textureCubeArrayShadow related sparse texture builtin func

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add _texture related sparse texture builtin functions
Qiang Yu [Fri, 24 Dec 2021 03:33:02 +0000 (11:33 +0800)]
glsl: add _texture related sparse texture builtin functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: ir_texture support sprase texture
Qiang Yu [Tue, 28 Dec 2021 14:14:11 +0000 (22:14 +0800)]
glsl: ir_texture support sprase texture

Sparse ir_texture will set is_sparse and use struct type to
hold both residency code and sampled texel.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoglsl: add ARB_sparse_texture2 extension
Qiang Yu [Fri, 24 Dec 2021 04:19:08 +0000 (12:19 +0800)]
glsl: add ARB_sparse_texture2 extension

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Singed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agomesa/main: relax alignment check when ARB_sparse_texture2 available
Qiang Yu [Thu, 30 Dec 2021 07:52:17 +0000 (15:52 +0800)]
mesa/main: relax alignment check when ARB_sparse_texture2 available

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agomesa: add ARB_sparse_texture2 extension
Qiang Yu [Thu, 30 Dec 2021 08:39:49 +0000 (16:39 +0800)]
mesa: add ARB_sparse_texture2 extension

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agogallium: add PIPE_CAP_QUERY_SPARSE_TEXTURE_RESIDENCY
Qiang Yu [Wed, 22 Dec 2021 06:41:33 +0000 (14:41 +0800)]
gallium: add PIPE_CAP_QUERY_SPARSE_TEXTURE_RESIDENCY

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agogallium/dd_debug: add get_sparse_texture_virtual_page_size
Qiang Yu [Fri, 7 Jan 2022 03:32:12 +0000 (11:32 +0800)]
gallium/dd_debug: add get_sparse_texture_virtual_page_size

Otherwise GALLIUM_DDEBUG=always crash when sparse texture is used.

Fixes: eed8421bbac ("gallium: add screen get_sparse_texture_virtual_page_size callback")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Sigend-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agonir: fix nir_tex_instr hash not count is_sparse field
Qiang Yu [Fri, 7 Jan 2022 09:37:27 +0000 (17:37 +0800)]
nir: fix nir_tex_instr hash not count is_sparse field

This fixes nir_opt_cse miss replace a non-sparse tex instruction
with a sparse tex instruction and fail the nir_validate_shader().

Fixes: 3a7972f72a53 ("nir,spirv: add sparse texture fetches")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>

2 years agoac/surface: allow displayable DCC with any resolution (e.g. 8K)
Marek Olšák [Thu, 13 Jan 2022 07:35:08 +0000 (02:35 -0500)]
ac/surface: allow displayable DCC with any resolution (e.g. 8K)

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

2 years agotu: support VK_EXT_primitive_topology_list_restart
Danylo Piliaiev [Fri, 14 Jan 2022 13:46:02 +0000 (15:46 +0200)]
tu: support VK_EXT_primitive_topology_list_restart

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14556>

2 years agonir/unsigned_upper_bound: don't follow 64-bit f2u32()
Rhys Perry [Fri, 14 Jan 2022 13:41:55 +0000 (13:41 +0000)]
nir/unsigned_upper_bound: don't follow 64-bit f2u32()

Fixes Doom Eternal crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 72ac3f60261 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14555>

2 years agoegl/dri2: short-circuit dri2_make_current when possible
Lucas Stach [Mon, 3 Jan 2022 18:57:14 +0000 (19:57 +0100)]
egl/dri2: short-circuit dri2_make_current when possible

If an application calls eglMakeCurrent with the same context and the same
draw and read surfaces as the current ones, there is no need to go
through all the work of unbinding/flushing the old context and binding
the new one.

While the EGL spec is a bit ambiguous here, it seems that the implicit
flush of the outgoing context only needs to be done when the context is
actually changed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14379>

2 years agoegl/dri2: remove superfluous flush when changing the context
Lucas Stach [Thu, 6 Jan 2022 16:44:04 +0000 (17:44 +0100)]
egl/dri2: remove superfluous flush when changing the context

The flush of the outgoing GL context, as required by the EGL spec for
eglMakeCurrent and extended by KHR_context_flush_control, is already
performed in the unbindContext call. There is no need to pierce through
the layers and unconditionally call glFlush() here.

Getting the out-fence FD for explicit fencing needs to move behind the
unbindContext, to make sure we are getting the fence for the most
recently flushed commands.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14379>

2 years agoradv/winsys: fix zero submit if no timeline semaphore support
Samuel Pitoiset [Thu, 13 Jan 2022 16:30:38 +0000 (17:30 +0100)]
radv/winsys: fix zero submit if no timeline semaphore support

Kernels that don't support timeline semaphores also don't support
transferring syncobjs. Use export/import instead.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5845
Fixes: 967fc415fc4 ("radv: Add new submission path for use by the common sync framework.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14538>

2 years agonir: Apply nir_opt_offsets to nir_intrinsic_load_uniform as well.
Emma Anholt [Mon, 10 Jan 2022 22:49:09 +0000 (14:49 -0800)]
nir: Apply nir_opt_offsets to nir_intrinsic_load_uniform as well.

Doing this for ir3 required adding a struct for limits of how much base to
fold in (which NTT wants as well for its case of shared vars), otherwise
the later work to lower to the 1<<9 word limit would emit more
instructions.

The shader-db results are that sometimes the reduction in NIR instruction
count results in the fewer sampler prefetches due to the shader being
estimated to be shorter (dota2, nexuiz):

total instructions in shared programs: 8996651 -> 8996776 (<.01%)
total cat5 in shared programs: 86561 -> 86577 (0.02%)

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

2 years agofreedreno/ir3: Use nir_opt_offset for removing constant adds for shared vars.
Emma Anholt [Thu, 2 Dec 2021 18:31:57 +0000 (10:31 -0800)]
freedreno/ir3: Use nir_opt_offset for removing constant adds for shared vars.

Saves some work in carchase and manhattan31:

instructions in affected programs: 2842 -> 2818 (-0.84%)
nops in affected programs: 1131 -> 1105 (-2.30%)
non-nops in affected programs: 1236 -> 1238 (0.16%)
mov in affected programs: 57 -> 61 (7.02%)
dwords in affected programs: 2144 -> 2150 (0.28%)
cat0 in affected programs: 1195 -> 1169 (-2.18%)
cat1 in affected programs: 151 -> 155 (2.65%)
cat2 in affected programs: 142 -> 140 (-1.41%)
sstall in affected programs: 190 -> 178 (-6.32%)
(ss) in affected programs: 63 -> 63 (0.00%)
systall in affected programs: 532 -> 511 (-3.95%)

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

2 years agoagx: Handle discard intrinsics
Alyssa Rosenzweig [Thu, 16 Dec 2021 02:01:19 +0000 (21:01 -0500)]
agx: Handle discard intrinsics

Lower to `sample_mask = 0`. Actually that implements a demote... doing
discard correctly probably requires rewriting the shader control flow to
insert a return where necessary...

Also, possibly we should be lowering this in NIR to play nice with
gl_SampleMask writes but that's a problem for when we understand the
hardware better.

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