Commit graph

181775 commits

Author SHA1 Message Date
Yiwei Zhang
5b26bebcf4 venus: add vn_gettid helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
b170c1a391 venus: switch to vn_ring as the protocol interface - part 3
Sync protocol and fix all the interfaces, otherwise we have to generate
two sets of headers with both interfaces to separate protocol sync and
the driver side adaptation.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
5943f70c7a venus: switch to vn_ring as the protocol interface - part 2
Use instance ring as the primary ring of a logical device.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d28ebf7b99 venus: switch to vn_ring as the protocol interface - part 1
No functional change but just preparations for switching instance
to ring to interface with the venus protocol headers.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
a0ef347a82 venus: add vn_ring_get_id and hide vn_ring internals entirely
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9e38c74139 venus: move the actual ring creation into ring as well
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
c779fc9fb1 venus: move ring submission into ring
At first, no behavior change in this CL.

The instance level helper for normal command submission is left to work
with the current venus protocol. Meanwhile, we leave the helper to
submit recorded command buffer inside instance to it can later redirect
to the primary ring.

We've internalized a few ring helpers that no longer need to be exposed.
Besides, indirect submission decision is on per-ring basis since the
ring buffer can vary later.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9229c13a2c venus: move the rest ring belongings into ring
This change only moves the fields without changing the accessors. It's
better to let ring own its own upload cs encoder (which is backed by
shmem array) to avoid lock contention between indirect submissions
across rings.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d1e29b7557 venus: move ring shmem into vn_ring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
3e122014cf venus: relax ring mutex
Now we are able to break up the original lock to allow shmem alloc to be
outside the ring mutex, as long as the reply shmem set is still coupled
with ring submission.

Add and expose vn_instance_reply_shmem_alloc helper which will be used
by rings separately later.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
b98d850efd venus: remove command_dropped tracking
The encoder must not be empty by then so switch to an assert. Failing to
get a reply shmem would end up with VK_ERROR_OUT_OF_HOST_MEMORY, thus
there's no need to track either.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
90e64564b8 venus: make vn_renderer_shmem_pool thread-safe
This can be thread-safe only because we have dropped seeking command
stream offset, which requires comparing pool shmem to decide conditional
set stream.

This is to prepare for later sharing reply shmem pool across rings.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
0273c9cc03 venus: always set reply command stream to avoid seek
More considerations and details here:
- The seek is a bit lighter than set, since it assumes renderer side
  resource being immutable. It does affect perf when Venus is still
  making verbose synchronous calls at runtime (e.g. descriptor set,
  buffer, device memory, etc).
- Seek still requires lock protection as the reply shmem must be
  immutable before the seek and the followed cmd are committed to the
  ring.
- Removing seek without doing set requires renderer change to always
  bump the encoder end position according to what the original request
  is instead of being ad-hoc upon what the host driver tells to write.
  The overhead and extra complexity there isn't negligible.
- Further, removing seek requires each ring to track the prior reply
  pool shmem in the multi-ring scenario. While the additional host side
  resource lookup isn't costy as the number of resources is must less
  than the vk object table.
- The nice thing is that we can make shmem pool thead safe to be more
  easily shared across rings.

So we just drop it.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
70e8d1397e venus: further cleanup vn_relax_init to take instance instead of ring
For multi-ring, later we can just check primary ring alive status.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
f6adc60822 venus: refactor to add vn_watchdog
Summary:
- cleanup redundant report_period_us check post 1.0 release
- add vn_watchdog and its accessors
  - vn_watchdog_init
  - vn_watchdog_fini
  - vn_watchdog_acquire
  - vn_watchdog_release
  - vn_watchdog_timeout

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d8b059b01b venus: move ring monitor to instance for sharing across rings
Later we will base off just the primary ring alive status.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
22b5c9c65f venus: refactor instance creation failure path
Make fail path more precise and slightly adjust cs_shmem to sit together
with reply shmem pool.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
26e20eb12c venus: add vn_instance_fini_ring helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
2cdab2c25d venus: use instance allocator for indirect cs storage alloc
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
ec131c6e55 venus: use instance allocator for ring allocs
and some nice to have refactors

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
15c7e7743e venus: add ring helper to avoid redundant ring wait requests
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
891d3fb2db venus: enable renderer shmem cache dump for cache debug
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
34c9864318 venus: use STACK_ARRAY to prepare for indirect submission
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
60e0af9661 venus: reduce ring idle timeout from 50ms to 5ms
The ring wake up is no longer costy as the other notifies followed by
the initial call won't be blocked by ring cmd execution anymore
(without vkr side big context lock). Reducing the timeout can help cpu
bound scenarios.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9c9e097585 venus: add missing shmem pool fini for cs_shmem pool
This is missed from the fail path. No need to backport since there's
nothing leaked from this yet.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
8ac7d78bf3 venus: properly initialize ring monitor initial alive status
This avoids a potential race condition if two threads are competing for
the monitor with the initial states, and the losing one may run into
alive status being false and abort.

Fixes: 4a4b05869a ("venus: check and configure new ringMonitoring feature")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reported-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
aed4c4d04e venus: fix async compute pipeline creation
Fixes: a771efdefe ("venus: Enable VK_EXT_pipeline_creation_cache_control")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:36 +00:00
Dave Airlie
55e0aced28 nvk: drop unneeded shader type conversion function
This is both pointless now and not used anywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26583>
2023-12-08 12:27:18 +10:00
Kenneth Graunke
a7b054c974 anv: Don't report more memory available than the heap size
When calculating the system memory heap size, we report only 3/4 of
the total RAM size (or 1/2 for systems with less than 4GB of RAM).

In the memory budget extension query, we were reporting 90% of the
available system memory.  If most of the memory in the system is free,
this could result in the total heap size being 3/4 of RAM, but the
memory available being 9/10 of RAM.  But if the application tried to
allocate the memory reported as "available", it would exceed the heap
size.  This can confuse some applications.

This patch makes the memory budget query clamp the available RAM to
the heap size, so it will never report more available than the heap
can provide.  Unfortunately, this means that we'll report only 67.5%
of system memory as available (3/4 * 9/10).  We may want to adjust
this estimate in the future.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26553>
2023-12-07 15:12:38 -08:00
Kenneth Graunke
029b1d3f26 anv: Drop 3/4 of PPGTT size restriction for sys heap size calculation
This was mainly useful for older Gen7.x GPUs with 32-bit PPGTT, which
are now supported by hasvk rather than anv.  The remaining platforms
which anv supports have 36, 47, or 48-bit PPGTT, which imposes a 3/4
limit of 48GB, 96TB, and 192TB of memory.

The GPUs with 36-bit PPGTT are Elkhart Lake and Jasper Lake, which
appear to be Atom CPUs that have a maximum supported memory
configuration of 32GB or less, so this limit should not matter there.
Nor is a multi-TB limit likely to matter on our other parts.

Drop this check to simplify the heap and memory budget calculations.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26553>
2023-12-07 15:12:35 -08:00
Faith Ekstrand
3bb4c14c75 nak: Rework barrier handling a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26577>
2023-12-07 22:44:36 +00:00
Thomas H.P. Andersen
eafc8f58c6 nouveau: drop unused #includes of tgsi_parse.h
The use of these includes was dropped. No need to keep these around

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26339>
2023-12-07 22:29:09 +00:00
David Heidelberg
0ea6e17130 ci: bump kernel to 6.6.4
Let's move to current LTS kernel.

Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26551>
2023-12-07 21:35:53 +00:00
Konstantin Seurer
4ac8d16006 nvk: Do not preserve metadata after lower_load_global_constant_offset_instr
The pass inserts control flow.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
99fdd98b3f drm-shim/nouveau: Stub mitting ioctls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
17bfaeac15 drm-shim/nouveau: Expose the 2D engine on NV50+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
3b0c34075c drm-shim/nouveau: Set nv_device_info_v0::platform
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Dave Airlie
45eaf6c002 nvk/nak/xfb: handle skipping properly when setting xfb_attr.
The code treated 0x00 and 0xff the same, but they aren't,
port over the codegen code.

Fixes GTF-GL45.gtf40.GL3Tests.transform_feedback3.transform_feedback3_skip_components
with zink on nvk

v2: drop padding to 0, tests still pass.

Fixes: 30f01c47c2 ("nak: Translate XFB info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26559>
2023-12-07 21:05:12 +00:00
Faith Ekstrand
6b1f3884c3 nak: Clean up instruction printing a bit
When we can do it in one line I like the little if else pattern for
single-bit modifiers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
f5869d1c5b nak: Audit sm50 for FTZ/DNZ bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
22aab2ccba nak: Audit remaining FTZ/DNZ bits on sm70+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
5bfb46a735 nak: Add dnz bits to OpFMul and OpFFma
Also, while we're here, clean up the from_nir code a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
97a59ded43 nak: Plumb through float controls for frnd[p]
Fixes: 1c84c8183c ("nak: Plumb through float controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
e179a90356 nak: Plumb through float controls for fset[p]
Fixes: 1c84c8183c ("nak: Plumb through float controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Dave Airlie
1b27a6be20 nvk: fix transform feedback with multiple saved counters.
The SET_STREAM_OUT_BUFFER_LOAD_WRITE_POINTER registers have an
8 dword stride, but the code is only adding one dword between them
then the MME is calling an illegal method.

This is the simple fix, otherwise I think we'd have to multiply
somehow in the MME which seems pointless.

Fixes KHR-GL45.transform_feedback* on zink on nvk.

Fixes: 5fd7df4aa2 ("nvk: Support for vertex shader transform feedback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26558>
2023-12-07 20:17:13 +00:00
Eric Engestrom
40c82b5f67 vk/update-aliases.py: only apply renames for the vulkan api (not vulkansc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
1b3fca1708 vk/update-aliases.py: enforce correct list order
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
2cf22af0a7 vk/update-aliases.py: handle more concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
04517193c5 vk/update-aliases.py: simplify addition of other concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
3fe90f2957 vk/update-aliases.py: sort files when informing the user of the matches
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00