Commit graph

4077 commits

Author SHA1 Message Date
Eric Engestrom
f30e5ff44b ci: uprev vkd3d
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
03cca4cd97...4acd227131

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38370>
2025-11-11 20:15:21 +00:00
Karol Herbst
92a4ae0ab2 rusticl/spirv: preserve signed zeroes by default
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38327>
2025-11-10 10:52:56 +00:00
Karol Herbst
df344f12cc rusticl/kernel: take no kernel_info reference inside the launch closure
Otherwise patterns like this wouldn't work:

clCreateKernel(prog)
clEnqueueNDRangeKernel
clReleaseKernel
clBuildProgram(prog)

Fixes: bb2453c649 ("rusticl/kernel: move most of the code in launch inside the closure")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38327>
2025-11-10 10:52:56 +00:00
Karol Herbst
c0f0baeaca rusticl/queue: fix error code for invalid sampler kernel arg
Fixes: 5795ee0e08 ("rusticl: translate spirv to nir and first steps to kernel arg handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38327>
2025-11-10 10:52:56 +00:00
Karol Herbst
e98abe35c0 rusticl/queue: fix error code for invalid queue properties part 2
Fixes: 2c202eb787 ("rusticl: verify validity of property names and values")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38327>
2025-11-10 10:52:56 +00:00
Karol Herbst
e83400cab2 rusticl/queue: fix error code for invalid queue properties part 1
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38327>
2025-11-10 10:52:56 +00:00
Lucas Fryzek
a824754de0 lvp: Enable VK_FORMAT_R4G4B4A4_UNORM_PACK16
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36558>
2025-11-10 10:10:07 +00:00
spencer-lunarg
f8e5e7cd7d lavapipe: Fix crash when using zero queues
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When using VK_KHR_maintenance9 the user can pass a null pointer
to VkDeviceQueueCreateInfo and we will create a dummy queue for
them.

Tested with new dEQP-VK.pipeline.no_queues.*
https://gerrit.khronos.org/c/vk-gl-cts/+/18717

Signed-off-by: spencer-lunarg <spencer@lunarg.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38288>
2025-11-10 02:10:43 +00:00
Faith Ekstrand
35cdddf632 nir: Simplify assign_io_var_locations()
The size and stage parameters are left-overs from history.  Originally,
the function acted on a list and so it needed an explicit stage and size
output.  Now that it takes a NIR shader and a mode, we can just take the
stage from the shader and set num_(in|out)puts.

The one caller that actually used the explicit output parameter was
turnip.  However, given that the helper sorts and re-numbers all the I/O
variables, it's not like changing num_(in|out)puts instead of writing it
to some other location is that big of a deal.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38297>
2025-11-07 16:29:56 +00:00
Pohsiang (John) Hsu
672c26535a mediafoundation: remove unused code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38301>
2025-11-07 13:02:49 +00:00
Pohsiang (John) Hsu
e4630c3567 mediafoundation: remove private CODECAPI_AVEncVideoEnableFramePsnrYuv as this is published
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38301>
2025-11-07 13:02:49 +00:00
Pohsiang (John) Hsu
1528a88643 mediafoundation: periodic clang-format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38301>
2025-11-07 13:02:48 +00:00
Eric Engestrom
03aa1e382a lavapipe/ci: mark more tests as flaky
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38305>
2025-11-07 12:46:08 +00:00
Eric Engestrom
c0044aa8f1 lavapipe/ci: document fixed tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38305>
2025-11-07 12:46:08 +00:00
Antonio Ospite
222b85328e mesa: replace most occurrences of getenv() with os_get_option()
The standard way to query options in mesa is `os_get_option()` which
abstracts platform-specific mechanisms to get config variables.

However in quite a few places `getenv()` is still used and this may
preclude controlling some options on some systems.

For instance it is not generally possible to use `MESA_DEBUG` on
Android.

So replace most `getenv()` occurrences with  `os_get_option()` to
support configuration options more consistently across different
platforms.

Do the same with `secure_getenv()` replacing it with
`os_get_option_secure()`.

The bulk of the proposed changes are mechanically performed by the
following script:

-----------------------------------------------------------------------
  #!/bin/sh

  set -e

  replace() {

    # Don't replace in some files, for example where `os_get_option` is defined,
    # or in external files
    EXCLUDE_FILES_PATTERN='(src/util/os_misc.c|src/util/u_debug.h|src/gtest/include/gtest/internal/gtest-port.h)'

    # Don't replace some "system" variables
    EXCLUDE_VARS_PATTERN='("XDG|"DISPLAY|"HOME|"TMPDIR|"POSIXLY_CORRECT)'

    git grep "[=!( ]$1(" -- src/ | cut -d ':' -f 1 | sort | uniq | \
      grep -v -E "$EXCLUDE_FILES_PATTERN" | \
      while read -r file;
      do
        # Don't replace usages of XDG_* variables or HOME
        sed -E -e "/$EXCLUDE_VARS_PATTERN/!s/([=!\( ])$1\(/\1$2\(/g" -i "$file";
      done
  }

  # Add const to os_get_option results, to avoid warning about discarded qualifier:
  #   warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  # but also errors in some cases:
  #   error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  add_const_results() {
    git grep -l -P '(?<!const )char.*os_get_option' | \
      while read -r file;
      do
        sed -e '/^\s*const/! s/\(char.*os_get_option\)/const \1/g' -i "$file"
      done
  }

  replace 'secure_getenv' 'os_get_option_secure'

  replace 'getenv' 'os_get_option'

  add_const_results
-----------------------------------------------------------------------

After this, the `#include "util/os_misc.h"` is also added in files where
`os_get_option()` was not used before.

And since the replacements from the script above generated some new
`-Wdiscarded-qualifiers` warnings, those have been addressed as well,
generally by declaring `os_get_option()` results as `const char *` and
adjusting some function declarations.

Finally some replacements caused new errors like:

-----------------------------------------------------------------------
../src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:127:31: error: no matching function for call to 'strtok'
  127 |          for (n = 0, option = strtok(env_llc_options, " "); option; n++, option = strtok(NULL, " ")) {
      |                               ^~~~~~
/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/string.h:124:17: note: candidate function not viable: 1st argument ('const char *') would lose const qualifier
  124 | char* _Nullable strtok(char* _Nullable __s, const char* _Nonnull __delimiter);
      |                 ^      ~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------

Those have been addressed too, copying the const string returned by
`os_get_option()` so that it could be modified.

In particular, the error above has been fixed  by copying the `const
char *env_llc_options` variable in
`src/gallium/auxiliary/gallivm/lp_bld_misc.cpp` to a `char *` which can
be tokenized using `strtok()`.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38128>
2025-11-06 04:36:13 +00:00
Eric R. Smith
417be4f77e dri: check modifier in dri_create_image_from_winsys
When importing an image, check that the specific combination of
format plus modifier is supported, rather than just checking the
format. This will allow drivers to support some YUV formats in
special cases (specific modifiers, like AFBC for panfrost) while
also allowing us to fall back to generic multi-plane formats when
those modifier+format combinations are not supported by
hardware.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35771>
2025-11-04 22:28:03 +00:00
Eric R. Smith
b11f543c4e mesa: Add R16G16_R16B16_UNORM and related formats
Including the 10 bit variant X6R10X6G10_X6R10X6B10_UNORM. Only the
RG_RB variants seem to have fourccs, so those are the only ones being
added for now, although they would, obviously, be easy to add).

These are used for Y210, Y212, and Y216 fourccs. In particular Y210
is interesting for panfrost, as it is the fourcc used to indicate a
10 bit single plane 4:2:2 encoded as AFBC (similar to how YUYV is
the canonical AFBC for 10 bit 4:2:0).

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35771>
2025-11-04 22:28:03 +00:00
spencer-lunarg
17d8a5d8ae lavapipe: Remove trailing whitespace
Signed-off-by: spencer-lunarg <spencer@lunarg.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38223>
2025-11-04 21:20:47 +00:00
Alyssa Rosenzweig
17355f716b treewide: use UTIL_DYNARRAY_INIT
Instead of util_dynarray_init(&dynarray, NULL), just use
UTIL_DYNARRAY_INIT instead. This is more ergonomic.

Via Coccinelle patch:

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray = {0};
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray;
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(&(dynarray), NULL);
    +dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(dynarray, NULL);
    +(*dynarray) = UTIL_DYNARRAY_INIT;

Followed by sed:

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(&\(.*\), NULL)/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init( &\(.*\), NULL )/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(\(.*\), NULL)/*\1 = UTIL_DYNARRAY_INIT/g' \{} \;"

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38189>
2025-11-04 13:39:48 +00:00
Konstantin Seurer
25e678a37d lavapipe: Bump MAX_DESCRIPTOR_UNIFORM_BLOCK_SIZE
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
2025-11-03 19:45:21 +01:00
Konstantin Seurer
d6dd96e1c7 lavapipe: Zero image null descriptors
The size queries for images do not use function pointers so we need to
be careful that width, height and depth are 0.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
2025-11-03 19:45:17 +01:00
Konstantin Seurer
ff145d2ddc lavapipe: Bump maxPrimitiveCount
The vulkan spec requires at least 2^29-1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14212
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
2025-11-03 19:44:46 +01:00
Dave Airlie
6a70406bb2 lavapipe: use vk_query_pool as the base for lvp_query_pool
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This just moves to the common code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 06:14:22 +10:00
Dave Airlie
3fc9c072b2 lavapipe: drop instance pointer from lvp_device.
This can be gotten elsewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 06:00:38 +10:00
Dave Airlie
f819e269f6 lavapipe: drop physical device pointer from lvp_device
Use the base pointer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:53:02 +10:00
Dave Airlie
b2db496ea3 lavapipe: drop unneeded physical device in sparse image format props
This isn't used here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:50:47 +10:00
Dave Airlie
7aef746de6 lavapipe: drop device pointer from pipeline cache
This is unused

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:43:51 +10:00
Dave Airlie
5875d6cf93 lavapipe: drop device pointer from queue
Just use the copy in the base

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:42:31 +10:00
Dave Airlie
fe5a99175f lavapipe: drop device pointer from pipeline object
Just get it from the base object.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:39:11 +10:00
Dave Airlie
8fae2cb67f lavapipe: drop device pointer from lvp_cmd_buffer
just get it from the vk object.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:38:44 +10:00
Dave Airlie
8e01a11a00 lavapipe: remove image pointer from lvp_image_view
Just use the underlying image pointer and pack the struct a bit
better.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:27:48 +10:00
Dave Airlie
9f0b57ce41 lavapipe: drop unused macro.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:13:29 +10:00
Dave Airlie
49c7b69020 lavapipe: cleanup some whitespace in lvp_private.h
This just has some wierd inconsistent stuff, clean it up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:10:26 +10:00
Dave Airlie
cde13f3674 lavapipe: drop lavapipe specific macro for generic one.
These can just all use the standard VK macro we define.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38198>
2025-11-02 05:01:12 +10:00
Pohsiang (John) Hsu
59b10dbe80 mediafoundation: add support for initial pool size and max pool size for stats pool
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38195>
2025-10-31 13:47:08 -07:00
Silvio Vilerino
00700bae45 mediafoundation: Check for PIPE_VIDEO_CODEC_UNIT_LOCATION_FLAG_MAX_SLICE_SIZE_OVERFLOW in calls to get_slice_bitstream_data
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38195>
2025-10-31 13:47:04 -07:00
Silvio Vilerino
087b1f4948 mediafoundation: Remove stale call to MFCreateMemoryBuffer
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38195>
2025-10-31 13:46:54 -07:00
Silvio Vilerino
7fb5c10f65 mediafoundation: Add a min slice buffer size stopgap
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38195>
2025-10-31 13:46:44 -07:00
Silvio Vilerino
027b523398 mediafoundation: Fix num_output_buffers for PIPE_VIDEO_SLICE_MODE_AUTO
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38195>
2025-10-31 13:46:40 -07:00
Pohsiang (John) Hsu
240b9159f4 mediafoundation: setup wpp logging in more of the files and add some error handling on dpb manager and reference frame tracker
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
2025-10-29 20:27:28 +00:00
Pohsiang (John) Hsu
ab2457591b mediafoundation: periodic clang-format, no code changes
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
2025-10-29 20:27:28 +00:00
Pohsiang (John) Hsu
d7e2754116 mediafoundation: for low latency, change stats pool size to 2, this is because there is no synchronization btwn returning MF sample and ProcessInput
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
2025-10-29 20:27:28 +00:00
Silvio Vilerino
4169a7f36a mediafoundation: Add AVEncVideoReconstructedPictureOutputMode and MFSampleExtension_VideoEncodeReconstructedPicture
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
2025-10-29 20:27:27 +00:00
Silvio Vilerino
0953924dbe mediafoundation: Add m_bHWSupportReadableReconstructedPicture
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
2025-10-29 20:27:26 +00:00
Mike Blumenkrantz
e1a4f53680 lavapipe: maintenance10
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38091>
2025-10-29 18:25:42 +00:00
Job Noorman
e16be20195 rusticl: fix mismatched-lifetime-syntaxes lint warning
This warn-by-default lint introduced in Rust 1.89.0 causes the following
warning:

warning: hiding a lifetime that's elided elsewhere is confusing
   --> ../../src/gallium/frontends/rusticl/core/semaphore.rs:276:14
    |
276 |     fn state(&self) -> MutexGuard<SemaphoreState> {
    |              ^^^^^     -------------------------- the same lifetime is hidden here
    |              |
    |              the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
276 |     fn state(&self) -> MutexGuard<'_, SemaphoreState> {
    |                                   +++

Follow the compiler's suggestion to fix this.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38132>
2025-10-29 10:35:29 +00:00
David Rosca
1232a7a754 frontends/va: Always reset H264 slice ref modification and marking count
This way the driver doesn't need to check the flag.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38050>
2025-10-28 09:43:26 +00:00
David Rosca
8c2de21090 frontends/va: Support H264 encode pic_order_cnt_type 1
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38052>
2025-10-28 09:14:24 +00:00
Silvio Vilerino
ca3ba3f924 mediafoundation: Remove unused AllocatePipeResourceFromAllocator
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38057>
2025-10-24 19:45:56 +00:00
Silvio Vilerino
e873beb33c mediafoundation: Cleanup MaxL1References variables
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38057>
2025-10-24 19:45:56 +00:00