platform/upstream/mesa.git
2 years agoi915g: Add missing support for sRGB S3TC.
Emma Anholt [Sat, 14 Aug 2021 00:03:55 +0000 (17:03 -0700)]
i915g: Add missing support for sRGB S3TC.

Apparently despite not advertising the format, GL wanted it and we would
assertion fail in format choosing.  Easy enough to add.

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

2 years agoi915g: Add support for blitting compressed textures.
Emma Anholt [Fri, 13 Aug 2021 23:57:15 +0000 (16:57 -0700)]
i915g: Add support for blitting compressed textures.

Previously we would assertion fail on s3tc uploads.

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

2 years agoi915g: Make the 1D workaround keep TXP's .w channel in the right spot.
Emma Anholt [Sat, 14 Aug 2021 02:33:39 +0000 (19:33 -0700)]
i915g: Make the 1D workaround keep TXP's .w channel in the right spot.

Fixes: 390a3fcdc45e ("nir_to_tgsi: Add support for TXP.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12367>

2 years agopython: drop explicit output_encoding='utf-8' in mako templates
Eric Engestrom [Sat, 7 Aug 2021 10:36:38 +0000 (11:36 +0100)]
python: drop explicit output_encoding='utf-8' in mako templates

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

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agoglsl/tests: remove some dead code
Eric Engestrom [Sat, 7 Aug 2021 10:01:54 +0000 (11:01 +0100)]
glsl/tests: remove some dead code

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agoisl: drop left-over comment
Eric Engestrom [Sat, 8 Aug 2020 14:07:49 +0000 (16:07 +0200)]
isl: drop left-over comment

Fixes: cf9ff082b48779c52fa6 ("isl: Bring back isl_format_layout::bpb")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agoisl: drop comment about "python 2 vs 3" as it doesn't apply anymore
Eric Engestrom [Sat, 8 Aug 2020 12:28:57 +0000 (14:28 +0200)]
isl: drop comment about "python 2 vs 3" as it doesn't apply anymore

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agoRevert "python: Explicitly add the 'L' suffix on Python 3"
Eric Engestrom [Sat, 8 Aug 2020 14:10:16 +0000 (16:10 +0200)]
Revert "python: Explicitly add the 'L' suffix on Python 3"

This reverts commit ad363913e6766280f53838126d67370f9e97aa12.

This code was added to be able to compare the output file while porting
the script from python2 to python3, but this has long been finished and
the extra complexity is not needed anymore.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agopython: drop python2 support
Eric Engestrom [Sun, 2 Feb 2020 18:25:47 +0000 (18:25 +0000)]
python: drop python2 support

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agogitlab-ci: stop installing python-is-python3 package
Eric Engestrom [Thu, 6 Aug 2020 14:24:31 +0000 (16:24 +0200)]
gitlab-ci: stop installing python-is-python3 package

Suggested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agopython: explicitly require python3
Eric Engestrom [Sun, 2 Feb 2020 15:26:16 +0000 (15:26 +0000)]
python: explicitly require python3

Ubuntu has dropped the `python` symlink to `python2` [1] instead of
redirecting it to `python3` like other distros are doing, which means
that if we want to build Mesa on Ubuntu we need the `python3` shebang.

[1] https://lists.ubuntu.com/archives/ubuntu-devel/2020-January/040882.html

Reported-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>

2 years agonir/dead_cf: Do not remove loops with loads that can't be reordered
Caio Marcelo de Oliveira Filho [Tue, 30 Mar 2021 21:18:05 +0000 (14:18 -0700)]
nir/dead_cf: Do not remove loops with loads that can't be reordered

If a loop is followed by a barrier, the ordering between a load inside
the loop and other memory operations after the barrier may have to be
preserved depending on the type of memory involved.  This is relevant
when the memory is writeable by other invocations.  In such case, it
is not valid to completely eliminate the loop.

This commit doesn't attempt to precisely catch the barrier case, as
analysis could become too complex.  It simply assumes it can't drop
the loops that contain certain types of loads unless those are known
to be safe to reorder (via the access flag).

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4475
Acked-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9938>

2 years agodrm-shim: Support kernels with >4k pages
Alyssa Rosenzweig [Thu, 12 Aug 2021 18:54:49 +0000 (18:54 +0000)]
drm-shim: Support kernels with >4k pages

mmap requires its offset is page aligned, but the current code only
guarantees 4k alignment, causing drm-shim to break badly on kernels with
>4k page sizes. This fixes drm-shim on my Apple M1, running bare metal
Linux with 16k pages. It probably also fixes exotic PowerPC systems with
64k pages.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Zoltan Boszormenyi <zboszor@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12347>

2 years agogallium: Remove "optimize" parameter from pipe_screen::finalize_nir
Ian Romanick [Tue, 10 Aug 2021 19:27:59 +0000 (12:27 -0700)]
gallium: Remove "optimize" parameter from pipe_screen::finalize_nir

As part of adding support for inline uniforms in Iris, I was going to
add a finalize_nir hook.  I went looking to see how other drivers use
the "optimize" parameter, and I discovered that *nobody* uses it at all.

v2: Fix typo in commit message.  Noticed by Mike.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12317>

2 years agov3dv: implement VK_EXT_color_write_enable
Ella-0 [Sat, 10 Jul 2021 20:02:47 +0000 (20:02 +0000)]
v3dv: implement VK_EXT_color_write_enable

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

2 years agonir/inline_functions: Handle halting functions.
Bas Nieuwenhuizen [Mon, 26 Jul 2021 15:05:20 +0000 (17:05 +0200)]
nir/inline_functions: Handle halting functions.

Without this stitch_blocks complains about ending in a jump with a
non-empty block after the inserted body.

I hit this with CTS raytracing tests where we tried to inline a
function that basically ended up being something like

{
   ignore_ray_intersection
   halt
}

I kept the nop path when possible as that does not leave a mess
for the optimization loop to optimize.

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

2 years agonir/lower_scratch: Ensure we don't lower vars with unsupported usage.
Bas Nieuwenhuizen [Mon, 26 Jul 2021 13:23:29 +0000 (15:23 +0200)]
nir/lower_scratch: Ensure we don't lower vars with unsupported usage.

Need to avoid lowering temps when they are used by other instructions,
like the rt instructions (some of the shader call parameters get
converted to temp variables and we will lower them later with
the explicit io lowering pass as we need to guarantee they will
end up in scratch).

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

2 years agonir: remove src/compiler/nir/nir_control_flow
Rhys Perry [Fri, 13 Aug 2021 14:34:41 +0000 (15:34 +0100)]
nir: remove src/compiler/nir/nir_control_flow

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12357>

2 years agonir: Move phi src setup to a helper.
Emma Anholt [Wed, 7 Jul 2021 20:24:45 +0000 (13:24 -0700)]
nir: Move phi src setup to a helper.

Cleans up the ralloc/list push code all over the tree.

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

2 years agoci/v3dv: update flakes
Juan A. Suarez Romero [Fri, 13 Aug 2021 07:50:22 +0000 (09:50 +0200)]
ci/v3dv: update flakes

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12352>

2 years agofrontends/va: Reallocate p010 buffer for AV1 10 bits decode
Leo Liu [Sat, 7 Aug 2021 21:09:55 +0000 (17:09 -0400)]
frontends/va: Reallocate p010 buffer for AV1 10 bits decode

Check bit depth and reallocate p010 buffer if it's 10 bits.

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

2 years agoradeon/vcn: Enable the AV1 decode p010 mode
Leo Liu [Sat, 7 Aug 2021 21:07:36 +0000 (17:07 -0400)]
radeon/vcn: Enable the AV1 decode p010 mode

It will still support 8 bits dithering mode decode.

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

2 years agofrontends/va: Add AV1 profile main to the config
Leo Liu [Sat, 7 Aug 2021 21:04:20 +0000 (17:04 -0400)]
frontends/va: Add AV1 profile main to the config

Thus enabling the AV1 support

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

2 years agofrontends/va: Place AV1 picture and slice parameter buffers functions
Leo Liu [Sat, 7 Aug 2021 20:41:57 +0000 (16:41 -0400)]
frontends/va: Place AV1 picture and slice parameter buffers functions

So that can pass the parameters from application to driver.

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

2 years agofrontends/va: Add AV1 parameter buffers functions
Leo Liu [Sat, 7 Aug 2021 20:01:43 +0000 (16:01 -0400)]
frontends/va: Add AV1 parameter buffers functions

Includes picture parameter and slice parameter buffers.

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

2 years agofrontends/va: Add AV1 picture description
Leo Liu [Sat, 7 Aug 2021 19:50:32 +0000 (15:50 -0400)]
frontends/va: Add AV1 picture description

Driver will get codec parameters for hardware from it.

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

2 years agovirgl/ci: switch glmark2 traces from .rdc to .trace
Italo Nicola [Fri, 13 Aug 2021 11:33:33 +0000 (08:33 -0300)]
virgl/ci: switch glmark2 traces from .rdc to .trace

Lately we've been experiencing some flakes with glmark2 renderdoc traces
on CI, this patch makes traces-virgl.yml use apitraces instead.
Hopefully this helps with reducing the flakes.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12354>

2 years agoradv: fix build with mingw
Michel Zou [Mon, 14 Jun 2021 13:57:17 +0000 (15:57 +0200)]
radv: fix build with mingw

Cc: 21.2 mesa-stable
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes #5092

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

2 years agofreedreno, tu: Set GRAS_LRZ_PS_INPUT_CNTL::SAMPLEID
Connor Abbott [Thu, 12 Aug 2021 12:55:56 +0000 (14:55 +0200)]
freedreno, tu: Set GRAS_LRZ_PS_INPUT_CNTL::SAMPLEID

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

2 years agofreedreno, tu: Stop asking for foveation quality
Connor Abbott [Thu, 12 Aug 2021 12:51:15 +0000 (14:51 +0200)]
freedreno, tu: Stop asking for foveation quality

We were setting it to r0.x.

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

2 years agofreedreno/a6xx: Add new register fields
Connor Abbott [Thu, 12 Aug 2021 12:47:40 +0000 (14:47 +0200)]
freedreno/a6xx: Add new register fields

Also use them in drivers and delete some comments that are now
irrelevant.

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

2 years agoanv/android: handle image bindings from gralloc buffers
Lionel Landwerlin [Wed, 11 Aug 2021 09:57:37 +0000 (12:57 +0300)]
anv/android: handle image bindings from gralloc buffers

When creating an image out of a swapchain on Android, the android
layer call will detect a VkBindImageMemorySwapchainInfoKHR in the
pNext chain of the vkBindImageMemory2() call and add a
VkNativeBufferANDROID in the chain. This is what we should use as
backing memory for that image.

v2: Fix a couple of obvious mistakes (Tapani)

v3: Silence build warning (Lionel)
    Fix invalid object argument to vk_error() (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bc3c71b87ae0b8 ("anv: don't try to access Android swapchains")
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5180
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12244>

2 years agonir: Initialize evaluate_cube_face_index_amd dst.x.
Vinson Lee [Mon, 9 Aug 2021 21:24:07 +0000 (14:24 -0700)]
nir: Initialize evaluate_cube_face_index_amd dst.x.

Fix defect reported by Coverity Scan.

Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value dst.x.

Fixes: a1a2a8dfda7 ("nir: add AMD_gcn_shader extended instructions")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12290>

2 years agomeson: Remove duplicate xvmc in build summary.
Vinson Lee [Tue, 10 Aug 2021 01:12:22 +0000 (18:12 -0700)]
meson: Remove duplicate xvmc in build summary.

Fixes: d30ce03bc07 ("meson: add build-summary")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12296>

2 years agoutil: Fix translate from block compressed to rgba
Axel Davy [Tue, 10 Aug 2021 18:52:45 +0000 (20:52 +0200)]
util: Fix translate from block compressed to rgba

Since
2b5178ee util: Switch the non-block formats to unpacking rgba rows instead of rects,
compressed formats define unpack_rgba_8unorm_rect instead
of unpack_rgba_8unorm.

Fixes the u_format_translate check to take this into account.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5201
Fixes: 2b5178ee ("util: Switch the non-block formats to unpacking rgba rows instead of rects")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12315>

2 years agoiris: Stop using SET_DOMAIN on discrete GPUs altogether
Kenneth Graunke [Wed, 21 Jul 2021 19:09:59 +0000 (12:09 -0700)]
iris: Stop using SET_DOMAIN on discrete GPUs altogether

SET_DOMAIN is definitely not going to be allowed on discrete GPUs,
so don't even bother trying it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12044>

2 years agoiris: Allow SET_DOMAIN to fail when allocating new GEM objects
Kenneth Graunke [Wed, 21 Jul 2021 19:08:14 +0000 (12:08 -0700)]
iris: Allow SET_DOMAIN to fail when allocating new GEM objects

We're just using this as a minor optimization to allocate pages for
buffers up front outside of some kernel locking.  It's not essential.
The SET_DOMAIN ioctl may be going away in the future, so let's be a
bit cautious and try it but not fail.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12044>

2 years agoiris: Use the new I915_USERPTR_PROBE API
Kenneth Graunke [Wed, 21 Jul 2021 19:02:54 +0000 (12:02 -0700)]
iris: Use the new I915_USERPTR_PROBE API

We need to raise an error when importing a user pointer as a BO if the
supplied pointer can't actually be used on the GPU.  Previously, we were
(ab)using the SET_DOMAIN ioctl for this, but it's not really intended
for that purpose, and is going away on discrete.

Fortunately, there's a new kernel API for this: the I915_USERPTR_PROBE
flag tries to perform basic sanity checking of the supplied pointer so
that we can at least reject obvious misuse of this API up front.

Use the new API where available.  Fall back to SET_DOMAIN if it isn't.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12044>

2 years agoanv: Use I915_USERPTR_PROBE when available
Jason Ekstrand [Fri, 23 Jul 2021 17:45:47 +0000 (12:45 -0500)]
anv: Use I915_USERPTR_PROBE when available

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

2 years agoiris: Use I915_MMAP_OFFSET_FIXED for LMEM platforms
Jason Ekstrand [Wed, 14 Jul 2021 18:26:22 +0000 (13:26 -0500)]
iris: Use I915_MMAP_OFFSET_FIXED for LMEM platforms

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

2 years agoiris: Add a new IRIS_MMAP_NONE map type
Jason Ekstrand [Thu, 22 Jul 2021 20:29:16 +0000 (15:29 -0500)]
iris: Add a new IRIS_MMAP_NONE map type

This indicates that the buffer can never be mapped.  We use this
primarily for imported BOs.

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

2 years agoiris: Don't try to CPU read imported clear color BOs
Kenneth Graunke [Mon, 26 Jul 2021 19:59:42 +0000 (12:59 -0700)]
iris: Don't try to CPU read imported clear color BOs

Previously, when importing a resource with modifiers that include
clear color as auxiliary data, we were mapping the clear color BO
on the CPU in order to set res->aux.clear_color to the value stored
there.

We are generally trying to avoid CPU mapping imported buffers, because
in hybrid setups, they could be from a different device, and may not be
mappable.  So we'd like to avoid that here.

This CPU-side knowledge of the clear color is only used in a few cases:

1. Avoiding a resolve due to a partial clear with a changing clear color

2. Avoiding disabling CCS when rendering to a texture view of a resource
   where the only format difference is sRGB vs. linear and the clear
   color is 0/1.

Instead of mapping the clear color BO on the CPU, we instead set a flag
indicating that we don't know the clear color, and reset it to known on
our first clear.

In the first case, the first partial fast clear of a resource would eat
an extra resolve (there is no penalty if we clear the whole resource).

The second case doesn't seem that critical, as it's someone rendering
to an imported BO - when the common case is to texture from it.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>

2 years agoiris: Add an assert to iris_bo_gem_mmap_legacy()
Jason Ekstrand [Fri, 16 Jul 2021 14:39:56 +0000 (09:39 -0500)]
iris: Add an assert to iris_bo_gem_mmap_legacy()

It only supports two caching modes so we should assert that the only
mode we ever see is one of them.

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

2 years agoiris: Use a tiny table to map mmap modes to offsets
Jason Ekstrand [Wed, 14 Jul 2021 18:17:03 +0000 (13:17 -0500)]
iris: Use a tiny table to map mmap modes to offsets

This is a little more obvious than the if-ladder.

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

2 years agoiris: SMEM buffers on discrete platforms are coherent
Jason Ekstrand [Fri, 23 Jul 2021 17:03:32 +0000 (12:03 -0500)]
iris: SMEM buffers on discrete platforms are coherent

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

2 years agoanv: Use I915_MMAP_OFFSET_FIXED for LMEM platforms
Jason Ekstrand [Wed, 14 Jul 2021 18:11:01 +0000 (13:11 -0500)]
anv: Use I915_MMAP_OFFSET_FIXED for LMEM platforms

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

2 years agoinclude/drm-uapi: Bump headers
Jason Ekstrand [Tue, 27 Jul 2021 21:24:08 +0000 (16:24 -0500)]
include/drm-uapi: Bump headers

From drm-next at the following commit:

    commit a22c074fd1dd52a8b41dd6789220409b64093e9c
    Merge: cb22f12f3025 3bfa7d40ce73
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Thu Aug 12 11:20:16 2021 +1000

        Merge tag 'drm-intel-next-2021-08-10-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11888>

2 years agodocs/panfrost: Update llvm option
Alyssa Rosenzweig [Thu, 12 Aug 2021 15:05:26 +0000 (11:05 -0400)]
docs/panfrost: Update llvm option

meson complains that =false is deprecated and that we should use
=disabled instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12344>

2 years agoradv: enable DCC with signedness reinterpretation
Rhys Perry [Tue, 2 Mar 2021 16:34:59 +0000 (16:34 +0000)]
radv: enable DCC with signedness reinterpretation

It seems we can enable DCC if the possible formats differ in signedness
and are otherwise compatible. We just need a fast-clear eliminate for
certain clear colors.

Improves Trine 4 performance.

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

2 years agoci: skip minio login if PIGLIT_REPLAY_UPLOAD_TO_MINIO is not set
Italo Nicola [Tue, 10 Aug 2021 15:58:07 +0000 (12:58 -0300)]
ci: skip minio login if PIGLIT_REPLAY_UPLOAD_TO_MINIO is not set

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12309>

2 years agobroadcom/compiler: set current block on incrementing unifa
Juan A. Suarez Romero [Thu, 12 Aug 2021 08:50:09 +0000 (10:50 +0200)]
broadcom/compiler: set current block on incrementing unifa

When incrementing unifa address in DCE optimization, ensure that we
setup correctly the current block, so the ldfunif optimization is also
executed correctly.

This fixes
dEQP-VK.graphicsfuzz.cov-struct-float-array-mix-uniform-vectors
heap-buffer overflow with address sanitizer enabled.

v2 (Iago):
 - Save and restore current block

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

2 years agov3dv: add API entry points for sampler Ycbcr conversions
Iago Toral Quiroga [Thu, 12 Aug 2021 09:50:12 +0000 (11:50 +0200)]
v3dv: add API entry points for sampler Ycbcr conversions

While this feature is optional in Vulkan 1.1 and we don't currently
expose it, the CTS still requires that the entry points exist.

From the Vulkan 1.1 spec:

   "If the VK_KHR_sampler_ycbcr_conversion extension is not supported,
    support for the samplerYcbcrConversion feature is optional."
   (...)
   "samplerYcbcrConversion specifies whether the implementation supports
    sampler YCBCR conversion. If samplerYcbcrConversion is VK_FALSE,
    sampler YCBCR conversion is not supported, and samplers using sampler
    YCBCR conversion must not be used."

Fixes (with Vulkan 1.1 exposed):
dEQP-VK.api.version_check.entry_points

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

2 years agov3dv: don't try to access pColorBlendState if rasterization is disabled
Iago Toral Quiroga [Thu, 12 Aug 2021 07:26:40 +0000 (09:26 +0200)]
v3dv: don't try to access pColorBlendState if rasterization is disabled

Fixes:
dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics

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

2 years agoradeonsi/test: add Sienna Cichlid expected results
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 14:59:32 +0000 (16:59 +0200)]
radeonsi/test: add Sienna Cichlid expected results

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

2 years agoradeonsi/test: prettier output
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 13:30:40 +0000 (15:30 +0200)]
radeonsi/test: prettier output

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

2 years agoradeonsi/test: allow to pass a filename as a test filter value
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 13:25:22 +0000 (15:25 +0200)]
radeonsi/test: allow to pass a filename as a test filter value

This allows this pattern:

   $ radeonsi-run-tests.py /tmp/foo
   ... reports that some piglit tests regressed ...
   $ radeonsi-run-tests.py -t /tmp/foo/new_baseline/sienna_cichlid-piglit-quick-fail.csv
   ... this only runs the test that regressed ...

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

2 years agoradeonsi/test: format radeonsi-run-test.py with black
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 13:15:38 +0000 (15:15 +0200)]
radeonsi/test: format radeonsi-run-test.py with black

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

2 years agoradeonsi/test: fix test script args handling
Pierre-Eric Pelloux-Prayer [Tue, 10 Aug 2021 12:04:02 +0000 (14:04 +0200)]
radeonsi/test: fix test script args handling

Fixes: 20055a307df ("radeonsi: add -t option to the test script")
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12306>

2 years agotu: enable VK_EXT_extended_dynamic_state2
Danylo Piliaiev [Tue, 10 Aug 2021 03:33:18 +0000 (03:33 +0000)]
tu: enable VK_EXT_extended_dynamic_state2

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

2 years agotu: implement dynamic rasterizer discard enable
Danylo Piliaiev [Tue, 10 Aug 2021 03:32:15 +0000 (03:32 +0000)]
tu: implement dynamic rasterizer discard enable

The state which could be omitted with rasterization discard
enabled - is unconditionally emitted when discard is a dynamic
state. It's not an optimal way, but does not intruduce much complexity.

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

2 years agotu: implement dynamic primitive restart enable
Danylo Piliaiev [Tue, 10 Aug 2021 03:30:07 +0000 (03:30 +0000)]
tu: implement dynamic primitive restart enable

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

2 years agotu: implement dynamic depth bias enable
Danylo Piliaiev [Thu, 22 Apr 2021 16:10:42 +0000 (19:10 +0300)]
tu: implement dynamic depth bias enable

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

2 years agotu: declare VK_EXT_extended_dynamic_state2 but leave it disabled
Danylo Piliaiev [Tue, 10 Aug 2021 03:27:10 +0000 (03:27 +0000)]
tu: declare VK_EXT_extended_dynamic_state2 but leave it disabled

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

2 years agoaux/cso: try harder to keep cso state in sync on cso context unbind
Roland Scheidegger [Fri, 6 Aug 2021 15:23:19 +0000 (17:23 +0200)]
aux/cso: try harder to keep cso state in sync on cso context unbind

Before a73cb106a677, cso contexts were never reused, but now that they
are we need to be extra careful that the state in the cso context and
in the pipe context matches even after an unbind, since when the cso
context is reused the state might otherwise get out of sync (as there is
no concept of "initial state", basically cso always relied on the default
values being the same both in cso and the drivers).
This fixes some errors we've seen internally with lavapipe.

Fixes: a73cb106a677 ("aux/cso: split cso_destroy_context into unbind and a destroy functions")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12261>

2 years agotu: allow dynamic primitive topology with tessellation
Hyunjun Ko [Tue, 10 Aug 2021 05:06:36 +0000 (05:06 +0000)]
tu: allow dynamic primitive topology with tessellation

This allows to set VK_PRIMITIVE_TOPOLOGY_PATCH_LIST dynamically when
tessellation used.

If other values are set via vkCmdSetPrimitiveTopologyEXT for the case,
the validation layer can detect the issue.

Fixes dEQP-VK.pipeline.extended_dynamic_state.*.topology_patch*

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

2 years agoci: Build ANV on Android
Jason Ekstrand [Tue, 10 Aug 2021 15:51:08 +0000 (10:51 -0500)]
ci: Build ANV on Android

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5211
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agoanv/android: Drop unused device variables
Jason Ekstrand [Wed, 11 Aug 2021 01:46:31 +0000 (20:46 -0500)]
anv/android: Drop unused device variables

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agoanv/android: Pass the correct pointer type to vk_errorf
Jason Ekstrand [Tue, 10 Aug 2021 22:48:32 +0000 (17:48 -0500)]
anv/android: Pass the correct pointer type to vk_errorf

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agointel/perf: Use a char array for OA perf query data
Jason Ekstrand [Tue, 10 Aug 2021 20:09:51 +0000 (15:09 -0500)]
intel/perf: Use a char array for OA perf query data

drm_i915_query_perf_config::data is an unsized array and declaring a
struct containing an unsized array that isn't at the end is a GNU
extension which trips up Android builds.  Instead, stuff both into a
char array of the appropriate size.  This emulates what you'd normally
do to allocate one of these with malloc only on the stack.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agointel/vec4: Don't override emit_urb_write_opcode for SNB GS
Jason Ekstrand [Tue, 10 Aug 2021 19:33:08 +0000 (14:33 -0500)]
intel/vec4: Don't override emit_urb_write_opcode for SNB GS

The gfx6_gs_visitor overrides emit_urb_write_opcode but with a different
function signature.  This causes warnings with -Woverloaded-virtual.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agomeson/glsl: Only run GLSL tests if can_run_host_binaries()
Jason Ekstrand [Wed, 11 Aug 2021 02:05:30 +0000 (21:05 -0500)]
meson/glsl: Only run GLSL tests if can_run_host_binaries()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agomeson: Intel drivers don't require expat on Android
Jason Ekstrand [Tue, 10 Aug 2021 17:43:00 +0000 (12:43 -0500)]
meson: Intel drivers don't require expat on Android

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agomeson/intel: Don't build genxml tests on Android
Jason Ekstrand [Tue, 10 Aug 2021 22:37:31 +0000 (17:37 -0500)]
meson/intel: Don't build genxml tests on Android

They require expat which we don't have on Android.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

2 years agost/mesa: fix pbo download store image type
Ilia Mirkin [Wed, 11 Aug 2021 01:02:43 +0000 (21:02 -0400)]
st/mesa: fix pbo download store image type

There's generally not too big of a difference between 1D (default) and
buffer, but can't hurt to be accurate.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12319>

2 years agoiris: use add_bo_to_batch() when adding batch->bo
Paulo Zanoni [Mon, 2 Aug 2021 20:41:46 +0000 (13:41 -0700)]
iris: use add_bo_to_batch() when adding batch->bo

Again, we don't need all the dependency checking, seqno incrementing
and duplicate tracking for batch->bo. Just use the unchecked version.

This commit is not particularly significant since it really just saves
us a check in the iris_use_pinned_bo() hot path, but since we already
have the helper function, why not?

v2:
 - (turns out the answer to "why not?" is because the patch had a bug)
 - Call ensure_exec_obj_space() since batch batch chaining can happen
   and doesn't guarantee pre-reserved space (Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

2 years agoiris: add the workaround_bo directly to the batch
Paulo Zanoni [Mon, 2 Aug 2021 20:32:20 +0000 (13:32 -0700)]
iris: add the workaround_bo directly to the batch

Don't use iris_use_pinned_bo(), go directly with add_bo_to_batch(),
skipping every check. This allows us to early return from
iris_use_pinned_bo when the workaround bo is used, saving us the call
to find_validation_entry() which ends up doing nothing except
iterating over every bo in the batch. Also don't bother with
ensure_exec_obj_space() since we just reset the batch and this is the
second BO we're adding to it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

2 years agoiris: extract the code that adds BOs to the batch lists
Paulo Zanoni [Fri, 11 Jun 2021 23:25:01 +0000 (16:25 -0700)]
iris: extract the code that adds BOs to the batch lists

We want to add a new caller, so extract this first.

v2: kflags can never contain EXEC_OBJECT_WRITE (Ken).
v3: Rebase after s/gtt_offset/address/.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

2 years agoiris: assign bo->index to the aux map BOs too
Paulo Zanoni [Fri, 11 Jun 2021 22:53:19 +0000 (15:53 -0700)]
iris: assign bo->index to the aux map BOs too

I don't see these BOs being searched for in the benchmarks I tested so
I don't think this should improve anything. On the other hand, it
shouldn't hurt either since it's just an extra assignment.

I want to unify both places where we have this code into a single
function and the lack of the bo->index assignment was the only
difference between the two places. So first we make both functions the
same and in the next commit we'll unify things. This should make
bisecting easier in case I'm wrong.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

2 years agoiris: don't bump the seqno for the workaround_bo
Paulo Zanoni [Mon, 2 Aug 2021 20:13:13 +0000 (13:13 -0700)]
iris: don't bump the seqno for the workaround_bo

The last_seqnos list is used by iris_emit_buffer_barrier_for() and as
far as I can understand we don't emit barriers for the workaround bo,
so don't even bother doing the atomic operations required to bump the
workaround_bo seqno list.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

2 years agodocs: update calendar and link releases notes for 21.1.7
Eric Engestrom [Wed, 11 Aug 2021 20:41:10 +0000 (21:41 +0100)]
docs: update calendar and link releases notes for 21.1.7

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

2 years agodocs: add release notes for 21.1.7
Eric Engestrom [Wed, 11 Aug 2021 19:20:54 +0000 (20:20 +0100)]
docs: add release notes for 21.1.7

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

2 years agointel/vec4: sel.cond writes the flags on Gfx4 and Gfx5
Dave Airlie [Wed, 4 Aug 2021 07:38:12 +0000 (17:38 +1000)]
intel/vec4: sel.cond writes the flags on Gfx4 and Gfx5

This is the equivalent of idr's
intel/fs: sel.cond writes the flags on Gfx4 and Gfx5

except for the vec4 backend.

This fixes buggy rendering seen with crocus on a qt trace.

v2 (idr): Trivial whitespace change.  Add unit tests.

v3: Fix type in comment in unit tests.  Noticed by Jason and Priit.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Iron Lake
total instructions in shared programs: 8183077 -> 8184543 (0.02%)
instructions in affected programs: 198990 -> 200456 (0.74%)
helped: 0
HURT: 1355
HURT stats (abs)   min: 1 max: 8 x̄: 1.08 x̃: 1
HURT stats (rel)   min: 0.29% max: 6.00% x̄: 0.99% x̃: 0.70%
95% mean confidence interval for instructions value: 1.04 1.12
95% mean confidence interval for instructions %-change: 0.96% 1.03%
Instructions are HURT.

total cycles in shared programs: 238967672 -> 238962784 (<.01%)
cycles in affected programs: 4666014 -> 4661126 (-0.10%)
helped: 406
HURT: 314
helped stats (abs) min: 4 max: 54 x̄: 22.46 x̃: 18
helped stats (rel) min: <.01% max: 12.80% x̄: 1.82% x̃: 0.65%
HURT stats (abs)   min: 2 max: 112 x̄: 13.48 x̃: 12
HURT stats (rel)   min: <.01% max: 7.82% x̄: 0.81% x̃: 0.16%
95% mean confidence interval for cycles value: -8.60 -4.98
95% mean confidence interval for cycles %-change: -0.87% -0.49%
Cycles are helped.

GM45
total instructions in shared programs: 4986888 -> 4988354 (0.03%)
instructions in affected programs: 198990 -> 200456 (0.74%)
helped: 0
HURT: 1355
HURT stats (abs)   min: 1 max: 8 x̄: 1.08 x̃: 1
HURT stats (rel)   min: 0.29% max: 6.00% x̄: 0.99% x̃: 0.70%
95% mean confidence interval for instructions value: 1.04 1.12
95% mean confidence interval for instructions %-change: 0.96% 1.03%
Instructions are HURT.

total cycles in shared programs: 153577826 -> 153572938 (<.01%)
cycles in affected programs: 4666014 -> 4661126 (-0.10%)
helped: 406
HURT: 314
helped stats (abs) min: 4 max: 54 x̄: 22.46 x̃: 18
helped stats (rel) min: <.01% max: 12.80% x̄: 1.82% x̃: 0.65%
HURT stats (abs)   min: 2 max: 112 x̄: 13.48 x̃: 12
HURT stats (rel)   min: <.01% max: 7.82% x̄: 0.81% x̃: 0.16%
95% mean confidence interval for cycles value: -8.60 -4.98
95% mean confidence interval for cycles %-change: -0.87% -0.49%
Cycles are helped.

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

2 years agointel/fs: sel.cond writes the flags on Gfx4 and Gfx5
Ian Romanick [Tue, 3 Aug 2021 04:33:17 +0000 (21:33 -0700)]
intel/fs: sel.cond writes the flags on Gfx4 and Gfx5

On Gfx4 and Gfx5, sel.l (for min) and sel.ge (for max) are implemented
using a separte cmpn and sel instruction.  This lowering occurs in
fs_vistor::lower_minmax which is called very, very late... a long, long
time after the first calls to opt_cmod_propagation.  As a result,
conditional modifiers can be incorrectly propagated across sel.cond on
those platforms.

No tests were affected by this change, and I find that quite shocking.
After just changing flags_written(), all of the atan tests started
failing on ILK.  That required the change in cmod_propagatin (and the
addition of the prop_across_into_sel_gfx5 unit test).

Shader-db results for ILK and GM45 are below.  I looked at a couple
before and after shaders... and every case that I looked at had
experienced incorrect cmod propagation.  This affected a LOT of apps!
Euro Truck Simulator 2, The Talos Principle, Serious Sam 3, Sanctum 2,
Gang Beasts, and on and on... :(

I discovered this bug while working on a couple new optimization
passes.  One of the passes attempts to remove condition modifiers that
are never used.  The pass made no progress except on ILK and GM45.
After investigating a couple of the affected shaders, I noticed that
the code in those shaders looked wrong... investigation led to this
cause.

v2: Trivial changes in the unit tests.

v3: Fix type in comment in unit tests.  Noticed by Jason and Priit.

v4: Tweak handling of BRW_OPCODE_SEL special case.  Suggested by Jason.

Fixes: df1aec763eb ("i965/fs: Define methods to calculate the flag subset read or written by an fs_inst.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Tested-by: Dave Airlie <airlied@redhat.com>
Iron Lake
total instructions in shared programs: 8180493 -> 8181781 (0.02%)
instructions in affected programs: 541796 -> 543084 (0.24%)
helped: 28
HURT: 1158
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.35% max: 0.86% x̄: 0.53% x̃: 0.50%
HURT stats (abs)   min: 1 max: 3 x̄: 1.14 x̃: 1
HURT stats (rel)   min: 0.12% max: 4.00% x̄: 0.37% x̃: 0.23%
95% mean confidence interval for instructions value: 1.06 1.11
95% mean confidence interval for instructions %-change: 0.31% 0.38%
Instructions are HURT.

total cycles in shared programs: 239420470 -> 239421690 (<.01%)
cycles in affected programs: 2925992 -> 2927212 (0.04%)
helped: 49
HURT: 157
helped stats (abs) min: 2 max: 284 x̄: 62.69 x̃: 70
helped stats (rel) min: 0.04% max: 6.20% x̄: 1.68% x̃: 1.96%
HURT stats (abs)   min: 2 max: 48 x̄: 27.34 x̃: 24
HURT stats (rel)   min: 0.02% max: 2.91% x̄: 0.31% x̃: 0.20%
95% mean confidence interval for cycles value: -0.80 12.64
95% mean confidence interval for cycles %-change: -0.31% <.01%
Inconclusive result (value mean confidence interval includes 0).

GM45
total instructions in shared programs: 4985517 -> 4986207 (0.01%)
instructions in affected programs: 306935 -> 307625 (0.22%)
helped: 14
HURT: 625
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.35% max: 0.82% x̄: 0.52% x̃: 0.49%
HURT stats (abs)   min: 1 max: 3 x̄: 1.13 x̃: 1
HURT stats (rel)   min: 0.12% max: 3.90% x̄: 0.34% x̃: 0.22%
95% mean confidence interval for instructions value: 1.04 1.12
95% mean confidence interval for instructions %-change: 0.29% 0.36%
Instructions are HURT.

total cycles in shared programs: 153827268 -> 153828052 (<.01%)
cycles in affected programs: 1669290 -> 1670074 (0.05%)
helped: 24
HURT: 84
helped stats (abs) min: 2 max: 232 x̄: 64.33 x̃: 67
helped stats (rel) min: 0.04% max: 4.62% x̄: 1.60% x̃: 1.94%
HURT stats (abs)   min: 2 max: 48 x̄: 27.71 x̃: 24
HURT stats (rel)   min: 0.02% max: 2.66% x̄: 0.34% x̃: 0.14%
95% mean confidence interval for cycles value: -1.94 16.46
95% mean confidence interval for cycles %-change: -0.29% 0.11%
Inconclusive result (value mean confidence interval includes 0).

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

2 years agocrocus: align staging resource pitch on gen4/5 to allow BLT usage.
Dave Airlie [Wed, 11 Aug 2021 17:34:26 +0000 (13:34 -0400)]
crocus: align staging resource pitch on gen4/5 to allow BLT usage.

Aligning the pitch to 4 bytes allows the BLT engine to be used for
transfers to/from these surfaces.

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12329>

2 years agocrocus/blt: add pitch/offset checks to fix blt corruption
Dave Airlie [Wed, 11 Aug 2021 17:32:41 +0000 (13:32 -0400)]
crocus/blt: add pitch/offset checks to fix blt corruption

I lost these in my conversion from i965 but they are necessary.

This should fix corruption in qt fonts at seen in the minecraft
launcher.

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12329>

2 years agopan/bi: Unit test DISCARD+FCMP fusing
Alyssa Rosenzweig [Wed, 4 Aug 2021 22:21:34 +0000 (18:21 -0400)]
pan/bi: Unit test DISCARD+FCMP fusing

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

2 years agopan/bi: Fuse DISCARD with conditions
Alyssa Rosenzweig [Tue, 3 Aug 2021 21:56:31 +0000 (17:56 -0400)]
pan/bi: Fuse DISCARD with conditions

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

2 years agopan/bi: Add fclamp unit tests
Alyssa Rosenzweig [Wed, 4 Aug 2021 16:12:31 +0000 (12:12 -0400)]
pan/bi: Add fclamp unit tests

The negative cases here did not pass before this series, showing the bug
in the clamp optimization. By introducing the FCLAMP pseudo op, the bug
is fixed. Let's ensure we don't regress.

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

2 years agopan/bi: Use FCLAMP pseudo op for clamp prop
Alyssa Rosenzweig [Wed, 4 Aug 2021 18:49:30 +0000 (14:49 -0400)]
pan/bi: Use FCLAMP pseudo op for clamp prop

Map nir_op_fsat/etc to FCLAMP pseudo ops, instead of FADD. There are
significantly fewer knobs on FCLAMP, meaning significantly fewer things
to get wrong.

This fixes two(!) classes of bugs:

* Swizzles (failing to lower/compose swizzles on clamps)
* Numerical bugs (incorrectly treating +0.0 as an additive identity)

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

2 years agopan/bi: Add optimizer unit tests
Alyssa Rosenzweig [Tue, 3 Aug 2021 22:39:13 +0000 (18:39 -0400)]
pan/bi: Add optimizer unit tests

Writing these tests brought to light the cluster of bugs fixed in the
previous commits. Now that things work, let's ensure they stay working.

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

2 years agopan/bi: Use FABSNEG pseudo ops for modifier prop
Alyssa Rosenzweig [Tue, 3 Aug 2021 23:16:52 +0000 (19:16 -0400)]
pan/bi: Use FABSNEG pseudo ops for modifier prop

Simplifies pattern matching. This commit by itself fixes multiple
numerical issues -- the previous fabsneg check failed to check the round
mode or the sign of the zero. That will break Vulkan/OpenCL.

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

2 years agopan/bi: Add shader equality helper for unit tests
Alyssa Rosenzweig [Tue, 3 Aug 2021 22:38:46 +0000 (18:38 -0400)]
pan/bi: Add shader equality helper for unit tests

Optimizer tests really are global.

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

2 years agopan/bi: Fuse abs/neg more on Valhall
Alyssa Rosenzweig [Tue, 3 Aug 2021 22:09:56 +0000 (18:09 -0400)]
pan/bi: Fuse abs/neg more on Valhall

Some of these Bifrost restrictions may be skipped on Valhall.

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

2 years agopan/bi: Simplify bi_compose_clamp
Alyssa Rosenzweig [Tue, 3 Aug 2021 17:47:59 +0000 (13:47 -0400)]
pan/bi: Simplify bi_compose_clamp

Realized this trick when reversing Valhall.

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

2 years agopan/bi: Unit test new constant folding patterns
Alyssa Rosenzweig [Tue, 10 Aug 2021 19:49:47 +0000 (15:49 -0400)]
pan/bi: Unit test new constant folding patterns

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

2 years agopan/bi: Constant fold texturing lowerings
Alyssa Rosenzweig [Tue, 3 Aug 2021 15:19:11 +0000 (11:19 -0400)]
pan/bi: Constant fold texturing lowerings

This ensures we can constant fold the ALU ops used to lower:

* explicit LOD calculations
* array textures
* texture offsets
* multisample indices

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

2 years agopan/va: Document IEEE 754 conformance of clamps
Alyssa Rosenzweig [Wed, 4 Aug 2021 16:21:06 +0000 (12:21 -0400)]
pan/va: Document IEEE 754 conformance of clamps

These rules are not obvious. But they turn out to be exactly what's
required by the spec.

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

2 years agopanfrost: Test src*dst + dst*src blending
Alyssa Rosenzweig [Fri, 30 Jul 2021 23:30:05 +0000 (19:30 -0400)]
panfrost: Test src*dst + dst*src blending

Validates the prior commit.

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

2 years agopanfrost: Leverage Bifrost's 2*src blend factor
Alyssa Rosenzweig [Fri, 30 Jul 2021 23:28:37 +0000 (19:28 -0400)]
panfrost: Leverage Bifrost's 2*src blend factor

Bifrost adds a value for the C factor equaling 2*src. This does not
correspond directly to API blend modes so it is not too useful in
general. However, it's required for src*dest + dest*src blending to be
done in hardware instead of a blend shader. GFXbench uses that blend
mode, so it must be important ;-)

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

2 years agopanfrost: Add basic fixed-function blending tests
Alyssa Rosenzweig [Fri, 30 Jul 2021 22:43:48 +0000 (18:43 -0400)]
panfrost: Add basic fixed-function blending tests

Add unit tests for the fixed-function blending helpers in pan_blend.c.
Each test consists of a Porter-Duff blend mode and the associated
hardware state. In this commit, we add tests for the most common modes.

For motivation, this code has NOT been properly tested in CI. True,
functional correctness of the blend module as a whole is tested by
dEQP-GLES3.functional.fragment_ops.blend.* among other integration
tests. However, this testing is insufficient to check for regressions.
Crucially, the following broken patch would clear CI:

   bool pan_can_fixed_function(...) {
      return false;
   }

In that case, blend shaders are used 100% of the time, which will
regress performance horribly but still pass dEQP. The only clue
something went wrong would be some traces changing checksum due to the
fixed-function blender producing slightly different output than
equivalent blend shaders. By unit testing the fixed blend path, we
ensure we always use the fixed-function path when we expect it to.

Similarly, using incorrect values for the blend metadata may not affect
functional correctness but will increase power consumption. Let's check
all the data we export to drivers.

Note: due to additive commutativity, there are many pairs of equivalent
Mali blend modes. Unfortunately, the vendor is... inconsistent about how
to resolve ambiguous modes. Our algorithm for computing modes is
correct; the "preferred" values are left in comments since otherwise our
tests fail despite correct code. I want to blame Bifrost for this, but
Midgard was patient zero.

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