platform/upstream/mesa.git
2 years agozink: stop leaking resource surface cache hash tables
Mike Blumenkrantz [Thu, 7 Oct 2021 15:31:49 +0000 (11:31 -0400)]
zink: stop leaking resource surface cache hash tables

these are owned by the resource, so stick them on a resource context
instead of the screen context

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

2 years agozink: remove reads/writes members from zink_resource_object
Mike Blumenkrantz [Thu, 7 Oct 2021 18:28:18 +0000 (14:28 -0400)]
zink: remove reads/writes members from zink_resource_object

these haven't been used in a while

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

2 years agozink: switch remaining direct access of zink_resource_object::(reads|writes) to util
Mike Blumenkrantz [Thu, 7 Oct 2021 21:50:01 +0000 (17:50 -0400)]
zink: switch remaining direct access of zink_resource_object::(reads|writes) to util

I missed this one

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

2 years agozink: stop leaking buffers on replacement
Mike Blumenkrantz [Thu, 7 Oct 2021 21:45:26 +0000 (17:45 -0400)]
zink: stop leaking buffers on replacement

I tried to be pointlessly clever here to avoid an atomic op, but the move()
here ended up leaking a ref in some cases (descriptor bind + multiple replacements in same cmdbuf)

more importantly, it's a stupid idea now that zink_resource_object structs
are entirely owned by the driver, meaning their refcounts are never
altered in threads, and thus the atomic ops are just regular ops

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

2 years agozink: remove zink_context::curr_batch
Mike Blumenkrantz [Wed, 6 Oct 2021 13:20:41 +0000 (09:20 -0400)]
zink: remove zink_context::curr_batch

this hasn't been a real value in a while and it's confusing to have
it still exist

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

2 years agozink: move semaphore reset handling to submit
Mike Blumenkrantz [Wed, 6 Oct 2021 13:18:56 +0000 (09:18 -0400)]
zink: move semaphore reset handling to submit

this is the earliest place the batch_id is available now, so check it
here since ctx->curr_batch isn't actually a thing anymore

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

2 years agozink: wait in the flush thread when ETOOMANY batches are out
Mike Blumenkrantz [Tue, 5 Oct 2021 19:24:07 +0000 (15:24 -0400)]
zink: wait in the flush thread when ETOOMANY batches are out

when dispatch is fast enough, some tests fire off cmdbufs so quickly that the normal
oom flushing and batch pruning in end_batch isn't sufficient to keep memory
usage down

to combat this, start throwing in stalls after submission to clean out a bunch of cmdbufs
while preventing further ones from being submitted

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

2 years agoradeonsi: remove duplicate partial_count variable
Marek Olšák [Wed, 6 Oct 2021 20:26:40 +0000 (16:26 -0400)]
radeonsi: remove duplicate partial_count variable

"count" is computed identically.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13235>

2 years agoradeonsi: fix a leak in draw_vertex_state if threaded_context is disabled
Marek Olšák [Wed, 6 Oct 2021 20:28:39 +0000 (16:28 -0400)]
radeonsi: fix a leak in draw_vertex_state if threaded_context is disabled

Fixes: fb8f532ea1b - radeonsi: implement draw_vertex_state for lower display list overhead

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13235>

2 years agogallium/u_threaded: fix draw_vertex_state with multi draws
Marek Olšák [Wed, 6 Oct 2021 20:25:39 +0000 (16:25 -0400)]
gallium/u_threaded: fix draw_vertex_state with multi draws

It caused an assertion failure in debug builds and a GPU hang in release
builds.

Fixes: 0842488859e - gallium/u_threaded: implement draw_vertex_state
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5457

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13235>

2 years agozink: split out fb state updating to helper function
Mike Blumenkrantz [Thu, 30 Sep 2021 19:16:40 +0000 (15:16 -0400)]
zink: split out fb state updating to helper function

no functional changes

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

2 years agozink: wait on thread queue before destroying context
Mike Blumenkrantz [Thu, 30 Sep 2021 14:50:14 +0000 (10:50 -0400)]
zink: wait on thread queue before destroying context

ensure there's no submits in progress that would explode if they were deleted

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

2 years agocrocus: Honor scanout requirement from DRI
Dave Airlie [Thu, 7 Oct 2021 22:35:19 +0000 (08:35 +1000)]
crocus: Honor scanout requirement from DRI

Translate PIPE_BIND_SCANOUT as ISL_SURF_USAGE_DISPLAY_BIT,
instead of PIPE_BIND_DISPLAY_TARGET.

PIPE_BIND_DISPLAY_TARGET isn't used for dri images and seem to
be set only for fake winsys buffers (which aren't displayed).
The trouble is that a fake buffer could be multisampled and we
cannot have multisampled surface with display bit.

Ported from iris 82b46667836647226387442b2feb9d7f1475bd36

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Tested-by: Jason Ekstrand <jason@jlekstrand.net>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5464
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13260>

2 years agointel/isl: Add mocs settings for DG2
Jordan Justen [Wed, 16 Sep 2020 07:55:17 +0000 (00:55 -0700)]
intel/isl: Add mocs settings for DG2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12712>

2 years agoutil/vector: make util_vector_init harder to misuse
Chia-I Wu [Tue, 5 Oct 2021 18:58:58 +0000 (11:58 -0700)]
util/vector: make util_vector_init harder to misuse

Make u_vector_init a wrapper to u_vector_init_pot.  Let both take
(element_count, element_size) as parameters.

Motivated by eed0fc4caf2 ("vulkan/wsi/wayland: fix an invalid
u_vector_init call")

v2: rename u_vector_init_pot to u_vector_init_pow2

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13201>

2 years agoRevert "mesa: use simple_mtx_t for TexMutex"
Jason Ekstrand [Thu, 7 Oct 2021 20:01:30 +0000 (15:01 -0500)]
Revert "mesa: use simple_mtx_t for TexMutex"

This reverts the following commit from main:

    commit f6abb3445b7f244c0243f03bd7cf1e7ad1e2f1ab
    Author: Marek Olšák <maraeo@gmail.com>
    Date:   Fri Oct 1 15:46:48 2021 -0400

        mesa: use simple_mtx_t for TexMutex

        change mtx_recursive -> mtx_plain, there's no recursive locking

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
        Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

Contrary to the claim in the commit message, there is recursive locking.
The meta stuff used by i965 does GL operations while the texture is
locked.  If we don't allow recursive locks, it will deadlock.  No, it's
not great, but it's the current state of affairs.  Once we delete i965
in favor of crocus and any other users of meta, we can restore the above
patch.  Until then, we need mtx_recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13254>

2 years agovulkan/device: Use vk_errorf to report missing features
Jason Ekstrand [Thu, 30 Sep 2021 16:41:15 +0000 (11:41 -0500)]
vulkan/device: Use vk_errorf to report missing features

With a tiny bit more code-gen, we can now not only throw the error but
also log back to the client exactly which feature was missing.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan/device: Use vk_error
Jason Ekstrand [Fri, 24 Sep 2021 21:04:51 +0000 (16:04 -0500)]
vulkan/device: Use vk_error

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan/instance: Use vk_error in vk_instance_init
Jason Ekstrand [Fri, 24 Sep 2021 20:52:04 +0000 (15:52 -0500)]
vulkan/instance: Use vk_error in vk_instance_init

We have to be a bit careful here.  Calling log functions during instance
initialization can be a bit sketchy.  However, we know that __vk_log_impl
only ever touches the callbacks lists if instance->base.client_visible
so it's safe to call vk_error as soon as we've set up instance_callbacks.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan/log: Drop _impl from the log helper names
Jason Ekstrand [Fri, 24 Sep 2021 20:38:40 +0000 (15:38 -0500)]
vulkan/log: Drop _impl from the log helper names

Now that we no longer have every driver in the tree defining their own
__vk_errorf and __vk_errorv, we don't need to worry about the symbol
collision anymore and can use the "real" names for the common ones.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agoturnip: Plumb non-startup errors through the new vk_error helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:35:20 +0000 (15:35 -0500)]
turnip: Plumb non-startup errors through the new vk_error helpers

Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

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

2 years agov3dv: Switch to the new vk_error helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:31:03 +0000 (15:31 -0500)]
v3dv: Switch to the new vk_error helpers

Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

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

2 years agopanvk: Switch to the new vk_error helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:23:14 +0000 (15:23 -0500)]
panvk: Switch to the new vk_error helpers

Also switch all our calls to use the closest object to the error and let
vk_error sort out which object to actually use.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agolavapipe: Switch to the new vk_error helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:20:49 +0000 (15:20 -0500)]
lavapipe: Switch to the new vk_error helpers

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agoradv: Switch to the new common vk_error helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:19:16 +0000 (15:19 -0500)]
radv: Switch to the new common vk_error helpers

Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

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

2 years agoradv: Stop printing descriptor pool allocation failures
Jason Ekstrand [Wed, 6 Oct 2021 14:18:42 +0000 (09:18 -0500)]
radv: Stop printing descriptor pool allocation failures

The VK_ERROR_FRAGMENTED_POOL and VK_ERROR_OUT_OF_POOL_MEMORY errors are
not as exceptional cases as most.  These are expected to be hit by
applications in the normal course of doing their thing.  Probably best
not to spam stderr and the debug logs with them.

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

2 years agoanv: Use the common vk_error and vk_errorf helpers
Jason Ekstrand [Fri, 24 Sep 2021 17:06:32 +0000 (12:06 -0500)]
anv: Use the common vk_error and vk_errorf helpers

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

2 years agoanv/queue: Plumb the queue through all the queue_submit calls
Jason Ekstrand [Fri, 24 Sep 2021 16:22:10 +0000 (11:22 -0500)]
anv/queue: Plumb the queue through all the queue_submit calls

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

2 years agoanv: Drop unused logging helpers
Jason Ekstrand [Fri, 24 Sep 2021 20:15:24 +0000 (15:15 -0500)]
anv: Drop unused logging helpers

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

2 years agovulkan/log: Add common vk_error and vk_errorf helpers
Jason Ekstrand [Fri, 24 Sep 2021 18:38:17 +0000 (13:38 -0500)]
vulkan/log: Add common vk_error and vk_errorf helpers

These helpers have quite a bit of smarts in them to log errors to chase
the object chain as needed and log errors to roughly the appropriate
object.  For instance, VK_ERROR_OUT_OF_DEVICE_MEMORY always goes to a
device while VK_ERROR_OUT_OF_HOST_MEMORY always goes to the instance.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan/log: Handle logging to a physical device
Jason Ekstrand [Fri, 24 Sep 2021 19:53:13 +0000 (14:53 -0500)]
vulkan/log: Handle logging to a physical device

Instance-level objects won't have a device pointer so we can't rely on
that.  Instead, we should look at the object type and try to chase it
back to an instance.  Sadly, we can't do that for certain display and
WSI objects.  However, we never use the vk_log* helpers for those.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agoanv: s/vk_error/anv_error/g
Jason Ekstrand [Fri, 24 Sep 2021 18:44:41 +0000 (13:44 -0500)]
anv: s/vk_error/anv_error/g

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

2 years agoanv: Stop printing descriptor pool allocation failures
Jason Ekstrand [Wed, 6 Oct 2021 14:12:43 +0000 (09:12 -0500)]
anv: Stop printing descriptor pool allocation failures

The VK_ERROR_FRAGMENTED_POOL and VK_ERROR_OUT_OF_POOL_MEMORY errors are
not as exceptional cases as most.  These are expected to be hit by
applications in the normal course of doing their thing.  Probably best
not to spam stderr and the debug logs with them.

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

2 years agoanv: drop a misplaced and wrong comment
Jason Ekstrand [Fri, 24 Sep 2021 18:43:53 +0000 (13:43 -0500)]
anv: drop a misplaced and wrong comment

We do actually use vk_error in the one place we check that limit.

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

2 years agovulkan/log: Log to instance messages during instance construction
Jason Ekstrand [Fri, 24 Sep 2021 19:26:35 +0000 (14:26 -0500)]
vulkan/log: Log to instance messages during instance construction

If the instance isn't client-visible yet (i.e. foo_instance_to_handle
hasn't been called), then the instance is still under construction and
we should log using vk_debug_message_instance.  This makes the vk_log*
macros work regardless of whether the instance is fully constructed or
not.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan/log: Assert if the driver logs a client-invisible object
Jason Ekstrand [Fri, 24 Sep 2021 19:27:49 +0000 (14:27 -0500)]
vulkan/log: Assert if the driver logs a client-invisible object

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan: Track which objects are client-visible
Jason Ekstrand [Fri, 24 Sep 2021 15:58:39 +0000 (10:58 -0500)]
vulkan: Track which objects are client-visible

When dealing with debug logging, it's useful to track when an object's
construction is finished and it's now visible to the client.  We can
detect this pretty easily by setting a flag the first time foo_to_handle
is called.  As long as drivers only ever call that function at the end
of object construction (they all do to my knowledge), this should be a
reliable mechanism for detecting when a client knows about a handle.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agovulkan: Drop vk_object_base_reset
Jason Ekstrand [Fri, 24 Sep 2021 19:05:16 +0000 (14:05 -0500)]
vulkan: Drop vk_object_base_reset

It's no longer used and just makes the init/finish path more
complicated.

Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>

2 years agospirv: Declare PointCoord as a sysval
Boris Brezillon [Mon, 27 Sep 2021 13:20:49 +0000 (15:20 +0200)]
spirv: Declare PointCoord as a sysval

Now that all drivers have been patched to convert sysvals to input
varyings when they have too, we can safely declare PointCoord as a sysval
too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>

2 years agospirv: Always declare FragCoord as a sysval
Boris Brezillon [Mon, 27 Sep 2021 13:16:43 +0000 (15:16 +0200)]
spirv: Always declare FragCoord as a sysval

Now that all spirv_to_nir() users take care of converting sysvals to
varyings, we can unconditionally declare FragCoord as a sysval.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>

2 years agospirv: Let spirv_to_nir() users turn sysvals into input varyings
Boris Brezillon [Mon, 27 Sep 2021 13:05:44 +0000 (15:05 +0200)]
spirv: Let spirv_to_nir() users turn sysvals into input varyings

This is an attempt at simplifying the spirv_to_nir() backend when it
comes to choosing between system values and input varyings. Let's patch
drivers to do the sysval to input varying conversion on their own so we
can get rid of the frag_coord_is_varying field in spirv_to_nir_options
and unconditionally create create sysvals for FragCoord, FrontFacing and
PointCoord inputs instead of adding new xxx_is_{sysval,varying} flags.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>

2 years agonir: Add a nir_sysvals_to_varyings() helper
Boris Brezillon [Mon, 27 Sep 2021 12:20:20 +0000 (14:20 +0200)]
nir: Add a nir_sysvals_to_varyings() helper

Allow backends to turn some sysvals into input varyings so the frontend
(in our case spirv_to_nir()) doesn't have to bother selecting which
one is expected.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13017>

2 years agonir/algebraic: Add some opts for comparisons of comparisons
Jason Ekstrand [Sat, 13 Feb 2021 07:32:40 +0000 (01:32 -0600)]
nir/algebraic: Add some opts for comparisons of comparisons

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

2 years agonir/algebraic: Add some boolean optimizations
Jason Ekstrand [Thu, 29 Oct 2020 03:32:16 +0000 (22:32 -0500)]
nir/algebraic: Add some boolean optimizations

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

2 years agonir/algebraic: Lower fisfinite
Jason Ekstrand [Thu, 24 Sep 2020 18:35:32 +0000 (13:35 -0500)]
nir/algebraic: Lower fisfinite

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

2 years agomesa: signal driver when buffer is bound to different texture format
Gert Wollny [Wed, 6 Oct 2021 16:11:52 +0000 (18:11 +0200)]
mesa: signal driver when buffer is bound to different texture format

Gallium caches sampler states for TBOs. Now if a buffer is first
attached to a TBO specifying one format, and later attached by
specifying another format and this TBO is then used, that would lead
to an assertion failure in debug builds, or to invalid rendering in
release builds, because the TBO picks the original, wrong format for
the sampler view.

Resolve this by signalling the change to Gallium (and other drivers), so
that Gallium clears the sampler view cache.

Fixes: f0ecd36ef8e10c087738c92cf62bad3815366963
  st/mesa: add an entirely separate codepath for setting up buffer views

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13230>

2 years agogallium/u_threaded: Split out options struct
Rob Clark [Tue, 5 Oct 2021 23:24:47 +0000 (16:24 -0700)]
gallium/u_threaded: Split out options struct

Rather than having an ever increasing list of parameters to
threaded_context_create(), split out a struct for optional
flags and parameters.  This should reduce churn in adding
new options.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13207>

2 years agoradv,aco: don't include FMASK in the storage descriptor
Rhys Perry [Wed, 4 Aug 2021 17:19:20 +0000 (18:19 +0100)]
radv,aco: don't include FMASK in the storage descriptor

We perform a FMASK expand when transitioning to GENERAL or TRANSFER_DST
layout, so storage images always have an identity FMASK.

radeonsi doesn't appear to expand the FMASK for read-only storage images,
so the sample index adjustment is still needed there.

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

2 years agoradv,aco: use lower_to_fragment_fetch
Rhys Perry [Wed, 4 Aug 2021 15:17:56 +0000 (16:17 +0100)]
radv,aco: use lower_to_fragment_fetch

This simplifies ACO and will let us optimize the FMASK fetch (for example,
move it out of loops).

fossil-db (Sienna Cichlid):
Totals from 955 (0.64% of 150170) affected shaders:
CodeSize: 4722016 -> 4722952 (+0.02%); split: -0.02%, +0.04%
Instrs: 875619 -> 875760 (+0.02%); split: -0.02%, +0.04%
Latency: 14069089 -> 14071699 (+0.02%); split: -0.02%, +0.04%
InvThroughput: 2321419 -> 2321218 (-0.01%); split: -0.02%, +0.01%
VClause: 23080 -> 23081 (+0.00%)
SClause: 32426 -> 32019 (-1.26%); split: -1.88%, +0.62%
Copies: 42787 -> 42777 (-0.02%); split: -0.19%, +0.16%
Branches: 17900 -> 17902 (+0.01%); split: -0.04%, +0.06%
PreSGPRs: 43229 -> 41002 (-5.15%); split: -5.16%, +0.00%

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

2 years agoaco: use correct dim for FMASK fetches
Rhys Perry [Wed, 6 Oct 2021 17:10:25 +0000 (18:10 +0100)]
aco: use correct dim for FMASK fetches

I think it somehow worked fine previously, but this is more correct.

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

2 years agoac/nir: return 0x76543210 for NULL FMASK fetch
Rhys Perry [Wed, 4 Aug 2021 16:02:14 +0000 (17:02 +0100)]
ac/nir: return 0x76543210 for NULL FMASK fetch

This can replace several v_cndmask_b32 with a single v_cndmask_b32.

fossil-db (Sienna Cichlid):
Totals from 1169 (0.78% of 150170) affected shaders:
SGPRs: 82032 -> 81984 (-0.06%); split: -0.19%, +0.13%
VGPRs: 68368 -> 68280 (-0.13%); split: -0.30%, +0.18%
SpillSGPRs: 8754 -> 8609 (-1.66%); split: -4.06%, +2.40%
CodeSize: 5460132 -> 5446308 (-0.25%); split: -0.42%, +0.17%
MaxWaves: 24456 -> 24462 (+0.02%); split: +0.03%, -0.01%

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

2 years agoaco: return 0x76543210 for NULL FMASK fetch
Rhys Perry [Wed, 4 Aug 2021 15:13:47 +0000 (16:13 +0100)]
aco: return 0x76543210 for NULL FMASK fetch

This can replace several v_cndmask_b32 with a single v_cndmask_b32, and
will be useful when we lower sample index adjustment in NIR.

fossil-db (Sienna Cichlid):
Totals from 955 (0.64% of 150170) affected shaders:
VGPRs: 53232 -> 53208 (-0.05%)
CodeSize: 4712548 -> 4722016 (+0.20%); split: -0.02%, +0.23%
MaxWaves: 19052 -> 19056 (+0.02%)
Instrs: 875891 -> 875619 (-0.03%); split: -0.04%, +0.00%
Latency: 14070164 -> 14069089 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 2322982 -> 2321419 (-0.07%); split: -0.08%, +0.01%
VClause: 23070 -> 23080 (+0.04%); split: -0.00%, +0.05%
SClause: 32463 -> 32426 (-0.11%); split: -0.12%, +0.01%
Copies: 42840 -> 42787 (-0.12%); split: -0.19%, +0.07%
Branches: 17907 -> 17900 (-0.04%); split: -0.06%, +0.02%
PreSGPRs: 43585 -> 43229 (-0.82%)
PreVGPRs: 47676 -> 47625 (-0.11%)

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

2 years agoradv: don't create blit pipelines for multisampled 3D images
Rhys Perry [Wed, 4 Aug 2021 17:40:48 +0000 (18:40 +0100)]
radv: don't create blit pipelines for multisampled 3D images

These don't create sensible NIR.

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

2 years agonir/lower_tex: add lower_to_fragment_fetch_amd
Rhys Perry [Wed, 4 Aug 2021 15:17:39 +0000 (16:17 +0100)]
nir/lower_tex: add lower_to_fragment_fetch_amd

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12214>

2 years agonir: add _amd suffix to fragment_mask_fetch and fragment_fetch texops
Rhys Perry [Thu, 5 Aug 2021 15:19:51 +0000 (16:19 +0100)]
nir: add _amd suffix to fragment_mask_fetch and fragment_fetch texops

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12214>

2 years agonir/print: pad 64-bit constants with zeroes
Marcin Ślusarz [Wed, 6 Oct 2021 13:40:18 +0000 (15:40 +0200)]
nir/print: pad 64-bit constants with zeroes

... just like other-size constants are.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13223>

2 years agoradeonsi: make the DRI_PRIME dGPU -> iGPU copy async
Pierre-Eric Pelloux-Prayer [Tue, 7 Sep 2021 18:12:30 +0000 (20:12 +0200)]
radeonsi: make the DRI_PRIME dGPU -> iGPU copy async

Doing this copy using SDMA frees up the dGPU to do more
interesting things while the copy is happening; for instance
the rendering of the next frame.

hw queue activity before:
------------------------
dGPU:
  gfx: [renderframe 1][copy->iGPU][renderframe 2][copy->iGPU]...
iGPU:
  gfx:                            [Xorg]                    [Xorg]

hw queue activity before after:
------------------------------
dGPU:
  gfx: [renderframe 1][renderframe 2][renderframe 3]....
 sdma:                [copy->iGPU]  [copy->iGPU]   [copy->iGPU]
iGPU:
  gfx:                           [Xorg]        [Xorg] ...

If SDMA isn't available or can't do the copy, use an async compute
context instead.

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

2 years agogallium: add a is_dri_blit_image bool to pipe_blit_info
Pierre-Eric Pelloux-Prayer [Thu, 9 Sep 2021 14:57:15 +0000 (16:57 +0200)]
gallium: add a is_dri_blit_image bool to pipe_blit_info

This indicates driver that a given blit is coming from the DRI
frontend.
This information can then be used to pick an appropriate blitting
method.

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

2 years agoradeonsi: add an async compute context
Pierre-Eric Pelloux-Prayer [Mon, 27 Sep 2021 09:52:46 +0000 (11:52 +0200)]
radeonsi: add an async compute context

It'll be used exclusively for DRI_PRIME copies for now.

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

2 years agoradeonsi: implement si_sdma_copy_image for gfx7+
Pierre-Eric Pelloux-Prayer [Tue, 7 Sep 2021 18:07:19 +0000 (20:07 +0200)]
radeonsi: implement si_sdma_copy_image for gfx7+

SDMA support was dropped in 1f31a216640 mainly because the
advantages of delegating some copy/clear operations to the
SDMA hw came with large drawbacks: CPU overhead due to the
sdma/gfx synchronization and hangs.

This commit restores SDMA support for all gfx7+ chips but
only for the image copy operations.

SDMA operations won't be intertwined with gfx operations
like before. Instead, a SDMA IB will contain a single copy
at a time and the synchronization will be handled by the
winsys (based on the used buffers).

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

2 years agoradv: Add VK_FORMAT_R16G16B16A16_UNORM for accel. structures.
Bas Nieuwenhuizen [Tue, 5 Oct 2021 22:31:02 +0000 (00:31 +0200)]
radv: Add VK_FORMAT_R16G16B16A16_UNORM for accel. structures.

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

2 years agoir3: support source modes for resinfo.b
Danylo Piliaiev [Wed, 6 Oct 2021 13:44:50 +0000 (16:44 +0300)]
ir3: support source modes for resinfo.b

IBO/SSBO may have dynamic index, previously we just silently ignored
this fact. However resinfo supports different modes.

Fixes vkd3d test "test_null_uav"

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

2 years agoci/freedreno: try to fix the a630 cubearray flake's regex.
Emma Anholt [Thu, 7 Oct 2021 00:00:06 +0000 (17:00 -0700)]
ci/freedreno: try to fix the a630 cubearray flake's regex.

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

2 years agoci/freedreno: Move the other a530 test jobs to test-manual-mr.
Emma Anholt [Wed, 6 Oct 2021 23:55:12 +0000 (16:55 -0700)]
ci/freedreno: Move the other a530 test jobs to test-manual-mr.

I meant to put this in the general a530 properties, not just the a530 deqp.

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

2 years agor300: avoid searching for temp variable twice
Filip Gawin [Wed, 6 Oct 2021 16:16:11 +0000 (18:16 +0200)]
r300: avoid searching for temp variable twice

(when once is enough)

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

2 years agofeatures: be explicit about EXT_color_buffer_half_float support
Mike Blumenkrantz [Wed, 6 Oct 2021 01:33:31 +0000 (21:33 -0400)]
features: be explicit about EXT_color_buffer_half_float support

it's annoying not being able to glance at this and see whether my
driver has support, so these are the drivers I know support it

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

2 years agobuild: also remove wayland wsi flags from c++ build
Mike Blumenkrantz [Wed, 6 Oct 2021 17:27:42 +0000 (13:27 -0400)]
build: also remove wayland wsi flags from c++ build

...until aco stops exploding

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13233>

2 years agoturnip: do nothing on dispatch with zero total workgroups
Danylo Piliaiev [Wed, 6 Oct 2021 15:02:26 +0000 (18:02 +0300)]
turnip: do nothing on dispatch with zero total workgroups

Otherwise GPU hangs...

Fixes vkd3d test "test_dispatch_zero_thread_groups"

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

2 years agoCODEOWNERS: add @jenatali for Microsoft & D3D12
Eric Engestrom [Sun, 3 Oct 2021 20:39:17 +0000 (21:39 +0100)]
CODEOWNERS: add @jenatali for Microsoft & D3D12

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

2 years agoCODEOWNERS: add @bbrezillon for src/panfrost/vulkan/
Eric Engestrom [Sun, 3 Oct 2021 20:37:38 +0000 (21:37 +0100)]
CODEOWNERS: add @bbrezillon for src/panfrost/vulkan/

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2178>

2 years agoCODEOWNERS: add @alyssa for Asahi and Panfrost
Eric Engestrom [Sun, 3 Oct 2021 20:36:27 +0000 (21:36 +0100)]
CODEOWNERS: add @alyssa for Asahi and Panfrost

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2178>

2 years agoCODEOWNERS: add android build system
Eric Engestrom [Sun, 19 Sep 2021 10:48:45 +0000 (11:48 +0100)]
CODEOWNERS: add android build system

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

2 years agoCODEOWNERS: add intel group
Eric Engestrom [Fri, 17 Jul 2020 21:16:37 +0000 (23:16 +0200)]
CODEOWNERS: add intel group

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

2 years agoCODEOWNERS: add SWR maintainers
Eric Engestrom [Fri, 17 Jul 2020 13:02:14 +0000 (15:02 +0200)]
CODEOWNERS: add SWR maintainers

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

2 years agogitlab: convert old REVIEWERS into GitLab's CODEOWNERS
Eric Engestrom [Mon, 30 Sep 2019 21:46:47 +0000 (22:46 +0100)]
gitlab: convert old REVIEWERS into GitLab's CODEOWNERS

The old REVIEWERS file was useful back in the mailing lists days, but
nowadays we use GitLab, and we tag people by using their usernames, not
email addresses.

Most of us know each other's usernames by now, but documentation like
this is not meant for us but for everyone else, so that they can talk to
us.

Let's convert the file into GitLab's CODEOWNERS format, which maps files
in the repository to GitLab users that people can look up or tag in
their issues or merge requests.

See also: https://docs.gitlab.com/ce/user/project/code_owners.html

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2178>

2 years agoegl/wayland: Support RGBA ordered formats
Derek Foreman [Thu, 23 Sep 2021 19:37:19 +0000 (14:37 -0500)]
egl/wayland: Support RGBA ordered formats

There's no reason not to try to use RGBA ordered formats, and in some
cases doing so might lead to features such as AFBC being available when
they otherwise wouldn't.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13040>

2 years agolavapipe: fix fence handling around wsi submission
Dave Airlie [Wed, 6 Oct 2021 07:52:21 +0000 (17:52 +1000)]
lavapipe: fix fence handling around wsi submission

My previous fix was incorrect, properly fix things so that
fences in acquire get a proper timeline set.

Fixes: 028591954a2d7 ("lvp/fence: quick fix to previous commit.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13218>

2 years agoRevert "lvp/fence: quick fix to previous commit."
Dave Airlie [Wed, 6 Oct 2021 19:39:05 +0000 (05:39 +1000)]
Revert "lvp/fence: quick fix to previous commit."

This reverts commit 028591954a2d7e1c3cf8ecec04f1555564dd8076.

This wasn't the correct fix, that is coming up.

Fixes: 028591954a2d7 ("lvp/fence: quick fix to previous commit.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13218>

2 years agoanv: implement VK_KHR_synchronization2
Lionel Landwerlin [Wed, 11 Nov 2020 19:38:25 +0000 (21:38 +0200)]
anv: implement VK_KHR_synchronization2

v2: Use u_foreach_bit64() (Samuel)

v3: Add missing handling of VkMemoryBarrier2KHR in pNext of
    VkSubpassDependency2KHR (Samuel)

v4: Remove unused ANV_PIPELINE_STAGE_PIPELINED_BITS (Ivan)

v5: fix missing anv_measure_submit() (Jason)
    constify anv_pipeline_stage_pipelined_bits (Jason)

v6: Split flushes & invalidation emissions on
    vkCmdSetEvent2KHR()/vkCmdWaitEvents2KHR() (Jason)

v7: Only apply flushes once on events (Jason)

v8: Drop split flushes for this patch

v9: Add comment about ignore some fields of VkMemoryBarrier2 in
    VkSubpassDependency2KHR (Jason)
    Drop spurious PIPE_CONTROL change s/,/;/ (Jason)

v10: Fix build issue on Android (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agoanv: improve readability of pipelined states
Lionel Landwerlin [Tue, 28 Sep 2021 07:33:58 +0000 (10:33 +0300)]
anv: improve readability of pipelined states

Improving maintenance.

v2: Also add TOP_OF_PIPE_BIT, HOST_BIT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agoanv: make semaphore helper work on a single object
Lionel Landwerlin [Fri, 12 Mar 2021 17:34:31 +0000 (19:34 +0200)]
anv: make semaphore helper work on a single object

Should have done that last time.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agoanv: add missing transition handling bits
Lionel Landwerlin [Wed, 11 Nov 2020 09:36:33 +0000 (11:36 +0200)]
anv: add missing transition handling bits

New access flags & pipeline stages got added for transform feedback
and we missed handling them.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 36ee2fd61c8f ("anv: Implement the basic form of VK_EXT_transform_feedback")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agovulkan: implement legacy entrypoints on top of VK_KHR_synchronization2
Lionel Landwerlin [Wed, 10 Feb 2021 00:24:39 +0000 (02:24 +0200)]
vulkan: implement legacy entrypoints on top of VK_KHR_synchronization2

v2: fix common vkQueueSubmit() pNext generation
    fix potential leak of perf_query_submit_info
    fix comment about casting VkQueue to vk_object_base
    add helper for barrier struct upgrades (Jason)
    reuse __vk_append_struct() (Jason)
    optimize vk_common_GetQueueCheckpointDataNV
    use multialloc for vk_common_QueueSubmit (Dave)

v3: Reuse new vk_queue/vk_command_buffer objects
    Fixup CmdWaitEvents() (Jason)

v4: Add comment about dep_flags for CmdWaitEvents() (Jason)

v5: Drop multialloc in VkQueueSubmit entrypoint (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v5)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agovulkan/util: generate define for a selected few enums
Lionel Landwerlin [Wed, 11 Nov 2020 13:27:29 +0000 (15:27 +0200)]
vulkan/util: generate define for a selected few enums

One of the unfortunate effect of Vulkan starting to use 64bit bitmasks
is that they can no longer be defined using enums because C doesn't
guarantees that enum values will be 64bits.

Vulkan therefore started using those patterns :

  static const VkAccessFlags2KHR VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 0x00000001;

This has the effect that we can not longer use those values in
switch/case statements.

This change introduces defines so that we can keep doing this. For now
only VkAccessFlags2KHR/VkPipelineStageFlags2KHR are allowed to be
redefined this way, this list could be changed later (or all bitmask
could be processed this way).

v2: Generate hexadecimal numbers (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agovulkan: remove unused VkCommand
Lionel Landwerlin [Wed, 22 Sep 2021 07:59:02 +0000 (10:59 +0300)]
vulkan: remove unused VkCommand

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agovulkan: handle new VK_KHR_synchronization2 image layouts
Lionel Landwerlin [Wed, 22 Sep 2021 07:42:47 +0000 (10:42 +0300)]
vulkan: handle new VK_KHR_synchronization2 image layouts

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agovulkan: put generated defines into their own header
Lionel Landwerlin [Wed, 22 Sep 2021 07:52:43 +0000 (10:52 +0300)]
vulkan: put generated defines into their own header

v2: Put vk_enum_defines.h in the list of generated files

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9045>

2 years agowsi/x11: cleanup properly after mit shm paths are used.
Dave Airlie [Wed, 6 Oct 2021 07:23:39 +0000 (17:23 +1000)]
wsi/x11: cleanup properly after mit shm paths are used.

This path was being skipped on sw + has_mit_shm, when it
shouldn't be.

Fixes: a069b4e9b9a1 ("vulkan/wsi/sw: add mit-shm support for pixmap allocation")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13217>

2 years agodocs: mark off missing lavapipe exts
Michel Zou [Wed, 6 Oct 2021 17:27:01 +0000 (19:27 +0200)]
docs: mark off missing lavapipe exts

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13232>

2 years agoturnip: Free disk cache on pdev init failure.
Emma Anholt [Tue, 5 Oct 2021 17:34:01 +0000 (10:34 -0700)]
turnip: Free disk cache on pdev init failure.

Noticed while debugging test failure under valgrind (the disk cache
doesn't come from the vulkan allocator, so we could leak it and not fail
the test).

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

2 years agoturnip: Fix allocation failure handling around device->name.
Emma Anholt [Tue, 5 Oct 2021 17:22:45 +0000 (10:22 -0700)]
turnip: Fix allocation failure handling around device->name.

Fixes regressions in dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail

Fixes: 5116388e0ba9 ("turnip: Expose a device name similar to the blob.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>

2 years agoturnip: Plug the vendor/device ID into the pipeline cache fields, too.
Emma Anholt [Tue, 5 Oct 2021 16:50:24 +0000 (09:50 -0700)]
turnip: Plug the vendor/device ID into the pipeline cache fields, too.

Fixes a regression in dEQP-VK.pipeline.cache.misc_tests.cache_header_test.

Fixes: 7e471541e0d1 ("turnip: Match the blob's format for vendorID and deviceID.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>

2 years agoir3: remove obsolete assert for intrinsic_store_output in tess
Danylo Piliaiev [Tue, 5 Oct 2021 11:29:58 +0000 (14:29 +0300)]
ir3: remove obsolete assert for intrinsic_store_output in tess

We do support non-zero nir_intrinsic_component for
nir_intrinsic_store_output in tess shaders.

Fixes vkd3d test "test_hull_shader_fork_phase_dxbc"

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

2 years agoanv: allocate zeroed device object
Marcin Ślusarz [Wed, 6 Oct 2021 11:14:20 +0000 (13:14 +0200)]
anv: allocate zeroed device object

When enabling a new feature we made the mistake of initializing some fields
of the device object conditionally, which leads to crashes later. Initializing
those fields would be a trivial fix, but it's probably better to just zero
everything at allocation time and prevent any future screwups. Device objects
are allocated rarely enough for this additional memset to not matter for
performance.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13221>

2 years agogenxml: Drop bit 27 from RENDER_SURFACE_STATE::Surface Format
Jason Ekstrand [Tue, 5 Oct 2021 21:42:58 +0000 (16:42 -0500)]
genxml: Drop bit 27 from RENDER_SURFACE_STATE::Surface Format

Bit 27 is the "ASTC Format" bit in the PRMs but we just extended the
Surface Format field by one bit and made sure all the ASTC formats have
that bit set.  Since Gfx12.5 doesn't support ASTC, we can drop that bit
from the field and this will cause GenXML packing functions to assert if
it's ever set.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>

2 years agointel/isl: ASTC support was removed on Gfx12.5
Jason Ekstrand [Tue, 5 Oct 2021 21:16:16 +0000 (16:16 -0500)]
intel/isl: ASTC support was removed on Gfx12.5

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>

2 years agoanv: Ask ISL about ASTC support
Jason Ekstrand [Tue, 5 Oct 2021 21:19:49 +0000 (16:19 -0500)]
anv: Ask ISL about ASTC support

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>

2 years agointel/isl: Stop claiming ASTC works on Cherry View
Jason Ekstrand [Tue, 5 Oct 2021 21:12:41 +0000 (16:12 -0500)]
intel/isl: Stop claiming ASTC works on Cherry View

We do, however, leave a nice tombstone comment in case anyone comes
looking.  Given the age and scarcity of Cherry View hardware and ASTC
apps that run on desktop Linux, it's unlikely we'll ever bother to
implement it.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>

2 years agointel/isl: Simplify isl_format_supports_filtering
Jason Ekstrand [Tue, 5 Oct 2021 21:09:21 +0000 (16:09 -0500)]
intel/isl: Simplify isl_format_supports_filtering

For compressed formats, filtering and sampling has always gone together.
This lets us avoid duplicating all those nasty special cases between the
two functions.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13206>

2 years agobuild: unify vulkan cpp platform args
Mike Blumenkrantz [Fri, 1 Oct 2021 13:43:00 +0000 (09:43 -0400)]
build: unify vulkan cpp platform args

these were duplicated all over the place, and it's annoying to have to keep
duplicating them any time a new component includes the vulkan header

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13141>