Commit Graph

158054 Commits

Author SHA1 Message Date
Erik Faye-Lund
aea456776c docs: remove stale envvar-reference
This reference was left over when the envvar was removed.

Fixes: 231ccb6100 ("docs: Remove no-longer-accurate text about the xlib driver")

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
(cherry picked from commit 9bfa939a5e6377efe7b610dd9b6846edeb0fdafc)
2022-11-15 15:41:54 -08:00
Erik Faye-Lund
25c5a09f84 docs: do not mention EGL_MESA_drm_display
This extension was removed back in 2016, but it seems we left a mention
of it in the docs.

The entire section with this extension seems kinda pointless now, so
let's drop it entirely.

Fixes: f3e23ead53 ("egl: remove remnants of MESA_drm_display")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
(cherry picked from commit 9f2c9e4c3fa57deba3da30dfa8e022c0a49c80f0)
2022-11-15 15:41:53 -08:00
Lucas Stach
da12da77fc etnaviv: switch to late Z when linear PE is used
In linear PE mode the early and late depth stage do not only disagree
about the cache layout, but they seem to fundamentally disagree about
the buffer layout. When Z was written via the late stage, early tests
always show spurious zfails, even if they are not in the same draw
call. Cache flushing and pipe stalls don't help in that case.

The only option to get reliable Z tests with linear render targets is
to move all Z handling into the PE stage. Even when early Z writes
are possible, we don't know if any other draw to the same surface
needs late Z handling, so we must never use the early stage.

Fixes: 53445284a4 ("etnaviv: add linear PE support")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19686>
(cherry picked from commit 7fe91c9f660f3b76e2c08c0824d226417231c822)
2022-11-15 15:41:53 -08:00
Qiang Yu
7b1b097dd0 ac/llvm: fix gfx11 fs input load for 16bit varying
Otherwise we get empty output.

Fixes: b07204d780 ("radeonsi/gfx11: interp changes for 16bit")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.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/19637>
(cherry picked from commit 88b1bb326dae2d4cc7e069849f82c08f35c407d5)
2022-11-15 15:41:52 -08:00
Qiang Yu
838c1249b6 ac/nir/ngg: remove nuw for negative value add
Add negative value is possible to wrap around. I haven't seen this
"nuw" causes any problem yet, but let's remove it for safe.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19718>
(cherry picked from commit c21e184cc5cc818285c5590f36b170362defaf27)
2022-11-15 15:41:51 -08:00
Qiang Yu
af4c9789bb ac/nir/ngg: fix nogs culling with nuw add
We should not use "nuw" here as negative add positive may wrap
around (negative is 0xffffff??).

This problem can be observed with LLVM15 (I can't see when LLVM14):
  %.neg = mul nsw i32 %31, -4
  %163 = add nuw nsw i32 %.neg, 16
  %164 = lshr i32 257, %.neg
  %165 = lshr i32 %164, %163

LLVM just assume %.neg is possitive, so pre-shift 0x01010101 by 16.
This get wrong value because we can't get back the shifted bits with
a negative shift right.

Fixes: 75dbb40439 ("ac/nir: Remove byte permute from prefix sum of the repack sequence.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19718>
(cherry picked from commit 982b523769a75c99039deac7f832a1e10260e916)
2022-11-15 15:41:51 -08:00
Dave Airlie
c0c5eed580 gallivm: add coro malloc hooks earlier and always.
This fixes GALLIVM_DEBUG=asm for compute shaders, changing
the hooks after dumping causes a segfault because the
memory has already been finalised. Just add the hooks always,
and before dumping anything.

Fixes: f511d2a553 ("gallivm: rework coroutine malloc/free callouts.")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19714>
(cherry picked from commit fb7de303ba7cbdb4237d2ae93011bc2845114d35)
2022-11-15 15:41:50 -08:00
Caio Oliveira
2828fae0cf intel/compiler: Fix missing tie-breaker in brw_nir_analyze_ubo_ranges() ordering code
Per Ken suggestion, use ascending order for the start offset.

Fixes: 6d28c6e52c ("i965: Select ranges of UBO data to be uploaded as push constants.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19731>
(cherry picked from commit 494e2edb90d06f645e09b10d2c3f6b8d274d4dba)
2022-11-15 15:41:48 -08:00
Dylan Baker
6922ca94b3 .pick_status.json: Update to 51457b19cea9608f6bb2be81430d37da5333d2fe 2022-11-15 15:41:40 -08:00
Caio Oliveira
c9e65acaad intel/compiler: Fix dynarray usage in intel_clc
The code builds up the dynamic array of objects (spirv_objs) and
collect pointers to each of them into another dynamic
array (spirv_ptr_objs).

If the growth of the first array cause a reallocation, it is
possible that the previous pointers end up invalid.

Fixes: 77e929a527 ("intel/clc: allow multiple CL files to be compiled together")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19730>
(cherry picked from commit 9fd1d47aa0f19fac30d29e6ae40ed0383c1930ee)
2022-11-14 15:50:45 -08:00
Jason Ekstrand
e514b07e34 vulkan: Unconditionally add barriers for missing external subpass deps
This is a very scorched-earth approach which doesn't take into account
whether or not there are any explicitly provided dependencies.  We could
take a finer-grained approach in theory but it's unlikely to matter in
practice since you usually stall in Begin/EndRenderPass anyway.

Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6203
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7650
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
(cherry picked from commit 11b2a063bf1f18b3be9542be8c229427a33c92f0)
2022-11-14 15:50:42 -08:00
Jason Ekstrand
71be5b2549 vulkan: Handle VK_SUBPASS_EXTERNAL at the end of a subpass
Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
(cherry picked from commit 4ff5051944e7a7a8bf003c331af1a73ac6c7df61)
2022-11-14 15:50:40 -08:00
Lionel Landwerlin
fca0249e9c anv: bump pool bucket max allocation size
Age of Empire IV generates a shader of ~2.3Mb on DG2 which is above
the limit we currently have.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19669>
(cherry picked from commit ae76bba34a878dbd299f911bceaa9acdf01eb38a)
2022-11-14 13:37:58 -08:00
Timothy Arceri
7d0c7c57d5 nir: fix typo in lower_double options handling
Seems the intention was to check that both flags were not enabled
instead we were checking that the floor flag was both set and not
set so the result would always be false.

Fixes: 3749a6ecd2 ("nir: honor lower_double options for ffloor and ffract")

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19642>
(cherry picked from commit 34c52d8cb98e74a9debcd2605b377170c025582a)
2022-11-14 13:37:58 -08:00
Iago Toral Quiroga
2406718cc7 v3dv: fix debug dump on BO free
We were resetting the BO struct right before dumping its data. Fix
this by moving the reset later.

Fixes: 44fa8304d4 ('v3dv: add a refcount mechanism to BOs')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19672>
(cherry picked from commit 2c44597181e28b05d4b269ee73d4f3a59bc0a806)
2022-11-14 13:37:58 -08:00
Tapani Pälli
b8e787da4e anv: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>
(cherry picked from commit ecd4517560f135f64abf6e40acc48807b400ca41)
2022-11-14 13:37:58 -08:00
Tapani Pälli
fb86c07468 iris: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>
(cherry picked from commit 210d95bdb35c2c172f0a3a9527b181f8988a627f)
2022-11-14 13:37:58 -08:00
Emma Anholt
ef204ae80a ir3/ra: Make sure we don't pick a preferred reg overflowing the file.
If we're in handle_collect()'s dst allocation and are part of a merge set
near the end of the file, our check for reg_elem_size(reg) would let us
use the preferred reg when that would immediately lead to
allocate_dst_fixed() creating an interval extending thruogh reg_size(reg)
that overflows the file.

Avoids a regression on gfxbench5/gl_5_high_off/17.shader_test in the next
commit.  No change on shader-db.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
(cherry picked from commit a39113b616099a7bcce9e62337731f040c7cad64)
2022-11-14 12:00:32 -08:00
Dylan Baker
06c5579f32 .pick_status.json: Mark 25c180b50974b55e007dbbff18be1d831cd06551 as backported 2022-11-14 12:00:29 -08:00
Mario Kleiner
cce6fffe18 vulkan/wsi/display: Reset connector state in vkReleaseDisplay().
If an application was transitioning out of fullscreen exclusive
display mode, the wsi_display_connector->active state was not
reset in vkReleaseDisplay() from fullscreen. When the app then
later tried to go to fullscreen display mode again on the same
display output with the same video mode, this caused
_wsi_display_queue_next() to skip a required drmModeSetCrtc()
during the first vkQueuePresent() after entering direct display
mode.

While this often worked by pure luck on a single-display setup,
it goes sideways on a multi-display setup where the viewport
of the associated crtc does not have a (x,y) offset of (0,0).
E.g., XOrg/X11 RandR output leasing of an output whose viewport
starts at x = 1920:

1. X-Server has RandR outputs viewport at x = 1920, in a shared
   framebuffer, shared across all crtc's on a X-Screen.

2. Application leases that output for direct display mode,
   1st vkQueuePresent() triggers drmModeSetCrtc() of output
   to (x,y) = 0,0, as required for Vulkan/wsi/direct framebuffer
   setup.

3. Application does rendering and presenting.

4. Application vkReleaseDisplay() the output, terminates the
   RandR lease. X-Server takes over again.

5. X-Server modesets to reconfigure output back to viewport
   with (x,y) = 1920, 0.

6. Application leases same output again later on, and tries
   vkQueuePresent() again. Because of the bug fixed in this
   commit, the required drmModeSetCrtc() to (x,y) = 0,0 is
   erroneously skipped due to the stale cached connector state.

7. drmModePageflip() fails due to the wrong crtc viewport
   (x,y) = 1920, 0, mismatched for the need of the Vulkan
   framebuffer of (x,y) = 0,0. Kernel returns -ENOSPACE,
   Swapchain goes into permanent VK_ERROR_SURFACE_LOST state.
   Destroying and recreating the swapchain, as recommended
   by the Vulkan spec for error handling won't help. Game over!

Resetting wsi_display_connector->active = false; fixes the
problem of wrong / stale connector state and Vulkan/wsi/display
clients are happy on multi-display setups again, as tested
in various single- and multi-display configurations.

This bug affects all Mesa releases with Vulkan/WSI/Display
support and should therefore be backported.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Fixes: 352d320a07 ("vulkan: Add EXT_direct_mode_display [v2]")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19484>
(cherry picked from commit 24094ee03d625fbcd2d154e8c2dd5434ba88f166)
2022-11-14 12:00:20 -08:00
Dylan Baker
1c54e9a816 .pick_status.json: Update to 9fd1d47aa0f19fac30d29e6ae40ed0383c1930ee 2022-11-14 12:00:12 -08:00
Lionel Landwerlin
c388406617 anv: Reduce RHWO optimization (Wa_1508744258)
Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces.

v2: Move stalling to genX(cmd_buffer_apply_pipe_flushes) for clarity (Mark)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable
(cherry picked from commit ba0336ab3f69f958e4346c1465c2fe0859d4ac59)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19671>
2022-11-11 11:57:26 +02:00
Nanley Chery
ae07c08fd2 iris: Reduce use of RHWO optimization (Wa_1508744258)
Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces. MCS partial resolves are done via
software (i.e., not via a HW bit) and so are not expected to need this
workaround.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0fa540ef6137aa235f62a0ba60886f64d754566d)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19671>
2022-11-11 11:57:17 +02:00
Guilherme Gallo
130bfdde74 docs: Update link releases notes for 22.2.x
Some previous commits changed .gitlab-ci.yml, so the `test-docs-mr` was
triggered. It failed due to the lack of toctree reference in
documentation, even when the relnotes for 22.2.0 to 22.2.3 exist.

This commit fixes that to make the CI pipeline green again.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Benjamin Tissoires
2ae65f578b CI: convert to use the new S3 server instead of the legacy minio
We don't need to login anymore, but we can't use plain minio commands
now. `ci-fairy` got a helper as `s3cp` to keep an almost identical
API.

Solved Conflicts:
	.gitlab-ci/common/init-stage2.sh
	.gitlab-ci/container/lava_build.sh
	.gitlab-ci/prepare-artifacts.sh
	src/amd/ci/traces-amd.yml
	src/freedreno/ci/traces-freedreno.yml
	src/gallium/frontends/lavapipe/ci/traces-lavapipe.yml

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 67cee534a88c95a8eb6839f7bcf28a5e6dac8fbf)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Guilherme Gallo
4827c3c6d5 ci: Update ci-fairy in CI, rootfs and containers
ci-fairy is pulverized in possible different versions at Mesa CI.
This commit updates all of them to the version that migrates minio to
s3.
Also, trigger the build of base and test containers, as both uses
ci-fairy as well

Solved Conflicts:
	.gitlab-ci/image-tags.yml

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit a04ed2f971dccbf8b24f084ac9baaf8b299944a0)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Guilherme Gallo
2d1b544a79 ci: Update piglit-traces tests expectations
Found some:
- crashes in zink, softpipe
- fails in a630-restricted
- unexpectedpass in broadcom
    - fixed by https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/730

More details in the test expectations files comments.

Solved Conflicts:
	src/gallium/drivers/zink/ci/zink-lvp-skips.txt

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
(cherry picked from commit a108e4f70cc61a6b9119cd766d51c9b596e07c7f)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Guilherme Gallo
448079028d ci: Update piglit with s3 support
With new S3 support, we can use JWT-only server interaction via the
removal of `role-session` and `minio-host` arguments from PIGLIT_ARGS in
YAML.
This parameter change will come in a later commit.

Solved Conflicts:
	.gitlab-ci/container/build-piglit.sh
	.gitlab-ci/image-tags.yml

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 70ce1dcacc92a816322082c8695569b6a91a1810)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Guilherme Gallo
1867648d01 ci: Fix kernel+rootfs.* jobs
The rootfs generation is failing due to issues with the deqp and crosvm
build stages.

== crosvm ==

This week, crates.io released the bindgen cargo package at version
0.61.0, but this version could not be installed via `cargo install
bindgen ...`, setting the version to the previous one to avoid breaking
the Mesa rootfs builds.

See also related failed job:
https://gitlab.freedesktop.org/gallo/mesa/-/jobs/30046963

== deqp ==

The deqp build is failing due to the missing archive of an old zlib
release version, which was deleted due to a CVE, see zlib 1.2.13 release
notes.

As the deqp uprev to 1.3.4.0, which contains the fix, was not
straightforward, let's only apply the necessary patch to fix zlib
source code download link and then remove this indirection in an
eventual deqp uprev.

Example of a failed kernel+rootfs build job:
  https://gitlab.freedesktop.org/gallo/mesa/-/jobs/30045324

Solved Conflicts:
 	.gitlab-ci/image-tags.yml

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
(cherry picked from commit db2c14887bb52ec6fd05c5f8b5363f1689b4b45c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19604>
2022-11-11 02:29:52 +00:00
Yonggang Luo
8057091552 ci: Fixes macos.yml
Stick to macos-11 to prevent accident broken
always install meson with pip to prevent pull new version of python

Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Acked-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19640>
2022-11-11 00:17:26 +00:00
Alyssa Rosenzweig
e1fe4a64d3 panfrost: Require 64-byte alignment on imports
While Panfrost allocates linear images with strides that are a multiple of 64
bytes, other dma-buf producers on the system may not satisfy this requirement.
However, at least on v7 and newer, any image with a regular format must have a
stride that is a multiple of 64 bytes.

This fixes a real bug in an application that created a linear R8_UNORM image
with stride 480 bytes, imported it as an EGL_image, and then tried to texture
from it with the GPU. Previously, the driver allowed this situation but it
resulted in an imprecise fault from the GPU. This patch corrects the driver to
reject the import as invalid due to the unaligned stride, ensuring we never
attempt to texture from such a resource.

To implement, we add some new layout queries to centralize knowledge about the
stride alignment requirements, and we sprinkle in asserts to show how the
invariant is upheld throughout the lifecycle of image creation to texturing.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19620>
(cherry picked from commit 811f8a19469722bea32f3c539b8cf0939fe3b057)
2022-11-10 12:02:11 -08:00
Karol Herbst
91c675a097 glsl: fix buffer texture type
Fixes: 3ace6b968b ("compiler/types: Add a texture type")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
(cherry picked from commit 87526f79db68a13ebd448cfd6b1be4b25616c801)
2022-11-10 12:02:10 -08:00
Iago Toral Quiroga
b2a3f0d469 broadcom/compiler: avoid using ldvary sequence to hide latency of branching
This can cause us to stomp the contents of r5 before we have a chance to read
it, like this:

0x3d103186bb800000 nop                           ; nop                         ; ldvary.r0
0x3d105686bbf40000 nop                           ; mov rf26, r5                ; ldvary.r1
0x020000ef0000d000 bu.allna  232, r:unif (0x0000001c / 0.000000)
0x3d1096c6bbf40000 nop                           ; mov rf27, r5                ; ldvary.r2

Here, the MOV in the last instruction is supposed to read r5 produced from
ldvary.r0, but because we have inserted the bu instruction in between now
that read happens at the same time that ldvary.r1 updates r5, stomping the
value we were supposed to read.

Fix this by disallowing injection of a branch instruction in between an ldvary
instruction and its write to the r5 register 2 instructions later.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7062
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19616>
(cherry picked from commit 1174f376096ed6ceebb0fb2810456f1501a68df7)
2022-11-10 12:02:09 -08:00
Dylan Baker
caf17bfaee .pick_status.json: Update to ecc2dfc503dcf62573fa539b49caa874f908c1cf 2022-11-10 11:41:42 -08:00
Alyssa Rosenzweig
2a0c174d63 panfrost: Copy resources when necessary
If the map doesn't set MAP_DISCARD_RANGE, we do have to copy the existing
contents over. MAP_WRITE on its only gives permission to replace the contents,
unfortunately it does not require that the application actually do so.

Closes: #7640
Fixes: 0b26a9f7739 ("panfrost: Don't copy resources if replaced")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Roman Elshin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
(cherry picked from commit cf7a3906b0629b2b6aadd3b18a39eae06b10fd6a)
2022-11-09 09:33:49 -08:00
Caio Oliveira
3801b9438e nir: Don't reorder volatile intrinsics
Fixes issue with "is helper invocation" that in recent SPIR-V is mapped to
a volatile Load.  The CSE was catching the loads before they were transformed
in the new is_helper_invocation intrinsic (that is not reorderable).

Fixes: 729df14e45 ("nir: Handle volatile semantics for loading HelperInvocation builtin")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19432>
(cherry picked from commit 8ab628ab2e4d4f460e2eabdb11876997c0ab13bc)
2022-11-09 09:33:45 -08:00
Dylan Baker
40bdc68a52 .pick_status.json: Update to 4ca61b5420ed26683891664aa35dc5f1a3bad063 2022-11-09 09:33:39 -08:00
Ian Romanick
b7a7e78ade intel/fs: Fix constant propagation into 32x16 integer multiplication
Don't copy propagate the constant in situations like

    mov(8)          g8<1>D          0x7fffffffD
    mul(8)          g16<1>D         g8<8,8,1>D      g15<16,8,2>W

On platforms that only have a 32x16 multiplier, this will result in
lowering the multiply to

    mul(8)          g15<1>D         g14<8,8,1>D     0xffffUW
    mul(8)          g16<1>D         g14<8,8,1>D     0x7fffUW
    add(8)          g15.1<2>UW      g15.1<16,8,2>UW g16<16,8,2>UW

On Gfx8 and Gfx9, which have the full 32x32 multiplier, it results in

    mul(8)          g16<1>D         g15<16,8,2>W    0x7fffffffD

Volume 2a of the Skylake PRM says:

    When multiplying a DW and any lower precision integer, the
    DW operand must on src0.

See also https://gitlab.freedesktop.org/mesa/crucible/-/merge_requests/104.

Previous to INTEL_shader_integer_functions2 (in Vulkan or OpenGL), I
don't think it would be possible to create a situation where this could
occur.  I discovered this via some optimizations that can determine that
the non-constant source must be able to fit in 16-bits.  The case listed
above came from piglit's "ext_transform_feedback-order arrays points"
with those optimizations in place.

No shader-db or fossil-db changes on any Intel platform.

Fixes: de6c0f8487 ("intel/fs: Implement support for NIR opcodes for INTEL_shader_integer_functions2")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
(cherry picked from commit db204121686726c74dd0aba2d1c1790d40e7baba)
2022-11-08 15:11:37 -08:00
Mauro Rossi
3f1fe4b6bd Android.mk: Fix gnu++14 related build failures
This patch filters-out '-std=gnu++14' from the cflags obtained
from AOSP/KATI dummy target output to avoid the following building errors:

FAILED: src/gallium/drivers/r600/45f68e3@@r600@sta/sfn_sfn_assembler.cpp.o
...
clang++ ... -std=c++17 ... -std=gnu++14
...
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:56: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ~~~~~^~~~~~~~~~~~
                                                       is_base_of
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:1412:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
                            ^
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:51: error: template argument for non-type template parameter must be an expression
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:439:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
               ^
2 errors generated.

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19563>
(cherry picked from commit fd8ec189e575d5220d8b4c30647fa6de57928e07)
2022-11-08 15:11:36 -08:00
Marek Vasut
74e3535b3c etnaviv: Use old set of state registers for PE configuration on GC880
While the GC880 is HALTI0, it still uses the old set of state registers
for PE pipe configuration. This is another specialty of the GC880, readd
the missing handling for this GPU otherwise e.g. Qt5 cube example suffers
from rendering corruption with both eglfs and wayland backends.

Fixes: 7c46a48836 ("etnaviv: use new PE pipe address states on >= HALTI0")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19562>
(cherry picked from commit 20984aab0f6717f5fbf79fc21c2c5f442472b605)
2022-11-08 15:11:35 -08:00
Francisco Jerez
ef4460c21c nir/lower_int64: Fix float16 to int64 conversions.
Currently float16 to int64 conversions don't work correctly, because
the "div" variable has an infinite value, since 2^32 isn't
representable as a 16-bit float, which causes the result of of rem(x,
div) to be NaN for all inputs, leading to an incorrect result.  Since
no values of magnitude greater than 2^32 are representable as a
float16 we don't actually need to do the fdiv/frem operations, the
conversion is equivalent to f2u32 with the result padded to 64 bits.

Rework:
 * Jordan: Handle f16 in if/else rather than conditional

Fixes: 936c58c8fc ("nir: Extend nir_lower_int64() to support i2f/f2i lowering")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19391>
(cherry picked from commit e14f85366ebbc57f45d2561e0d3f0804f8adb549)
2022-11-08 15:11:34 -08:00
Marek Olšák
dde0dab8b5 radeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE
Fixes: ba02ed91a6 - ac/gfx11: fix the scratch buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
(cherry picked from commit bdfacd0a24e023515fb7b7fae4a279cff0fbac4e)
2022-11-08 15:11:32 -08:00
Alex Brachet
9005854510 nir: Fix qsort comparator function
`pred` is a pointer, for sufficiently large numbers these
being cast to int were both > 0 regardless of the order
of `data1` and `data2`.

Fixes: 523a28d3fe ("nir: add an instruction set API")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19539>
(cherry picked from commit c987a727a76eda1feada07e2eca6a5597dbddd93)
2022-11-08 13:02:06 -08:00
Samuel Pitoiset
0971b56a90 radv: invalidate L2 instead of only writeback L2 when using DCC stores
It seems INV_L2 is the right thing to do, especially for RDNA2 chips
with non-coherent RBs (NAVI22 is one of these). This fixes DCC
corruption.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6476
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7507
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19516>
(cherry picked from commit 06adf6ad117e92a832c5073326bd83b638b3ca37)
2022-11-08 13:02:05 -08:00
Iago Toral Quiroga
9855c364a1 v3dv: do better cleanup on failure during pipeline cache operation
Fixes (with disk cache enabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 5e97150e21a75920c3521717f70f9f92702729b4)
2022-11-08 13:00:41 -08:00
Iago Toral Quiroga
7d5c727f57 v3dv: handle allocation failure during pipeline initialization
Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 1f5966397aa208eb574394a4d0a592b66b776b44)
2022-11-08 13:00:40 -08:00
Iago Toral Quiroga
7f7586f87f v3dv: do a better job at cleaning up the device on init failure
These leaks on device creation failure have been there before, but
were only exposed as CTS failures after the recent event refactoring.

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit b78fd50e90c700466213e4b3b40ce10547b1e14e)
2022-11-08 13:00:39 -08:00
Dylan Baker
6c2e919156 .pick_status.json: Update to def56b531c86f529bc32d1834ccb479457717db7 2022-11-08 12:58:54 -08:00
Bas Nieuwenhuizen
79c1906231 radv: Do not try to run on GFX11 with mesa 22.2.
It isn't going to work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19577>
2022-11-08 14:59:33 +00:00
Eric Engestrom
b2e9eaf7e7 vk/runtime: drop incorrect UNUSED annotation
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit c6c5949ff70a47c47795fe9161a7514173b5be24)
2022-11-07 10:39:29 -08:00