Commit Graph

135593 Commits

Author SHA1 Message Date
Yogesh Mohan Marimuthu 27ff46bde6 ac/rgp: add ac_msgpack.h/c
This patch adds functions to create msgpack formatted data.
For msgpack specification refer to
github.com/msgpack/msgpack/blob/master/spec.md

This patch only adds formats from msgpac specification that
are required for rgp profile data.

v2: for newly added files, change copyright year from 2020 to 2021

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8609>
2021-02-19 14:29:46 +00:00
Michel Zou 34d6ce28e3 util: fix gcc vsnprintf overflow
Anything higher than INT_MAX results in overflow although the parameter is declared as size_t.

Worse, with (size_t)-1 it is silently ignored and Woverflow is not emitted.

Closes #4226

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9134>
2021-02-19 11:05:38 +00:00
Danylo Piliaiev b6b3b38434 turnip: consider HW limit on number of views when apply multipos opt
Blob doesn't apply multipos optimization starting from 11 views
even on a650, however in practice, with the limit of 16 views,
tests pass on a640/a650 and fail on a630.

Fixes tests:
 dEQP-VK.multiview.draw_indexed.max_multi_view_view_count
 dEQP-VK.multiview.input_attachments.max_multi_view_view_count
 dEQP-VK.multiview.masks.max_multi_view_view_count
 dEQP-VK.multiview.multisample.max_multi_view_view_count
 dEQP-VK.multiview.queries.max_multi_view_view_count
 dEQP-VK.multiview.renderpass2.index.fragment_shader.max_multi_view_view_count
 dEQP-VK.multiview.secondary_cmd_buffer.max_multi_view_view_count

Fixes: 8d275778 ("tu: Enable multi-position output")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9135>
2021-02-19 09:16:00 +00:00
Samuel Pitoiset 88f42ea93e radv: emit the trap handler registers earlier
Directly into the GFX init IB.

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/9076>
2021-02-19 08:58:19 +00:00
Samuel Pitoiset 2c6104d3d1 radv: make the TMA/TBA BOs resident buffers
They are always used if the trap handler is enabled.

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/9076>
2021-02-19 08:58:19 +00:00
Samuel Pitoiset 918838cd24 radv: make the trace BO a resident buffer
It's always used if RADV_DEBUG=hang is set.

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/9076>
2021-02-19 08:58:19 +00:00
Samuel Pitoiset d96c0a2263 radv: make the border color BO a resident buffer
It's always used if the feature is enabled.

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/9076>
2021-02-19 08:58:19 +00:00
Michel Zou 834b69d1ef zink: fix win32 build
Fixes: 57575627, c4cc3d91

Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9126>
2021-02-19 08:49:47 +00:00
Samuel Pitoiset e3bdf815b7 radv: set correct value for OFFCHIP_BUFFERING on GFX10+
Higher values break tessellation. I was only able to reproduce this
by switching back/from AMDVLK which was really weird...

According to Marek (1c6eca23fd), it looks like it's related to
register shadowing and PAL enables it, that probably explains a bit.

Copied from PAL and RadeonSI.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4207
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2498
Fixes: 74d69299d1 ("radv/gfx10: double the number of tessellation offchip buffers per SE")
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/9141>
2021-02-19 08:52:26 +01:00
Vinson Lee bf535c082b nv50/ir: Initialize Instruction members.
Fix defects reported by Coverity Scan.

uninit_member: Non-static class member serial is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member sched is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member bb is not initialized in this constructor nor in any functions that it calls.

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/9037>
2021-02-19 04:43:58 +00:00
Mike Blumenkrantz 31dd0a4a1e zink: use vkGetFenceStatus when we're obviously checking for status
a timeout of 0 indicates that gallium wants to know whether a fence is done,
so we can use a simpler call here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9154>
2021-02-19 04:32:25 +00:00
Mike Blumenkrantz 79861e3d88 zink: break out even more of zink_blit state saving
for reuse in upcoming clear refactoring

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9150>
2021-02-19 04:24:49 +00:00
Jonathan Marek ec54166a2b freedreno/a6xx: set SP_PERFCTR_ENABLE in computerator
Set this register to have properly working SP perfcntrs in computerator.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:03 +00:00
Jonathan Marek 46f64aa3be freedreno/a6xx: update some registers
Some sorting, adding unknown fields, documenting some fields, etc.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:03 +00:00
Jonathan Marek b94c652afe freedreno/a6xx: always use reg64 for address registers (no LO/HI)
Reduce noise in a6xx.xml by removing LO/HI versions of address registers.

Also fix type="address" registers in register packing (use bit size instead
of checking for "waddress" to use qword)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Jonathan Marek b15d4484f8 freedreno/a6xx: update perfcntr registers (declare as arrays)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Jonathan Marek 72f00fe72e freedreno/registers: use macro instead of inline function for array regs
This is to allow use in places where an inline function isn't allowed,
such as a static initializer.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Connor Abbott 79921b81bc freedreno/a6xx: Document threadsize-related fields
We'll need to use if we want to start playing around with thread sizes.
At least now we know what the actual threadsize is.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Mike Blumenkrantz 1cb3015a31 zink: just end the current renderpass in zink_batch_no_rp()
since we aren't (currently) parallelizing and now have barriers, we don't need to cycle
the batch here, which lets us avoid submitting too-small command buffers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9148>
2021-02-19 03:44:51 +00:00
Mike Blumenkrantz f3080eca75 zink: break out buffer copying into util function with batch param
if we want to explicitly specify compute batch, we need to be able
to pass that along

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9147>
2021-02-19 03:34:30 +00:00
Mike Blumenkrantz 46a04672af zink: add buffer barriers for resource_copy_region
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9147>
2021-02-19 03:34:30 +00:00
Mike Blumenkrantz 034657bf6c zink: just call context destructor on creation fail
this more reliably handles the failure case

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9149>
2021-02-19 03:24:29 +00:00
Mike Blumenkrantz 66d5966426 zink: update relnotes
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9151>
2021-02-19 03:20:39 +00:00
Mike Blumenkrantz 90b6d97c75 zink: tag some missing ES features
we're only missing advanced blend

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9151>
2021-02-19 03:20:39 +00:00
Mike Blumenkrantz 0a6b8685aa zink: fix surface creation for cube slices
if first==last layer, this should be a 2D slice of the cube

else if this isn't all the layers, this should be an array of slices

fixes a bunch of spec@arb_shader_image_size@builtin cases

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9080>
2021-02-19 03:10:17 +00:00
Dave Airlie 44f76d5fc7 lavapipe: use os_time for timing related things
drop the use of the Linux code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie 368c804383 lavapipe: make OPT macro MSVC compatible
This macros is ugly, make it uglier but msvc compatible.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie 0bd707ba17 lavepipe: some misc msvc fixes
drop some headers, get rid of printflike, drop the __builtin_ffs

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie c1e0249e90 lavapipe: use msvc compatible 0 init
trivial changes

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie ab42e49ea7 lavapipe: fix some void ptr arithmetic
msvc disagrees with it, and they are trivial to fix.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie f3dd9529fa lavapipe/meson: drop megadrivers build req
This just seems to be cut-n-paste, so lose it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Dave Airlie c0c03f29e0 lavapipe: implement physical device group enumeration
This was missing when I added physical device groups, and
was causing crashes on win32.

Fixes: 6af87193c ("lavapipe: add basic vulkan device group support.")
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9120>
2021-02-19 02:27:15 +00:00
Mike Blumenkrantz 0fd58b4537 zink: be more explicit with image barriers for copy operations
we know the access and pipeline stage here, so we can pass those along
to ensure synchronization

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 466efcb247 zink: add general zink_resource_barrier() wrapper
this simplifies a bit of code where we may want to be throwing in barriers
regardless of the resource type

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 6cbd25c04b zink: zink_resource_barrier -> zink_resource_image_barrier
need this namespace

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 55a0eb6e0a zink: improve barrier usage for clear functions
ensure that we're always using the right layout for images that are
being cleared

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 77b0533d75 zink: add batch references for resources in clear functions
need to make sure we track these writes

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 7d6c90826d zink: add access info for update_descriptor image barriers
this forces resources to transition where necessary to ensure that
data from previous ops have been made available (e.g., clear -> shader image)

we also switch needs_barrier over to a more accurate signature here since we
can now do it without breaking update_descriptors()

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz ab3a2fa690 zink: add access param for image resource barriers
we need more detail on some of these to ensure proper synchronization
and availability/visibility of image data between commands/stages

the signature for needs_barrier() is still funky here to avoid breaking
usage in update_descriptors()

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 3f6d104ba8 zink: add barriers for index and draw param buffers
need to ensure synchronization here too

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 5d664166c8 zink: assert batch is not in a renderpass when emitting pipeline barrier
this is only valid for subpasses which have self-dependencies set, and we
don't currently do that

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 9df8c4ba96 zink: take struct zink_batch param instead of direct cmdbuf in barrier helpers
this is weird and prevents us from verifying batch states

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 9d3935a0b3 zink: combine resource barriers where possible during update_descriptors
if we have a resource in the same state for multiple shader stages, we can
emit a single barrier for all the stage bits instead of multiple barriers

this also helps with detecting potentially redundant barriers when we go to
emit them later on

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 4b2fb61831 zink: break out barrier transitioning in update_descriptors
this hopefully makes the code a little more readable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 017dbd63fb zink: avoid emitting unnecessary pipeline barriers during update_descriptors
if the current state of the resource matches the desired state, we don't need
to emit anything, and we can potentially avoid ending a renderpass

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 5d7cb2495a zink: add generic wrapper for checking whether a resource needs a barrier
handy to not need to check ahead of time

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 4536607ea0 zink: use define for max descriptor array size
this was getting a bit unwieldy

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 03030f87a1 zink: add helper for image resource barriers and avoid unnecessary barriers
same as buffer barriers now

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz b00f407996 zink: add a VkPipelineStageFlags param to zink_resource_barrier()
this matches the buffer variant in its flexibility now

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00
Mike Blumenkrantz 061e4e2293 zink: remove aspect param from zink_resource_barrier
we have a helper function for this now that we can reuse

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
2021-02-19 02:05:13 +00:00