Commit graph

201327 commits

Author SHA1 Message Date
David Rosca
b3e666248b frontends/va: Support rotation and mirror for processing
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:04 +00:00
David Rosca
7b2a1812cf frontends/va: Refactor vlVaPostProcCompositor to be usable outside processing
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:04 +00:00
David Rosca
b7661be269 frontends/va: Stop using util_compute_blit
The progressive YUV shader used in vl_compositor_yuv_deint_full
does the same thing as util_compute_blit, but it also supports rotation.
Remove vlVaPostProcBlit and instead move the code to vlVaPostProcCompositor.

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:04 +00:00
David Rosca
24d69bdfe9 frontends/va: Disable color conversion for luma-only source formats
Fixes Y8_400 -> RGB conversion.

Cc: mesa-stable
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:04 +00:00
David Rosca
375e301837 frontends/va: Simplify format check in PutSurface
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:04 +00:00
David Rosca
3bbdc54a15 gallium/vl: Implement rotation and mirror in cs compositor
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:03 +00:00
David Rosca
dd4777736c gallium/vl: Use matrix for scale and crop in cs compositor
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:03 +00:00
David Rosca
a1db69a8c3 gallium/vl: Clear remaining planes in YUV conversion
Fixes Y8_400 -> YUV conversion.

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:03 +00:00
David Rosca
7fac4e3c79 gallium/vl: Add vl compositor layer mirror
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:03 +00:00
David Rosca
746ba9f2d2 gallium/vl: Fix sampler view components for Y8_400 format
Copy sampler view for last component to remaining components.
Fixes sampling from Y8_400 luma-only format.

Fixes: 8a20e634ce ("gallium/vl: Add plane order for Y8_400 format")
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
2025-01-22 12:49:03 +00:00
Lars-Ivar Hesselberg Simonsen
358dcdabba panvk: Fix valgrind issue in panvk_compile_shaders
Ensure we've read all the relevant NIR state before freeing it for the
current shader.

Also ensure we free the shaders in the same order we compile them.

Fixes: d93f9d6d1a ("panvk: use static noperspective when statically linking VS and FS")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33011>
2025-01-22 12:12:21 +00:00
Lars-Ivar Hesselberg Simonsen
eabf8054b8 panvk: Fix valgrind issue in nir_lower_descriptors
Initialize progress to false as it might not be set by NIR_PASS()

Fixes: 258979d69c ("panvk: Wrap our descriptor lowering passes in NIR_PASS()")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33011>
2025-01-22 12:12:21 +00:00
Erik Faye-Lund
365cd04375 panfrost: do not artificially limit texture-sizes
We're already limiting the maximum texture-size based on the available
system memory, so we shouldn't really need to limit this here. In
addition, the state-tracker also limits the max framebuffer size to
16384, so we don't have to worry about limiting this to the framebuffer
size either.

So I don't think we have a good reason to artificially limit the texture
size here. This allows us to support larger textures than 8192, which is
especially useful to support OpenCL images with RustiCL.

Unfortunately, while the HW supports up to 64k texture sizes, Gallium
currently caps us at 32k. So let's stick with that as the new limit for
now.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32866>
2025-01-22 10:09:24 +00:00
Erik Faye-Lund
3a5c606d20 panfrost: limit maximum texture size
We don't want huge textures to take up large amounts of system memory.

On a system with 1GB of RAM, this would limit us to 256 MB, which is the
same memory usage as a texture of 8192 x 8192 with 4 bytes per
component, which is what we currently limit max texture size to anyway.

The goal here is really to allow using larger textures on systems with
more memory, but that bit comes in a later patch in this series.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32866>
2025-01-22 10:09:24 +00:00
Erik Faye-Lund
c205777cb6 panfrost: reuse tiler hierarchy mask selection from panvk
We're doing a better job at selecting the tiler hierarchy mask in PanVK,
so let's move that to common code and reuse it for the Gallium driver as
well.

The logic to disable the first level for large tile-sizes has been left
at the call-sites, because this is specific to V10 GPUs and later, so it
doesn't apply to the JM code-paths.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32866>
2025-01-22 10:09:24 +00:00
Jose Maria Casanova Crespo
bfd29a55e5 v3d: Apply FBO resources invalidations on job creation
We can handle invalidation of the FBO attachments at job
creation. It solves that we were skipping invalidations in jobs
that had been created by a clear call, as before this change
invalidations were only taken into account the first draw calls
of the job. In these cases where there is a clear after FB
invalidation the resource attachment was tracked as invalidated
for more time than expected. So the stores of the job with the
clear were not being loaded by the next job attaching it because
of the not correct application of the invalidation.

Fixes: 6c46890325 ("v3d: avoid load/store of tile buffer on invalidated framebuffer")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12456
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33148>
2025-01-22 09:31:32 +00:00
Marek Olšák
09aa19fb64 gallium/u_threaded: sort cases in batch_execute by their occurrence
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:28:43 -05:00
Marek Olšák
f8c730158b gallium/u_threaded: inline all tc_call functions
There are no calls anymore. It's just a loop with a switch now, which should
be implemented as a jump table by the compiler. The only calls are to
the pipe_context functions.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:20:31 -05:00
Marek Olšák
3692a50398 gallium/u_threaded: replace the function table with a switch and direct calls
gcc should generate a jump table for the switch, so it should be faster than
indirect calls after we inline the calls in the next commit.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:20:31 -05:00
Marek Olšák
c2983d93da gallium/u_threaded: use TC_END_BATCH to terminate the loop
TC_END_BATCH (TC_NUM_CALLS) is always present as the batch terminator,
so use it

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:20:31 -05:00
Marek Olšák
1776a12949 gallium/u_threaded: make the execute function table private
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:20:31 -05:00
Marek Olšák
8f4173cadf gallium/u_threaded: move tc_batch_execute after all call functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33087>
2025-01-22 01:20:31 -05:00
Marek Olšák
bdd85c8393 nir: remove handling IO variables from passes used by st/mesa
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
2c5deaa98b st/mesa: inline st_finalize_nir_before_variants
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
02516ff0f9 nir: remove dead code due to IO being always lowered in st/mesa
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
f29530533c glsl: simplify nir_lower_io_to_temporaries logic
no change in behavior

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
b7c4a1479e glsl: remove dead code due to IO being always lowered
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
000679b9bf st/mesa: remove dead/no-op code due to IO being always lowered
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Marek Olšák
3e32ea3232 st/mesa: assert that all incoming shaders use lowered IO
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33146>
2025-01-22 02:15:04 +00:00
Valentine Burley
aa37e2e5cb android/ci: Build ANV for Android
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33132>
2025-01-22 01:15:22 +00:00
Valentine Burley
b53d09a417 android/ci: Allow specifying Vulkan driver in cuttlefish-runner.sh
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33132>
2025-01-22 01:15:22 +00:00
Iván Briano
de244bcdb0 vulkan: calculate remaining layers of 2d view of 3d image correctly
When a 2D_ARRAY view of a 3D image is created, the layer count of the 2D
view should be based on the depth of the 3D image. When
VK_REMAINING_ARRAY_LAYERS is used, we were incorrectly calculating them
from the layer count of the base image.

Fixes future tests: dEQP-VK.renderpass*.remaining_array_layers.*

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33075>
2025-01-22 00:33:16 +00:00
Matt Turner
c9007999f6 elk: Pass number and sizeof separately to calloc
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:56 +00:00
Matt Turner
82330eca3c elk: Bounds check access to p->store
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:56 +00:00
Matt Turner
262546eb0b elk: Pass brw_codegen to next_offset
In the next commit we will use this to assert that we are not reading
past the end of `p->store`.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:56 +00:00
Matt Turner
7c6f4a6041 elk: Avoid reading past the end of p->store
On the last iteration of the loop, `offset` will point to the location
just beyond the last instruction in the program. If the program exactly
fills `p->store` then calling `next_offset()` will read out of bounds.

Instead just let the inner while loop call `next_offset()` one
additional time.

Fixes: a35b9cb625 ("i965: Add annotation data structure and support code.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12486
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:56 +00:00
Matt Turner
88fd100f97 brw: Pass number and sizeof separately to calloc
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:56 +00:00
Matt Turner
21bb7785bb brw: Bounds check access to p->store
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:55 +00:00
Matt Turner
ab037b5daf brw: Pass brw_codegen to next_offset
In the next commit we will use this to assert that we are not reading
past the end of `p->store`.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:55 +00:00
Matt Turner
a4f0a96dda brw: Avoid reading past the end of p->store
On the last iteration of the loop, `offset` will point to the location
just beyond the last instruction in the program. If the program exactly
fills `p->store` then calling `next_offset()` will read out of bounds.

Instead just let the inner while loop call `next_offset()` one
additional time.

Fixes: a35b9cb625 ("i965: Add annotation data structure and support code.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12486
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
2025-01-21 22:58:55 +00:00
Rob Clark
27284d14fd tu: Fix raytracing query with vdrm
Need to query the cap _before_ we close the connection.

Fixes: 4a5b234d5e ("tu: Plumb through raytracing fuse")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33139>
2025-01-21 21:51:22 +00:00
Xaver Hugl
9f0567b2ab vulkan/wsi: unset GAMMA_LUT, CTM and DEGAMMA_LUT when doing a modeset
Another drm master may have previously set these to non-zero values, which
can change the image in undesired ways.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
Backport-to: 24.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32670>
2025-01-21 21:09:16 +00:00
Georg Lehmann
ee5017a0fa nir/opt_algebaric: convert fadd(a, a) to a * 2.0
On AMD, this is a clear win. 2.0 is a free constant,
the multiplication can be fused into fma, or it can
be done as a free output modifier. Otherwise, fmul
and fadd have the same throughput/latency, with the only
possible downside being potentially power consumption.

For other hardware this might not be as clear,
but we should at least choose one option for NIR because
it allows more CSE.

Foz-DB Navi21:
Totals from 12231 (15.41% of 79395) affected shaders:
MaxWaves: 309068 -> 309032 (-0.01%)
Instrs: 11826395 -> 11790132 (-0.31%); split: -0.31%, +0.00%
CodeSize: 63531496 -> 63512868 (-0.03%); split: -0.03%, +0.00%
VGPRs: 551256 -> 551328 (+0.01%); split: -0.00%, +0.02%
SpillSGPRs: 984 -> 979 (-0.51%)
Latency: 88486492 -> 88394296 (-0.10%); split: -0.11%, +0.01%
InvThroughput: 22360595 -> 22300790 (-0.27%); split: -0.27%, +0.00%
VClause: 226267 -> 226273 (+0.00%); split: -0.01%, +0.01%
SClause: 293820 -> 293783 (-0.01%); split: -0.02%, +0.00%
Copies: 727187 -> 727106 (-0.01%); split: -0.03%, +0.02%
PreSGPRs: 539623 -> 539625 (+0.00%)
PreVGPRs: 440843 -> 440946 (+0.02%); split: -0.00%, +0.03%
VALU: 8324962 -> 8288809 (-0.43%); split: -0.43%, +0.00%
SALU: 1278550 -> 1278538 (-0.00%); split: -0.00%, +0.00%
VMEM: 440600 -> 440599 (-0.00%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32989>
2025-01-21 20:28:04 +00:00
Marek Olšák
43d3451fdb mesa: switch fixed-func vertex program to IO intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33053>
2025-01-21 19:38:54 +00:00
Marek Olšák
3290222a1a st/mesa: move VS & TES output stores to the end before unlowering IO
required by vc4 & vc5

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33053>
2025-01-21 19:38:54 +00:00
Marek Olšák
b65973240c nir: add a pass that moves output stores to the end of the shader
required by vc4 & vc5 to merge the rest of the lowered IO code for st/mesa

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33053>
2025-01-21 19:38:54 +00:00
Rob Clark
15ada70677 freedreno/pps: Fix multiple counter collection runs
The drm device file is closed and re-opened between perfetto traces.  So
we either need to re-create the fd_device, or use fd_device_new_dup() so
we hold on to our own fd.  The former is preferred so that the kernel
can realize when we are no longer reading the perfcntrs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33073>
2025-01-21 18:23:52 +00:00
Caio Oliveira
fb09dac988 intel/brw: Remove 'fs' prefix from reg alloc code
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33112>
2025-01-21 07:33:49 -08:00
Caio Oliveira
62dd470d0a intel/brw: Rename brw_fs_reg_allocate.cpp to brw_reg_allocate.cpp
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33112>
2025-01-21 07:33:49 -08:00
Pierre-Eric Pelloux-Prayer
40308ef6e5 egl/wayland: validate dri_screen_display_gpu before use
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12370
Fixes: d795b4712c ("egl/wayland: only supply LINEAR modifier when supported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33036>
2025-01-21 14:33:14 +00:00