Commit graph

184774 commits

Author SHA1 Message Date
Dave Airlie
1782ab4d8b util: add a bitstream encoder for video stream headers.
This is based on the d3d12 code, and is mostly a rewrite in C,
these are just some helpers to use for writing h264 and h265
headers for vulkan encode.

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
72f52329cd vulkan/video: add a nal_unit lookup for hevc
This is needed to by drivers to get a nal unit type
for the picture type.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
fee258de27 vulkan/video: add h264 nal enum
This will be used later for header encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
8dd97080d8 vulkan/video: add h265 encode support
This just adds the session and parameter handling for h265 encode.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
5cb46f1ce7 vulkan/video: add support for h264 encode to common code
This adds support for the h264 encode session and parameter storage.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
b84c58d727 vulkan: update video headers
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
José Expósito
8a635e516e zink: Fix crash on zink_create_screen error path
The `zink_internal_create_screen()` function can fail before
`screen->loader_lib` and/or `screen->instance` are initialized.
The `zink_destroy_screen()` doesn't check those cases and crashes.

The error was found by Fedora's CI. The back trace is available at [1].

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-c39f82c465

Fixes: 0c2045553f ("zink: use screen destructor for creation fails")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26029>
2023-11-03 22:37:43 +00:00
Faith Ekstrand
5a85f67fa4 nvk: Assert no storage images on Kepler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
d5753a89a6 nvk: Drop a bogus assert
We've supported storageImageReadWithoutFormat for a while.  Also, thanks
to the fact that the assert assumed image_deref_load and happened after
nir_rewrite_image_intrinsic, it would never trigger.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
0ce49d4347 nvk: Fix nvk_heap_free() for contiguous heaps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
57d6722d79 nvk: Force all mappable BOs into GART pre-Maxwell
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Yonggang Luo
5e9dcffffd nvk: Should use alignment instead of align
align is a function, don't know why align > 0 is working

Fixes: 87686a2220 ("nvk: Rework side-band data upload")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Daniel Stone
80b87c18d1 ci: Try really hard to print final result string
a630 has been completing jobs, and then corrupting the very last line of
UART output - the one where we pass the overall result back from the DUT
to the job. The bare-metal monitor will wait for this line to appear,
never see it, and then the job times out.

Since this line is the most critical one of all to get out, just spam
the prints to try to make sure they get through.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26032>
2023-11-03 21:17:42 +00:00
Eric Engestrom
c826f70c37 rpi4/ci: remove spec@!opengl 1.1@depthstencil-default_fb-drawpixels-32f_24_8_rev samples=2 from fails as it's a flaky test and already marked as such
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Eric Engestrom
ed90430027 rpi4/ci: move spec@!opengl 1.1@depthstencil-default_fb-drawpixels-24_8 samples=2 from fails for flakes after an UnexpectedPass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Eric Engestrom
9f281899dc rpi4/ci: add more known dEQP-EGL.functional.*.*_context.gles*.other failures
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Jesse Natalie
67df2f29eb vulkan: Support loader interface v7
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Jesse Natalie
228329f4da vulkan: Consolidate common ICD methods
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Jesse Natalie
32f0034ec9 vulkan: Remove no-longer-needed prototypes for ICD entrypoints
The comment around these is no longer true, vk_icd.h does in fact
have prototypes for these functions.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
David Rosca
af2980e5b9 radeonsi/uvd_enc: Add VUI parameters in output bitstream
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
72fadf5faf radeonsi/vce: Add VUI parameters in output bitstream
This enables VUI parameters and sets aspect ratio, video format,
video full range, colour description and chroma location.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
5f70379e0d radeonsi/vce: Tweak motion estimation params for better quality
This gives better video quality while not slowing down the encoding
speed too much (less than 10% slower).

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
8dda860f83 Revert "radeon/radeon_vce: fix out of target bitrate in CBR mode (H.264)"
This reverts commit f7e7cf637e.

It is now possible to change the buffer size from VA frontend, so this
is no longer needed and instead it's up to applications to set
appropriate value.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
bf95000d74 radeonsi/uvd_enc: Fix leaking session info buffer
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
9feff3d695 radeonsi/uvd_enc: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
007ff4ea00 radeonsi/uvd: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
fdc8da6eb4 radeonsi/vce: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
Juan A. Suarez Romero
8f621174da v3d: use kmsro to create drm screen on real hw
When using `MESA_LOADER_DRIVER_OVERRIDE=v3d` in real hw, use kmsro to
create the drm screen, which is actually what happens when not exporting
such variable.

This avoids confusions when using the envvar in real hardware and starts
to fail.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26007>
2023-11-03 18:50:37 +00:00
Chia-I Wu
ef724ab695 vulkan, tu, pvr: remove vk_render_pass_state::render_pass
The spec says

  A VkRenderPass or VkPipelineLayout object passed as a parameter to
  create another object is not further accessed by that object after the
  duration of the command it is passed into.

The object could have been destroyed if we get the pointer from a
pipeline library.  Since it has no user now, let's remove it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>
2023-11-03 17:23:30 +00:00
Chia-I Wu
227300345e radv: stop using vk_render_pass_state::render_pass
vk_render_pass_state::pipeline_flags is derived from
vk_get_pipeline_rendering_flags and has the info we need.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10074
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>
2023-11-03 17:23:30 +00:00
David Rosca
c638e61ef5 frontends/va: Map decoder and postproc surfaces for reading
If application requests to map surface that was most recently used
as decoder or postproc target and also doesn't explicitly set the
map flags (vaMapBuffer2) it's very likely the intent is to read from
this surface, so we need to map it as such.

This fixes regression on radeonsi where mapping NV12 surfaces for
reading would fail with applications using vaDeriveImage. The reason
for this is that the VA frontend doesn't allow vaDeriveImage for
interlaced surfaces so the applications would use vaGetImage fallback,
but radeonsi doesn't allocate NV12 surfaces as interlaced anymore.

This also fixes mapping other formats surfaces (P010, RGBx, ...)
for reading, which never worked before.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9935
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10048

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26008>
2023-11-03 17:04:00 +00:00
Rob Clark
33de58154f freedreno: Handle DRM_FORMAT_MOD_QCOM_TILED3 import
This is something that we could allocate and export.  So we must import
them as well.

Fixes import failures in spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:09 +00:00
Rob Clark
a95ea2b6d6 freedreno: Fix modifier determination
Now that we have TILED2 and TILED3 modifiers, we should handle those
cases.

Fixes assert that modifier != INVALID in
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:09 +00:00
Rob Clark
6ac133c646 freedreno/drm: Fix race in zombie import
The check for the zombie case (racing with final unref of the bo vs
removal from table) must be atomic.

Fixes spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread

Fixes: a192923f99 ("freedreno/drm: Restart import on zombie race")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:08 +00:00
antonino
4a627af0e3 nir: don't take the derivative of the array index in nir_lower_tex
Previosuly when lowering to txd for sampler array the index would be
derived as well, therefore the resulting derivative would have been a
vec with one more component than what the txd instruction expects.

This patch truncates the coordinate vector in this case to make sure the
index is not derived.

Fixes: b154a4154b ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26012>
2023-11-03 12:53:11 +00:00
Gert Wollny
28b79b2ea5 r600/sfn: Fixup component count only if intrinsic has it
Fixes: 33d878e
   r600/sfn: Handle load_global in 64 to vec2 lowering

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Gert Wollny
1662897294 r600: Link with libgalliumvl, when enabling rusticl this is needed
Fixes: 33673bcc2a
    rusticl: stop linking with libgalliumvl

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Gert Wollny
022850ed05 r600: Add experimental get_compute_state_info
This callback is needed for rusticl, but the values that are returned
may be completely off.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7420

v2: use r600_wavefront_size value

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Karol Herbst
7b41921504 nvc0: implement PIPE_CAP_TIMER_RESOLUTION
This allows rusticl to create profiling queues.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10042
Fixes: 660f2eabe1 ("gallium: add PIPE_CAP_TIMER_RESOLUTION")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26016>
2023-11-03 11:13:44 +00:00
duncan.hopkins
1039da1400 vulkan: added build dependencies for systems using non-standard prefixed X11 libs.
To get MacOS to build, some extra dependencies need to be added to a couple of build targets.
This mainly shows up when not installing the dependencies in the default prefix locations.
On MacOS, this happens when using a custom build of brew to install the dependencies to 'odd' locations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26022>
2023-11-03 10:46:27 +00:00
Eric Engestrom
47398c65ee ci/radeonsi: add another flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26020>
2023-11-03 09:20:32 +00:00
Samuel Pitoiset
fc9bab73a9 radv/ci: document one more flake test
This test consistently fails on some GPUs (already documented) but on
some others it's a flake. It's a known issue that should be fixed soon
in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26019>
2023-11-03 09:16:54 +01:00
Jesse Natalie
5550c1daf4 dzn: Use vk_properties helper
Addresses part of https://gitlab.freedesktop.org/mesa/mesa/-/issues/9521
Required for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998
to actually work correctly for Dozen

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26014>
2023-11-03 00:00:13 +00:00
Alyssa Rosenzweig
0038f95b66 asahi: Fix tools=all builds
don't need clc here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26017>
2023-11-02 18:51:57 -04:00
Connor Abbott
2313a517d2 v3d/ci: Remove minetest trace
For the same reason as the previous commit. For examples of commits
causing spurious changes see 8019a1b9 and d89ca14e.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
2023-11-02 21:46:55 +00:00
Connor Abbott
16214710ca freedreno/ci: Remove minetest trace
I've repeatedly seen minor pixel changes due to changes that only affect
RA decisions, most recently in !22072. We changed the trace to hopefully
remove a use of texture() in control flow, but it seems there are more,
or the problem is something slightly different like reading
uninitialized values. On the other hand minetest has never actually
caught an issue for me that some other trace hasn't also caught. Just
remove it.

Cc: mesa-stable
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
2023-11-02 21:46:55 +00:00
Connor Abbott
e8b3006bfd util/rb_tree: Add augmented trees and interval trees
An "augmented tree" is a tree with extra data attached which flows from
the leaves to the root. An "interval tree" is a datastructure of
(potentially-overlapping) intervals where, in addition to inserting and
removing intervals, we can quickly lookup all the intervals which
overlap a given interval.

After describing red-black trees, CLRS explains how it's possible to
implement an interval tree using an augmented red-black tree where the
nodes are ordered by interval start and each node also stores the
maximum interval end for its entire subtree.

Implement the interval tree extension described by CLRS. Iterating over
all overlapping intervals is actually an exercise, so we have to solve
the exercise. The recursive solution has been re-written to use the
parent pointers to avoid needing a stack, similarly to rb_tree_first()
and rb_node_next().

For now, we only implement unsigned intervals, but the core algorithms
are all abstracted to allow other types. There's still some boilerplate,
but it's the best that can be done in C.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22071>
2023-11-02 21:03:46 +00:00
Connor Abbott
767e68972e util/rb_tree: Fix editorconfig
rb_tree has 4 space tabs, unlike everything else in util. We should
probably retab it, but for now add an editorconfig so that at least
people's editors aren't messed up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22071>
2023-11-02 21:03:46 +00:00
Faith Ekstrand
1793adbd3a nir/validate: Allow array derefs on vectors on function/shader_temp
This is required by OpenCL.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
0b3b4da82a nir: Handle array-deref-of-vec in var split passes
The changes are pretty straightforward.  For vector splitting, we just
ignore those vectors for now.  We could potentially handle array derefs
with a constant index (and probably should) but that's left for later.
For now, I'm mostly concerned with correctness of the pass.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00