Commit graph

177563 commits

Author SHA1 Message Date
Faith Ekstrand
4db1bd5846 nvk/nvkmd: Implement dev and pdev for nouveau
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:23 +00:00
Faith Ekstrand
c8b36bbcc0 nvk: Add the start of a KMD abstraction
This is just the initial header and structs for device enumeration and a
few dev and pdev queries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Faith Ekstrand
6de4a408f5 nvk: Initialize the debug flags in nvk_instance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Faith Ekstrand
1f405ef9c6 nvk: Fetch debug flags from the physical device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Faith Ekstrand
04bdbb71de nvk: Align sparse-bound images to the sparse binding size
Instead of trusting in nil::Image::align_B, force it to the sparse
binding size because we know we're going to try and sparse bind it.
Otherwise, small sparse images could fail to bind at the bind step.

Fixes: 7321d151a9 ("nvk: Add support for sparse images")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Faith Ekstrand
58181b7bbc nvk: Bump the sparse alignment requirement on buffers to 64K
Otherwise, if they live in VRAM, binding might fail.

Fixes: 03f0f01904 ("nvk: Add support for sparse buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Faith Ekstrand
9bd64cbefe nvk: Why are nvk_image.c/h writeable?
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30033>
2024-07-09 01:22:22 +00:00
Karol Herbst
47377b550f Revert "rusticl/queue: gracefully stop the worker thread"
Apparently this code caused issues and the fix was only papering over the
issue, which I now I can't trigger anyway.

This reverts commit 9d458b7fc1.

Fixes: 9d458b7fc1 ("rusticl/queue: gracefully stop the worker thread")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30067>
2024-07-08 23:30:31 +00:00
Karol Herbst
cf27fd22c4 Revert "rusticl/queue: run rustfmt"
This reverts commit 47b1241251.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30067>
2024-07-08 23:30:31 +00:00
Faith Ekstrand
4f89af3723 vulkan: Use u_cnd_monotonic for vk_sync_timeline
The code we had for handling this with c11 cnd_t was gross.  Let's use a
primitive that actually works.

Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
6aaf6d090c vulkan/wsi: Delete wsi_init_pthread_cond_monotonic
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
3c4e1c918c vulkan/wsi/queue: Use mtx_t and u_cnd_monotonic
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
97e22b70b4 vulkan/wsi/display: Use mtx_t and u_cnd_monotonic
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
7aac3ea26a vulkan/wsi/x11: Use mtx_t and u_cnd_monotonic
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
3ba664c640 vulkan/wsi/x11: Use c11/threads for thread spawning
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
a0820a2a37 vulkan/wsi/wayland: Use mtx_t and u_cnd_monotonic
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
bf3052009a util/cnd_monotonic: Use a void * on Windows
This is the same thing that our win32 implementation of c11/threads does
and it allows us to avoid using CONDITION_VARIABLE in a header.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Faith Ekstrand
71524fc82e util/cnd_monotonic: Move the guts to a c file
We need to be able to include windows.h which is pretty mean to pull in
globally.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29924>
2024-07-08 22:09:06 +00:00
Esdras Tarsis
2bbb859343 nvk: Enable 8bit and 16bit access in VK_KHR_workgroup_memory_explicit_layout.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30059>
2024-07-08 21:59:42 +00:00
David Rosca
20b76fe1d4 gallium: Remove pipe_h264_picture_desc.slice_parameter.slice_count
This is a duplicate of pipe_h264_picture_desc.slice_count and is not
currently used anywhere.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30011>
2024-07-08 19:09:38 +00:00
David Rosca
7c8a0c135c frontends/va: Support multi elements slice parameter buffers for H264/5
Same as AV1, this is also valid for H264 and HEVC.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30011>
2024-07-08 19:09:38 +00:00
David Rosca
feba91d390 frontends/va: Rename slice_idx to have_slice_params and move to context
Add explanation what it does.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30011>
2024-07-08 19:09:38 +00:00
David Rosca
e0c15579f3 frontends/va: Move slice_data_offset to context
Before it only worked correctly if application sends all data/parameter
buffers in one RenderPicture call, which most applications do but it's
also valid to use multiple RenderPicture calls.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30011>
2024-07-08 19:09:37 +00:00
David Rosca
7b6749224f frontends/va: Simplify AV1 slice parameters handling
Slice count is already tracked so no need to pass it from
RenderPicture. This way it also works correctly if application sends
the slice data/parameters buffers in multiple RenderPicture calls instead
of all at once.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30011>
2024-07-08 19:09:37 +00:00
Yogesh Mohan Marimuthu
47fb4b45f2 radeonsi: add more comments in si_query.c
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30052>
2024-07-08 17:51:25 +00:00
Yogesh Mohan Marimuthu
51885bba64 radeonsi: rename query_hw_ops to hw_query_ops match sw
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30052>
2024-07-08 17:51:25 +00:00
Yogesh Mohan Marimuthu
e00400e605 radeonsi: use reseults_end instead of unprepared to init query buffer
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30052>
2024-07-08 17:51:25 +00:00
Yogesh Mohan Marimuthu
068f631814 radeonsi: remove si_query_hw_ops table and call func directly
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30052>
2024-07-08 17:51:25 +00:00
Mike Blumenkrantz
a3c4d257a2 zink: don't lower fpow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30070>
2024-07-08 16:35:21 +00:00
Alyssa Rosenzweig
0ce2e6594d nir/opt_constant_folding: fix array size define
In practice these are equal but the old code was semantically wrong: that
dimension is "sources" not "components". Use the correct #define. This came up
when reviewing https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29994

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30066>
2024-07-08 14:34:29 +00:00
Tatsuyuki Ishi
24aab6bfaf vk_cmd_queue_gen: Exclude CmdDispatchGraphAMDX
With the weak symbols changes and -Dvulkan-beta this fails to link.

Co-authored-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 2953c93cca ("vulkan Add enqueue entrypoint for CmdDispatchGraphAMDX")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30057>
2024-07-08 13:17:42 +00:00
Mike Blumenkrantz
41836133ce aux/tc: update docs to indicate replaced buffers have multiple pipe_resources
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30040>
2024-07-08 12:35:19 +00:00
Patrick Lerda
f3c9ea9b8d st/pbo_compute: fix async->nir memory leak
This is an issue happening on radeonsi after the commit
6f8e6fb99c "mesa/st: use compute pbo download for readpixels".
This commit enables a new code path which has this memory leak.

For instance, this issue is triggered on radeonsi with
"piglit/bin/glsl-fs-raytrace-bug27060 -auto -fbo":
Too many leaks! Only the first 5000 leaks encountered will be reported.
Indirect leak of 327424 byte(s) in 5582 object(s) allocated from:
    #0 0x7fe27fa4d7ef in __interceptor_malloc (/usr/lib64/libasan.so.6+0xb17ef)
    #1 0x7fe2717fd4df in ralloc_size ../src/util/ralloc.c:118
    #2 0x7fe272dbbae4 in calc_dom_children ../src/compiler/nir/nir_dominance.c:138
    #3 0x7fe272dbbae4 in nir_calc_dominance_impl ../src/compiler/nir/nir_dominance.c:192
    #4 0x7fe272b7f4a2 in nir_metadata_require ../src/compiler/nir/nir_metadata.c:40
    #5 0x7fe272ba0d50 in nir_opt_cse_impl ../src/compiler/nir/nir_opt_cse.c:43
    #6 0x7fe272ba0d50 in nir_opt_cse ../src/compiler/nir/nir_opt_cse.c:67
    #7 0x7fe272686f83 in gl_nir_opts ../src/compiler/glsl/gl_nir_linker.c:92
    #8 0x7fe271a31e69 in create_conversion_shader ../src/mesa/state_tracker/st_pbo_compute.c:701
    #9 0x7fe271a353fa in create_conversion_shader_async ../src/mesa/state_tracker/st_pbo_compute.c:810
    #10 0x7fe271806ea8 in util_queue_thread_func ../src/util/u_queue.c:309
    #11 0x7fe27186379a in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #12 0x7fe27ea9a7c3  (/lib64/libc.so.6+0x867c3)
...
SUMMARY: AddressSanitizer: 1384704 byte(s) leaked in 17291 allocation(s).

Fixes: 5dab7673e1 ("mesa/st: add specialized pbo download shaders")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30068>
2024-07-08 11:41:17 +00:00
Juan A. Suarez Romero
4581bf595b broadcom: follow version naming convention
We usually name the functions that depend on hardware version as
v3d<version>_foo.

Keep the same convention in QPU and lower_image_load_store, so it makes
easier when searching for versioned functions.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
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/30000>
2024-07-08 11:19:31 +00:00
Juan A. Suarez Romero
a10957adb6 broadcom/qpu: clean all versions not supported
Right now we only support V3D 4.2 and V3D 7.1, so clean older versions
that were left in the QPU.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
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/30000>
2024-07-08 11:19:30 +00:00
Erico Nunes
aa4d0836fe lima: fix surface reload flags assignment
These flags are set at the end of the job based on its buffer usage and
then checked by following jobs.
If an application toggles stencil and depth tests alternatigly in
a sequence of jobs while also relying on previous contents to render,
with the current assignment the reload flags for depth or stencil may
be cleared incorrectly and a depth/stencil buffer may not be properly
reloaded.

Cc: mesa-stable
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30065>
2024-07-08 08:44:04 +00:00
Lucas Stach
f0c54e02cf etnaviv: always flush pending queries on get_query_result
This is basically a port from commit 591a3c738d ("freedreno: Be more
strict about QUERY_AVAILABLE to simplify the code.") to etnaviv.

perfmon queries already forced such a flush by setting no_wait_cnt
to a value above the flush threshold, now we unify the behavior between
occlusion and perfmon queries.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30055>
2024-07-08 08:11:47 +00:00
Lucas Stach
3bae3217d5 etnaviv: drm: don't skip flush when there are active PMRs
When there are active PMRs attached to the command buffer we can
not optimize the flush away, as that results in the queries never
reaching their expected sequence number, livelocking readers
waiting for the query result.

Fixes: 148658638e7f ("etnaviv: drm: Be able to mark end of context init")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30055>
2024-07-08 08:11:47 +00:00
Timothy Arceri
d1767ddd13 glsl/tests: fix test_gl_lower_mediump
This fixes test_gl_lower_mediump to properly test linking, which also
means we can drop all the custom nir calls as we are now simply passing
the tests directly through the real nir linking code.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30034>
2024-07-08 06:38:19 +00:00
Timothy Arceri
2f5b99ec17 glsl/standalone: init EmptyUniformLocations
This updates the scaffolding to reflect init_shader_program() and
will be required in the following patch to avoid a segfault.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30034>
2024-07-08 06:38:19 +00:00
Timothy Arceri
5ae5229e3d glsl/mesa: remove UniformHash field
Unused since 9617184bc2

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30034>
2024-07-08 06:38:19 +00:00
Eric Engestrom
801ed4d032 ci: simplify setting .no-auto-retry now that it isn't bundled with unrelated rules:
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30004>
2024-07-07 19:31:44 +00:00
Eric Engestrom
f37af2ab8c ci: split .no-auto-retry out of .scheduled_pipeline-rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30004>
2024-07-07 19:31:44 +00:00
Konstantin Seurer
d9e41e8a8c nir: Stop using "capture : true" for nir_opt_algebraic
"calture : true" is suboptimal and and prevents the script from writing
multiple files in one go.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30041>
2024-07-06 15:51:06 +00:00
Dmitry Baryshkov
b018489245 freedreno/registers: drop display-related register files
Neither freedreno nor turnip make use of the display-related source
files. With the XML files being imported to the kernel, drop them from
Mesa to prevent possible confusion and/or deviation between those files.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27787>
2024-07-06 15:16:48 +00:00
Sviatoslav Peleshko
b0b1907fa5 mesa: Fix PopAttrib not restoring states that changed on deeper stack level
Currently on each pop we reset the PopAttribState to the value from the
last push. But if we assume a sequence "push(X), push(Y), changeX(),
pop(), pop()": the first pop will remove X from PopAttribState, so the
second pop will not even try to restore X, leaving a wrong value forever.
Fix this by "bubbling up" the changed states that were not restored by pop.

Fixes: 68030bbf ("mesa: only pop states in glPopAttrib that have been changed since glPushAttrib")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11417
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30038>
2024-07-06 07:08:30 +00:00
Faith Ekstrand
73ec9f0183 nvk: Silently fail to enumerate if not on nouveau
The NVIDIA proprietary driver exposes a DRM device these days and this
can trip up NVK as it advertises an NVIDIA device id.  We fail to
enumerate but the check for nouveau happens too late and we throw a
warning.  This means tha if NVK is even installed side-by-side with the
proprietary driver, we spam warnings on every device enumeration.  It's
better to fail silently.

Fixes: 83786bf1c9 ("nvk: add vulkan skeleton")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11441
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30035>
2024-07-05 20:36:01 +00:00
Faith Ekstrand
1b56292733 nvk: Don't emit conservative rasterization before Maxwell B
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30054>
2024-07-05 20:22:58 +00:00
Faith Ekstrand
ea2aa3ca83 nvk: Re-order conservative rasterization checks
Generally, we check for the newest generation first and treat the later
generations as a fallback path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30054>
2024-07-05 20:22:58 +00:00
Faith Ekstrand
08a667e786 nvk: Fix whitespace issues around conservative rasterization
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30054>
2024-07-05 20:22:58 +00:00