platform/upstream/mesa.git
2 years agolavapipe: store subpass directly to rendering_state
Mike Blumenkrantz [Fri, 1 Oct 2021 20:13:08 +0000 (16:13 -0400)]
lavapipe: store subpass directly to rendering_state

this is fewer array derefs

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

2 years agolavapipe: remove last VK_ATTACHMENT_UNUSED check
Mike Blumenkrantz [Fri, 1 Oct 2021 19:57:58 +0000 (15:57 -0400)]
lavapipe: remove last VK_ATTACHMENT_UNUSED check

these are all just null checks now

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

2 years agolavapipe: remove lvp_subpass_attachment and use lvp_render_pass_attachment refs
Mike Blumenkrantz [Fri, 1 Oct 2021 19:53:34 +0000 (15:53 -0400)]
lavapipe: remove lvp_subpass_attachment and use lvp_render_pass_attachment refs

this is one fewer indirect reference that allows removing a bunch of stuff from
renderpass creation

now also unused subpass attachments are just NULL pointers, making detection simpler

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

2 years agolavapipe: remove lvp_subpass::max_sample_count
Mike Blumenkrantz [Fri, 1 Oct 2021 19:21:38 +0000 (15:21 -0400)]
lavapipe: remove lvp_subpass::max_sample_count

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

2 years agolavapipe: add attachment index to lvp_render_pass_attachment
Mike Blumenkrantz [Fri, 1 Oct 2021 19:00:36 +0000 (15:00 -0400)]
lavapipe: add attachment index to lvp_render_pass_attachment

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

2 years agolavapipe: remove lvp_subpass_attachment::layout
Mike Blumenkrantz [Fri, 1 Oct 2021 18:56:32 +0000 (14:56 -0400)]
lavapipe: remove lvp_subpass_attachment::layout

unused

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

2 years agolavapipe: remove lvp_subpass_attachment::in_render_loop
Mike Blumenkrantz [Fri, 1 Oct 2021 18:55:20 +0000 (14:55 -0400)]
lavapipe: remove lvp_subpass_attachment::in_render_loop

this isn't used

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

2 years agolavapipe: use framebuffer attachment_count member instead of renderpass
Mike Blumenkrantz [Fri, 1 Oct 2021 18:48:23 +0000 (14:48 -0400)]
lavapipe: use framebuffer attachment_count member instead of renderpass

according to spec, these must be equal

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

2 years agolavapipe: remove some unused struct members
Mike Blumenkrantz [Fri, 1 Oct 2021 18:19:24 +0000 (14:19 -0400)]
lavapipe: remove some unused struct members

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

2 years agolavapipe: stop reading renderpass during pipeline creation
Mike Blumenkrantz [Fri, 1 Oct 2021 17:48:44 +0000 (13:48 -0400)]
lavapipe: stop reading renderpass during pipeline creation

this is unnecessary and is going to be annoying in the future

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

2 years agoclover: use max shader sampler view/images queries for clover.
Dave Airlie [Mon, 18 Oct 2021 20:40:24 +0000 (06:40 +1000)]
clover: use max shader sampler view/images queries for clover.

This is probably sane than my last answer to this question

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13398>

2 years agozink: move last of lazy descriptor state updating back to lazy-only code
Mike Blumenkrantz [Wed, 13 Oct 2021 13:34:00 +0000 (09:34 -0400)]
zink: move last of lazy descriptor state updating back to lazy-only code

hybrid mode is controlled by the caching manager, so state tracking is irrelevant

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

2 years agozink: add an early return for zink_descriptors_update_lazy_masked()
Mike Blumenkrantz [Wed, 13 Oct 2021 13:32:09 +0000 (09:32 -0400)]
zink: add an early return for zink_descriptors_update_lazy_masked()

no point in generating pools/sets that won't be used here

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

2 years agozink: move push descriptor updating into lazy-only codepath
Mike Blumenkrantz [Wed, 13 Oct 2021 13:29:02 +0000 (09:29 -0400)]
zink: move push descriptor updating into lazy-only codepath

this was a bit confusing to read, and I originally left it in the hybrid
path to enable fallbacks to push descriptors in hybrid mode. the problem with
that idea is that it's impossible: the constant buffer set is the one set
that will never, ever trigger a fallback, so leaving it there just leaves
room for error and confusion

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

2 years agozink: don't update lazy descriptor states in hybrid mode
Mike Blumenkrantz [Wed, 13 Oct 2021 13:16:35 +0000 (09:16 -0400)]
zink: don't update lazy descriptor states in hybrid mode

I'm not 100% sure how, but this breaks tomb raider

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

2 years agozink: assert compute descriptor key is valid before hashing it
Mike Blumenkrantz [Tue, 12 Oct 2021 19:16:14 +0000 (15:16 -0400)]
zink: assert compute descriptor key is valid before hashing it

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

2 years agozink: clear descriptor refs on buffer replacement
Mike Blumenkrantz [Tue, 12 Oct 2021 18:03:51 +0000 (14:03 -0400)]
zink: clear descriptor refs on buffer replacement

the bo here can only ever be destroyed before it gets reused, so prune
it from the descriptor cache immediately

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

2 years agozink: fully zero surface creation struct
Mike Blumenkrantz [Mon, 18 Oct 2021 14:40:12 +0000 (10:40 -0400)]
zink: fully zero surface creation struct

gotta get those holes for caching

cc: mesa-stable

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13410>

2 years agozink: add a read barrier for indirect dispatch
Mike Blumenkrantz [Fri, 15 Oct 2021 15:57:14 +0000 (11:57 -0400)]
zink: add a read barrier for indirect dispatch

using the draw stage here doesn't make much sense, but that's what the
spec says, so let's git er done

fixes dEQP-GL45.functional.compute.indirect_dispatch* on radv

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

2 years agozink: use static array for detecting VK_TIME_DOMAIN_DEVICE_EXT
Mike Blumenkrantz [Thu, 14 Oct 2021 14:13:25 +0000 (10:13 -0400)]
zink: use static array for detecting VK_TIME_DOMAIN_DEVICE_EXT

there's only a few possible values for this, so just use a static array
to avoid leaking

Fixes: 039078fe972 ("zink: slight refactor of load_device_extensions()")

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

2 years agost: Fix comments in commit be6d584de43966e
Neha Bhende [Mon, 18 Oct 2021 19:50:19 +0000 (12:50 -0700)]
st: Fix comments in commit be6d584de43966e

This patch is adding comments as suggested by Ilia in MR

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13423>

2 years agoclover/api: fix clGetMemObjectInfo for images
Karol Herbst [Sun, 25 Oct 2020 00:43:48 +0000 (02:43 +0200)]
clover/api: fix clGetMemObjectInfo for images

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>

2 years agoclover/formats: pass in cl_mem_flags for better format checking
Karol Herbst [Wed, 21 Oct 2020 03:03:27 +0000 (05:03 +0200)]
clover/formats: pass in cl_mem_flags for better format checking

This allows us to advertise more formats depending on how the image is
getting used inside a kernel.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>

2 years agoclover/format: Full rework on how we declare supported images.
Karol Herbst [Wed, 21 Oct 2020 01:40:48 +0000 (03:40 +0200)]
clover/format: Full rework on how we declare supported images.

While at it also remove CL_LUMINANCE and CL_INTENSITY, which are optional
but also quite broken.

Also advertize all formats we can already support and make the list easier
to read. Also adds support for newer formats.

v2: fixup packing for non-8 bits (airlied)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13424>

2 years agost: Fix 64-bit vertex attrib index for TGSI path
Neha Bhende [Thu, 14 Oct 2021 16:37:21 +0000 (09:37 -0700)]
st: Fix 64-bit vertex attrib index for TGSI path

Patch 77c2b022a0c5 removed lowering of 64-bit vertex attribs to 32bits.
This has thrown TGSI translation off the guard for 64bit attrib.
This lead to fail/crash of 1000+ piglit tests.

This patch basically fixes 64 bit attrib index for TGSI shader by adding placeholder
for second part of a double attribute.
It fixes all regressed piglit tests.

A big help from Charmaine to fix this regression
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Fixes: 77c2b022a0c5 ("st/mesa: remove lowering of 64-bit vertex attribs to 32 bits")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13363>

2 years agoradeonsi: reorder and don't print patch level DRM version in the renderer string
Marek Olšák [Sat, 16 Oct 2021 09:50:11 +0000 (05:50 -0400)]
radeonsi: reorder and don't print patch level DRM version in the renderer string

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13392>

2 years agoac,radeonsi: print a lowercase codename in the renderer string
Marek Olšák [Sat, 16 Oct 2021 09:46:42 +0000 (05:46 -0400)]
ac,radeonsi: print a lowercase codename in the renderer string

to make it stand out less

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13392>

2 years agoradeonsi: enable shader culling on Navi1x consumer SKUs as well
Marek Olšák [Sat, 16 Oct 2021 16:21:30 +0000 (12:21 -0400)]
radeonsi: enable shader culling on Navi1x consumer SKUs as well

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

2 years agoradeonsi: replace the GS prolog with a monolithic shader variant
Marek Olšák [Sat, 16 Oct 2021 13:46:06 +0000 (09:46 -0400)]
radeonsi: replace the GS prolog with a monolithic shader variant

It only exists because of the hw bug and is used very rarely.
Let's simplify it.

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

2 years agoradeonsi: don't pass NULL into si_get_nir_shader
Marek Olšák [Sat, 16 Oct 2021 12:49:14 +0000 (08:49 -0400)]
radeonsi: don't pass NULL into si_get_nir_shader

so that we always have the shader key there

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

2 years agodrirc: Apply vk_dont_care_as_load workaround to Forsaken Remastered
Danylo Piliaiev [Thu, 14 Oct 2021 19:13:00 +0000 (22:13 +0300)]
drirc: Apply vk_dont_care_as_load workaround to Forsaken Remastered

Game has one renderpass which loads attachment with DONT_CARE, does
nothing, and writes it back.

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

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

2 years agoturnip: implement vk_dont_care_as_load workaround
Danylo Piliaiev [Thu, 14 Oct 2021 18:01:16 +0000 (21:01 +0300)]
turnip: implement vk_dont_care_as_load workaround

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

2 years agodriconf: add vk_dont_care_as_load workaround option
Danylo Piliaiev [Mon, 18 Oct 2021 10:45:52 +0000 (13:45 +0300)]
driconf: add vk_dont_care_as_load workaround option

It's easy to make a mistake of using VK_ATTACHMENT_LOAD_OP_DONT_CARE
when LOAD_OP_LOAD should be used since all desktop GPUs do the same
thing (nothing) for both of them.

However tiler GPUs do actually care about them.

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

2 years agoturnip: add support for dirconf
Danylo Piliaiev [Thu, 14 Oct 2021 15:16:54 +0000 (18:16 +0300)]
turnip: add support for dirconf

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

2 years agoradv: fix OpImageQuerySamples with non-zero descriptor set
Samuel Pitoiset [Mon, 18 Oct 2021 14:47:53 +0000 (16:47 +0200)]
radv: fix OpImageQuerySamples with non-zero descriptor set

The descriptor set was always 0 because it wasn't gathered by the
shader info pass.

This fixes CPU crashes with
arb_shader_texture_image_samples-builtin-image and Zink.

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13411>

2 years agotu/clear_blit: Stop creating a franken-image for staging blits
Connor Abbott [Thu, 14 Oct 2021 15:28:41 +0000 (17:28 +0200)]
tu/clear_blit: Stop creating a franken-image for staging blits

Extricate the last use of tu_image_*.

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

2 years agotu: Remove cross-check scaffolding
Connor Abbott [Thu, 14 Oct 2021 13:46:31 +0000 (15:46 +0200)]
tu: Remove cross-check scaffolding

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

2 years agotu: Switch clear/blit to fdl6_view and cross-check
Connor Abbott [Thu, 14 Oct 2021 13:10:17 +0000 (15:10 +0200)]
tu: Switch clear/blit to fdl6_view and cross-check

This will help us create staging resources with a Y8 format and avoids
calling into the Vulkan-level entrypoints which will have to be changed
to use vk_image and vk_image_view.

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

2 years agotu: Use fdl6_view in tu_image_view and cross-check
Connor Abbott [Wed, 13 Oct 2021 15:51:13 +0000 (17:51 +0200)]
tu: Use fdl6_view in tu_image_view and cross-check

Because some of the fields aren't filled out when a format doesn't
support rendering, we temporarily clear the structure so that we can
compare.

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

2 years agofreedreno/fdl: Add fdl6_view
Connor Abbott [Wed, 13 Oct 2021 15:34:26 +0000 (17:34 +0200)]
freedreno/fdl: Add fdl6_view

This is mostly based on tu_image_view. The notable difference is that we
don't handle choosing the correct plane out of multiple planes when
indicated by the aspect, which means that there is no equivalent of
VK_IMAGE_ASPECT_PLANE_1 etc. This is expected to be done in the driver,
and note that freedreno gallium handles this very differently anyway.

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

2 years agofreedreno/fdl: Add mip_level to fdl_layout
Connor Abbott [Wed, 13 Oct 2021 15:33:21 +0000 (17:33 +0200)]
freedreno/fdl: Add mip_level to fdl_layout

We need this when calculating the descriptors in the image view.

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

2 years agofreedreno/fdl: Constify fdl6_get_ubwc_blockwidth()
Connor Abbott [Wed, 13 Oct 2021 15:30:29 +0000 (17:30 +0200)]
freedreno/fdl: Constify fdl6_get_ubwc_blockwidth()

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

2 years agovk/format, v3dv: Add a vulkan -> pipe swizzle helper
Connor Abbott [Wed, 13 Oct 2021 15:28:07 +0000 (17:28 +0200)]
vk/format, v3dv: Add a vulkan -> pipe swizzle helper

And use it to replace the one in v3dv.

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

2 years agoRevert "gallium: add a is_dri_blit_image bool to pipe_blit_info"
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 12:35:09 +0000 (14:35 +0200)]
Revert "gallium: add a is_dri_blit_image bool to pipe_blit_info"

This reverts commit 22a1b7c5b3a9cdbf05a0fd97fb193763a525b732.

The only use was radeonsi and it switched to PIPE_BIND_DRI_PRIME
instead.

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

2 years agoradeonsi: use PIPE_BIND_DRI_PRIME instead of is_dri_blit_image
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 12:34:31 +0000 (14:34 +0200)]
radeonsi: use PIPE_BIND_DRI_PRIME instead of is_dri_blit_image

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

2 years agoradeonsi/gfx10.3: enable SDMA for DRI_PRIME copies
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 14:12:01 +0000 (16:12 +0200)]
radeonsi/gfx10.3: enable SDMA for DRI_PRIME copies

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

2 years agowinsys/amdgpu: add uncached flag to the imported DRI_PRIME buffer
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:16:31 +0000 (15:16 +0200)]
winsys/amdgpu: add uncached flag to the imported DRI_PRIME buffer

There's no point in caching this linear buffer since we're only
ever writing to it.

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

2 years agoradeon_winsys.h: add a parameter to buffer_from_handle
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:15:20 +0000 (15:15 +0200)]
radeon_winsys.h: add a parameter to buffer_from_handle

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

2 years agogallium/dri: let the driver know if the imported image is DRI_PRIME buffer
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:12:12 +0000 (15:12 +0200)]
gallium/dri: let the driver know if the imported image is DRI_PRIME buffer

Use createImageFromFds2 together with __DRI_IMAGE_PRIME_LINEAR_BUFFER, so
the driver's resource_from_handle hook will be aware that this specific
image is the linear buffer.

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

2 years agogallium/dri: add createImageFromFds2
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:09:49 +0000 (15:09 +0200)]
gallium/dri: add createImageFromFds2

Same as createImageFromFds but with added flags so the caller can give
the driver more context.

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

2 years agogallium/dri: replace bool with flag parameter
Pierre-Eric Pelloux-Prayer [Thu, 14 Oct 2021 13:06:31 +0000 (15:06 +0200)]
gallium/dri: replace bool with flag parameter

This will allow to pass more information.

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

2 years agozink: Fully initialize VkBufferViewCreateInfo for hashing
Witold Baryluk [Thu, 14 Oct 2021 22:40:14 +0000 (00:40 +0200)]
zink: Fully initialize VkBufferViewCreateInfo for hashing

Makes hashing achieve higher hit rate, and valgrind happier.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13371>

2 years agov3dv/ci: update expected results
Juan A. Suarez Romero [Mon, 18 Oct 2021 11:16:35 +0000 (13:16 +0200)]
v3dv/ci: update expected results

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13407>

2 years agoradeonsi: use viewport offset in quant_mode determination
Pierre-Eric Pelloux-Prayer [Fri, 15 Oct 2021 15:28:19 +0000 (17:28 +0200)]
radeonsi: use viewport offset in quant_mode determination

Instead of only using the viewport extent.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5344
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13382>

2 years agoanv: Fix assertion.
Vinson Lee [Sun, 17 Oct 2021 05:34:25 +0000 (22:34 -0700)]
anv: Fix assertion.

Fix defect reported by Coverity Scan.

Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been intended

Fixes: 35315c68a57 ("anv: Use the common wrapper for GetPhysicalDeviceFormatProperties")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@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/13395>

2 years agoradv: fix removing PSIZ when it's not emitted by the last VGT stage
Samuel Pitoiset [Fri, 15 Oct 2021 12:52:13 +0000 (14:52 +0200)]
radv: fix removing PSIZ when it's not emitted by the last VGT stage

This dereferences a NULL pointer and crash many tests with Zink.

Fixes: 92e1981a800 ("radv: Remove PSIZ output when it isn't needed.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13378>

2 years agoclover/image: add dimension property
Aaron Watry [Sun, 11 Oct 2020 19:34:24 +0000 (21:34 +0200)]
clover/image: add dimension property

With that we can fix CL_IMAGE_HEIGHT and CL_IMAGE_DEPTH.

v2 (Karol Herbst): split up commit
   (Serge Martin): convert to virtual method

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover: Implement CL_MEM_OBJECT_IMAGE1D_ARRAY
Edward O'Callaghan [Fri, 18 Nov 2016 06:21:51 +0000 (17:21 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D_ARRAY

v2: Consider surface height as valid when unused by using 1.
     Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
            Fix validation

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover: Implement CL_MEM_OBJECT_IMAGE1D_BUFFER
Edward O'Callaghan [Fri, 18 Nov 2016 05:51:14 +0000 (16:51 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE1D_BUFFER

v2: Consider surface height as valid when unused by using 1.
     Fixup width boundary checking.
v3 (Karol): Pull in changes from later commits
v4:(airlied): use max_buffer_size as the limit (Fixes CTS test)

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover: Implement CL_MEM_OBJECT_IMAGE2D_ARRAY
Edward O'Callaghan [Fri, 18 Nov 2016 04:24:18 +0000 (15:24 +1100)]
clover: Implement CL_MEM_OBJECT_IMAGE2D_ARRAY

v2: Ensure we pass in row_pitch state as well.
v3 (Karol): Pull in changes from later commits

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover: implement CL_IMAGE_BUFFER
Aaron Watry [Sun, 25 Oct 2020 17:32:27 +0000 (18:32 +0100)]
clover: implement CL_IMAGE_BUFFER

We will also need it to implement image1Dbuffer_t

v2 (Karol Herbst): extracted from other commit

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover/images: Add array_size to implement CL_IMAGE_ARRAY_SIZE
Edward O'Callaghan [Sat, 26 Nov 2016 06:18:58 +0000 (17:18 +1100)]
clover/images: Add array_size to implement CL_IMAGE_ARRAY_SIZE

This will be needed to implement array immages.

v2 (Karol Herbst): Extracted from other commit
                   Fix clEnqueueMapImage for arrays
                   Add some basic support for image arrays

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agoclover/image: add templated basic_image class to simplify image subclassing
Karol Herbst [Thu, 1 Apr 2021 16:12:30 +0000 (18:12 +0200)]
clover/image: add templated basic_image class to simplify image subclassing

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agospirv: Don't add 0.5 to array indicies for OpImageSampleExplicitLod
Karol Herbst [Tue, 3 Nov 2020 16:41:53 +0000 (17:41 +0100)]
spirv: Don't add 0.5 to array indicies for OpImageSampleExplicitLod

This fixes CLs 1.2 1Darray and 2Darray images.

Fixes: 589d918a4f9da83e3ae441aa674372a141d23349
       ("spirv: Add 0.5 to integer coordinates for OpImageSampleExplicitLod")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13401>

2 years agovc4/ci: update expected results
Juan A. Suarez Romero [Sun, 17 Oct 2021 21:41:02 +0000 (23:41 +0200)]
vc4/ci: update expected results

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13397>

2 years agollvmpipe: fix userptr for texture resources.
Dave Airlie [Wed, 13 Oct 2021 04:49:50 +0000 (14:49 +1000)]
llvmpipe: fix userptr for texture resources.

This is needed for CL image hostptr support, but it's possible
it could hit these paths from GL/Vulkan

Fixes: 9a57dceeb760 ("llvmpipe: add support for user memory pointers")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13375>

2 years agopanfrost: Don't allow rendering/texturing 48-bit
Alyssa Rosenzweig [Sat, 16 Oct 2021 23:36:16 +0000 (19:36 -0400)]
panfrost: Don't allow rendering/texturing 48-bit

Matches freedreno. Fixes crashes in Piglit arb_texture_view.

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

2 years agoegl/wayland: Properly clear stale buffers on resize
Derek Foreman [Fri, 8 Oct 2021 13:55:44 +0000 (08:55 -0500)]
egl/wayland: Properly clear stale buffers on resize

The following chain of events results in an incorrectly sized buffer
persisting beyond its useful lifetime, and causing visual artifacts.

buffer is attached at size A
window is resized to size B
rendering takes place for size B
window is resized back to size A
swapbuffers with damage is called

In this scenario, update_buffers fails to recognize that the surface it's
about to commit is a different size than it has rendered. The
attached_width and attached_height are set incorrectly, and periodic
flickering is observed.

Instead, we set a boolean flag at time of resize and use this at the time
we latch the window dimensions as surface dimensions to decide whether to
discard stale buffers.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13270>

2 years agoradeonsi: don't memcmp inlined uniform values if uniform inlining is disabled
Marek Olšák [Tue, 14 Sep 2021 04:32:51 +0000 (00:32 -0400)]
radeonsi: don't memcmp inlined uniform values if uniform inlining is disabled

This uses a C++ template to compute the memcmp size at compile time,
which is important for getting inlined memcmp.

There are 4 different key sizes now:

    GE with inlined uniforms:    68 bytes
    GE without inlined uniforms: 52 bytes
    PS with inlined uniforms:    28 bytes
    PS without inlined uniforms: 12 bytes

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

2 years agoradeonsi: split si_shader_key into ps and ge parts to minimize memcmp overhead
Marek Olšák [Tue, 14 Sep 2021 03:09:22 +0000 (23:09 -0400)]
radeonsi: split si_shader_key into ps and ge parts to minimize memcmp overhead

ps is for the pixel shader, while ge is for VS, TCS, TES, and GS.

si_shader_key: 68 bytes
si_shader_key_ge: 68 bytes
si_shader_key_ps: 28 bytes

The only notable change is that si_shader_select_with_key is changed
to a C++ template. Other changes are trivial.

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

2 years agoradeonsi: si_state_shaders.c -> cpp
Marek Olšák [Tue, 14 Sep 2021 03:25:31 +0000 (23:25 -0400)]
radeonsi: si_state_shaders.c -> cpp

We'll add some templates here.

Why is `extern "C"` not needed for exported functions?

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

2 years agogallium/util: add some extern "C" guards
Marek Olšák [Tue, 14 Sep 2021 03:28:04 +0000 (23:28 -0400)]
gallium/util: add some extern "C" guards

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

2 years agocompiler/types: Add a wrap_in_arrays helper
Jason Ekstrand [Fri, 15 Oct 2021 21:26:32 +0000 (16:26 -0500)]
compiler/types: Add a wrap_in_arrays helper

This has been copied+pasted 3 times now.

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

2 years agospirv: Use texture types for sampled images
Jason Ekstrand [Fri, 15 Oct 2021 19:15:52 +0000 (14:15 -0500)]
spirv: Use texture types for sampled images

Instead of using gsamplerND types for sampled images, use the new
gtextureND types for sampled images and reserve gsamplerND for combined
image+samplers.  Combined image+sampler bindings still get a gsamplerND
type.

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

2 years agoclover/nir: Don't remove texture variables
Jason Ekstrand [Fri, 15 Oct 2021 21:55:46 +0000 (16:55 -0500)]
clover/nir: Don't remove texture variables

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

2 years agolavapipe: Allow for texture types
Jason Ekstrand [Fri, 15 Oct 2021 21:55:37 +0000 (16:55 -0500)]
lavapipe: Allow for texture types

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

2 years agonir/deref: Also optimize samplerND -> textureND casts
Jason Ekstrand [Fri, 15 Oct 2021 19:53:19 +0000 (14:53 -0500)]
nir/deref: Also optimize samplerND -> textureND casts

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

2 years agonir: Allow texture types
Jason Ekstrand [Fri, 15 Oct 2021 19:15:32 +0000 (14:15 -0500)]
nir: Allow texture types

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

2 years agocompiler/types: Add a texture type
Jason Ekstrand [Fri, 15 Oct 2021 18:56:57 +0000 (13:56 -0500)]
compiler/types: Add a texture type

This is separate from images and samplers.  It's a texture (not a
storage image) without a sampler.  We also add C-visible helpers to
convert between sampler and image types.

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

2 years agocompiler/types: Unify the guts of get_sampler/image_count
Jason Ekstrand [Fri, 15 Oct 2021 21:52:51 +0000 (16:52 -0500)]
compiler/types: Unify the guts of get_sampler/image_count

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

2 years agocompiler/types: Combine image and sampler type serialization
Jason Ekstrand [Fri, 15 Oct 2021 19:25:00 +0000 (14:25 -0500)]
compiler/types: Combine image and sampler type serialization

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

2 years agodri_interface: remove gl header
Yiwei Zhang [Fri, 15 Oct 2021 20:30:56 +0000 (20:30 +0000)]
dri_interface: remove gl header

Only gl typedefs are used. So just remove the header and update the
types to the underlying types.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>

2 years agodri_interface: remove obsolete interfaces
Yiwei Zhang [Fri, 15 Oct 2021 18:38:32 +0000 (18:38 +0000)]
dri_interface: remove obsolete interfaces

Below are removed:
__DRI_FRAME_TRACKING
__DRI_TEX_OFFSET
__DRI_GET_DRAWABLE_INFO

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13387>

2 years agonir/serialize: Pack deref modes better
Jason Ekstrand [Fri, 15 Oct 2021 18:25:50 +0000 (13:25 -0500)]
nir/serialize: Pack deref modes better

With nir_var_image, we've now run out of bits in our packed blob for
deref instructions.  We could revert to an unpacked blob or we could be
a bit more clever about how we encode deref modes and pack them into 5
bits.

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

2 years agonir: Re-arrange the variable modes
Jason Ekstrand [Fri, 15 Oct 2021 18:04:45 +0000 (13:04 -0500)]
nir: Re-arrange the variable modes

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

2 years agonir: s/nir_var_mem_image/nir_var_image/g
Jason Ekstrand [Fri, 15 Oct 2021 17:58:22 +0000 (12:58 -0500)]
nir: s/nir_var_mem_image/nir_var_image/g

We typically use nir_var_mem_* for stuff that has an explicit byte-based
memory layout.  Images are opaque.

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

2 years agomeson: use gtest protocol for gtest based tests when possible
Dylan Baker [Wed, 13 Jan 2021 21:10:21 +0000 (13:10 -0800)]
meson: use gtest protocol for gtest based tests when possible

With the `gtest` protocol meson will add some extra arguments to the
test to generate better junit results, which may be useful. This
protocol is only available in meson 0.55.0+, so keep using the default
`exitcode` protocol for meson older than that.

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

2 years agomicrosoft/compiler: Shadow tex instructions always use shadow samplers
Enrico Galli [Tue, 12 Oct 2021 18:31:27 +0000 (11:31 -0700)]
microsoft/compiler: Shadow tex instructions always use shadow samplers

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

2 years agoaux/pb: more correctly check number of reclaims
Mike Blumenkrantz [Fri, 15 Oct 2021 20:01:52 +0000 (16:01 -0400)]
aux/pb: more correctly check number of reclaims

the increment needs to happen before the comparison here

Fixes: 3d6c8829f54 ("aux/pb: add a tolerance for reclaim failure")

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

2 years agonir: Drop our attempt at typed-based image mode validation
Jason Ekstrand [Fri, 15 Oct 2021 17:46:58 +0000 (12:46 -0500)]
nir: Drop our attempt at typed-based image mode validation

This is broken for bindless images declared as local variables.  It
turns out nir_variable::data::bindless is only used for uniforms and we
already assume anything in nir_var_function_temp or similar is bindless.
We could try to make a tricky assert but now that we have everything
else passing but now that we've got everyone converted the extra
validation probably isn't necessary.

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

2 years agointel: fix INTEL_DEBUG environment variable on 32-bit systems
Marcin Ślusarz [Wed, 13 Oct 2021 09:21:41 +0000 (11:21 +0200)]
intel: fix INTEL_DEBUG environment variable on 32-bit systems

INTEL_DEBUG is defined (since 4015e1876a77162e3444eeaa29a0dfbc47efe90e) as:

 #define INTEL_DEBUG __builtin_expect(intel_debug, 0)

which unfortunately chops off upper 32 bits from intel_debug
on platforms where sizeof(long) != sizeof(uint64_t) because
__builtin_expect is defined only for the long type.

Fix this by changing the definition of INTEL_DEBUG to be function-like
macro with "flags" argument. New definition returns 0 or 1 when
any of the flags match.

Most of the changes in this commit were generated using:
for c in `git grep INTEL_DEBUG | grep "&" | grep -v i915 | awk -F: '{print $1}' | sort | uniq`; do
    perl -pi -e "s/INTEL_DEBUG & ([A-Z0-9a-z_]+)/INTEL_DBG(\1)/" $c
    perl -pi -e "s/INTEL_DEBUG & (\([A-Z0-9_ |]+\))/INTEL_DBG\1/" $c
done
but it didn't handle all cases and required minor cleanups (like removal
of round brackets which were not needed anymore).

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13334>

2 years agovirgl: remove unused pipebuffer include
Mike Blumenkrantz [Fri, 15 Oct 2021 18:15:25 +0000 (14:15 -0400)]
virgl: remove unused pipebuffer include

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

2 years agoaux/pb: add a tolerance for reclaim failure
Mike Blumenkrantz [Wed, 13 Oct 2021 17:34:30 +0000 (13:34 -0400)]
aux/pb: add a tolerance for reclaim failure

originally, a slab attempts to reclaim a single bo. there are two outcomes
to this which can occur:
* the bo is reclaimed
* the bo is not reclaimed

if the bo is reclaimed, great.

if the bo is not reclaimed, it remains at the head of the list until it can
be reclaimed. this means that any bo with a "long" work queue which makes it
into a slab will effectively kill the entire slab. in a benchmarking scenario,
this can occur in rapid succession, and every slab will get 1-2 suballocations
before it reaches a bo that blocks long enough for a new slab to be needed.

the inevitable result of this scenario is that all memory is depleted almost instantly,
all because pb assumes that if the first bo in the reclaim list isn't ready, none of them
can be ready

for drivers like radeonsi, this happens to be a fine assumption

for drivers like zink, this is entirely not workable and explodes the gpu

Cc: mesa-stable
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13345>

2 years agointel/compiler: Build all tests in a single binary
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:27:53 +0000 (23:27 -0700)]
intel/compiler: Build all tests in a single binary

With gtest is possible to filter execution and run only a specific
test suite or individual test, so there's no particular reason here to
generate multiple binaries for the tests of a single module.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>

2 years agointel/compiler: Rename vec4 test fixtures
Caio Marcelo de Oliveira Filho [Tue, 12 Oct 2021 06:20:39 +0000 (23:20 -0700)]
intel/compiler: Rename vec4 test fixtures

Include vec4 in their names to avoid same names as the fs
counterparts.  This will allow compiling all the tests together in the
future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13303>

2 years agofreedreno/isa: Add immed reg accessors
Rob Clark [Wed, 13 Oct 2021 22:53:55 +0000 (15:53 -0700)]
freedreno/isa: Add immed reg accessors

This way we can assert that a src that we expect to be an immediate
actually is.

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

2 years agoisaspec: Add bitfield size assertions
Rob Clark [Mon, 11 Oct 2021 18:50:03 +0000 (11:50 -0700)]
isaspec: Add bitfield size assertions

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

2 years agoisaspec: Do not emit duplicate field encodes
Rob Clark [Wed, 13 Oct 2021 17:55:16 +0000 (10:55 -0700)]
isaspec: Do not emit duplicate field encodes

If an <override> overrides the definition of a field, don't emit
encoding for both the override's definition and the fallback.  (See
"SAMP" in #cat5-src3).  It is harmless currently, because (in this
case) it will just re-encode the low bits of "SAMP".  But when we
start asserting on that the field being encoded fits in the allowed
number of bits, the re-encoding of the fallback field definition
will start triggering asserts.

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

2 years agoisaspec: Fix derived field width
Rob Clark [Tue, 12 Oct 2021 21:22:25 +0000 (14:22 -0700)]
isaspec: Fix derived field width

The low/high bit positions should be integers.

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

2 years agofreedreno/ir3: Don't lower s2en if samp/tex is too large
Rob Clark [Wed, 13 Oct 2021 21:14:29 +0000 (14:14 -0700)]
freedreno/ir3: Don't lower s2en if samp/tex is too large

We only have four bits to encode an immediate samp/tex.

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