Commit Graph

136487 Commits

Author SHA1 Message Date
Mike Blumenkrantz c3db26a6f6 lavapipe: use common interfaces for shader modules
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz a41e98ddca vk/util: add a util macro for initializing stack vk_shader_module structs
radv does a lot of this, so having a central dispatch point will be useful in
case changes are made to this struct in the future

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Mike Blumenkrantz 76078ed9fe vk/util: add unified shader module struct/functions
there's some extra logging stuff dumped into here to match functionality,
eventually that should also be consolidated into vk_util.c

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9508>
2021-03-15 21:47:44 +00:00
Dave Airlie b0de4468c2 lavapipe: add host query reset
This just resets the queries on the host size.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:37 +10:00
Dave Airlie 6865ec210b lavapipe: fix writing availability for queries.
If the availability has to be written it needs to be written
 to the correct place.

The host query reset tests fall over this.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:33 +10:00
Dave Airlie 774bbc299f lavapipe: add missing break
No effect as-is but annoying later.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9594>
2021-03-16 06:50:28 +10:00
Sagar Ghuge 3a73148f25 anv: Set correct binding table entry count
We can use surface_count as it is to set binding table entry count since
it's already in units.

On Felix's Tigerlake with the GPU at fixed frequency, this patch
improves performance of several games:

   - Shadow of the Tomb Raider: +1.5%
   - Dota2vk: +1%
   - Dark Souls: +1%

v2: (Ken)
- Remove get_binding_table_entry_count() and use surface_count directly.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9548>
2021-03-15 20:11:13 +00:00
Jordan Justen b6875b0094 anv: Drop has_slm in emit_l3_config for gen11+
For some gen12+ platforms, L3 config (cfg) can be NULL leading to a
seg-fault in emit_l3_config. But, we don't use has_slm for gen11+, so
we can just avoid declaring the variable.

Reworks:
 * Drop has_slm variable for all gens (suggested-by Jason)

Ref: 633dec7163 ("anv: Set L3 full way allocation at context init if L3 cfg is NULL")
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9534
Fixes: 581e68bc99 ("anv: move L3 config emission to genX_state.c")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9589>
2021-03-15 11:33:25 -07:00
Anuj Phogat b1ab69f467 anv: Remove redundant #if checks
Patch removes redundant #if checks and unused code inside another #if
block.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9604>
2021-03-15 18:02:58 +00:00
Caio Marcelo de Oliveira Filho f603a2c25a anv: Lower ViewIndex to zero when multiview is disabled
Vulkan spec says

    If multiview is enabled in the render pass, this value will be one
    of the bits set in the view mask of the subpass the pipeline is
    compiled against. If multiview is not enabled in the render pass,
    this value will be zero.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4446
Fixes: 0db7070330 ("anv/pipeline: Add shader lowering for multiview")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9574>
2021-03-15 09:51:14 -08:00
Mike Blumenkrantz edcad555f8 zink: stop leaking programs
gfx and compute programs both end up with an extra ref from creation,
so they both need to lose a ref during creation after they get their
shader refs

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz 46b356ca2d zink: unset ctx->program pointers when an unref destroys the object
if we destroy a program object which is currently the "active" program then
we need to unset the pointer to avoid invalid access

also unset injected tcs pointers where appropriate

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz ddb807e5c9 zink: return true from program ref functions upon free
this lets us unset the context pointer accurately

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9470>
2021-03-15 15:37:46 +00:00
Mike Blumenkrantz 25d895747c zink: use internal api for first-frame fence
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 11:19:16 -04:00
Mike Blumenkrantz e93ca92d4a zink: force explicit fence only on first frame flush
we have implicit sync hooked up for drivers now so we don't need to worry
about drawing over our frontbuffer unexpectedly

still a weird issue remaining where we miss the first frame without an explicit
fence, but I expect that will get resolved eventually by wsi

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 11:18:59 -04:00
Mike Blumenkrantz bbfeebabfd zink: force mesa flush implicit fencing on ANV
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 10:58:21 -04:00
Mike Blumenkrantz 6fb4e1345d zink: determine whether the vulkan driver requires mesa flush wsi
this is used for ANV's implicit fencing (until we get wsi)

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9290>
2021-03-15 10:58:21 -04:00
Mike Blumenkrantz 86bd643d6a zink: use a safer iteration for fb surfaces during rp init
doing a pointer iteration looks cool, but if the array is full, then it
goes out of bounds and we crash

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9542>
2021-03-15 14:10:52 +00:00
Mike Blumenkrantz 38f7faa8a4 zink: implement a surface cache
this is a global cache for all surface objects, enabling some memory
optimizations as well as improved reuse of cached descriptors

loosely based on patches from Antonio Caggiano

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9541>
2021-03-15 09:42:30 -04:00
Mike Blumenkrantz 2643f9ed28 zink: ralloc screen objects
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9541>
2021-03-15 09:42:30 -04:00
Michel Zou 6083ebe078 swr: fix array-bounds warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 12af7f97ee swr: fix deprecated llvm 11 declaration warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou c58a7c7108 swr: fix unused SplitString warning
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 17441cf92f swr: Fix SWR_CONTEXT pre-declaration
Silents a warning on msvc

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 0e8cdea6d9 swr: fix win32 intrinsics
The doc doesnt mention Index is altered when mask is null.
This is consistent with both llvm & migw implementations.

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Michel Zou 31dbef02a0 swr: extern declaration for win32 intrinsics
This fixes compilation on msvc because llvm redefines these too
Closes #4417

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
2021-03-15 13:19:09 +00:00
Samuel Pitoiset 321dadf229 radv: rework radv_use_dcc_for_image() a bit
To make it clear that only GFX8-9 have missing DCC features.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9526>
2021-03-15 13:22:44 +01:00
Samuel Pitoiset 9704ed3f57 radv: remove useless DCC disable check for 3D images on GFX10+
addrlib uses the S swizzle mode which disables DCC completely.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9526>
2021-03-15 13:22:44 +01:00
Samuel Pitoiset 2bc51226e1 radv: add missing SQTT events for copy_commands2/create_renderpass2
A bunch of entrypoints were missing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9560>
2021-03-15 12:34:39 +01:00
Marcin Ślusarz 99e9a6721a anv: fix memory allocation error handling
Reported by Coverity.

Fixes: 0a7224f3ff ("anv: group as many command buffers into a single execbuf")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9596>
2021-03-15 10:53:41 +01:00
Lionel Landwerlin 87966b0aa0 intel: install intel_device_info
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9595>
2021-03-15 09:22:13 +00:00
Pierre-Eric Pelloux-Prayer 9e5623ccc3 frontends/va: fix protected slice data buffer read size
Read vlVaBuffer->size bytes instead of an hardcoded value.

Fixes: deb7dc82f6 ("frontends/va: handle protected slice data buffer")
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9553>
2021-03-15 09:43:15 +01:00
Pierre-Eric Pelloux-Prayer 4668cd30d9 radeonsi/sqtt: fix user event max size
Larger strings can corrupt rgp files.

Fixes: 5dc823304b ("radeonsi/sqtt: forward string markers to sqtt")
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9553>
2021-03-15 09:42:40 +01:00
Iago Toral Quiroga 177dcd4b68 broadcom/compiler: be more flexible scheduling TMU writes
V3D 4.x allows more flexibility, so take advantage of that. Generally,
we can reorder any writes in the same sequence, so long as they are
not the sequence terminator (which must always be last, since it is
the one triggering the operation), and TMUD writes, since these must
be ordered with respect to each other.

total instructions in shared programs: 13735183 -> 13731927 (-0.02%)
instructions in affected programs: 903057 -> 899801 (-0.36%)
helped: 2358
HURT: 746
Instructions are helped.

total max-temps in shared programs: 2322020 -> 2322009 (<.01%)
max-temps in affected programs: 619 -> 608 (-1.78%)
helped: 19
HURT: 11
Inconclusive result (value mean confidence interval includes 0).

total sfu-stalls in shared programs: 31494 -> 31489 (-0.02%)
sfu-stalls in affected programs: 182 -> 177 (-2.75%)
helped: 40
HURT: 40
Inconclusive result (value mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13766677 -> 13763416 (-0.02%)
inst-and-stalls in affected programs: 901343 -> 898082 (-0.36%)
helped: 2349
HURT: 746
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9555>
2021-03-15 08:03:28 +01:00
Iago Toral Quiroga 87ed614c47 broadcom/compiler: flag wrtmuc with a read dependency on last_tmu_config
Instead of using a write depdency. We use last_tmu_config to ensure ordering
of instructions participating in different TMU sequences. To this end,
all sequence terminators flag a write dependency on last_tmu_config, but
wrtmuc is not a sequence terminator, so we can be more flexible by flagging
it as a read depedency. This would prevent it to be moved into a previous
sequence (since it cannot be moved past the previous sequence terminator due
to the read depedency), but it allows it to be reordered with instructions in
the same sequence, which allows us to pair it up more effectively. Particularly,
it allows to pair up a wrtmuc with the sequence terminator of the same sequence,
turning code like this:

nop                  ; mov  tmut, r0     ; thrsw; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[0].p1 | 0x0)
nop                  ; mov  tmus, r1

Into this:

nop                  ; mov  tmut, r0     ; thrsw; wrtmuc (tex[0].p0 | 0x3)
nop                  ; mov  tmus, r1     ; wrtmuc (tex[0].p1 | 0x0)

total instructions in shared programs: 13755738 -> 13735183 (-0.15%)
instructions in affected programs: 2510921 -> 2490366 (-0.82%)
helped: 10963
HURT: 485
Instructions are helped.

total max-temps in shared programs: 2322828 -> 2322020 (-0.03%)
max-temps in affected programs: 11303 -> 10495 (-7.15%)
helped: 608
HURT: 19
Max-temps are helped.

total sfu-stalls in shared programs: 31545 -> 31494 (-0.16%)
sfu-stalls in affected programs: 235 -> 184 (-21.70%)
helped: 62
HURT: 11
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 13787283 -> 13766677 (-0.15%)
inst-and-stalls in affected programs: 2525187 -> 2504581 (-0.82%)
helped: 10989
HURT: 477
Inst-and-stalls are helped.

v2: add a comment explaining the read depdency (Piñeiro).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9555>
2021-03-15 08:03:28 +01:00
Timothy Arceri 6d6fd57e09 util/fossilize_db: remove compression from foz db helper
We now handle compression in the shared cache item creation code.
Compressing the cache item header with the already compressed blob
doesn't help much so lets just remove it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9593>
2021-03-15 03:34:48 +00:00
Timothy Arceri 4a98764da8 util/disk_cache: make use of the new compression helpers
This makes compression use more consistent between the zstd and
zlib libraries. It also reduces the amount of code required for
zlib use.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9593>
2021-03-15 03:34:48 +00:00
Timothy Arceri d7ecbd5bf8 util: create some standalone compression helpers
This will be used by the following patch. It allows us to detangle
compression from the disk cache code, and abstract the underlying
compression libraries we use.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9593>
2021-03-15 03:34:48 +00:00
Mike Blumenkrantz 1819283413 zink: use _mesa_set_search_and_add() for set management
this avoids extra hash lookups

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9565>
2021-03-14 21:57:00 -04:00
Mike Blumenkrantz c5029ddf8c zink: optimize resource usage tracking
we already have the batch usage info here for the resource, so if we know
the resource is already used on the batch then we don't need to also perform
a hash lookup to double check that it's really there

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9565>
2021-03-14 21:57:00 -04:00
Dave Airlie db0a71c9ae lavapipe: enable EXT_scalar_block_layout
The frontend should handle this.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9590>
2021-03-15 00:06:58 +00:00
Dave Airlie db8e2aad5e lavapipe: enable KHR_uniform_buffer_standard_layout
I think the frontend should handle all of this fine.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9590>
2021-03-15 00:06:58 +00:00
Vinson Lee 7e412a5d33 iris: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9382>
2021-03-15 00:01:30 +00:00
Vinson Lee 1193f2bd74 nv50/ir: Add constructor for NV50LegalizePostRA.
Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
member_not_init_in_gen_ctor: The compiler-generated constructor
for this class does not initialize r63.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9326>
2021-03-14 16:49:49 -07:00
Mike Blumenkrantz 09d53d63ad zink: ci updates
disabling qbo piglit test for now due to lots of brokenness in zink which
makes them flaky, will be reenabled soon

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9566>
2021-03-14 19:22:39 -04:00
Mike Blumenkrantz 4e14c3dcb1 zink: remove extraneous flush in transfer_map_region_flush
this was only needed to cover up some other bugs:
* missing barriers for buffer sampler/image descriptors
* weirdness with first frame handling

there's better ways of handling both cases, and now they're handled better

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9566>
2021-03-14 18:51:58 -04:00
Mike Blumenkrantz d40e372fe9 zink: move buffer<->image copying to pipe_context::resource_copy_region hook
that's a todo item off the list

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9566>
2021-03-14 18:51:58 -04:00
Dave Airlie 88f41a8fa5 docs: update lavapipe features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9551>
2021-03-15 06:39:53 +10:00
Dave Airlie 585b5fcf44 lavapipe: add single ssbo variable pointer support.
Multiple buffer seems to break with tess eval only,
something to investigate later.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8222>
2021-03-15 06:20:54 +10:00
Dave Airlie c843e3b5b4 lavapipe: move to common create render pass code
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9550>
2021-03-14 20:03:13 +00:00