platform/upstream/mesa.git
2 years agovirgl: Allocate qdws after virgl_init_context to avoid leak.
Vinson Lee [Sat, 30 Oct 2021 22:12:00 +0000 (15:12 -0700)]
virgl: Allocate qdws after virgl_init_context to avoid leak.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable qdws going out of scope leaks the storage it
points to.

Fixes: 9a7d6a110e2 ("virgl/drm: explicit context initialization")
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13609>

2 years agomicrosoft/spirv_to_dxil: Fix non-Windows build.
Vinson Lee [Wed, 10 Nov 2021 05:25:52 +0000 (21:25 -0800)]
microsoft/spirv_to_dxil: Fix non-Windows build.

../src/microsoft/spirv_to_dxil/dxil_validation.cpp: In function ‘bool validate_dxil(dxil_spirv_object*)’:
../src/microsoft/spirv_to_dxil/dxil_validation.cpp:129:12: error: ‘stderr’ was not declared in this scope
  129 |    fprintf(stderr, "DXIL validation only available in Windows.\n");
      |            ^~~~~~

Fixes: 37c366e2830 ("microsoft/spirv_to_dxil: Add DXIL validation to spirv2dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13736>

2 years agofreedreno/a6xx: Inline remaining fd6_tex_const_0() call.
Emma Anholt [Tue, 9 Nov 2021 22:32:49 +0000 (14:32 -0800)]
freedreno/a6xx: Inline remaining fd6_tex_const_0() call.

Less indirection and fixups for figuring out what's going on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/a6xx: Drop an unused tile_mode arg.
Emma Anholt [Tue, 9 Nov 2021 22:36:51 +0000 (14:36 -0800)]
freedreno/a6xx: Drop an unused tile_mode arg.

I added this in ebaeddcbb3e9 ("freedreno/a6xx: Rewrite the format table
format/swap helpers.")  but it had already become unused through some
bugfixing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/a6xx: Clean up sysmem fb read patching using fd6_view.
Emma Anholt [Tue, 9 Nov 2021 22:10:36 +0000 (14:10 -0800)]
freedreno/a6xx: Clean up sysmem fb read patching using fd6_view.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/a6xx: Use fd6_view for non-buffer image descriptors, too.
Emma Anholt [Mon, 18 Oct 2021 22:18:14 +0000 (15:18 -0700)]
freedreno/a6xx: Use fd6_view for non-buffer image descriptors, too.

This deletes a whole lot of code, but there's a modest drawoverhead perf
loss:

drawoverhead 1-image change -6.48856% +/- 4.28269% (n=50)
drawoverhead 8-image change -5.29195% +/- 2.62549% (n=90)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/a6xx: Switch to relying on fd6_view for our texture descriptors.
Emma Anholt [Mon, 18 Oct 2021 21:24:40 +0000 (14:24 -0700)]
freedreno/a6xx: Switch to relying on fd6_view for our texture descriptors.

Having checked the deltas between fdl6_view and what we did before, switch
over to fdl6_view now.

No statistically significant difference on no-hw drawoverhead 8-texture
change (n=50) with the texture cache disabled from this and the previous
commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/a6xx: Create a fd6_view at sampler view update time.
Emma Anholt [Mon, 18 Oct 2021 17:15:04 +0000 (10:15 -0700)]
freedreno/a6xx: Create a fd6_view at sampler view update time.

The goal is to share the same code as turnip for descriptor setup. This
just calls it and cross-checks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno: Set layer_first on (2D) resource imports.
Emma Anholt [Mon, 18 Oct 2021 19:47:59 +0000 (12:47 -0700)]
freedreno: Set layer_first on (2D) resource imports.

Prevents getting a weird layer stride if you ask for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agofreedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.
Emma Anholt [Mon, 18 Oct 2021 19:58:56 +0000 (12:58 -0700)]
freedreno/fdl6: Skip redundant setting of TILE_ALL for NV12.

We already respect the tile_all flag above, and it should be set in tu.
Fixes a mismatch between fdl6_view_init() and gallium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agoutil/format: Add G8_B8R8_420_UNORM to match Vulkan.
Emma Anholt [Wed, 20 Oct 2021 22:52:23 +0000 (15:52 -0700)]
util/format: Add G8_B8R8_420_UNORM to match Vulkan.

turnip was playing fast and loose with the name, using the R8_G8B8 format
name but actually setting the descriptors up to read G8_B8R8 like Vulkan
(sensibly) wants.  This caused trouble when trying to make freedreno and
turnip share code.  By having both orderings as format names, we can share
the descriptor code and also confuse readers less.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agoutil: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.
Emma Anholt [Wed, 20 Oct 2021 22:34:03 +0000 (15:34 -0700)]
util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.

The only user, turnip, was actually treating it as this layout, matching
vulkan's specification of how the planes map to RGB values.  (Y=G means
that Cb=B and Cr=R).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>

2 years agoutil/ra: Fix deserialization of register sets
Caio Oliveira [Tue, 9 Nov 2021 23:15:15 +0000 (15:15 -0800)]
util/ra: Fix deserialization of register sets

Set ra_class::regset and ra_class::index  when deserializing.

Fixes: 95d41a3525d ("ra: Use struct ra_class in the public API.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>

2 years agoutil/ra: Add simple test for register set serialization
Caio Oliveira [Tue, 9 Nov 2021 23:13:39 +0000 (15:13 -0800)]
util/ra: Add simple test for register set serialization

Marked as DISABLED since it currently fails.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>

2 years agodocs: update calendar for 21.3.0-rc5
Eric Engestrom [Wed, 10 Nov 2021 22:10:41 +0000 (22:10 +0000)]
docs: update calendar for 21.3.0-rc5

Add another release candidate as we're not ready for 21.3.0 final just yet.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13744>

2 years agoci/bare-metal: Close serial and join serial threads before exit.
Emma Anholt [Thu, 21 Oct 2021 00:16:54 +0000 (17:16 -0700)]
ci/bare-metal: Close serial and join serial threads before exit.

This should fix the intermittent (~1/week) cheza failure where python
complains that a thread tried to do stdio while the main thread has
exited.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>

2 years agoci/etnaviv: Add more texturing flakes.
Emma Anholt [Tue, 9 Nov 2021 21:28:30 +0000 (13:28 -0800)]
ci/etnaviv: Add more texturing flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>

2 years agoci/etnaviv: Mark the rest of uniform_api.random as flaky.
Emma Anholt [Tue, 9 Nov 2021 01:04:32 +0000 (17:04 -0800)]
ci/etnaviv: Mark the rest of uniform_api.random as flaky.

Another 3 new flakes happened on my last run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13462>

2 years agomesa/main: Fix use of alloca() without #include "c99_alloca.h"
Jesse Natalie [Wed, 10 Nov 2021 01:36:50 +0000 (17:36 -0800)]
mesa/main: Fix use of alloca() without #include "c99_alloca.h"

Fixes: c216f193 ("mesa: use alloca in search_resource_hash")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13735>

2 years agofreedreno: Fix constant-index assumptions in IBO loads.
Emma Anholt [Fri, 29 Oct 2021 20:41:16 +0000 (13:41 -0700)]
freedreno: Fix constant-index assumptions in IBO loads.

The encoder already sets up our IBO accesses as potentially nonuniform, so
we just need to be careful to not try to force the IBO index into an
immediate.

Fixes assertion failures in piglit arb_shader_image_load_store-invalid
(intermittent due to
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/597), which
had some interesting actual failures hidden behind it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>

2 years agofreedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.
Emma Anholt [Fri, 29 Oct 2021 22:00:10 +0000 (15:00 -0700)]
freedreno: Fix the uniform/nonuniform handling for cat5 bindful modes.

We can see from the dynamically_uniform (compiler doesn't know if you're
uniform or not) vs uniform (compiler can see it's uniform) case in the
blob which is which.  Now that we have the right names, also use the
nonunif flag for encoding the actual non-uniform mode (previously, we were
always setting it always in a way that meant uniform).

I verified this behavior back to a418 with samplers.  The a3xx blob I have
only does GLES3, so we don't have the opaque_type_indexing tests to see.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13601>

2 years agoanv: don't forget to add scratch buffer to BO list
Lionel Landwerlin [Wed, 27 Oct 2021 10:06:07 +0000 (13:06 +0300)]
anv: don't forget to add scratch buffer to BO list

We reference the scratch BO using a bindless index in the command
streamer instructions, but we forgot to add them to the BO list.

v2: Make use of pipeline reloc list (Jason)

v3: Don't add NULL BOs to the reloc list (Lionel)

v4: Don't add BOs twice to reloc list when dealing with addresses
    (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: eeeea5cb873b40 ("anv: Add support for scratch on XeHP")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13544>

2 years agoaco: Work around MSVC restrict in c99_compat.h
James Park [Sun, 24 Oct 2021 01:02:48 +0000 (18:02 -0700)]
aco: Work around MSVC restrict in c99_compat.h

Future LLVM header leads to __declspec(__restrict), which is invalid.
Just undefine the restrict macro to keep __declspec(restrict).

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13505>

2 years agowsi/x11: support depth 30 visuals
Niklas Haas [Sun, 7 Mar 2021 12:38:01 +0000 (13:38 +0100)]
wsi/x11: support depth 30 visuals

There's only really one format that makes sense here, since there's no
sRGB equivalent for 10-bit packed formats.

It's possible that this results in flipped colors, if 10-bit visuals
exist that have the channels in the opposite order. (They don't seem to,
on my end)

Perhaps a more principled solution would also compare the exact r/g/b
bitmasks. But for now, this works.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3537
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9450>

2 years agovulkan/wsi: Unlock before return on error path.
Vinson Lee [Sat, 6 Nov 2021 22:56:21 +0000 (15:56 -0700)]
vulkan/wsi: Unlock before return on error path.

Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking wsi->wait_mutex.

Fixes: 4885e63a6d2 ("vulkan/wsi: implement missing wsi_register_device_event")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13698>

2 years agov3dv,v3d: don't store swizzle pointer in shader/pipeline keys
Iago Toral Quiroga [Wed, 10 Nov 2021 10:26:06 +0000 (11:26 +0100)]
v3dv,v3d: don't store swizzle pointer in shader/pipeline keys

We had been storing pointers to a driver owned swizzle table
rather than storing the actual swizzle value in various shader
and pipeline keys on both GL and Vulkan drivers.

This doesn't look very robust, particularly since we also
compute sha1 hashes from these values and we may store these
hashes to disk (for the disk cache).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13738>

2 years agovulkan, radv: Support backslash in ICD paths
James Park [Wed, 20 Oct 2021 21:42:32 +0000 (14:42 -0700)]
vulkan, radv: Support backslash in ICD paths

Vulkan loader wants backslash for paths on Windows. Need to jump through
hoops because Meson does not support backslashes in commands.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13461>

2 years agoradv/sqtt: fix GPU hangs when capturing from the compute queue
Samuel Pitoiset [Fri, 5 Nov 2021 19:18:42 +0000 (20:18 +0100)]
radv/sqtt: fix GPU hangs when capturing from the compute queue

S_008D20_FINISH_DONE is a mask of queues and 1 means "wait on the gfx
queue until the value is not 0" which can never happen when the driver
captures from compute. Instead, use the full mask of possible queues.

Cc: 21.3 mesa-stable
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/13694>

2 years agozink: update gfx pipeline shader module pointer even if the program is unchanged
Mike Blumenkrantz [Wed, 10 Nov 2021 00:44:48 +0000 (19:44 -0500)]
zink: update gfx pipeline shader module pointer even if the program is unchanged

this is used for pipeline comparisons, so it has to always be accurate

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>

2 years agozink: be more consistent about applying module hash for gfx pipeline
Mike Blumenkrantz [Wed, 10 Nov 2021 00:42:16 +0000 (19:42 -0500)]
zink: be more consistent about applying module hash for gfx pipeline

this was a little spaghetti-ish: the module hash was sometimes being applied
during module update, sometimes in draw during program create, and then also
it was removed when a shader unbind would cause the program to no longer be reachable

now things are more consistent:
* keep removing module hash when program becomes unreachable
* only apply module hash in draw during updates there

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>

2 years agozink: ci updates
Mike Blumenkrantz [Tue, 9 Nov 2021 21:35:28 +0000 (16:35 -0500)]
zink: ci updates

these don't spend forever in llvmpipe optimization passes anymore

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>

2 years agozink: always inline uniforms when running on a cpu driver
Mike Blumenkrantz [Tue, 9 Nov 2021 15:44:45 +0000 (10:44 -0500)]
zink: always inline uniforms when running on a cpu driver

the overhead from creating new inlined shader variants is likely to be less than
the time required to fully optimize and run those variants, so just
inline 100% of the time to cut down shader runs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>

2 years agozink: implement cs uniform inlining
Mike Blumenkrantz [Tue, 9 Nov 2021 15:07:49 +0000 (10:07 -0500)]
zink: implement cs uniform inlining

this implements shader variants for compute

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13727>

2 years agozink: radv ci updates for 1dshadow stuff
Mike Blumenkrantz [Tue, 9 Nov 2021 18:44:22 +0000 (13:44 -0500)]
zink: radv ci updates for 1dshadow stuff

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13583>

2 years agozink: add 1DShadow sampler handling for drivers (radv) that don't support it
Mike Blumenkrantz [Thu, 28 Oct 2021 19:17:11 +0000 (15:17 -0400)]
zink: add 1DShadow sampler handling for drivers (radv) that don't support it

some drivers won't create zs textures in any shape but 2D. this can be
handled instead by using 2D textures and then performing shader rewrites to
convert shadow samplers for 1D and 1DArray types to 2D/array

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13583>

2 years agoutil/xmlconfig: Allow DT_UNKNOWN files
Ryan Houdek [Sat, 6 Nov 2021 06:41:39 +0000 (23:41 -0700)]
util/xmlconfig: Allow DT_UNKNOWN files

Some filesystems don't fill in d_type in dirent. Resulting in
DT_UNKNOWN. Pass this entry through to the next step and use stat on the
full filepath to determine if it is a file.

sshfs is known to not fill d_type.
This resolves an issue where driconf living on an sshfs path wasn't
working.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13697>

2 years agoanv: Also disallow CCS_E for multi-LOD images
Jason Ekstrand [Tue, 26 Oct 2021 18:17:16 +0000 (13:17 -0500)]
anv: Also disallow CCS_E for multi-LOD images

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4616
Fixes: e3101c96bb64 ("anv/image: Disable multi-layer CCS_E on TGL+")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13680>

2 years agozink: add another compiler pass to convert 64bit vertex attribs
Mike Blumenkrantz [Mon, 25 Oct 2021 16:22:11 +0000 (12:22 -0400)]
zink: add another compiler pass to convert 64bit vertex attribs

gallium always provides uint types, so rewrite the shader to load a 64bit
attrib and then cast back to whatever it was before

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>

2 years agozink: simplify 64bit vertex attrib lowering
Mike Blumenkrantz [Mon, 25 Oct 2021 15:29:06 +0000 (11:29 -0400)]
zink: simplify 64bit vertex attrib lowering

this was a cool myfirstcompilerpass.exe but there's easier ways to do
things like this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>

2 years agozink: declare int/float size caps inline with type usage
Mike Blumenkrantz [Mon, 25 Oct 2021 15:06:19 +0000 (11:06 -0400)]
zink: declare int/float size caps inline with type usage

this is much more accurate than trying to use shader info

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13566>

2 years agoci: Add RADV to Android CI.
Bas Nieuwenhuizen [Wed, 15 Sep 2021 19:20:47 +0000 (21:20 +0200)]
ci: Add RADV to Android CI.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoutil: Add support for clang::fallthrough.
Bas Nieuwenhuizen [Tue, 9 Nov 2021 10:57:28 +0000 (11:57 +0100)]
util: Add support for clang::fallthrough.

Looks like the __attribute__ version doesn't work for C++ in the
Android build. Only found now because we don't enable
-Wimplicit-fallthrough by default project wide for C++. Only
ACO enables it.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoamd/addrlib: Ignore self-assign warnings.
Bas Nieuwenhuizen [Tue, 9 Nov 2021 10:35:39 +0000 (11:35 +0100)]
amd/addrlib: Ignore self-assign warnings.

There was a preference to not fix addrlib to make syncing with
upstream easier.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agomeson: Check arguments before adding.
Bas Nieuwenhuizen [Mon, 25 Oct 2021 22:27:53 +0000 (00:27 +0200)]
meson: Check arguments before adding.

-static-libstdc++ doesn't exist on the Android NDK, casuing all
later has_argument calls to return false even though the compiler
supports that argument.

Fixes: 3aee462781a "meson: add windows compiler checks and libraries"
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoaco: Remove useless sub-expr.
Bas Nieuwenhuizen [Mon, 25 Oct 2021 21:46:12 +0000 (23:46 +0200)]
aco: Remove useless sub-expr.

../src/amd/compiler/aco_instruction_selection.cpp:11915:83: error: expression result unused [-Werror,-Wunused-value]
      bld.vop2(aco_opcode::v_lshrrev_b32, fetch_index_def, div_info, instance_id).instr;

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoradv: Always use linker script when possible.
Bas Nieuwenhuizen [Sun, 3 Oct 2021 22:11:36 +0000 (00:11 +0200)]
radv: Always use linker script when possible.

Also without LLVM. Useful for Android with statically linked libelf.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoradv: Remove android build warning.
Bas Nieuwenhuizen [Sun, 3 Oct 2021 19:43:09 +0000 (21:43 +0200)]
radv: Remove android build warning.

Shadowed variable.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoamd/addrlib: Use alternative ADDR_C_ASSERT definition.
Bas Nieuwenhuizen [Mon, 4 Oct 2021 22:08:56 +0000 (00:08 +0200)]
amd/addrlib: Use alternative ADDR_C_ASSERT definition.

Copied from mesa util/macros.h Avoids unused-local-typedef warnings.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoci: Add libelf to the Android image.
Bas Nieuwenhuizen [Sun, 3 Oct 2021 15:34:29 +0000 (17:34 +0200)]
ci: Add libelf to the Android image.

Needed for RADV.

The mirror situation is kinda messy since the library is not
maintained and the original website is offline. Put a mirror
in that seemed to be used by some non-fdo CIs already, but
if reliability is still a concern we can discuss more mirrors.

There is an alternative implementation that is maintained in
elfutils, but that doesn't build on Android:
1) Doesn't build with clang (resolved in git, so next release probably)
2) Needs argp_parse with is a glibc specific feature.

There is a version of elfutils in AOSP but instead of fixing upstream
they just made an Android.bp that avoids building most stuff, which
isn't really usable here.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agoci: Bump libdrm for the android image.
Bas Nieuwenhuizen [Sun, 3 Oct 2021 13:04:11 +0000 (15:04 +0200)]
ci: Bump libdrm for the android image.

Seems I bumped the tag previously but not the script. Let us do
better this time.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

2 years agod3d12: Don't wait for GPU reads to do CPU reads
Jesse Natalie [Thu, 4 Nov 2021 00:05:05 +0000 (17:05 -0700)]
d3d12: Don't wait for GPU reads to do CPU reads

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13669>

2 years agod3d12: Don't wait for *all* batches when synchronizing a resource
Jesse Natalie [Wed, 3 Nov 2021 22:25:18 +0000 (15:25 -0700)]
d3d12: Don't wait for *all* batches when synchronizing a resource

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13669>

2 years agozink: update the CI lists for RADV
Samuel Pitoiset [Tue, 9 Nov 2021 15:23:58 +0000 (16:23 +0100)]
zink: update the CI lists for RADV

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13726>

2 years agovulkan/util: Move helper functions for depth/stencil images to vk_iamge
Hyunjun Ko [Mon, 27 Sep 2021 03:42:43 +0000 (03:42 +0000)]
vulkan/util: Move helper functions for depth/stencil images to vk_iamge

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12785>

2 years agoradv: Fix to honor the spec to get stencil layout.
Hyunjun Ko [Fri, 17 Sep 2021 02:10:22 +0000 (02:10 +0000)]
radv: Fix to honor the spec to get stencil layout.

Fixes: 3ef89b245e3e ("radv: fix separate depth/stencil layout in render pass")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12785>

2 years agoanv: Fix to honor the spec to get stencil layout.
Hyunjun Ko [Fri, 17 Sep 2021 02:07:14 +0000 (02:07 +0000)]
anv: Fix to honor the spec to get stencil layout.

Fixes: 28207669d0 ("anv: Fix stencil layout in render passes")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12785>

2 years agoradv/winsys: use same IBs padding as the kernel
Samuel Pitoiset [Mon, 8 Nov 2021 09:03:28 +0000 (10:03 +0100)]
radv/winsys: use same IBs padding as the kernel

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13703>

2 years agoac/rgp: add support for clock calibration
Samuel Pitoiset [Mon, 8 Nov 2021 13:28:33 +0000 (14:28 +0100)]
ac/rgp: add support for clock calibration

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13709>

2 years agoac/rgp: add support for queue event timings
Samuel Pitoiset [Fri, 5 Nov 2021 14:42:43 +0000 (15:42 +0100)]
ac/rgp: add support for queue event timings

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13709>

2 years agoradv: only emit PGM_LO for the vertex prolog
Samuel Pitoiset [Fri, 15 Oct 2021 10:18:43 +0000 (12:18 +0200)]
radv: only emit PGM_LO for the vertex prolog

Shaders are allocated in the 32-bit address space.

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/13551>

2 years agoac/rgp: fix alignment of code object records to follow the RGP spec
Samuel Pitoiset [Mon, 8 Nov 2021 14:01:10 +0000 (15:01 +0100)]
ac/rgp: fix alignment of code object records to follow the RGP spec

Should be aligned to 4 bytes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13711>

2 years agoradv: do not expose buffer features for depth/stencil formats
Samuel Pitoiset [Mon, 8 Nov 2021 07:50:14 +0000 (08:50 +0100)]
radv: do not expose buffer features for depth/stencil formats

The Vulkan spec got clarified recently and it's invalid (hw can support
it though). Fixes new CTS dEQP-VK.api.buffer.invalid_buffer_features.*.

Cc: 21.3 mesa-stable
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/13701>

2 years agoradv/sqtt: stop calling radv_cs_add_buffer() for the thread trace BO
Samuel Pitoiset [Mon, 8 Nov 2021 15:38:03 +0000 (16:38 +0100)]
radv/sqtt: stop calling radv_cs_add_buffer() for the thread trace BO

It's resident, so global.

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/13717>

2 years agoradv/sqtt: reserve a VMID for better profiling
Samuel Pitoiset [Fri, 5 Nov 2021 19:35:57 +0000 (20:35 +0100)]
radv/sqtt: reserve a VMID for better profiling

To avoid capturing other processes work. PAL always requests a VMID
when capturing with SQTT too.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5051
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/13695>

2 years agomeson: allow building with vulkan beta extensions enabled.
Dave Airlie [Thu, 4 Nov 2021 23:52:05 +0000 (09:52 +1000)]
meson: allow building with vulkan beta extensions enabled.

This is just a precursor to anyone enabling beta stuff later.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13685>

2 years agovulkan: add new image types undef beta define to switch statements.
Dave Airlie [Thu, 4 Nov 2021 23:51:39 +0000 (09:51 +1000)]
vulkan: add new image types undef beta define to switch statements.

This fixes some warnings when building with beta extensions enabled.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13685>

2 years agovulkan/include: import the video codec headers.
Dave Airlie [Thu, 4 Nov 2021 23:42:03 +0000 (09:42 +1000)]
vulkan/include: import the video codec headers.

I'd like to allow mesa builds with beta headers enabled,
this requires importing these.

v2: add video headers to khronos update

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13685>

2 years agoutil/libsync: Fix timeout handling if poll() wakes up early
Jesse Natalie [Tue, 2 Nov 2021 17:10:01 +0000 (10:10 -0700)]
util/libsync: Fix timeout handling if poll() wakes up early

Check how long poll waited, and use a smaller timeout on the next
iteration through the loop.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12268>

2 years agod3d12: Handle non-infinite wait timeouts > 49.7 days as infinite
Jesse Natalie [Tue, 2 Nov 2021 17:02:57 +0000 (10:02 -0700)]
d3d12: Handle non-infinite wait timeouts > 49.7 days as infinite

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12268>

2 years agod3d12: Fix Linux fence wait return value
Jesse Natalie [Sun, 8 Aug 2021 02:27:41 +0000 (19:27 -0700)]
d3d12: Fix Linux fence wait return value

zero is for success, nonzero is failure.

Fixes: 0b60d6a2 ("d3d12: Support Linux eventfds for fences")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12268>

2 years agoturnip: expose VK_KHR_driver_properties
Hyunjun Ko [Fri, 1 Oct 2021 02:00:11 +0000 (02:00 +0000)]
turnip: expose VK_KHR_driver_properties

Now that we have a conformance version to advertise, we can expose the
extension.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6251>

2 years agoturnip: Claim 1.2.7.1 CTS conformance.
Emma Anholt [Tue, 2 Nov 2021 20:55:29 +0000 (13:55 -0700)]
turnip: Claim 1.2.7.1 CTS conformance.

I submitted a conformance package for A618 today, so let's stop doing all
this warning about non-conformance.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6251>

2 years agoanv: Add an anv_bo_is_pinned helper
Jason Ekstrand [Thu, 4 Nov 2021 14:44:20 +0000 (09:44 -0500)]
anv: Add an anv_bo_is_pinned helper

If we ever want to stop depending on the EXEC_OBJECT_PINNED to detect
when something is pinned (like for VM_BIND), having a helper will reduce
the code churn.  This also gives us the opportunity to make it compile
away to true/false when we can figure it out just based on compile-time
GFX_VERx10.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Stop checking for HAS_EXEC_FENCE
Jason Ekstrand [Wed, 3 Nov 2021 12:32:37 +0000 (07:32 -0500)]
anv: Stop checking for HAS_EXEC_FENCE

Starting with 3b363d5b552d ("anv: Assume syncobj support"), we assume
syncobj support and no longer use the execbuf sync_file API directly so
there's no point in checking for it.  For the one physical device check
this deletes, we can assume has_exec_fence is always true because every
kernel with syncobj support also has sync_file.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Add a use_relocations physical device bit
Jason Ekstrand [Wed, 3 Nov 2021 12:23:22 +0000 (07:23 -0500)]
anv: Add a use_relocations physical device bit

This is more the bit of information we want to be carrying around
long-term.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Add a anv_use_relocations helper and use it
Jason Ekstrand [Tue, 2 Nov 2021 17:28:43 +0000 (12:28 -0500)]
anv: Add a anv_use_relocations helper and use it

Soft-pin is but one possible mechanism for pinning buffers.  We're
working on another called VM_BIND.  Most of the time, the real question
we're asking isn't "are we using soft-pin?" but rather "are we using
relocations?" because it's relocations, and not soft-pin, that cause us
all the extra pain we have to write code to handle.  This commit flips
the majority of those checks around.  The new helper is currently just
the exact inverse of the old use_softpin helper.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Int64 atomics don't need to depend on softpin
Jason Ekstrand [Tue, 2 Nov 2021 17:28:43 +0000 (12:28 -0500)]
anv: Int64 atomics don't need to depend on softpin

Ever since 04ccfeae98f2 ("anv: Require softpin on Gen8+"), softpin has
been a hard requirement on BDW+ so there's no reason for SKL+ code to
have a relocation path.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Always set bindless surface base on SKL+
Jason Ekstrand [Tue, 2 Nov 2021 17:25:13 +0000 (12:25 -0500)]
anv: Always set bindless surface base on SKL+

Ever since 04ccfeae98f2 ("anv: Require softpin on Gen8+"), softpin has
been a hard requirement on BDW+ so there's no reason for SKL+ code to
have a relocation path.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Add helpers in anv_allocator for mapping BOs
Jason Ekstrand [Sat, 30 Oct 2021 22:02:41 +0000 (17:02 -0500)]
anv: Add helpers in anv_allocator for mapping BOs

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Fix FlushMappedMemoryRanges for odd mmap offsets
Jason Ekstrand [Sat, 30 Oct 2021 21:57:02 +0000 (16:57 -0500)]
anv: Fix FlushMappedMemoryRanges for odd mmap offsets

When the client calls vkMapMemory(), we have to align the requested
offset down to the nearest page or else the map will fail.  On platforms
where we have DRM_IOCTL_I915_GEM_MMAP_OFFSET, we always map the whole
buffer.  In either case, the original map may start before the requested
offset and we need to take that into account when we clflush.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Add a couple more checks in MapMemory
Jason Ekstrand [Sat, 30 Oct 2021 21:32:47 +0000 (16:32 -0500)]
anv: Add a couple more checks in MapMemory

Reviwed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Add get/set_tiling helpers
Jason Ekstrand [Sat, 30 Oct 2021 20:47:38 +0000 (15:47 -0500)]
anv: Add get/set_tiling helpers

These are only required WSI cases and Android but still better to have
them in a central place.

Reviwed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Rename anv_bo::index to exec_obj_index
Jason Ekstrand [Sat, 30 Oct 2021 20:30:37 +0000 (15:30 -0500)]
anv: Rename anv_bo::index to exec_obj_index

This is more descriptive of its very specific purpose.

Reviwed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv/allocator: Use anv_device_release_bo in anv_block_pool_finish
Jason Ekstrand [Sat, 30 Oct 2021 20:28:53 +0000 (15:28 -0500)]
anv/allocator: Use anv_device_release_bo in anv_block_pool_finish

This is left-over from the days where we didn't use BO pointers and had
them embedded and we didn't have a nice allocation API.  Now that block
pools get their memory via anv_device_alloc_bo(), they really should be
using anv_device_release_bo() to tear it down.  This is equivalent in
this case because anv_device_release_bo() does the following:

 1. Decrements refcount.  The pool holds the only reference so it will
    proceed onto the clean-up steps

 2. Unmaps it, if needed.  This is the same as the tear-down code today
    except anv_device_release_bo() will avoid doing an unmap if it's
    been created via userptr.  The current code probably unmaps the
    userptr which is wrong but pretty harmless since it happens on a
    tear-down path.

 3. Unmaps the CCS range from the AUX-TT, if any.  There is none, so
    this is a no-op.

 4. Frees the VA range if it's not pinned and doesn't have a fixed VA
    assignment.  These BOs always either have a fixed VA range (softpin)
    or aren't pinned (relocations).

 5. Closes the GEM handle.  Same as the current code.

In short, anything created using the BO API should probably be destroyed
that way.  We were getting away with hand-rolling it because this is a
simple case.  Why did we do it this way?  It dates back to before the
more formlized BO cache and BO API in ANV.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv: Pull aperture size from devinfo
Jason Ekstrand [Sat, 30 Oct 2021 19:04:30 +0000 (14:04 -0500)]
anv: Pull aperture size from devinfo

Reviwed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoanv/allocator: Add a couple of helpers
Jason Ekstrand [Thu, 30 Jan 2020 22:07:45 +0000 (16:07 -0600)]
anv/allocator: Add a couple of helpers

The anv_bo_finish helper is explicitly supposed to be capable of tearing
down partially completed BOs as long as the flag and metadata parameters
are set correctly.

Reviwed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13610>

2 years agoci/windows: Add validation tests for spriv_to_dxil
Enrico Galli [Wed, 3 Nov 2021 18:36:01 +0000 (11:36 -0700)]
ci/windows: Add validation tests for spriv_to_dxil

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13655>

2 years agomicrosoft/spirv_to_dxil: Add DXIL validation to spirv2dxil
Enrico Galli [Wed, 3 Nov 2021 18:18:30 +0000 (11:18 -0700)]
microsoft/spirv_to_dxil: Add DXIL validation to spirv2dxil

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13655>

2 years agod3d12: Fully init primconvert config
Jesse Natalie [Mon, 8 Nov 2021 20:41:39 +0000 (12:41 -0800)]
d3d12: Fully init primconvert config

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Hook up threaded context
Jesse Natalie [Wed, 3 Nov 2021 20:12:42 +0000 (13:12 -0700)]
d3d12: Hook up threaded context

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Pass explicit context to pre/post draw surface blits
Jesse Natalie [Thu, 4 Nov 2021 17:15:56 +0000 (10:15 -0700)]
d3d12: Pass explicit context to pre/post draw surface blits

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Use thread safe slab allocators in transfer_map handling
Jesse Natalie [Wed, 3 Nov 2021 17:32:04 +0000 (10:32 -0700)]
d3d12: Use thread safe slab allocators in transfer_map handling

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Inherit from threaded_transfer
Jesse Natalie [Wed, 3 Nov 2021 17:27:09 +0000 (10:27 -0700)]
d3d12: Inherit from threaded_transfer

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Resources inherit from threaded_resource
Jesse Natalie [Wed, 3 Nov 2021 17:23:14 +0000 (10:23 -0700)]
d3d12: Resources inherit from threaded_resource

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agod3d12: Inherit from threaded_query
Jesse Natalie [Wed, 3 Nov 2021 17:20:44 +0000 (10:20 -0700)]
d3d12: Inherit from threaded_query

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agou_threaded_context: Support including from C++
Jesse Natalie [Wed, 3 Nov 2021 17:22:56 +0000 (10:22 -0700)]
u_threaded_context: Support including from C++

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Ol\9aák <marek.olsak@amd.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>

2 years agoir3/spill: Initial implementation of rematerialization
Connor Abbott [Mon, 11 Oct 2021 15:02:28 +0000 (17:02 +0200)]
ir3/spill: Initial implementation of rematerialization

This only handles moves from immedates/constants. The next step would be
to rematerialize ALU instructions whose sources are available.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13650>

2 years agoir3/spill: Mark root as non-spillable after inserting
Connor Abbott [Sun, 31 Oct 2021 15:01:02 +0000 (16:01 +0100)]
ir3/spill: Mark root as non-spillable after inserting

We have to mark the root as non-spillable in case the interval is the
child of some other interval, but we can't know whether it's the child
of some other interval until it's been inserted. Move the setting of
cant_spill below the insertion. This prevents us from using a bogus
parent value.

Fixes: 613eaac7b53 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13650>

2 years agoanv,blorp,iris: Set MOCS for COMPUTE_WALKER post-sync operation
Jordan Justen [Mon, 1 Nov 2021 06:22:42 +0000 (23:22 -0700)]
anv,blorp,iris: Set MOCS for COMPUTE_WALKER post-sync operation

We don't current enable post sync operations, but it is probably
better to set them to "internal" MOCS than to remove the non-zero
checking for this genxml field.

Reworks:
 * Fix COMPUTE_WALKER in cmd_buffer_trace_rays (s-b Jason)

Fixes: 7b78b2fcac6 ("intel/genxml: Assert that all MOCS fields are non-zero on Gfx7+")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13624>

2 years agointel/genxml/125: Update COMPUTE_WALKER POSTSYNC_DATA struct
Jordan Justen [Mon, 1 Nov 2021 07:24:51 +0000 (00:24 -0700)]
intel/genxml/125: Update COMPUTE_WALKER POSTSYNC_DATA struct

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13624>