Commit Graph

181544 Commits

Author SHA1 Message Date
Sil Vilerino
bed54fc9b0 d3d12: Video Encoder - When setting rate control dirty flags take into account rolled back optional configs
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
960d86ef9a d3d12: Fix max reference frames reporting when HW does not support B frame
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
d010364841 d3d12: d3d12_create_fence_win32 - Fix double refcount bump
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
81c8e89ff8 d3d12: Fix screen->winsys leak in d3d12_screen
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
7bd6a42d1f d3d12: Fix d3d12_tcs_variant_cache_destroy leak in d3d12_context
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
ba85ca3721 d3d12: Improve error detection and reporting for video encoder
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0233cdd00d d3d12: Detect imported resource buffer unknown format
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
bf73d5551a d3d12: Implement PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
bee68059cb d3d12: Autodetect d3d12_video_buffer imported handle/resource format and dimensions when not passed
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
3f43b2eae5 d3d12: Implement PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
364cc5d51d d3d12: Fix max slice size and max frame size metadata reporting
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
25e2a7544b d3d12: max_frame_poc workaround for infinite GOPs
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c89766f416 d3d12: Use new pipe h264 encode ip_period param
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
8af080cec4 d3d12: Implement d3d12_video_encoder_get_encode_headers for out of band VPS, SPS, PPS
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
829e821aab d3d12: Only pass texture dimensions to d3d12_video_encoder_update_current_encoder_config_state
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
05fe740374 d3d12: Implement fence_get_win32_handle to get HANDLE from d3d12_fence
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
942791b937 d3d12: Implement get_feedback_fence for encode async waiting on pipe_feedback_fence
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0cc0220cce d3d12: H264 encode - Allow CONSTRAINED_BASELINE profile to be written in headers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c80b35274f d3d12: Do not increase active_seq_parameter_set_id on new SPS. Force PPS on new SPS
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
1032fc07b5 d3d12: Implement inserting optional new headers on each H264/HEVC IDR frame
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
9a927f21fb vl_winsys_win32: call winsys->destroy(winsys) in error conditions
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
88f25f35e4 frontend/va: Use p_video_codec.get_feedback_fence to report errors on frame submission
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
e0345bff94 frontend/va: Add VACodedBufferSegment Average QP metadata
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0c1ff82bc8 frontend/va: Add h264 encode ip_period param
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
413b466aea pipe: Add PIPE_H264_MAX_REFERENCES
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
92b73aeb16 pipe: Add PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c954830132 pipe: Add PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
3f07c8c321 pipe: Add p_video_codec.get_encode_headers for out of band VPS, SPS, PPS
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
34d45cf7ed pipe: Add fence_get_win32_handle to get HANDLE from pipe_fence_handle
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
Sil Vilerino
d9bbae6a0c pipe: Add get_feedback_fence for encode async waiting on pipe_feedback_fence
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
Sil Vilerino
3ab25d6fb3 pipe: Support inserting new headers on each H264/HEVC IDR frame
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
jphuang
02a873fa2a dzn: Change dst image layout according to aspect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26532>
2023-12-06 03:36:07 +00:00
Eric Engestrom
cb6422765c turnip: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26493>
2023-12-06 02:21:04 +00:00
Eric Engestrom
df8ea977be radeonsi/ci: track changes to vpelib
According to `src/amd/meson.build`, radeonsi uses vpelib, so we should
track changes to it as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26479>
2023-12-06 01:58:41 +00:00
Eric Engestrom
3a8da0b8bf v3d: drop leftover from "move v3d_tiling to common"
Fixes: d198e26a1e ("broadcom/common: move v3d_tiling to common")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26525>
2023-12-06 01:44:14 +00:00
Eric Engestrom
4dd8030b25 freedreno/ci: add more a630 flakes
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52405040 and passed
in the auto-retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52405437

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26531>
2023-12-06 01:22:30 +00:00
Jesse Natalie
d7f038e8de microsoft/clc: Add a test which sinks image derefs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26529>
2023-12-06 01:07:24 +00:00
Jesse Natalie
c8895a4b85 microsoft/clc: Fix images with multiple derefs for real
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26529>
2023-12-06 01:07:24 +00:00
Paulo Zanoni
bf0f261c1e anv/sparse: document USAGE_2D_3D_COMPATIBLE as non-standard too
The standard block shapes (and by extension, the tiling formats they
require) are simply incompatible with getting a 2D view of a 3D image.
I couldn't find in the Vulkan spec anything related to what are the
expectations when trying to use both at the same time.

So here we "document" that this case is known non-standard. Please
notice that since we report residencyStandard3DBlockShape as true we
were actually supposed to support this case, but I can't see how this
would be possible, so set is_known_nonstandard_format to true so we
can avoid the assert() that comes right after.

Fixes the following when using Zink:
  KHR-GL46.sparse_texture_tests.SparseTextureAllocation

Also "moves forward" the following test on Zink, so it now hits a
different assertion:
  KHR-GL46.sparse_texture_tests.SparseTextureCommitment

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
819b94176a anv/sparse: check if the non-sparse version is supported first
During vkGetPhysicalDeviceSparseImageFormatProperties(), check first
if the non-sparse version of the image is supported, and return in
case it's not.

On TGL, if we don't do that, we may hit the following assertion:
  deqp-vk: ../../src/intel/isl/isl.c:2584: isl_surf_init_s: Assertion `!(info->usage & ISL_SURF_USAGE_CPB_BIT) || dev->info->has_coarse_pixel_primitive_and_cb' failed.

My TGL doesn't has_coarse_pixel_primitive_and_cb.

Fixes the following on TGL:
  dEQP-VK.api.maintenance5.flags.sparse_image_format_props
  dEQP-VK.api.maintenance5.flags.sparse_image_format_props2

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
181aa83027 anv/tr-tt: assert the bind size is a multiple of the granularity
If the size here is not a multiple of the granularity (64kb) then
we'll miss our "pages" estimation by 1. We could fix this with
DIV_ROUND_UP() or by simply putting a "+1" there, but the upper layers
should now be preventing this case so let's just put the assertion
here.

Previously it was possible to hit this case with Zink by running
under certain conditions piglit/arb_sparse_buffer-basic.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
c87f7c13fa anv/sparse: reject binds that are not a multiple of the granularity
From the spec:

  "Resources can be bound at some defined (sparse block) granularity."

  "The sparse block size in bytes for sparse buffers and
   fully-resident images is reported as
   VkMemoryRequirements::alignment. alignment represents both the
   memory alignment requirement and the binding granularity (in bytes)
   for sparse resources."

Not only the upper layer (the Spec) doesn't allow this, the lower
layers (both the vm_bind ioctl and TR-TT) also work on a granularity.
Just check for this case and return an error.

Before this check, what would happen was:
  - for the vm_bind backend, the vm_bind ioctl would fail
  - for the TR-TT backend, we'd understimate l1_binds_capacity and
    fail an assertion, or we'd just silently bind 64kb instead of the
    original size

Currently, some Zink tests such as piglit/arb_sparse_buffer-basic can
trigger this behavior, but we're working to fix Zink for this case
(and that commit may be merged before this one).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Ryan Neph
a495d437b7 venus: add dri option to enable multi-plane wsi modifiers
Adds a venus dri option to advertise support for multi-plane format
modifiers to Vulkan's common WSI. Otherwise, Venus will only support
modifiers with planeCount == 1 to ensure compatibility with Xwayland's
virgl-backed Glamor backend.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
035730f26e venus: reject multi-plane modifiers for tiled wsi images
Force the use of single-plane modifiers for tiled wsi images as long as
Venus is integrated with Virgl, which does not support non-format
compression metadata planes (e.g. Intel's CCS or AMD's DCC modifiers).

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
833d228f53 venus: strip ALIAS_BIT for WSI image creation on ANV
For compositors that advertise modifier support, Vulkan common WSI
modifier support queries still fail in Venus on the Intel ANV driver.

This is due to the presence of VK_CREATE_IMAGE_ALIAS_BIT, without
accompanying wsi_image_create_info struct, which is implicitly excluded
from serialized messages over the venus-protocol.

By removing ALIAS_BIT, modifier queries begin to pass when the host
supports them.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
9bde89591e venus: add VN_PERF=no_tiled_wsi_image
Force DRM_FORMAT_MOD_LINEAR for wsi image creation, even for winsys that
supports non-linear modifiers.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
aa15f52bf5 virgl: implemement resource_get_param() for modifier query
Without such, Xwayland gets back the implicit modifier token (INVALID)
when calling gbm_bo_get_modifier() for a dmabuf shared by the WSI layer.
Then mistakenly sends INVALID upon wl_buffer creation, rather than the
explicit modifier sent by WSI.

The logic of Xwayland's Glamor gbm backend is a bit circuitous, since
the modifier is sent by WSI alongside the dmabuf fd. Rather than use
that modifier directly when creating wl_buffer (via
zwp_linux_dmabuf_v1), Glamor first imports the dmabuf+modifier with
gbm_bo_import(), then uses the result of later gbm_bo_get_modifier().

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Faith Ekstrand
95c0447ad6 radeonsi: Drop an unnecessary cast
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
2a28338aa8 compiler: Fix a comment
We're not using GL enums here anymore

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
06257514c1 nir: Return a mesa_prim from gs_in_prim_for_topology
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00