platform/upstream/mesa.git
2 years agoturnip: Implement VK_EXT_physical_device_drm
Danylo Piliaiev [Thu, 10 Feb 2022 13:35:59 +0000 (15:35 +0200)]
turnip: Implement VK_EXT_physical_device_drm

Copied from ANV and V3DV.

v1. Fix a build error for clang "unannotated fall-through between switch labels"
( Hyunjun Ko <zzoon.ko@igalia.com> )

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14971>

2 years agoradeonsi/drirc: use force_gl_vendor for Maya
Pierre-Eric Pelloux-Prayer [Thu, 24 Feb 2022 08:59:51 +0000 (09:59 +0100)]
radeonsi/drirc: use force_gl_vendor for Maya

Otherwise OpenCL initialization fails with "unknown vendor id 0".

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

2 years agonouveau: add dEQP/GLCTS run failure info for GF108/GT215
Ilia Mirkin [Mon, 31 Jan 2022 05:45:52 +0000 (00:45 -0500)]
nouveau: add dEQP/GLCTS run failure info for GF108/GT215

I happened to have these plugged in. Ran them against mesa 21.3 and
recent VK-GL-CTS tree (shortly after vulkan-cts-1.2.8).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14797>

2 years agoRevert "anv: Require the local heap for CCS on XeHP"
Nanley Chery [Thu, 17 Feb 2022 18:34:17 +0000 (10:34 -0800)]
Revert "anv: Require the local heap for CCS on XeHP"

This reverts commit 382f6ccda8869f72134dbfa9c3cc68a229e01138.

The spec requires that all color images created with the same tiling
(and a few other properties) support the same memoryTypeBits. So this
wasn't a valid change. It also wasn't necessary - we already have a
mechanism in anv_BindImageMemory2 for disabling compression if the BO
doesn't support it.

With this, XeHP passes the tests in
dEQP-VK.memory.requirements.*tiling_optimal

Fixes: 382f6ccd ("anv: Require the local heap for CCS on XeHP")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>

2 years agoanv: Add a perf warning in anv_BindImageMemory2
Nanley Chery [Fri, 18 Feb 2022 00:20:00 +0000 (16:20 -0800)]
anv: Add a perf warning in anv_BindImageMemory2

It reports: "BO lacks implicit CCS. Disabling the CCS aux usage."

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>

2 years agoanv: Fall back to HiZ when disabling CCS on HiZ+CCS
Nanley Chery [Thu, 17 Feb 2022 18:26:34 +0000 (10:26 -0800)]
anv: Fall back to HiZ when disabling CCS on HiZ+CCS

When an image configured for HIZ_CCS/HIZ_CCS_WT is bound to a BO lacking
implicit CCS, we disable any compression it may have had. Such images
are still compatible with ISL_AUX_USAGE_HIZ however. Fall back to that
aux usage to retain the performance benefit.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>

2 years agoanv: Don't disable HiZ/MCS in anv_BindImageMemory2
Nanley Chery [Thu, 17 Feb 2022 18:26:34 +0000 (10:26 -0800)]
anv: Don't disable HiZ/MCS in anv_BindImageMemory2

When an image is bound to a BO lacking implicit CCS, we disable any
compression it may have had. This is unnecessary in the cases where the
compression type doesn't depend on the BO having implicit CCS support.
Avoid this disabling for ISL_AUX_USAGE_MCS and ISL_AUX_USAGE_HIZ.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15068>

2 years agoir3: Use isam for bindless images
Connor Abbott [Mon, 21 Feb 2022 18:25:40 +0000 (19:25 +0100)]
ir3: Use isam for bindless images

In the bindless case, we don't have to keep any shadow descriptors and
can just reuse the IBO descriptor as a texture descriptor. Now that
we're emitting the swizzle we can just flip this on.

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

2 years agotu: Call nir_opt_access
Connor Abbott [Mon, 21 Feb 2022 18:24:39 +0000 (19:24 +0100)]
tu: Call nir_opt_access

This adds some small optimizations, and enables lowering to isam in more
cases where the app didn't specify readonly.

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

2 years agoir3/nir: Fix 1d array readonly images
Connor Abbott [Tue, 22 Feb 2022 10:35:55 +0000 (11:35 +0100)]
ir3/nir: Fix 1d array readonly images

ncoords includes the array index, and the NIR source has the array index
as its last component, so we have to insert the extra y coordinate in
the middle in this case.

Fixes: 0bb0cac ("freedreno/ir3: handle image buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>

2 years agoir3: Don't always set bindless_tex with readonly images
Connor Abbott [Mon, 21 Feb 2022 18:18:19 +0000 (19:18 +0100)]
ir3: Don't always set bindless_tex with readonly images

Fixes: 274f381 ("ir3: Plumb through bindless support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>

2 years agofreedreno/fdl: Set swizzle on storage descriptor
Connor Abbott [Mon, 21 Feb 2022 18:12:03 +0000 (19:12 +0100)]
freedreno/fdl: Set swizzle on storage descriptor

It appears to be unused by ldib/stib, but it will let us use isam on IBO
descriptors for bindless images.

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

2 years agofreedreno: Replace A6XX_IBO with A6XX_TEX_CONST
Connor Abbott [Mon, 21 Feb 2022 18:05:52 +0000 (19:05 +0100)]
freedreno: Replace A6XX_IBO with A6XX_TEX_CONST

Since these were reverse-engineered, it's become clear that IBO
descriptors are just a subset of texture descriptors, and bindless reads
of readonly images actually use isam on the IBO descriptor, further
confirming that the two are always compatible, even if not all of the
texture fields exist for IBOs. It's pointless to have a separate type
for IBOs, and just leads to things getting out-of-sync unnecessarily
which has already happened. Just remove it and use TEX_CONST insted.

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

2 years agoir3: Use CAN_REORDER instead of NON_WRITEABLE
Connor Abbott [Mon, 21 Feb 2022 17:42:49 +0000 (18:42 +0100)]
ir3: Use CAN_REORDER instead of NON_WRITEABLE

CAN_REORDER takes volatile into account, and is closer to what we
actually require to use texture instructions, which is that we can
arbitrarily reorder loads.

Fixes: aa93896 ("freedreno/ir3: adjust condition for when to use ldib")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>

2 years agoturnip: Set drmFormatModifierTilingFeatures
Danylo Piliaiev [Tue, 15 Feb 2022 15:08:14 +0000 (17:08 +0200)]
turnip: Set drmFormatModifierTilingFeatures

From Vulkan spec for VkDrmFormatModifierProperties2EXT:

 "drmFormatModifierTilingFeatures is a bitmask of VkFormatFeatureFlagBits
  that are supported by any image created with format and drmFormatModifier."

 "The returned drmFormatModifierTilingFeatures must contain at least one bit."

 "Therefore, if the returned drmFormatModifier is DRM_FORMAT_MOD_LINEAR,
  then drmFormatModifierPlaneCount must equal the format planecount, and
  drmFormatModifierTilingFeatures must be identical to the
  VkFormatProperties2::linearTilingFeatures returned in the same pNext chain."

Relevant tests: dEQP-VK.drm_format_modifiers.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15032>

2 years agozink: add layer asserts for 3d imageview creation
Mike Blumenkrantz [Fri, 18 Feb 2022 14:44:45 +0000 (09:44 -0500)]
zink: add layer asserts for 3d imageview creation

make sure there's no other mishaps here in the future

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

2 years agozink: more accurately clamp 3d fb surfaces to corresponding 2d target
Mike Blumenkrantz [Tue, 22 Feb 2022 21:10:05 +0000 (16:10 -0500)]
zink: more accurately clamp 3d fb surfaces to corresponding 2d target

if more than 1 layer is being bound, this is an array, otherwise it's just
regular 2d

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

2 years agozink: clamp 3d/array shader images to lower dimensionality using layer counts
Mike Blumenkrantz [Fri, 18 Feb 2022 14:43:24 +0000 (09:43 -0500)]
zink: clamp 3d/array shader images to lower dimensionality using layer counts

this creates the view type expected by the shader instead of doing weird stuff
like trying to create a 3D imageview with layers > 1

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

2 years agozink: directly create surfaces for shader images
Mike Blumenkrantz [Fri, 18 Feb 2022 14:42:25 +0000 (09:42 -0500)]
zink: directly create surfaces for shader images

avoid the implicit clamping of fb surfaces in zink_create_surface()
in order to provide more granularity

no functional changes

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

2 years agozink: restrict clear flushing on sampler/image bind to compute binds
Mike Blumenkrantz [Tue, 8 Feb 2022 16:03:48 +0000 (11:03 -0500)]
zink: restrict clear flushing on sampler/image bind to compute binds

this is otherwise going to be handled on the next renderpass start

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

2 years agozink: use VK_EXT_depth_clip_control when available
Mike Blumenkrantz [Wed, 23 Feb 2022 15:59:12 +0000 (10:59 -0500)]
zink: use VK_EXT_depth_clip_control when available

this saves a few ALUs in vertex stages

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

2 years agoglx/drisw: handle GL_RESET_NOTIFICATION_STRATEGY
Mike Blumenkrantz [Thu, 17 Feb 2022 15:36:05 +0000 (10:36 -0500)]
glx/drisw: handle GL_RESET_NOTIFICATION_STRATEGY

fixes (llvmpipe):
KHR-NoContext.gl45.robustness.lose_context_on_reset

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

2 years agozink: update psiz handling to fix xfb output
Mike Blumenkrantz [Thu, 3 Feb 2022 15:22:34 +0000 (10:22 -0500)]
zink: update psiz handling to fix xfb output

now when gl_PointSize and gl_PointSizeMESA are both present, the former
will be used for xfb with a new location and the latter will be
exported by the shader

fixes (zink):
GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_builtins

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

2 years agonir/lower_psiz_mov: stop clobbering existing exports
Mike Blumenkrantz [Thu, 3 Feb 2022 15:21:19 +0000 (10:21 -0500)]
nir/lower_psiz_mov: stop clobbering existing exports

for this pass to work with xfb, the original value in the shader must be
preserved when xfb is active, and the driver must export only the newly
created output

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

2 years agonir/lower_psiz: create the store instruction more accurately
Mike Blumenkrantz [Tue, 1 Feb 2022 21:53:20 +0000 (16:53 -0500)]
nir/lower_psiz: create the store instruction more accurately

creating this at the start of the shader means it will get optimized out
when the pass is used to overwrite existing psiz values, and creating it
at the end means it will get optimized out in geometry shaders, so instead
just walk the instructions and create another store right after the existing one

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

2 years agoutil: use correct type in sysctl argument
Jonathan Gray [Mon, 31 Aug 2020 03:00:53 +0000 (13:00 +1000)]
util: use correct type in sysctl argument

Fixes build on OpenBSD/macppc powerpc

error: incompatible pointer types passing 'int *' to parameter of type 'size_t *'
    (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]

Fixes: 01bd21eef8f ("gallium: Import Dennis Smit cpu detection code.")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>

2 years agoutil: fix build with clang 10 on mips64
Jonathan Gray [Tue, 4 Aug 2020 08:48:34 +0000 (18:48 +1000)]
util: fix build with clang 10 on mips64

On mips64, the compiler does not allow use of non-zero argument with
__builtin_frame_address(). However, the returned frame address is only
used when PIPE_ARCH_X86 is defined. The compile error can be avoided
by making #ifdef PIPE_ARCH_X86 cover the getting of frame address too.

The argument checking of __builtin_frame_address() has been present
as a debug assert in clang 8. In clang 10, there is a proper runtime
check for the argument. This is why the build has not failed before.

Fixes: dc94a0506f1 ("gallium: Do not add -Wframe-address option for gcc <= 4.4.")
from Visa Hankala

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>

2 years agoutil/u_atomic: fix build on clang archs without 64-bit atomics
Jonathan Gray [Mon, 15 Jun 2020 04:40:06 +0000 (14:40 +1000)]
util/u_atomic: fix build on clang archs without 64-bit atomics

Make this build on clang architectures that don't have 64-bit atomic
instructions.  Clang doesn't allow redeclaration (and therefore
redefinition) of the __sync_* builtins.  Use #pragma redefine_extname
to work around that restriction.  Clang also turns __sync_add_and_fetch
into __sync_fetch_and_add (and __sync_sub_and_fetch into
__sync_fetch_and_sub) in certain cases, so provide these functions as
well.

Fixes: a6a38a038bd ("util/u_atomic: provide 64bit atomics where they're missing")
patch from Mark Kettenis

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>

2 years agoRevert "CI: Disable Panfrost T720 jobs"
Daniel Stone [Mon, 28 Feb 2022 14:07:23 +0000 (14:07 +0000)]
Revert "CI: Disable Panfrost T720 jobs"

This reverts commit 35209b94a6c7d88fb67b6446fda8f8daf556c911.

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

2 years agoRevert "CI: Disable panfrost-t760"
Daniel Stone [Mon, 28 Feb 2022 14:07:21 +0000 (14:07 +0000)]
Revert "CI: Disable panfrost-t760"

This reverts commit b9b444e0b8bc318cea2a93ec04b0a383c444180e.

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

2 years agopanfrost: fix segfault in pandecode
Adrián Larumbe [Mon, 28 Feb 2022 05:47:04 +0000 (05:47 +0000)]
panfrost: fix segfault in pandecode

The structure wrapped around the rb tree node was being freed, but not the node
itself, which caused a segmentation fault when accessing its parent node.

Add rb tree node remove call to fix it.

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

2 years agoCI: Disable Panfrost T720 jobs
Daniel Stone [Mon, 28 Feb 2022 07:06:20 +0000 (07:06 +0000)]
CI: Disable Panfrost T720 jobs

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15189>

2 years agoCI: Disable panfrost-t760
Daniel Stone [Sun, 27 Feb 2022 20:26:17 +0000 (20:26 +0000)]
CI: Disable panfrost-t760

The DUTs are extremely tempremental for some reason.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15186>

2 years agodocs: update irc channel
Erik Faye-Lund [Wed, 17 Nov 2021 14:47:18 +0000 (15:47 +0100)]
docs: update irc channel

According to the virglrenderer README.rst[1] file, #virgil3d has moved
from FreeNode to OFTC. Let's update our link as well.

While we're at it, use a proper link as well.

[1]: https://gitlab.freedesktop.org/virgl/virglrenderer/-/blob/master/README.rst

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: mark virgl gles2 renderer as done
Erik Faye-Lund [Wed, 17 Nov 2021 12:10:33 +0000 (13:10 +0100)]
docs: mark virgl gles2 renderer as done

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: update virgl description
Erik Faye-Lund [Wed, 17 Nov 2021 11:54:07 +0000 (12:54 +0100)]
docs: update virgl description

Since this text was written, VirGL has become a shipping, production
quality solution. It's no longer a research project. Let's update the
text to reflect that.

While we're at it, let's drop the project from the page title, as this
is no longer the docs for the entire project.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: link to gitlab instead of cgit
Erik Faye-Lund [Wed, 17 Nov 2021 12:11:38 +0000 (13:11 +0100)]
docs: link to gitlab instead of cgit

While we're at it, let's update the releasing article as well.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: master -> main
Erik Faye-Lund [Wed, 17 Nov 2021 12:08:12 +0000 (13:08 +0100)]
docs: master -> main

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: Virgl -> VirGL
Erik Faye-Lund [Wed, 17 Nov 2021 12:01:21 +0000 (13:01 +0100)]
docs: Virgl -> VirGL

The name used for this project is usually stylized as VirGL instead of
"Virgil" or "Virgil 3D" these days. Let's be consistent.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: qemu -> QEMU
Erik Faye-Lund [Wed, 17 Nov 2021 11:48:45 +0000 (12:48 +0100)]
docs: qemu -> QEMU

This is the official syling of the name, let's use that instead of
lower-case for consistensy.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: add missing get
Erik Faye-Lund [Wed, 17 Nov 2021 11:55:17 +0000 (12:55 +0100)]
docs: add missing get

This sentence doesn't make sense without a 'get' or something similar
here.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: remove a few repeated words
Erik Faye-Lund [Wed, 17 Nov 2021 11:22:50 +0000 (12:22 +0100)]
docs: remove a few repeated words

It doesn't make sense to repeat these, let's fix that.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agodocs: import virgl docs
Erik Faye-Lund [Wed, 17 Nov 2021 11:16:05 +0000 (12:16 +0100)]
docs: import virgl docs

The docuentation has been imported verbatim from
https://virgil3d.github.io/.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13836>

2 years agozink: don't free non-fbfetch dsl structs when switching to fbfetch
Mike Blumenkrantz [Wed, 23 Feb 2022 18:46:30 +0000 (13:46 -0500)]
zink: don't free non-fbfetch dsl structs when switching to fbfetch

this triggers invalid access when recycling in-flight non-fbfetch sets

cc: mesa-stable

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

2 years agozink: free push descriptor pools on deinit
Mike Blumenkrantz [Wed, 23 Feb 2022 17:36:30 +0000 (12:36 -0500)]
zink: free push descriptor pools on deinit

these are owned by the context, so destroy them when the context
requests destruction

cc: mesa-stable

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

2 years agozink: fix cached descriptor set invalidation for array bindings
Mike Blumenkrantz [Wed, 23 Feb 2022 17:31:40 +0000 (12:31 -0500)]
zink: fix cached descriptor set invalidation for array bindings

need to iterate over the descriptors in the binding to invalidate the whole
thing here

=================================================================
==546534==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a0000ae6c0 at pc 0x7fe20e26fd9d bp 0x7ffd92be6bc0 sp 0x7ffd92be6bb8
READ of size 8 at 0x61a0000ae6c0 thread T0
    #0 0x7fe20e26fd9c in zink_descriptor_set_refs_clear ../src/gallium/drivers/zink/zink_descriptors.c:950
    #1 0x7fe20e401304 in zink_destroy_surface ../src/gallium/drivers/zink/zink_surface.c:340
    #2 0x7fe20e21311b in zink_surface_reference ../src/gallium/drivers/zink/zink_surface.h:106
    #3 0x7fe20e21a5b9 in zink_sampler_view_destroy ../src/gallium/drivers/zink/zink_context.c:835
    #4 0x7fe20c41d35f in tc_sampler_view_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:1848
    #5 0x7fe20e210ff7 in pipe_sampler_view_reference ../src/gallium/auxiliary/util/u_inlines.h:216
    #6 0x7fe20e22d592 in zink_set_sampler_views ../src/gallium/drivers/zink/zink_context.c:1532
    #7 0x7fe20c41a3d8 in tc_call_set_sampler_views ../src/gallium/auxiliary/util/u_threaded_context.c:1393
    #8 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #9 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #10 0x7fe20c42b728 in tc_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:4250
    #11 0x7fe20b65176a in st_destroy_context_priv ../src/mesa/state_tracker/st_context.c:387
    #12 0x7fe20b65669f in st_destroy_context ../src/mesa/state_tracker/st_context.c:1009
    #13 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #14 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #15 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #16 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #17 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #18 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #19 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384
    #20 0x41b88a in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:734
    #21 0x41b8e9 in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:735
    #22 0x2323aa7 in deqp::gles31::Context::destroyRenderContext() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:77
    #23 0x2323969 in deqp::gles31::Context::~Context() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:55
    #24 0x232278e in deqp::gles31::TestPackage::deinit() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestPackage.cpp:102
    #25 0x2c866c2 in tcu::DefaultHierarchyInflater::leaveTestPackage(tcu::TestPackage*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:75
    #26 0x2c87058 in tcu::TestHierarchyIterator::next() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:252
    #27 0x2c365da in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:122
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7fe2263e160b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x61a0000ae6c0 is located 64 bytes inside of 1328-byte region [0x61a0000ae680,0x61a0000aebb0)
freed by thread T0 here:
    #0 0x7fe226cb6627 in free (/usr/lib64/libasan.so.6+0xae627)
    #1 0x7fe20aab1751 in unsafe_free ../src/util/ralloc.c:302
    #2 0x7fe20aab16c8 in unsafe_free ../src/util/ralloc.c:295
    #3 0x7fe20aab13c3 in ralloc_free ../src/util/ralloc.c:265
    #4 0x7fe20e269234 in descriptor_pool_free ../src/gallium/drivers/zink/zink_descriptors.c:286
    #5 0x7fe20e26937d in descriptor_pool_delete ../src/gallium/drivers/zink/zink_descriptors.c:296
    #6 0x7fe20e26ff53 in zink_descriptor_pool_reference ../src/gallium/drivers/zink/zink_descriptors.c:967
    #7 0x7fe20e270db2 in zink_descriptor_program_deinit ../src/gallium/drivers/zink/zink_descriptors.c:1071
    #8 0x7fe20e3b6536 in zink_destroy_gfx_program ../src/gallium/drivers/zink/zink_program.c:695
    #9 0x7fe20e1eaaf9 in zink_gfx_program_reference ../src/gallium/drivers/zink/zink_program.h:242
    #10 0x7fe20e20d386 in zink_shader_free ../src/gallium/drivers/zink/zink_compiler.c:2099
    #11 0x7fe20e3b9f0b in zink_delete_shader_state ../src/gallium/drivers/zink/zink_program.c:1074
    #12 0x7fe20c3e29ad in util_shader_reference ../src/gallium/auxiliary/util/u_live_shader_cache.c:188
    #13 0x7fe20e3ba11e in zink_delete_cached_shader_state ../src/gallium/drivers/zink/zink_program.c:1093
    #14 0x7fe20c41709e in tc_call_delete_fs_state ../src/gallium/auxiliary/util/u_threaded_context.c:998
    #15 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fe20c423683 in tc_flush ../src/gallium/auxiliary/util/u_threaded_context.c:3003
    #18 0x7fe20b62d996 in st_flush ../src/mesa/state_tracker/st_cb_flush.c:60
    #19 0x7fe20b62dbe3 in st_glFlush ../src/mesa/state_tracker/st_cb_flush.c:94
    #20 0x7fe20ae4bded in _mesa_make_current ../src/mesa/main/context.c:1493
    #21 0x7fe20ae49702 in _mesa_free_context_data ../src/mesa/main/context.c:1187
    #22 0x7fe20b65668b in st_destroy_context ../src/mesa/state_tracker/st_context.c:1005
    #23 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #24 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #25 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #26 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #27 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #28 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #29 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384

previously allocated by thread T0 here:
    #0 0x7fe226cb691f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fe20aab0c81 in ralloc_size ../src/util/ralloc.c:120
    #2 0x7fe20aab0e33 in rzalloc_size ../src/util/ralloc.c:153
    #3 0x7fe20aab12c8 in rzalloc_array_size ../src/util/ralloc.c:233
    #4 0x7fe20e26c76d in allocate_desc_set ../src/gallium/drivers/zink/zink_descriptors.c:657
    #5 0x7fe20e26e9cb in zink_descriptor_set_get ../src/gallium/drivers/zink/zink_descriptors.c:840
    #6 0x7fe20e2747aa in zink_descriptors_update ../src/gallium/drivers/zink/zink_descriptors.c:1424
    #7 0x7fe20e36fc48 in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:788
    #8 0x7fe20e29166d in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #9 0x7fe20c424982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #10 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #11 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #12 0x7fe20c41f7a9 in tc_texture_map ../src/gallium/auxiliary/util/u_threaded_context.c:2279
    #13 0x7fe20b630757 in pipe_texture_map_3d ../src/gallium/auxiliary/util/u_inlines.h:572
    #14 0x7fe20b6341f6 in st_ReadPixels ../src/mesa/state_tracker/st_cb_readpixels.c:546
    #15 0x7fe20b42fea7 in read_pixels ../src/mesa/main/readpix.c:1178
    #16 0x7fe20b42fea7 in _mesa_ReadnPixelsARB ../src/mesa/main/readpix.c:1195
    #17 0x7fe20b42ffc0 in _mesa_ReadPixels ../src/mesa/main/readpix.c:1210
    #18 0x2a6d094 in glu::readPixels(glu::RenderContext const&, int, int, tcu::PixelBufferAccess const&) /home/zmike/src/VK-GL-CTS/framework/opengl/gluPixelTransfer.cpp:61
    #19 0x29eaa06 in deqp::gls::ShaderExecUtil::FragmentOutExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:677
    #20 0x25a600b in iterate /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fOpaqueTypeIndexingTests.cpp:585
    #21 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #22 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #23 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #24 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #25 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #26 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

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

2 years agozink: set shader key size to 0 for non-generated tcs
Mike Blumenkrantz [Wed, 23 Feb 2022 16:05:15 +0000 (11:05 -0500)]
zink: set shader key size to 0 for non-generated tcs

Test case 'dEQP-GLES31.functional.shaders.builtin_functions.common.modf.vec2_mediump_tess_control'..
=================================================================
==539161==ERROR: AddressSanitizer: unknown-crash on address 0x60400008cfef at pc 0x7fffdb47b2d6 bp 0x7fffffffa490 sp 0x7fffffffa488
READ of size 4 at 0x60400008cfef thread T0
    #0 0x7fffdb47b2d5 in XXH_read32 ../src/util/xxhash.h:531
    #1 0x7fffdb47bfbf in XXH_readLE32 ../src/util/xxhash.h:608
    #2 0x7fffdb47bfbf in XXH_readLE32_align ../src/util/xxhash.h:620
    #3 0x7fffdb47bfbf in XXH32_endian_align ../src/util/xxhash.h:797
    #4 0x7fffdb47bfbf in XXH32 ../src/util/xxhash.h:831
    #5 0x7fffdb480b49 in _mesa_hash_data ../src/util/hash_table.c:631
    #6 0x7fffded8c10a in shader_module_hash ../src/gallium/drivers/zink/zink_program.c:82
    #7 0x7fffded8cad8 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:144
    #8 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #9 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #10 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #11 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #12 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #13 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #14 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #15 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #18 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #19 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #20 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #21 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #22 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #23 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #24 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #25 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #26 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #27 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7ffff6dbc60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x60400008cff1 is located 0 bytes to the right of 33-byte region [0x60400008cfd0,0x60400008cff1)
allocated by thread T0 here:
    #0 0x7ffff769191f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fffded8c608 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:115
    #2 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #3 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #4 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #5 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #6 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #7 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #8 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #9 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #10 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #11 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #12 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #13 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #14 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #15 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #16 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #17 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #18 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #19 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #20 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #21 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #22 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #23 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #24 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

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

2 years agozink: skip extra descriptor lookups for images during barrier updates
Mike Blumenkrantz [Tue, 15 Feb 2022 14:15:57 +0000 (09:15 -0500)]
zink: skip extra descriptor lookups for images during barrier updates

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

2 years agozink: add layout to sampler descriptor hash
Mike Blumenkrantz [Tue, 15 Feb 2022 14:15:22 +0000 (09:15 -0500)]
zink: add layout to sampler descriptor hash

this can have more than one value, so avoid stale cache entries

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

2 years agozink: fix typo for image descriptor rebinds
Mike Blumenkrantz [Tue, 15 Feb 2022 14:14:54 +0000 (09:14 -0500)]
zink: fix typo for image descriptor rebinds

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

2 years agozink: update descriptor refs after starting renderpass
Mike Blumenkrantz [Mon, 7 Feb 2022 19:33:02 +0000 (14:33 -0500)]
zink: update descriptor refs after starting renderpass

this ensures that swapchain images will have been acquired before potentially
accessing swapchain images bound as descriptors

fixes caselist like:
dEQP-GLES31.functional.fbo.color.texcubearray.r8ui
dEQP-GLES31.functional.primitive_bounding_box.blit_fbo.blit_default_to_fbo

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

2 years agoradv: use MAJOR_IN_SYSMACROS for sysmacros.h include
Jonathan Gray [Wed, 20 Oct 2021 01:41:12 +0000 (12:41 +1100)]
radv: use MAJOR_IN_SYSMACROS for sysmacros.h include

fixes build on OpenBSD
../src/amd/vulkan/radv_device.c:35:10: fatal error: 'sys/sysmacros.h' file not found

Fixes: 7aaa54feb53 ("radv: implement VK_EXT_physical_device_drm")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>

2 years agoutil: fix util_cpu_detect_once() build on OpenBSD
Jonathan Gray [Wed, 20 Oct 2021 00:58:01 +0000 (11:58 +1100)]
util: fix util_cpu_detect_once() build on OpenBSD

Correct type for sysctl argument to fix the build.

../src/util/u_cpu_detect.c:631:29: error: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
      sysctl(mib, 2, &ncpu, &len, NULL, 0);
                            ^~~~

Fixes: 5623c75e40b ("util: Fix setting nr_cpus on some BSD variants")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>

2 years agoutil: fix u_print.cpp build on OpenBSD
Jonathan Gray [Wed, 20 Oct 2021 00:50:57 +0000 (11:50 +1100)]
util: fix u_print.cpp build on OpenBSD

move include so va_list will be picked up via stdarg.h

In file included from ../src/util/u_printf.cpp:24:
../src/util/u_printf.h:43:41: error: unknown type name 'va_list'; did you mean '__va_list'?
size_t u_printf_length(const char *fmt, va_list untouched_args);
                                        ^~~~~~~
                                        __va_list
/usr/include/machine/_types.h:126:27: note: '__va_list' declared here
typedef __builtin_va_list       __va_list;
                                ^

and add includes to u_printf.h as suggested by Ilia Mirkin
stdarg.h for va_list and stddef.h for size_t

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>

2 years agoutil: unbreak non-linux mips64 build
Jonathan Gray [Fri, 25 Feb 2022 12:17:32 +0000 (23:17 +1100)]
util: unbreak non-linux mips64 build

Put linux specific path inside an ifdef.  Unbreaks mips64 build on
OpenBSD and likely other systems without Elf64_auxv_t.

Fixes: 88b234d7a7c ("gallivm: add basic mips64 support and set mcpu to mips64r5 on ls3a4000")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15166>

2 years agointel/compiler: optimize flat inputs mask calculation
Marcin Ślusarz [Thu, 24 Feb 2022 16:09:25 +0000 (17:09 +0100)]
intel/compiler: optimize flat inputs mask calculation

Don't bother looking at urb if variable is not flat.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15169>

2 years agointel/compiler: ignore per-primitive attrs when calculating flat input mask
Marcin Ślusarz [Thu, 24 Feb 2022 16:06:33 +0000 (17:06 +0100)]
intel/compiler: ignore per-primitive attrs when calculating flat input mask

If we say that per-primitive attributes are flat (which is communicated by
3DSTATE_SBE.ConstantInterpolationEnable), GPU freaks out and applies it
to other (non-flat) attributes.

Fixes: be89ea3231c ("intel/compiler: Handle per-primitive inputs in FS")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15169>

2 years agopan/va: Add TEX_FETCH assembler case
Alyssa Rosenzweig [Fri, 25 Feb 2022 17:28:52 +0000 (12:28 -0500)]
pan/va: Add TEX_FETCH assembler case

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Handle sr_write_count in the disassembler
Alyssa Rosenzweig [Fri, 25 Feb 2022 17:29:00 +0000 (12:29 -0500)]
pan/va: Handle sr_write_count in the disassembler

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Fix definitions of TEX_SINGLE and TEX_FETCH
Alyssa Rosenzweig [Thu, 17 Feb 2022 19:05:18 +0000 (14:05 -0500)]
pan/va: Fix definitions of TEX_SINGLE and TEX_FETCH

Fix the definitions of the basic texturing instructions. In particular, a
register format and a write mask were previously missing, as well as incorrect
handling of staging registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Don't use staging index as a sideband
Alyssa Rosenzweig [Fri, 25 Feb 2022 21:26:57 +0000 (16:26 -0500)]
pan/va: Don't use staging index as a sideband

It would cause us to get incorrect disassembly when the syntax is flipped.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Handle extended staging counts in assembler
Alyssa Rosenzweig [Fri, 25 Feb 2022 17:34:11 +0000 (12:34 -0500)]
pan/va: Handle extended staging counts in assembler

Needed for texturing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Allow forcing enums for 1-bit modifiers
Alyssa Rosenzweig [Fri, 25 Feb 2022 16:51:56 +0000 (11:51 -0500)]
pan/va: Allow forcing enums for 1-bit modifiers

Ocassionally the 0 value has a meaningful value that's not meaningfully default,
so we want an enum to encode both possible states.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Add MUX.v2i16 and MUX.v4i8 opcodes
Alyssa Rosenzweig [Fri, 25 Feb 2022 19:18:44 +0000 (14:18 -0500)]
pan/va: Add MUX.v2i16 and MUX.v4i8 opcodes

Basically identical to MUX.i32, slight differences in opcode and swizzling only.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agopan/va: Remove incorrect TEX test cases
Alyssa Rosenzweig [Fri, 25 Feb 2022 21:48:53 +0000 (16:48 -0500)]
pan/va: Remove incorrect TEX test cases

Not close enough to salvage; TEX is going to be redefined.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15182>

2 years agonir: Allow the _replicates opcodes to have num_components != 4.
Emma Anholt [Wed, 15 Dec 2021 03:26:21 +0000 (19:26 -0800)]
nir: Allow the _replicates opcodes to have num_components != 4.

This required relaxing a core NIR assertion which I don't think is doing
any important validation.

The shader-db effects here are small, but they're important for avoiding a
regression when we start doing per-component DCE in opt_shrink_vectors
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12468)

softpipe shader-db:
total instructions in shared programs: 2859777 -> 2859454 (-0.01%)
instructions in affected programs: 18881 -> 18558 (-1.71%)
total temps in shared programs: 293994 -> 293914 (-0.03%)
temps in affected programs: 418 -> 338 (-19.14%)

i915g:
total instructions in shared programs: 407562 -> 407544 (<.01%)
instructions in affected programs: 570 -> 552 (-3.16%)

r300:
total instructions in shared programs: 1414450 -> 1414459 (<.01%)
instructions in affected programs: 44494 -> 44503 (0.02%)
total vinst in shared programs: 473782 -> 473727 (-0.01%)
vinst in affected programs: 1102 -> 1047 (-4.99%)
total sinst in shared programs: 231224 -> 231216 (<.01%)
sinst in affected programs: 432 -> 424 (-1.85%)
total temps in shared programs: 197605 -> 197607 (<.01%)
temps in affected programs: 103 -> 105 (1.94%)

crocus hsw:
total instructions in shared programs: 8158185 -> 8158134 (<.01%)
instructions in affected programs: 10927 -> 10876 (-0.47%)

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

2 years agoaco: relax condition to remove branches in case of few instructions
Daniel Schürmann [Fri, 27 Nov 2020 14:23:34 +0000 (15:23 +0100)]
aco: relax condition to remove branches in case of few instructions

This patch relaxes the conditions under which
we remove branch instructions.

Totals from 27246 (20.20% of 134913) affected shaders: (GFX10.3)
CodeSize: 193413312 -> 192924928 (-0.25%)
Instrs: 36146788 -> 36024692 (-0.34%)
Latency: 528374112 -> 528469044 (+0.02%); split: -0.01%, +0.02%
InvThroughput: 106198759 -> 106216583 (+0.02%); split: -0.00%, +0.02%
Branches: 1040640 -> 918543 (-11.73%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8647>

2 years agoradv,drirc: move RADV workarounds to 00-radv-defaults.conf
Samuel Pitoiset [Thu, 24 Feb 2022 09:13:51 +0000 (10:13 +0100)]
radv,drirc: move RADV workarounds to 00-radv-defaults.conf

Because we have to maintain two different packages of Mesa, one
specific to RADV and another one for RadeonSI and such, it's a bit
annoying to have to synchronize the drirc entries. Currently, only our
Mesa package installs 00-mesa-defaults.conf which means we have to
backport the drirc RADV changes.

This splits 00-mesa-defaults.conf in two to move the drirc RADV entries
to src/amd/vulkan/00-radv-defaults.conf. Meson will install the file
only if RADV is built.

There is still a caveat for common drirc workarounds like for WSI but
they are rare enough and we could still duplicate them if needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15152>

2 years agoaco: Support memory modes properly with load/store_buffer_amd.
Timur Kristóf [Fri, 25 Feb 2022 08:23:31 +0000 (09:23 +0100)]
aco: Support memory modes properly with load/store_buffer_amd.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>

2 years agoaco: Support task_payload with barriers, refactor allowed storage class.
Timur Kristóf [Fri, 25 Feb 2022 08:22:41 +0000 (09:22 +0100)]
aco: Support task_payload with barriers, refactor allowed storage class.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>

2 years agoaco: Add storage class for Task Shader payload.
Timur Kristóf [Fri, 25 Feb 2022 08:22:04 +0000 (09:22 +0100)]
aco: Add storage class for Task Shader payload.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15161>

2 years agospirv: Use task_payload mode for generic task outputs and mesh inputs.
Timur Kristóf [Tue, 8 Feb 2022 01:59:31 +0000 (02:59 +0100)]
spirv: Use task_payload mode for generic task outputs and mesh inputs.

This new mode will be only used for the actual payload variables and
not the number of launched mesh shader workgroups, which will still
be treated as an output.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14930>

2 years agonir: Add new variable mode for task/mesh payload.
Timur Kristóf [Tue, 8 Feb 2022 01:55:18 +0000 (02:55 +0100)]
nir: Add new variable mode for task/mesh payload.

Task shader outputs work differently than other shaders, so they
need special consideration. Essentially, they have two kinds of
outputs:

1. Number of mesh shader workgroups to launch.
Will be still represented by a shader output.

2. Optional payload of up to (at least) 16K bytes.
These payload variables behave similarly to shared memory, but
the spec doesn't actually define them as shared memory (also, they
may be implemented differently by each backend), so we need to add
a new NIR variable mode for them.

These payload variables can't be represented by shader outputs
because the 16K bytes don't fit the 32x vec4 model that NIR uses
for its output variables.

This patch adds a new NIR variable mode: nir_var_mem_task_payload
and corresponding explicit I/O intrinsics, as well as support for
this new mode in nir_lower_io.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14930>

2 years agoradv: Refactor mesh shader draws and add num_workgroups.
Timur Kristóf [Fri, 21 Jan 2022 17:08:34 +0000 (18:08 +0100)]
radv: Refactor mesh shader draws and add num_workgroups.

Several of the new draw packets need this argument
including all of the taskmesh commands, so it's
best to always declare it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoac/nir: Refactor mesh shader output code to smaller functions.
Timur Kristóf [Thu, 17 Feb 2022 15:05:09 +0000 (16:05 +0100)]
ac/nir: Refactor mesh shader output code to smaller functions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoac/nir: Make sure to exclude special outputs from arrayed output masks.
Timur Kristóf [Thu, 20 Jan 2022 15:43:45 +0000 (16:43 +0100)]
ac/nir: Make sure to exclude special outputs from arrayed output masks.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoac/nir: Sanitize mesh shader primitive indices using umin.
Timur Kristóf [Mon, 14 Feb 2022 14:17:58 +0000 (15:17 +0100)]
ac/nir: Sanitize mesh shader primitive indices using umin.

This makes our implementation friendlier to potentially buggy shaders,
meaning that it will less likely to hang the GPU.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoac/nir: Properly handle when mesh API workgroup size is smaller than HW.
Timur Kristóf [Thu, 10 Feb 2022 22:55:51 +0000 (23:55 +0100)]
ac/nir: Properly handle when mesh API workgroup size is smaller than HW.

The problem is that the real workgroup launched on NGG HW
can be larger than the size specified by the API, and the
extra waves need to keep up with barriers in the API waves.

There are 2 different cases:

1. The whole API workgroup fits in a single wave.
   We can shrink the barriers to subgroup scope and
   don't need to insert any extra ones.

2. The API workgroup occupies multiple waves, but not
   all. In this case, we emit code that consumes every
   barrier on the extra waves.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoac/nir: Move LDS area for primitive count to the beginning.
Timur Kristóf [Mon, 14 Feb 2022 14:11:54 +0000 (15:11 +0100)]
ac/nir: Move LDS area for primitive count to the beginning.

This makes it impossible for out of bounds vertex and primitive
attribute stores and indices stores to overwrite this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoaco: Fix multiview view index for mesh shaders.
Timur Kristóf [Fri, 21 Jan 2022 18:23:15 +0000 (19:23 +0100)]
aco: Fix multiview view index for mesh shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoaco: Fix workgroup_id.y and .z for NV_mesh_shader.
Timur Kristóf [Sat, 12 Feb 2022 19:29:50 +0000 (20:29 +0100)]
aco: Fix workgroup_id.y and .z for NV_mesh_shader.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoaco: Allow 1-byte loads and stores with load/store_buffer_amd
Timur Kristóf [Thu, 10 Feb 2022 22:53:24 +0000 (23:53 +0100)]
aco: Allow 1-byte loads and stores with load/store_buffer_amd

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoradv: Better exclude special MS outputs from driver location assignment.
Timur Kristóf [Fri, 21 Jan 2022 17:05:54 +0000 (18:05 +0100)]
radv: Better exclude special MS outputs from driver location assignment.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>

2 years agoci: skqp: Add Vulkan support for a630_skqp job
Guilherme Gallo [Fri, 21 Jan 2022 05:43:03 +0000 (02:43 -0300)]
ci: skqp: Add Vulkan support for a630_skqp job

This commit adds support for Vulkan backend on a630_skqp job.

= Needed changes
- Needed to install libvulkan-dev package on system
- Refactored the way the available skqp reports are printed
  tested in development builds with skia tools

Piglit expectations had to be updated in various drivers due to !14750 not
having bumped the tags when it tried to uprev.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14686>

2 years agoci: skqp: Build skqp from android-cts-10.0_r11 tag with Clang
Guilherme Gallo [Thu, 27 Jan 2022 04:28:51 +0000 (01:28 -0300)]
ci: skqp: Build skqp from android-cts-10.0_r11 tag with Clang

The Android CTS 10 version is relative old when compared with skia main
branch, which was being used before. Some modifications in the skqp
build/runner scripts were needed to make it run on CI.

- skqp versions from android-cts have already all assets inside
  platform_tools folder.
  - along with the assets, are the render and unit files which are
    expected to pass in the Android CTS execution.
  - removed custom test files from the a630 folder, to make it comply
    with the CTS expectations.
- include new patches to remove Python2 dependencies and avoid the
  installation of it in rootfs.
- strip binariesthe built binaries `skqp` and `list_gpu_unit_tests`, as
  `is_debug = false` gn argument did not work, maybe it is not well
      tested in development builds with skia tools
- use Clang instead of GCC. The GCC support is not so graceful as it is
  in the skia main branch, some NEON instructions needs to be turned off
  in the GCC compilation, causing different tests result. This change
  does not imply a bigger rootfs, since the built skqp binary uses GCC
  libc++ and other library runtimes. So clang is just a build
  dependency.

= Changes in skqp results =

Some errors were found for GL backend and unit tests. GLES and VK tests are green.
All the failed tests were classified as expected to fail in the render and unit tests list.

```
gl_blur2rectsnonninepatch
gl_bug339297_as_clip
gl_bug6083
gl_dashtextcaps
```

```
SRGBReadWritePixels (../../tests/SRGBReadWritePixelsTest.cpp:214 Could not create sRGB surface context. [OpenGL])
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14686>

2 years agofeatures: VK_EXT_depth_clip_control for lavapipe
Mike Blumenkrantz [Fri, 25 Feb 2022 05:26:12 +0000 (00:26 -0500)]
features: VK_EXT_depth_clip_control for lavapipe

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

2 years agolavapipe: EXT_depth_clip_control
Mike Blumenkrantz [Tue, 22 Feb 2022 23:17:58 +0000 (18:17 -0500)]
lavapipe: EXT_depth_clip_control

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15126>

2 years agoci/zink: Add testing of dEQP GLES3.1/3.2.
Emma Anholt [Wed, 23 Feb 2022 01:34:34 +0000 (17:34 -0800)]
ci/zink: Add testing of dEQP GLES3.1/3.2.

I think this has been kind of just an oversight.  Increases runtime by a
minute, to 5:30.

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

2 years agoci/zink: Move testing to shared 64-core runners at Google.
Emma Anholt [Tue, 8 Feb 2022 21:21:50 +0000 (13:21 -0800)]
ci/zink: Move testing to shared 64-core runners at Google.

Now the main deqp and piglit run takes about 4:30 of runner time in a
single job.

Added a couple of flakes that hit this MR, but which I think predate it
(probably due to not having #zink-ci until recently).

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15159>

2 years agodocs: remove incorrect drivers from extension
Erik Faye-Lund [Wed, 23 Feb 2022 11:04:05 +0000 (12:04 +0100)]
docs: remove incorrect drivers from extension

This extension isn't wired up in Gallium, so there's just no way a
Gallium driver like Panfrost exposes it.

While there were support in i965 for this for the cancelled Broxton GPU,
thre's no such support in the Iris driver. And since Broxton has been
cancelled, it's unlikely to be wired up any time soon.

Fixes: da23a31726f ("docs/features: Update ASTC entries for Panfrost")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15145>

2 years agopanfrost: Flush resources when shadowing
Alyssa Rosenzweig [Sat, 23 Oct 2021 14:13:51 +0000 (10:13 -0400)]
panfrost: Flush resources when shadowing

When we shadow a resource, the backing BO is changed; as such,
existing references to the resource become invalid. So batches accessing the
resource need to be flushed (or otherwise have their references invalidated).

The wrong behaviour change (not flushing) was introduced when we started
tracking resources instead of BOs. The issue manifested as a severe performance
regression in glmark2's -bbuffer test, particular the subdata subtest. The issue
is magnified on slow CPUs; without the fix, the test becomes completely CPU
bound

Relevant glmark2 -bbuffer test from 43fps to 84fps.

Apparently, this causes functional issues too -- this performance-minded change
also fixes a few piglits.

Fixes: cecb889481d ("panfrost: Do tracking of resources, not BOs")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13502>

2 years agopanfrost: Handle NULL samplers
Alyssa Rosenzweig [Tue, 28 Sep 2021 00:26:54 +0000 (20:26 -0400)]
panfrost: Handle NULL samplers

Fixes a NULL dereference in Piglit fp-fragment-position, getting the
test to pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>

2 years agopanfrost: Handle NULL sampler views
Alyssa Rosenzweig [Tue, 28 Sep 2021 00:24:01 +0000 (20:24 -0400)]
panfrost: Handle NULL sampler views

Fixes a NULL dereference in Piglit fp-fragment-position.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>

2 years agopanfrost: Fix set_sampler_views for big GL
Alyssa Rosenzweig [Tue, 28 Sep 2021 00:24:38 +0000 (20:24 -0400)]
panfrost: Fix set_sampler_views for big GL

Roughly use the freedreno logic to handle all the extra things that will
come up in our Piglit sooner than later.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>

2 years agopanfrost/ci: Update xfails list
Alyssa Rosenzweig [Thu, 24 Feb 2022 22:43:31 +0000 (17:43 -0500)]
panfrost/ci: Update xfails list

These tests seem to be passing now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13203>

2 years agoblorp: Add blorp_measure hooks to the blitter codepaths
Kenneth Graunke [Thu, 24 Feb 2022 18:16:27 +0000 (10:16 -0800)]
blorp: Add blorp_measure hooks to the blitter codepaths

I had missed these when hooking up the original support.

Fixes: 31eeb72e45b ("blorp: Add support for blorp_copy via XY_BLOCK_COPY_BLT")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15157>

2 years agoiris: Set MI_FLUSH_DW::PostSyncOperation correctly
Kenneth Graunke [Fri, 18 Feb 2022 11:02:53 +0000 (03:02 -0800)]
iris: Set MI_FLUSH_DW::PostSyncOperation correctly

The MI_FLUSH_DW post-sync operation uses the same encoding as the
PIPE_CONTROL one so we can use the same helper.  Write PS Depth Count
is not supported, of course, as the blitter has no depth pipeline.

This means that we can write the timestamp register from the blitter.

Fixes: 604d97671b6 ("iris: Add support for flushing the blitter (hackily)")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15157>

2 years agor300: add predicate instructions to statistics of vertex shaders
Pavel Ondračka [Fri, 18 Feb 2022 10:48:23 +0000 (11:48 +0100)]
r300: add predicate instructions to statistics of vertex shaders

All of IF, ELSE, ENDIF, BREAK and CONTINUE were already translated
to the predication instructions in rc_vert_fc so all the flow control
we count at the moment is just BGNLOOP and ENDLOOP.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>

2 years agor300: report number of loops in shader statistics
Pavel Ondračka [Fri, 18 Feb 2022 08:32:00 +0000 (09:32 +0100)]
r300: report number of loops in shader statistics

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>

2 years agor300: use %u specifiers when printing unsigned stats values
Pavel Ondračka [Fri, 18 Feb 2022 07:53:53 +0000 (08:53 +0100)]
r300: use %u specifiers when printing unsigned stats values

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6019
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15077>