Commit graph

185688 commits

Author SHA1 Message Date
Job Noorman
ddd5f6abae ir3: fold negations into cmps.ne zero
It was already implemented for sel so pull that functionality into a
helper function which can be used from ir3_get_predicate.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
c43d0e4e4f ir3: insert predicate conversions after their source
Instead of creating a cmps.s.ne for every use of a predicate, create
just one and insert it after the instruction whose def is tested. This
reduces the number of compares or, when they are folded into bitwise
operations, those operations.

It also decreases register pressure on GPRs by increasing pressure on
predicate registers. This should be preferred in general since at worst,
the predicate register will be spilled to a GPR again.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
c6a6902e4d ir3: optimize bitwise ops that can directly write predicates
On a6xx+, bitwise operations can directly write to predicate registers.
The result will be 1 iff the result of the non-predicate operation would
be non-zero.

When generating instructions that need a predicate source, ir3 will
insert a cmps.s.ne 0 instruction to guarantee a predicate can be
produced. This is kept in place by this patch and we add a pass that
tries to optimize useless comparisons away.

Concretely:
- Look through chains of multiple cmps.s.ne instructions and remove all
  but the first.
- If the source of the cmps.s.ne can write directly to predicates,
  remove the cmps.s.ne.

In both cases, no instructions are actually removed but clones are made
and we rely on DCE to remove anything that became unused. Note that it's
fine to always make a clone since even in the case that the original
instruction is also used for non-predicate sources (so it won't be
DCE'd), we replaced a cmps.ne.s with another instruction so this pass
should never increase instruction count.

Note that this pass replaces the double-comparison folding that was
performed by ir3_cp before.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
9905b6f2f4 ir3: integrate predicates into RA validation
In principle, validating the result of predicate RA works exactly the
same as for normal RA. There is one slight issue: spilling is
implemented by cloning the instruction that produced the original def
which might cause different defs to legitimately reach the same source.
For example:

bool b = ...;
if (...) {
    // b gets spilled and reloaded
} else {
    // b is not spilled
}
use b;

The use of b might see different reaching defs. To solve this, RA will
store a pointer to the original def in the instruction's data field.
Validation then uses the original def.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
96dc227988 ir3: validate no registers are invalid after RA
This would already be caught by another check but would produce a
message that was difficult to interpret. Better to check for it
explicitly.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
21cd9b9557 ir3: implement RA for predicate registers
Up to now, ir3 only supported one predicate register (p0.x). However,
since a6xx, four predicate registers are available. This patch adds a
register allocator for predicate registers that allows all of them to be
used. The RA also works for older generations with only one register.

The use of p0.x was hard-coded in many places in ir3. This has been
replaced by a new flag, IR3_REG_PREDICATE, to indicate that an SSA value
should be allocated to a predicate register.

The RA uses the standard liveness analysis available in ir3. Using this,
registers are allocated in a single pass over all blocks. For each block
we keep track of currently live defs in the registers. Predicate
destinations allocate a new register and sources take the register from
their def.

The live defs of a block are initialized with the intersection of the
live-out defs of their predecessors: if all predecessors have the same
live-out def in the same register, it is used as live-in. However, we
only do this for defs that are actually live-in according to the
liveness analysis.

This doesn't work for loops: since predecessors from back edges are
processed after their successors, we don't know their live-out state
yet. We solve this by ignoring such predecessors while calculating the
live-in state. When this predecessor is later processed, we fix-up its
live-out state to match what its successor expects by reloading defs if
necessary.

Spilling is implemented by reloading, or rematerializing, the
instruction that produced the def. Whenever we need a new register while
none are available, we simply free one. If the freed def is later needed
again, we clone the original instruction in front on the new use. We
keep track of the original def the reload is cloned from so that
subsequent uses can reuse the reload.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:11 +00:00
Job Noorman
49f5a73312 ir3: allow finding SSA uses for a subset of uses
Predicate RA only needs uses of predicate registers so we don't need to
calculate the uses of all instructions.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
f55a44d88b ir3: allow liveness calculation for different register types
This allows us to only calculate the liveness for predicate registers
during predicate RA.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
49b2fbe2f0 ir3: remove comp1/2 from cat0
Just take the component values from the source registers.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
a720eef12d ir3: remove OPC_B and brtype from cat0
We currently have a bit of a confusing situation where we have both
opcodes for the different branches (OPC_BR, OPC_BRAA,...) and branch
types which are supposed to be used with OPC_B (BRANCH_PLAIN,
BRANCH_AND,...). However, not every kind of branch has a corresponding
type. For example, getone is represented by OPC_GETONE instead of a
branch type.

This patch proposes to get rid of the branch types and use opcodes
everywhere. I think this makes the representation of branches more
consistent. It also removes the for the encoder to translate branch
types into opcodes.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
7a66523124 ir3: print branch sources
Now that branches are always inserted at the end of blocks, it's
convenient to see their sources when printed.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
846c813355 ir3: fix instruction count before kill_sched
It uses the start- and end IPs of blocks but never counts instructions.
It probably just accidentally works most of the time.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
eefb1d9d3f ir3: add terminators to blocks
Instead of using brtype and condition fields in blocks, explicitly add
terminator branches in their instruction lists. This makes it more
uniform to deal with branches in passes. This will be especially useful
for passes that need to deal with predicate registers like the new
register allocator.

Note that only a single terminator is added to blocks: either an
unconditional jump in case of a single successor, or a conditional
branch in case of two successors. In the latter case, the unconditional
jump to the second successor is implicit. This makes it slightly easier
to handle terminators since there is always exactly one.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
1aa1036525 ir3: validate instruction block pointer
When moving instructions between blocks, it's easy to forget to update
the block pointer resulting in obscure errors later. Let's add a
validation check to improve error reporting.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
4d0445d914 ir3: fix alignment of spill slots
Alignment was set in units of half registers instead of bytes causing
spill slots to sometimes be under-aligned.

Fixes: 613eaac ("ir3: Initial support for spilling non-shared registers")
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
cef867edc5 ir3: update a0/a1 users when cloning instructions
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Job Noorman
a38f7ea125 ir3: add disassembly for flat.b
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
2024-03-01 13:45:10 +00:00
Eric Engestrom
54cb45cc6c ci: uprev mold to the latest release
The mold version we've been using is very old by now, and we've
now encountered some mold bugs, so let's uprev it to see it things
work better now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27905>
2024-03-01 13:02:58 +00:00
Eric Engestrom
140480974e ci: document which image tags to bump when touching build-mold.sh
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27905>
2024-03-01 13:02:58 +00:00
Erik Faye-Lund
3711964f33 panvk: do not handle illegal null
The Vulkan spec says that VkBindBufferMemoryInfo::memory must be a valid
VkDeviceMemory handle, see

https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkBindBufferMemoryInfo-memory-parameter

So let's assert instead here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27910>
2024-03-01 12:34:27 +00:00
Lionel Landwerlin
5a7e58a430 anv: fix non matching image/view format attachment resolve
Let's say you have an image in R32_UINT format, a view is created in
R32_SFLOAT and used as color attachment.

When resolving the attachment, our current code uses the image format
(R32_UINT in this case). But resolve mode might apply only to SFLOAT,
so we currently run into an assert in blorp.

We should instead use the view format. There is an exception for
depth/stencil view because the format we want to resolve is actually
the depth/stencil format, not just the depth or stencil aspect.

This fixes vkd3d-proton's test_multisample_resolve_formats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27875>
2024-03-01 12:10:28 +00:00
Eric Engestrom
2106092e63 ci/android: use a specific version of android-cuttlefish
Using whatever version is the latest at the time of the image build is
bad practice from a stability & reproducibility point of view, and the
latest version is currently broken, preventing any change that rebuilds
the android image from being merged.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27911>
2024-03-01 11:16:41 +00:00
Boris Brezillon
fab675956a panfrost: Update the release note to mention G310/G610 addition
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
d778df1a60 panfrost: Advertize G310 support
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
d17d076cc6 panfrost: Advertize G610 support
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Bob Beckett
f54c8413e6 panfrost: Add the gallium glue to get panfrost loaded when panthor is detected
Needed if we don't want to force users to pass GALLIUM_DRIVER=panfrost.

Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Bob Beckett
a29443dc6b panfrost: Add an entry for panthor in the renderonly_drivers[] array
Same as panfrost, but the kernel driver has a different name.

Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
4943002a2c panfrost: Enable v10 in the gallium driver
Now that everything is in place to support v10, add it to the
panfrost_versions array in meson.build and patch panfrost_create_screen()
to hook up pipe_screen initialization.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Alyssa Rosenzweig
447075eeee panfrost: Add support for the CSF job frontend
CSF-specific implementation of the job-frontend helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
e6a97a2b4a panfrost: Add a cleanup_batch() method to panfrost_vtable
We have to do some cleanup on v10+. Let's add a new hook to allow
per-arch batch cleanup procedures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
5b53db5f60 panfrost: Add a panfrost_context_reinit() helper
Will be needed for v10, so we can re-instantiate a context when an
unrecoverable error is reported on a group or VM.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
5e3771ab5a panfrost: Add arch-specific context init/cleanup hooks
This will allow us to defer some CSF-specific initialization to
pan_csf.c, keeping pan_context.c job-frontend agnostic.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
1b93524605 panfrost: Relax position result alignment constraint on v10+
Looks like the alignment constraint is gone on v10...

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Alyssa Rosenzweig
3b82448f47 panfrost: Add a library to build CSF command streams
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
8e303b9350 pan/genxml: Make sure pan_pack() evaluates 'dst' only once
Will be useful for the cs_builder, where we have

and we don't want cs_alloc_ins() to be called more than once.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
2d44800079 panfrost: Don't allocate a tiler heap buffer on v10+
Heap management is completely different on CSF hardware, and the heap
buffer remain unused in that case. Make the tiler heap BO creation
conditional to reflect that.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
ce24f78603 pan/decode: Introduce the concept of usermode queue
This way we allow JUMPs to be decoded when the decode function is
passed an indirect CS buffer that's called from a kernelmode queue.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
2e9450f49f pan/genxml: Various CS related improvements in v10.xml
Various improvements to the CS related definitions:

- make the field name consistent across all instructions using the same
  pattern
- define missing fields,
- replace the CEU prefix by a CS prefix
- define enums where it makes sense
- re-order instruction definitions by IDs
- add missing instructions

While at it, extend decode_csf.c to support all known instructions.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
729f6b28a6 panfrost: Add v10 support to libpanfrost
The code has already been patched to support v10, we just need to add
v10 to the version array when compiling per-arch files.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
97f6a62f7e pan/kmod: Add a backend for panthor
Panthor is a new kernel driver handling CSF-based GPUs. It's designed
around the new VM model where:

- VM management is all explicit (you get to choose where objects are
  mapped in the GPU VA space)
- synchronization is explicit too (there's not BO_WAIT, and we don't
  pass BOs around to serve as implicit deps)

We add a few panthor specific helpers (those exposed in panthor_kmod.h)
too:

- panthor_kmod_xxx_sync_point() are needed to make pan_kmod_bo_wait()
  work with the new synchronization/VM model
- panthor_kmod_get_flush_id() is exposing the LATEST_FLUSH_ID register
- panthor_kmod_vm_handle() is providing a way to query the VM handle
  attached to the pan_kmod_vm object (needed for a few panthor ioctls)

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
fe76c22aeb drm-uapi: Add panthor uAPI
Import panthor uAPI header from the drm-misc-next branch, commit
0f25e493a246 ("drm/panthor: Add uAPI").

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
89ea39c09d pan/perf: Reject panthor kernel driver
Make sure we reject perfcnt users when the kernel driver is not panfrost.
We might decide to abstract perf counters at the kmod level at some
point, but we're not there yet.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
1519d613c8 panfrost: Prepare support for GPU variants
Some GPU gens have variants impacting the GPU capabilities. Let the
kmod backend report a variant ID through a new
pan_kmod_dev_props::gpu_variant field, and patch the panfrost_model
logic to match both the gpu_id and the gpu_variant.

All existing entries are assumed to have no variant, hence the
gpu_variant field assigned to zero.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
4477daf957 panfrost: Rework the way we compute thread info
Rework the way we compute thread info to make it mostly GPU-agnostic
outside of the kmod backend.

The new logic is based on the following information extracted from
GPU registers:

- mximum number of threads per core
- maximum number ot threads per workgroup
- number of registers per core

If the GPU doesn't provide this information (registers are zero), we
pick the per-arch defaults we had in panfrost_max_thread_count().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
73da66706e pan/kmod: Reject pre 1.1 panfrost kernel drivers
Panfrost kernel driver has been around long enough to bump the minimal
requirement to 1.1. This allows us to get rid of the texture_features
hack we had to cope with the absence of
DRM_PANFROST_PARAM_TEXTURE_FEATURES[0-3] kernel side.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
0b5f1b6cb1 pan/kmod: Add a PAN_KMOD_VM_FLAG_TRACK_ACTIVITY flag
This flag reflects whether the backend should track the VM activity or
not. Needed if PAN_KMOD_VM_OP_MODE_DEFER_TO_NEXT_IDLE_POINT is used, so
we can insert proper dependencies on our VM operations.

Patch the gallium driver to set this flag at VM creation time since it
calls pan_kmod_vm_bind() with
mode=PAN_KMOD_VM_OP_MODE_DEFER_TO_NEXT_IDLE_POINT in the BO
destruction path.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Boris Brezillon
812035b2d2 pan/kmod: Fix typo in pan_kmod_vm_op_check() helper
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-03-01 10:42:43 +00:00
Karol Herbst
36fb256e9a rusticl/event: we need to call the CL_COMPLETE callback on errors as well
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10673
Fixes: 47a80d7ff4 ("rusticl/event: proper eventing support")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27777>
2024-03-01 09:44:10 +00:00
Daniel Schürmann
67ea2eb97a radv: fix initialization of radv_shader_layout->use_dynamic_descriptors
Fixes: 66eaca3a0a ('radv: introduce radv_shader_layout for per-stage descriptor layout')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27898>
2024-03-01 09:06:33 +00:00
Christian Gmeiner
0a3a80a4ca etnaviv: Remove no_oneconst_limit from etna_inst
It makes no sense to store no_oneconst_limit in struct etna_inst as this
flag is not instruction specific. This is a flag that affects every instruction.

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/27887>
2024-03-01 07:38:57 +00:00