Commit Graph

152997 Commits

Author SHA1 Message Date
Mike Blumenkrantz 305fe87d98 zink: fix/improve swapchain surface info updating
if the swapchain is updated, the base surface info needs to be updated
so that the surface info used for the framebuffer is updated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16151>
2022-04-26 18:58:26 +00:00
Mike Blumenkrantz 25840a31eb kopper: add DISPLAY_TARGET bind for depth buffer
this doesn't affect functionality and is only used for validation
in the driver

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16151>
2022-04-26 18:58:26 +00:00
Konstantin Seurer aeeb0b4deb radv: Copy shader modules to avoid use after free
The vkd3d-proton ray tracing tests delete shader modules after creating
pipeline libraries from them. This resulted in a use after free when
creating ray tracing pipelines.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16027>
2022-04-26 18:20:11 +00:00
Konstantin Seurer 1873880b50 vulkan: Add a shader module clone helper
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16027>
2022-04-26 18:20:11 +00:00
Alyssa Rosenzweig 7998f242a8 panfrost: Add a test for pan_image_layout_init
Would have caught a significant issue with ETC2 handling. Luckily Midgard dEQP
failed on this, even though Bifrost didn't (due to explicit strides?)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 52f8f7d6c9 panfrost: Simplify how image_layout_init is called
Rather than using it as a catch-all initialize, use it to fill in derived from
fields from a partially initialized image_layout. This is easier to understand
and, more importantly, easier to unit test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig c45ed7e576 panfrost: Unit test block size queries
Simple interface, make sure we don't screw it up.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 11d0a5292b panfrost: Remove unused dev argument
This function has enough arguments as it is... Motivated by wanting to unit test
this monster.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 321e1b37b9 panfrost: Unify paths through image_layout_init
We can always align the width/height, now that block_size is defined (as 1x1)
for linear textures. We can also remove the useless effective_depth assignment.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 724f835d2f panfrost: Unify panfrost_block_size paths
Handle linear, interleaved, and AFBC formats. This requires taking a format, as
block compressed u-interleaved textures have a different tile size than other
u-interleaved textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig ef5e66b1fd panfrost: Use pan_block_size in layout calculation
This gets rid of the weird "call block_dim twice with a mystery argument"
pattern, and will allow us to further unify code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig e4ee2c213a panfrost: Extract panfrost_afbc_is_wide helper
Rather than open-code the > 16 check in multiple places and have to justify it
in each. This is easier to understand at the call sites.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig e6f3abd5ec panfrost: Don't pretend to support multiplane AFBC
This requires tons of driver changes we're not ready for. In the mean time, this
will just get in the way of refactoring AFBC support.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig d25bb73bb6 panfrost: Use panfrost_afbc_superblock_width
..instead of panfrost_block_dim. This is clearer, and gets rid of block dim
users.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 36449bdcdc panfrost: Add afbc_superblock_{size, width, height} helpers
...and use them to implement block_dim transitionally.

These should be clearer than the general block_dim.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 43202320ee panfrost: Always use 64-bit SD with strides
Midgard has multiple Surface Descriptor formats selectable in the texture
descriptor. Previously, we have used both the "64-bit surface descriptor" and
the "64-bit surface descriptor with 32-bit line stride and 32-bit layer stride".
A delicate routine tried to guess what stride the hardware will use if we don't
specify it explicitly, and omit the stride if it matches. Unfortunately, that
routine is broken in at least two ways:

* Textures with ASTC must always specify an explicit stride. Failing to do so
  (like we were doing) is invalid.

* It applies even for interleaved textures. The comment above the function
  saying otherwise is incorrect. (TODO: double check this)

Bifrost onwards always specify the strides explicitly. Let's just do that and
unify the gens. What is lost from doing this? A ludicrously trivial amount of
memory and texture descriptor cache space. 8 bytes per layer*level per texture,
in fact. Compared to the size of the textures being addressed, the memory usage
is trivial. The texture descriptor cache size maybe matters more. But given
Arm's hardware people went this direction for Bifrost and stuck to it, I doubt
it matters much.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 644611010e panfrost: Split pan_layout.c from pan_texture.c
Before we used GenXML, pan_texture mixed layout code with texture descriptor
packing code. For the most part, the layout code is generation-independent; the
pack code is not. We introduced an anti-pattern where the file was compiled N+1
times: N times for each PAN_ARCH value, and an extra time with no PAN_ARCH
value. And then the contents of the file changed completely depending on
PAN_ARCH. This is a pretty weird construction.

Let's instead split off the layout file from the descriptor file, compile the
layout file once, and compile the descriptor file per-gen.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Alyssa Rosenzweig 9ccba4943d panfrost: Advertise all textures in drm-shim
I was rather confused when I couldn't reproduce an ASTC bug under drm-shim...
Fix that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15991>
2022-04-26 17:47:49 +00:00
Yevhenii Kolesnikov 65caf46b3b nir: Remove single-source phis before opt_if_loop_last_continue
We might have some single-source phis leftover after prior optimizations. We
want to get rid of them before merging the blocks.

Fixes: 5921a19d4b ("nir: add if opt opt_if_loop_last_continue()")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6312

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16095>
2022-04-26 17:06:07 +00:00
Lucas Stach 90ea4283b4 etnaviv: set VIVS_GL_VERTEX_ELEMENT_CONFIG depending on prim type
New blob versions always emit this state on GPUs that don't have the
NEW_GPIPE feature bit before drawing a primitive, as it needs to be
set according to the primitive type.

Closes: #2933
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16094>
2022-04-26 16:59:13 +00:00
Lucas Stach 9696355802 etnaviv: update headers from rnndb
Update to etna_viv commit 100009142dc2.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16094>
2022-04-26 16:59:13 +00:00
Jason Ekstrand 37d4b72ff3 vulkan/log: Allow but warn for client-invisible objects
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107>
2022-04-26 16:22:23 +00:00
Jason Ekstrand 62a44d1bda vulkan/log: Allow but warn if called with a NULL object
Most of the time when the logging code is invoked, it means we're
already in an edge case.  It should be as robust as possible, otherwise
we risk making hard to debug things even harder.  To that end, instead
of blowing up if passed a NULL object on the list, handle it as
gracefully as we can.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16107>
2022-04-26 16:22:23 +00:00
Jason Ekstrand ef9d97ec1f spirv: Handle Op*MulExtended for non-32-bit types
Fixes: 58bcebd987 ("spirv: Allow [i/u]mulExtended to use new nir opcode")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6306
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16060>
2022-04-26 15:16:11 +00:00
Alyssa Rosenzweig f329f67243 panfrost: Kick off v9 support in the driver
Call panfrost_cmdstream_screen_init_v9.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 1a1546ca7e panfrost: Compile for v9
Now that everything is ported!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 26d339ef8a panfrost: Generate Valhall Malloc IDVS jobs
These look similar to Bifrost IDVS but with a twist: memory allocation is
handled by the hardware, and the descriptors are split up. Add the handling for
these.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig e626c9f6f8 panfrost: Use dirty flags to emit v9 descriptors
These new descriptors take the place of removed descriptors like the RSD, and
need corresponding dirty tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 351403fe75 panfrost: Specialize shader descriptors for Valhall
Instead of being globbed into the RSD, Valhall uses minimal shader program
descriptors. For IDVS, we need separate descriptors for position and varying
shaders. It's actually worse -- we need separate descriptors for drawing points
and drawing lines/triangles in order to skip over the gl_PointSize write. Adapt
prepare_shader to upload all these descriptors.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig b15f53ffaa panfrost: Specialize ZSA state for Valhall
Now we have a much nicer Z/Stencil Descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 68e7bcab3d panfrost: Specialize vertex elements for Valhall
The split between attribute descriptors and buffer descriptors parallels that of
Bifrost's attribute descriptors and attribute buffer descriptors, with some
shuffling and simplication.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 2a027abfcf panfrost: Simplify attribute format expression
Chew through a layer of indirection for clarity.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 603c06d00f panfrost: Specialize rasterizer state for Valhall
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 818bbcecb2 panfrost: Adapt compute job emit for Valhall
Similar data structure, simpler packing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig cb14c639eb panfrost: Use common state emit for compute jobs
This reduces the "specialness" of the Bifrost compute job emit path. It's not
useful in its own right since we currently put compute jobs in their own batch.
This could be optimized.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig 7ad159aab2 panfrost: Don't fix up alpha test on Bifrost
Since 7d1d7cdf57 ("panfrost: Don't check alpha test in fs_required on
Bifrost+"), we don't use the alpha testing state on Bifrost. So the fixup isn't
needed either.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig cf02a1a555 panfrost: Port uniform/UBO logic to Valhall
Use Valhall descriptors, and report sizes so we can accurately inform the
hardware of sizes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig d7b3532553 panfrost: Add helper to emit UBOs
Either as uniform remap table entries on Bifrost, or as simple buffer
descriptors on Valhall. The underlying hardware is different (and there are
compiler changes for load_ubo handling), but the high level UBO upload logic
does not have to care about that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:23 +00:00
Alyssa Rosenzweig bfbce9c1d9 panfrost: Compile libpanfrost for v9
Now that everything is ported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig af6071053b panfrost: Don't allocate storage for PSIZ on Valhall
It's implicit.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig 44689b222a pan/blit: Support v9 data structures
Now that everything is appropriately refactored, we can support Valhall's data
structures in the blitter. Things look similar to Bifrost, but the RSD no longer
exists.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig ec6de03487 pan/blit: Prepare for Valhall port
Valhall's data structures are organized differently. In particular, they don't
use RSDs. So we need to reshuffle the blitter's data structures so we can map to
Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig dbe95af5dd pan/blit: Generalize texture alignment
For Valhall compat.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig b7e8084af5 pan/blit: Compile blit shaders without IDVS
On Valhall, the fragment shader differs based on whether IDVS or the legacy
geometry flow is used be. In particular, varyings are accessed differently.

We use the legacy geometry flow for blitting on all GPUs, so indicate this in
the shader inputs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Alyssa Rosenzweig 5ee4852239 panfrost: Add texture features enum to v9.xml
Required to query texture features on Valhall. It's technically the same as
previous Malis (except for narrow ASTC), but conceptually it's different as
plane descriptors have superseded indexed pixel formats for block compressed
textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16035>
2022-04-26 14:56:22 +00:00
Adam Jackson 0db826a038 docs: Update supported drivers for 22.x
nouveau doesn't support pre-nv30 anymore, pre-DX9 drivers are no longer
supported generally, and llvmpipe jits on more than just x86.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15489>
2022-04-26 14:46:40 +00:00
Adam Jackson ddc59ccd71 docs: Note EGL enum allocation for EGL_EXT_present_opaque
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15489>
2022-04-26 14:46:40 +00:00
Jason Ekstrand e0f27eca7a vulkan: Use ALL_COMMANDS_BIT for waits/signals instead of ~0
This is a bit more accurate for what's going on and, while all Mesa
drivers today seem to be ok with extra bits, ensures we're passing a
valid Vulkan thing.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16145>
2022-04-26 14:17:28 +00:00
Jason Ekstrand 02fea6c179 vulkan: Set signals[i].stageMask = ALL_COMMANDS for QueueSubmit2 wrapping
My understanding of the signal masks is that they control what stages
must complete before the semaphore is signaled.  Using 0 theoretically
means the semaphore could be signaled immediately without waiting on
anything.  Use ~0 instead to say it depends on everything.

Fixes: 97f0a4494b ("vulkan: implement legacy entrypoints on top of VK_KHR_synchronization2")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16145>
2022-04-26 14:17:28 +00:00
David Heidelberg 2f5cf6fcee ci: skqp: update URL
The file and functionality isn't present in `main` branch anymore.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15973>
2022-04-26 14:12:20 +00:00