Commit Graph

186467 Commits

Author SHA1 Message Date
David Rosca 05f7589fec radeonsi/vcn: Fix coded size in sequence header on VCN5
Introduce coded_width/coded_height for values used in headers
and change it to aligned size on VCN4 to reflect the actual coded size.
VCN5 doesn't have this limitation and can code any size.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:21 +00:00
David Rosca 8b2f0fb574 radeonsi/vcn: Support raw packed headers for AV1
Same as H264/HEVC, we still write sequence header ourselves
and slice header is sent to FW, everything else gets copied
directly to output bitstream buffer.
Fixes generating correct output with libva-utils/av1encode.
Also fixes temporal delimiter insertion, it's no longer forced
on every frame, but instead it lets application handle it.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:21 +00:00
David Rosca 46d8e57f16 frontends/va: Remove now unused ref fields for AV1 encode
Need to get rid of these as they allocate buffers for drivers
not implementing create_dpb_buffer and waste memory.
No driver is using these fields anymore.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:20 +00:00
David Rosca 813812b925 radeonsi/vcn: Switch to app DPB management for AV1
Also move the common part of the frame header into shared function.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:20 +00:00
David Rosca 454a26662d frontends/va: Support raw packed headers for AV1
When there is show_existing_frame = 1 frame header, we don't parse
it and instead output directly as raw header. Only the frame header
that will be used for encoding current frame is parsed and indicated
with is_slice.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:20 +00:00
David Rosca 1fdd773450 frontends/va: Parse more AV1 frame and sequence header params
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:20 +00:00
David Rosca 36ddcc130b frontends/va: Implement DPB management for AV1
Same logic as H264 and HEVC, except surfaces are evicted immediately.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31520>
2024-10-10 09:02:20 +00:00
Christian Gmeiner 3ae3425c5d etnaviv: blt: Convert assert to real if
etna_try_blt_blit(..) returns if it is possible to do the blit
in hardware or not. When building mesa in debug mode this assert(..)
is hit many times.

Fixes the following piglits on GC7000L:
 - spec@!opengl 1.0@gl-1.0-scissor-copypixels
 - spec@nv_conditional_render@copypixels
 - spec@!opengl 1.1@copypixels-draw-sync
 - spec@!opengl 1.1@copypixels-sync
 - spec@!opengl 1.1@depthstencil-default_fb-blit
 - spec@!opengl 1.1@draw-copypixels-sync
 - spec@!opengl 1.1@gl-1.1-xor-copypixels

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31581>
2024-10-10 08:31:53 +00:00
Iago Toral Quiroga 4d1971f17f broadcom: fix pairing tmu lookup with previous ldtmu
There are some restrictions when pairing a new TMU lookup with
a previous LDTMU and we had code to handle this but we were not
limiting the restriction only to TMU lookups.

total instructions in shared programs: 10856992 -> 10823967 (-0.30%)
instructions in affected programs: 1823670 -> 1790645 (-1.81%)
helped: 10212
HURT: 110
Instructions are helped.

total max-temps in shared programs: 2234069 -> 2233153 (-0.04%)
max-temps in affected programs: 15100 -> 14184 (-6.07%)
helped: 660
HURT: 3
Max-temps are helped.

total sfu-stalls in shared programs: 15935 -> 15967 (0.20%)
sfu-stalls in affected programs: 317 -> 349 (10.09%)
helped: 31
HURT: 57
Inconclusive result (%-change mean confidence interval includes 0).

total inst-and-stalls in shared programs: 10872927 -> 10839934 (-0.30%)
inst-and-stalls in affected programs: 1824656 -> 1791663 (-1.81%)
helped: 10199
HURT: 111
Inst-and-stalls are helped.

total nops in shared programs: 185612 -> 185767 (0.08%)
nops in affected programs: 4865 -> 5020 (3.19%)
helped: 164
HURT: 256
Nops are HURT.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31574>
2024-10-10 06:58:15 +00:00
David Rosca 20d5020ad7 radeonsi/vcn: Fix out of bounds read in H264 decode
When all 16 references are used, this would read pic->ref[16].
Same for HEVC, but HEVC only uses 15 reference frames so it would
never happen there yet is still reported by coverity.

Fixes coverity issues 1497283 and 1465569 Out-of-bounds read

Cc: mesa-stable

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31558>
2024-10-10 06:25:36 +00:00
David Rosca 10a7356488 radeonsi/vcn: Fix out of bounds write when invalidating QP map regions
Fixes coverity issue 1559460 Out-of-bounds write

Fixes: 9c07a2e10d ("radeonsi/vcn: ROI feature implementation")

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31558>
2024-10-10 06:25:35 +00:00
David Rosca 17842f0584 radeonsi/vcn: Fix some small coverity issues
* 1619409 Resource leak
  - fix leak when mapping encode bitstream buffer fails
* 1619403 Dereference after null check
  - remove size ptr NULL check in radeon_enc_get_feedback, can't be NULL
* 1434887 Out-of-bounds access
  - use correct variable for memset in get_vp9_msg
* 1619400 'Constant' variable guards dead code
  - remove code handling frame_mbs_only_flag == 0, hardcoded to true

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31558>
2024-10-10 06:25:35 +00:00
Tapani Pälli f77ffd6b7c drirc/anv: force_vk_vendor=-1 for Silent Hill 2
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11992
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31573>
2024-10-10 04:07:12 +00:00
Caio Oliveira c06a55fd39 spirv: Update SPIR-V grammar to use aliases
For enumerants and instruction names, instead of duplicating the values
now the grammar will use an aliases field to list the alternative names.
Update the Python scripts for that.

The new SPIR-V files correspond to d92cf88c371424591115a87499009dfad41b669c
("Add "aliases" fields to the grammar and remove duplicated (#447)")
in https://github.com/KhronosGroup/SPIRV-Headers.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31369>
2024-10-10 02:48:00 +00:00
Guilherme Gallo 59d909eb56 ci/lava: Make perf jobs use pyutils artifact
Following the merge of Merge Request #31151, we encountered an issue
where the performance jobs were failing silently. Although these
failures did not cause the pipeline to fail, they resulted in warnings
for all merge requests that ran the .*-traces-performance jobs, putting
critical performance data for the [Mesa Performance Driver
dashboard](https://ci-stats-grafana.freedesktop.org/goto/G3xkvykHg?orgId=1)
at risk.

To resolve this issue, this commit updates the LAVA performance jobs to
utilize the Pyutils artifact package, which is now the only required
artifact for the jobs that run the LAVA job submitter.

Fixes: dd5d737e6c ("ci/lava: Use new pyutils container")

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31553>
2024-10-10 01:33:16 +00:00
Rob Clark f54748ea38 freedreno/drm: Add preemption support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark 753c8bf834 freedreno/a6xx: Emit CP_SET_AMBLE packets
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark d572fcf04a freedreno/a6xx: Move more state emit per-bin
With skipsaverestore=1 we can't rely on this values being restored.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark 270e595811 freedreno/a6xx: Move static regs to preamble IB
We can re-use this for preemption.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark 0c36ca7446 freedreno/a6xx: Move PC_TESSFACTOR_ADDR emit
This depends on batch state, so emit in gmem code.  The remainder of the
static reg initialization can be re-used across batches.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark f3cc9335e6 freedreno/a6xx: Set bin size per bin
It is not saved/restored by level 1 preemption with skipsaverestore=1,
so we need to set it for each bin.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark be6342633c freedreno/a6xx: Cleanup WFIs around RB_CCU_CNTL
This was only actually needed on the earliest a6xx (probably just
a630?).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark 3aac51a6d5 freedreno/a6xx: De-open-code VFD_MODE_CNTL
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Rob Clark 2f82555efa freedreno/a6xx: Only emit VFD/PC_POWER_CNTL for a6xx
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott c7a7f6dad8 tu: Add TU_DEBUG=hiprio
The same as FD_MESA_DEBUG=hiprio in freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott 1d2b479a3b tu: Allow being preempted on a7xx
This is only tested on a7xx so far, although it should work on a6xx too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott 3631f9ad62 tu/virtio: Make virtio_simple_ioctl take a vdrm_device
We need to do an ioctl in order to try to create a queue before the
tu_device is created.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott 700e26a448 tu: Emit CP_SET_AMBLE packets
Make sure skipsaverestore works.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott db86c4c496 tu: Simplify device startup CS creation
We have a few different command streams we create at startup. Simplify
the initialization by creating a single sub_cs to allocate all of the
cs's out of and inlining structures where appropriate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott acdbfe9812 tu: Re-emit LRZ state before each bin
Similar to the bin size register, even though this is the same for each
bin it needs to be re-emitted to make skipsaverestore work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott b9d9fdb6d1 tu: Write bin size for each bin
While the register is constant for all bins in the render pass, it is
not saved and restored with level 1 preemption with skipsaverestore=1 so
it needs to be restored. Follow what the blob does and set it before
each bin.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott 4d75a4ac4b tu: Split out register setting from tu6_init_hw()
Split out the parts that will also have to be done in the bin restore
IB.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott a9f88ff2af tu: Don't WFI after initializing RB_CCU_CNTL on a7xx
There's no reason to do this and the blob doesn't.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Jonathan Marek b6432a6c66 freedreno/a6xx: add missing USES_GMEM flag and BIN_RENDER_END markers
Add USES_GMEM flag to indicate that GMEM is in use, so that preemption can
know it needs save and restore GMEM contents.

The missing BIN_RENDER_END markers are also added, their purpose is to
clear the USES_GMEM flag once GMEM is no longer in use.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Jonathan Marek 72900e1aac freedreno: improve a6xx CP_SET_MARKER xml definition
Use real names for most of a6xx_marker enum, add USES_GMEM, remove
overlapping bitfields.

Note the actual "real names" start with PM4_RENDER_MODE_ instead of RM6_

This is a small change to adreno_pm4.xml, with the corresponding
find/replace and updated ci references

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott 022fb8e4c7 ir3, turnip: Support VK_*_compute_shader_derivatives on a7xx
Quad derivative groups are supported since a7xx using the tiling mode
bit. Linear derivative groups may also work on a6xx but I haven't tested
it yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31130>
2024-10-10 00:14:04 +00:00
Lionel Landwerlin 624d83bfd1 isl: add support of aux disable bit on hiz
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Lionel Landwerlin e4d1fd7fd6 iris: delete stencil mapping support
Now that we have ISL support.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Lionel Landwerlin 1a72fc013c isl: Tile W memcpy support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Lionel Landwerlin c0e98d2c89 isl/tests: rename span variable to xt_sub_range_alignment
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Lionel Landwerlin e44249af5d isl/tests: add more coordinates for full tiles testing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Lionel Landwerlin 52263413f4 isl: remove duplicated copy for tileX/TileY
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31579>
2024-10-09 23:38:19 +00:00
Gurchetan Singh 635cefcdad gfxstream: use sync_fence_info
This gives logs of the form:

[bootanimation] Fence: bbq-adapter#0(BLAST Consumer:0, status: 1, timestamp (ms): 15391

sync_merge(..) allows userspace to name the fence
and that's what's observed for in-fences.  The goal
is debug potentially long-running fences via the
use of timestamp data.

Perfetto may be used too.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31548>
2024-10-09 22:53:05 +00:00
Gurchetan Singh d7f264452e util: add sync_fence_info
This returns sync file info, including timestamps.
The caller is responsible for freeing the memory.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31548>
2024-10-09 22:53:05 +00:00
Gurchetan Singh 02b383fded gfxstream: use util/libsync
Gets rid of some #ifdefs.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31548>
2024-10-09 22:53:05 +00:00
Gurchetan Singh 34e0394580 gfxstream: nuke util function
Use ALIGN_POT instead.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31548>
2024-10-09 22:53:05 +00:00
Gurchetan Singh 5b82c130d9 gfxstream: add clang-format
Version of clang from the gfxstream
repo.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31548>
2024-10-09 22:53:05 +00:00
Danylo Piliaiev b31a4037de tu/a750: Workaround GPU fault when fast-clearing R8G8 formats
Clearing VK_FORMAT_R8G8_* with fast-clear value and certain
dimensions (e.g. 960x540), and having GMEM renderpass afterwards
may lead to a GPU fault on A7XX.

Prop driver directly clears UBWC layers for R8G8_UNORM, and
doesn't use UBWC for R8G8_UINT. It uses generic clear for R8G8 only
for renderpass, where doesn't cause issues in Turnip.

Fixes GPU fault in Limbo game running via Zink.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31258>
2024-10-09 22:01:10 +00:00
Samuel Pitoiset 1641db461f radv: fix generating the global key for pipeline binaries
The global key wasn't considering GPU family, Git revision etc and it
was mostly invariant.

Fixes: be06bfcbed ("radv: add initial support for pipeline binaries")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11995
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31576>
2024-10-09 21:15:48 +00:00
Maíra Canal 47a78614ea v3d: Don't use performance counters names array with an older kernel
Starting with Linux v6.11+, performance counter information is no
longer duplicated in both the kernel and userspace. Instead, an IOCTL
retrieves this information, allowing userspace to maintain a local
array for reuse, thus avoiding redundant kernel queries.

However, support for older kernels without these new IOCTLs remains.
To distinguish between versions, we check `devinfo->max_perfcnt` -
which is non-zero on Linux v6.11+ and zero on older kernels.

Currently, applications using performance queries on platforms with
older kernels encounter a SEGFAULT, as we don't validate
`devinfo->max_perfcnt` before accessing the userspace array for
performance counter information.

This commit makes sure that, if `devinfo->max_perfcnt` is zero,
`screen->perfcnt_names` will be NULL. This way, we can check if
`screen->perfcnt_names` is different than NULL before attempting to use
the userspace array.

Fixes: 017dde0d1c ("v3d: Use DRM_IOCTL_V3D_GET_COUNTER to get perfcnt information")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31552>
2024-10-09 15:51:51 -03:00