platform/upstream/mesa.git
3 years agozink: use vkresult helper for map return
Mike Blumenkrantz [Mon, 17 May 2021 19:03:11 +0000 (15:03 -0400)]
zink: use vkresult helper for map return

consistency++

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

3 years agoutil/disk_cache: Don't leak when cache is empty
Daniel Stone [Thu, 1 Jul 2021 22:58:49 +0000 (23:58 +0100)]
util/disk_cache: Don't leak when cache is empty

When we exit early having failed to find any candidate cache files to
evict, don't leak the list head whilst doing so.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: f58e6fee7452 ("util/disk_cache: delete more cache items in one go when full")
Ref: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11523>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11682>

3 years agozink: add resource refs after last descriptor unbind
Mike Blumenkrantz [Tue, 11 May 2021 13:17:28 +0000 (09:17 -0400)]
zink: add resource refs after last descriptor unbind

redundant at this point; no functional changes

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

3 years agozink: split samplerview/imageview usage/refcounting calls
Mike Blumenkrantz [Tue, 11 May 2021 13:13:42 +0000 (09:13 -0400)]
zink: split samplerview/imageview usage/refcounting calls

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

3 years agozink: split batch usage setting from refcounting
Mike Blumenkrantz [Tue, 11 May 2021 12:44:29 +0000 (08:44 -0400)]
zink: split batch usage setting from refcounting

batch tracking has until now been the same as refcounting, but this
is inefficient and incurs additional overhead from constant atomic ops,
so make them separate

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

3 years agozink: split out resource tracking into more incremental functions
Mike Blumenkrantz [Mon, 10 May 2021 23:39:34 +0000 (19:39 -0400)]
zink: split out resource tracking into more incremental functions

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

3 years agozink: remove stencil resource batch tracking
Mike Blumenkrantz [Mon, 10 May 2021 23:32:05 +0000 (19:32 -0400)]
zink: remove stencil resource batch tracking

I think maybe I misunderstood how things worked, or there were issues
generally with resource lifetimes, or whatever, but this isn't needed anymore

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

3 years agozink: don't add batch tracking during buffer rebinds if refs are dirty
Mike Blumenkrantz [Mon, 10 May 2021 19:48:26 +0000 (15:48 -0400)]
zink: don't add batch tracking during buffer rebinds if refs are dirty

this will be handled automatically

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

3 years agozink: add more explicit casts to draw code
Mike Blumenkrantz [Fri, 2 Jul 2021 01:13:17 +0000 (21:13 -0400)]
zink: add more explicit casts to draw code

this makes c++ happy

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

3 years agozink: add c++ header guards
Mike Blumenkrantz [Fri, 2 Jul 2021 01:13:06 +0000 (21:13 -0400)]
zink: add c++ header guards

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

3 years agozink: remove unnecessary return from zink_desc_type_from_vktype()
Mike Blumenkrantz [Tue, 11 May 2021 18:21:07 +0000 (14:21 -0400)]
zink: remove unnecessary return from zink_desc_type_from_vktype()

this doesn't compile in c++

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

3 years agozink: rename 'template' struct member
Mike Blumenkrantz [Wed, 12 May 2021 11:39:12 +0000 (07:39 -0400)]
zink: rename 'template' struct member

this is a c++ keyword

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

3 years agozink: make prim type a bitfield in pipeline info
Mike Blumenkrantz [Tue, 11 May 2021 17:51:47 +0000 (13:51 -0400)]
zink: make prim type a bitfield in pipeline info

match draw info here

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

3 years agonir: Fix constant folding for irhadd/urhadd
Alyssa Rosenzweig [Wed, 30 Jun 2021 22:16:55 +0000 (18:16 -0400)]
nir: Fix constant folding for irhadd/urhadd

This should be a subtract, not an add. The comment's proof is correct,
but the (wrong) expression we actually use isn't what it's in the
comment! Correct the discrepancy.

The lowering in nir_opt_algebraic was correctly typed.

Fixes: 272e927d0e9 ("nir/spirv: initial handling of OpenCL.std extension opcodes")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11671>

3 years agozink: rework pipeline cache implementation
Mike Blumenkrantz [Sun, 9 May 2021 15:13:09 +0000 (11:13 -0400)]
zink: rework pipeline cache implementation

this is now a screen-based queue which can be triggered to serialize
cache updates, ensuring synchronization

the cache is on the program object, enabling incremental updates as well as
variant loading for an entire pipeline collection at once

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

3 years agozink: merge some streamout state emission into the same draw conditional
Mike Blumenkrantz [Tue, 11 May 2021 16:42:11 +0000 (12:42 -0400)]
zink: merge some streamout state emission into the same draw conditional

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

3 years agozink: move line width and depth bias updating into conditional during draw
Mike Blumenkrantz [Tue, 11 May 2021 16:38:57 +0000 (12:38 -0400)]
zink: move line width and depth bias updating into conditional during draw

only do calculations when needed

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

3 years agozink: unify fb surface unbinding
Mike Blumenkrantz [Tue, 11 May 2021 13:37:10 +0000 (09:37 -0400)]
zink: unify fb surface unbinding

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

3 years agozink: add a ref for flush resource
Mike Blumenkrantz [Fri, 28 May 2021 19:06:53 +0000 (15:06 -0400)]
zink: add a ref for flush resource

the lifetime of this needs to always be preserved

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

3 years agozink: break up ctx descriptor state updating to per-type functions
Mike Blumenkrantz [Mon, 10 May 2021 19:14:06 +0000 (15:14 -0400)]
zink: break up ctx descriptor state updating to per-type functions

this is a bit easier to read/manage going forward

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

3 years agozink: unify/consolidate some barrier queuing
Mike Blumenkrantz [Mon, 10 May 2021 18:52:55 +0000 (14:52 -0400)]
zink: unify/consolidate some barrier queuing

this queuing is based on bind counts, and it's all the same, so it
can mostly be combined for better reuse

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

3 years agozink: avoid unnecessarily rewriting gl_DrawID
Mike Blumenkrantz [Fri, 29 Jan 2021 22:12:44 +0000 (17:12 -0500)]
zink: avoid unnecessarily rewriting gl_DrawID

with tc enabled, we get genuine multidraws with valid drawids, so we can
update this to reflect the new capabilities...which are the same as the old
ones except that potentially some drivers can now do direct multidraws

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

3 years agomicrosoft/compiler: Change behavior for emitting inexpressible barriers
Jesse Natalie [Sun, 11 Apr 2021 21:32:09 +0000 (14:32 -0700)]
microsoft/compiler: Change behavior for emitting inexpressible barriers

If the barrier tries to apply to memory that we can't express, just
don't apply the memory portion of the barrier. Similarly, if it tries
to apply a global memory barrier at invocation level, upgrade it to
thread-group.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11670>

3 years agodocs/isl/tiling: Fix swizzle pattern for X-tiling
Jason Ekstrand [Thu, 1 Jul 2021 19:05:41 +0000 (14:05 -0500)]
docs/isl/tiling: Fix swizzle pattern for X-tiling

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

3 years agolavapipe: Add a missing VKAPI_ATTR.
Georg Lehmann [Mon, 7 Jun 2021 17:31:25 +0000 (19:31 +0200)]
lavapipe: Add a missing VKAPI_ATTR.

Signed-off-by: Georg Lehmann's avatarGeorg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>

3 years agolavapipe: Use common default allocator.
Georg Lehmann [Tue, 1 Jun 2021 15:37:06 +0000 (17:37 +0200)]
lavapipe: Use common default allocator.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>

3 years agooverlay_layer: add missing undef
Luis Felipe Strano Moraes [Wed, 23 Jun 2021 21:03:11 +0000 (14:03 -0700)]
overlay_layer: add missing undef

reviewed-by: Dylan Baker <dylan@pnwbakers.com>

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

3 years agomeson: print information about layers being built as part of summary
Luis Felipe Strano Moraes [Wed, 12 May 2021 23:12:36 +0000 (16:12 -0700)]
meson: print information about layers being built as part of summary

reviewed-by: Dylan Baker <dylan@pnwbakers.com>

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

3 years agogallium/u_threaded: do not apply start twice
Erik Faye-Lund [Tue, 29 Jun 2021 08:45:44 +0000 (10:45 +0200)]
gallium/u_threaded: do not apply start twice

We already apply start when setting the bits in writable_buffer, so
shifting the bits up by start just makes us apply the offset twice.

Caught by Coverity.

Fixes: 988d0917208 ("gallium/u_threaded: clear valid buffer range only if it's not bound for write")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11635>

3 years agoradv: disable DCC for DOOM 2016 and Wolfenstein II
Samuel Pitoiset [Wed, 30 Jun 2021 15:32:25 +0000 (17:32 +0200)]
radv: disable DCC for DOOM 2016 and Wolfenstein II

Both games perform two image layout transitions with the same image
in the same pipeline barrier with UNDEFINED and this re-initializes
DCC to the uncompressed state. No ideal solution sadly. Note that
both games declare all images as CONCURRENT.

This fixes rendering issues on GFX10+ because DCC for stores is
supported and this implicitly enables DCC for concurrent.

Fixes: da166f648f6 ("radv: enable DCC for concurrent images on GFX10")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4927
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4607
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/11656>

3 years agozink: drop getenv hacking now that gallium is fixed.
Dave Airlie [Tue, 29 Jun 2021 19:25:10 +0000 (05:25 +1000)]
zink: drop getenv hacking now that gallium is fixed.

This drops the getenv hacks which cause problems testing multithread apps

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

3 years agogallium/sw: add sw_vk bit to avoid having to futz with env vars for lavapipe
Dave Airlie [Tue, 29 Jun 2021 19:22:58 +0000 (05:22 +1000)]
gallium/sw: add sw_vk bit to avoid having to futz with env vars for lavapipe

lavapipe really only currently works with llvmpipe, and likely for the forseeable
future.

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

3 years agoradv: enable VK_KHR_shader_subgroup_uniform_control_flow
Rhys Perry [Mon, 21 Jun 2021 15:54:56 +0000 (16:54 +0100)]
radv: enable VK_KHR_shader_subgroup_uniform_control_flow

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

3 years agoaco: handle NIR loops without breaks
Rhys Perry [Tue, 22 Jun 2021 14:23:37 +0000 (15:23 +0100)]
aco: handle NIR loops without breaks

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11626>

3 years agoci: update VK-GL-CTS to 1.2.6.2
Juan A. Suarez Romero [Wed, 30 Jun 2021 12:13:31 +0000 (14:13 +0200)]
ci: update VK-GL-CTS to 1.2.6.2

v1:
 - Fix typos (Emma)
 - Remove needless sort (Adam)

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11654>

3 years agoRevert "CI: Disable LAVA devices for maintenance"
Daniel Stone [Wed, 30 Jun 2021 21:54:05 +0000 (22:54 +0100)]
Revert "CI: Disable LAVA devices for maintenance"

This actually came back a few hours ago.

This reverts commit b07dc014c44849af59f98afa3a1703c9d9d3cf27.

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

3 years agoturnip/kgsl: new flag TU_USE_KGSL
Hyunjun Ko [Fri, 18 Jun 2021 00:52:00 +0000 (00:52 +0000)]
turnip/kgsl: new flag TU_USE_KGSL

There are some cases using kgsl backend on linux that is still not usual
setup though, we need to consider too.

Regarding the timeline semaphore feature, we could implement it for
the kgsl backend in the future, and probalby it should be using the
existing code in tu_drm.

See #4738, #4907

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11488>

3 years agovenus: fix AHB VkBuffer memory requirement
Yiwei Zhang [Wed, 30 Jun 2021 18:39:00 +0000 (18:39 +0000)]
venus: fix AHB VkBuffer memory requirement

Layering AHB on top of dma_buf_fd requires venus to combine the memory
type bits internally for VkBuffer.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: handle ahb backed VkBuffer creation properly
Yiwei Zhang [Wed, 30 Jun 2021 17:28:47 +0000 (17:28 +0000)]
venus: handle ahb backed VkBuffer creation properly

Venus needs to override the external handle type from AHB to dma buf.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: prepare vn_CreateBuffer for AHB
Yiwei Zhang [Wed, 30 Jun 2021 06:04:39 +0000 (06:04 +0000)]
venus: prepare vn_CreateBuffer for AHB

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agovenus: add more logs for Android WSI debugging
Yiwei Zhang [Wed, 30 Jun 2021 06:02:17 +0000 (06:02 +0000)]
venus: add more logs for Android WSI debugging

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>

3 years agolavapipe: implement EXT_vertex_input_dynamic_state
Mike Blumenkrantz [Fri, 28 May 2021 20:19:20 +0000 (16:19 -0400)]
lavapipe: implement EXT_vertex_input_dynamic_state

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

3 years agolavapipe: hook up some bits for handling dynamic line stipple state
Mike Blumenkrantz [Mon, 7 Jun 2021 23:26:30 +0000 (19:26 -0400)]
lavapipe: hook up some bits for handling dynamic line stipple state

this won't actually work, but it stubs out some (functional) placeholder
code for later code to build on

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

3 years agoanv: remove dead code
Thomas H.P. Andersen [Tue, 29 Jun 2021 20:31:06 +0000 (22:31 +0200)]
anv: remove dead code

The unused bo_flags here is a leftover from the past. A similar
setup of bo_flags is now performed within anv_device_alloc_bo
via a call to anv_bo_alloc_flags_to_bo_flags.

Reviewed-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/11645>

3 years agofreedreno: Flush the shadowed resource's write batch up front.
Emma Anholt [Tue, 22 Jun 2021 22:16:00 +0000 (15:16 -0700)]
freedreno: Flush the shadowed resource's write batch up front.

This simplifies my mental model of the swapping/blit process for resource
shadowing.

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

3 years agofreedreno: Swap needs_ubwc_clear when shadowing.
Emma Anholt [Tue, 22 Jun 2021 22:10:12 +0000 (15:10 -0700)]
freedreno: Swap needs_ubwc_clear when shadowing.

The destination of the upcoming blit (the old rsc struct that houses the
fresh BO) wouldn't have its ubwc cleared first, which if it got
unfortunate data in a recycled BO could lead to blit failures.

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

3 years agofreedreno: Stop manually marking blit dst buffers as valid.
Emma Anholt [Tue, 22 Jun 2021 22:06:47 +0000 (15:06 -0700)]
freedreno: Stop manually marking blit dst buffers as valid.

fd_batch_resource_write() does this already.

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

3 years agofreedreno/a5xx: Make sure to mark blit read/write access in the BC.
Emma Anholt [Tue, 22 Jun 2021 22:05:37 +0000 (15:05 -0700)]
freedreno/a5xx: Make sure to mark blit read/write access in the BC.

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

3 years agofreedreno: swap ->valid when shadowing resources.
Emma Anholt [Tue, 22 Jun 2021 21:55:37 +0000 (14:55 -0700)]
freedreno: swap ->valid when shadowing resources.

The valid flag indicates whether the bo has had any data written to it.
Failure to swap it meant that if for some reason we fell back to SW
mappings during the blit from shadow, the PIPE_MAP_READ staging blit would
get dropped.

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

3 years agofreedreno: Update comments about PIPE_BUFFER shadowing.
Emma Anholt [Tue, 22 Jun 2021 21:55:10 +0000 (14:55 -0700)]
freedreno: Update comments about PIPE_BUFFER shadowing.

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

3 years agodocs/release-calendar: add a few more 21.1 releases
Eric Engestrom [Wed, 30 Jun 2021 18:44:28 +0000 (19:44 +0100)]
docs/release-calendar: add a few more 21.1 releases

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

3 years agodocs: update calendar and link releases notes for 21.1.4
Eric Engestrom [Wed, 30 Jun 2021 18:38:19 +0000 (19:38 +0100)]
docs: update calendar and link releases notes for 21.1.4

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

3 years agodocs: add release notes for 21.1.4
Eric Engestrom [Wed, 30 Jun 2021 18:02:52 +0000 (19:02 +0100)]
docs: add release notes for 21.1.4

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

3 years agoaco: remove resource flags
Rhys Perry [Fri, 18 Sep 2020 15:24:14 +0000 (16:24 +0100)]
aco: remove resource flags

After disabling SMEM stores, nir_opt_access() now does the same analysis
and we don't need this anymore. Doing it in isel is also too late if we
want to lower descriptor loads in NIR.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11652>

3 years agoi915g: Set up the cube map texture wrap modes.
Emma Anholt [Wed, 30 Jun 2021 04:01:19 +0000 (21:01 -0700)]
i915g: Set up the cube map texture wrap modes.

There are HW limits on what you're allowed to do.  No change on dEQP, but
one less thing for me to worry about with our busted cubes.

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

3 years agoi915g: Add curly braces for normal mesa style (and helps clang-format)
Emma Anholt [Wed, 30 Jun 2021 04:01:47 +0000 (21:01 -0700)]
i915g: Add curly braces for normal mesa style (and helps clang-format)

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

3 years agoi915g: Delete redundant i915_hw_sampler_views atom.
Emma Anholt [Wed, 30 Jun 2021 03:46:13 +0000 (20:46 -0700)]
i915g: Delete redundant i915_hw_sampler_views atom.

The i915_hw_samplers atom already updated both samplers and maps, since
both samplers and maps depend on parts of both the gallium sampler state
and the sampler view.  Just move the samplers+views atom down to the
bottom of the file for legibility, and delete the views-only one.

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

3 years agoi915g: Fix FS debug dumping for declarations.
Emma Anholt [Wed, 30 Jun 2021 03:30:03 +0000 (20:30 -0700)]
i915g: Fix FS debug dumping for declarations.

Samplers have a type, and non-samplers have a destination writemask.

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

3 years agoi915g: Add the nice cube map layout comments from i915c.
Emma Anholt [Wed, 30 Jun 2021 02:50:26 +0000 (19:50 -0700)]
i915g: Add the nice cube map layout comments from i915c.

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

3 years agoi915g: Finish the uint -> uint32_t conversion.
Emma Anholt [Wed, 30 Jun 2021 03:32:08 +0000 (20:32 -0700)]
i915g: Finish the uint -> uint32_t conversion.

My sed job missed a few.

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

3 years agofreedreno/a6xx: Fix framebuffer_barrier crash
Rob Clark [Wed, 30 Jun 2021 16:49:40 +0000 (09:49 -0700)]
freedreno/a6xx: Fix framebuffer_barrier crash

This is emitting cmdstream, it should take the submit lock to (a) ensure
we actually have a batch, and (b) prevent it from being flushed from
under it.  This was overlooked in the conversion.

Fixes: 02298ed1fc6 ("freedreno: Add submit lock")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11658>

3 years agoegl: android: add IMapper@4 metadata API buffer_info getter
Roman Stratiienko [Tue, 15 Dec 2020 14:50:19 +0000 (16:50 +0200)]
egl: android: add IMapper@4 metadata API buffer_info getter

Starting from Android-11 Google introduces generalized API
to access buffer information. This API is a part of IMapper@4 HAL.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6045>

3 years agoegl: android: prepare code for adding more buffer_info getters
Roman Stratiienko [Thu, 20 Aug 2020 15:31:17 +0000 (18:31 +0300)]
egl: android: prepare code for adding more buffer_info getters

Instead of calling droid_create_image_ for every gralloc implementation,
create struct buffer_info which contains all required field for invoking
createImageFromDmaBufs2() and let the getters to fill this structure.
Since createImageFromDmaBufs2() is called now only once, the code looks
cleaner and more robust.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6045>

3 years agointel: fix leaking memory on shader creation
Yevhenii Kolesnikov [Tue, 29 Jun 2021 15:49:42 +0000 (18:49 +0300)]
intel: fix leaking memory on shader creation

ralloc_adopt takes care of all the shader's children, but shader itsel ends up
orphaned and never gets free'd.

Fixes: ef5bce9253e ("intel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4951

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11651>

3 years agointel/fs: Lower uniform pull constant load message to LSC dataport
Jason Ekstrand [Sat, 26 Jun 2021 16:11:09 +0000 (11:11 -0500)]
intel/fs: Lower uniform pull constant load message to LSC dataport

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower varying pull constant load message to LSC dataport
Sagar Ghuge [Tue, 4 May 2021 21:57:50 +0000 (14:57 -0700)]
intel/fs: Lower varying pull constant load message to LSC dataport

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower A64 atomic messages to LSC dataport
Sagar Ghuge [Tue, 4 May 2021 04:13:09 +0000 (21:13 -0700)]
intel/fs: Lower A64 atomic messages to LSC dataport

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower A64 byte scattered r/w messages to LSC dataport
Sagar Ghuge [Tue, 4 May 2021 03:11:29 +0000 (20:11 -0700)]
intel/fs: Lower A64 byte scattered r/w messages to LSC dataport

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower A64 untyped r/w messages to LSC when available
Mark Janes [Mon, 3 May 2021 19:42:03 +0000 (12:42 -0700)]
intel/fs: Lower A64 untyped r/w messages to LSC when available

We set the ex_desc to 0, since the address surface type is FLAT.

v2 (Sagar Ghuge):
 - Fix message descriptor encoding

v2 (Jason Ekstrand):
 - Drop support for block messages

Co-authored-by: Sagar Ghuge <sagar.ghuge@intel.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower Byte scattered r/w messages to LSC when available
Sagar Ghuge [Fri, 30 Apr 2021 06:58:26 +0000 (23:58 -0700)]
intel/fs: Lower Byte scattered r/w messages to LSC when available

v2 (Jason Ekstrand):
 - Squash in brw_scheduler changes
 - Update brw_ir_performance

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower untyped float atomic messages to LSC when available
Sagar Ghuge [Fri, 30 Apr 2021 03:50:42 +0000 (20:50 -0700)]
intel/fs: Lower untyped float atomic messages to LSC when available

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower untyped atomic messages to LSC when available
Mark Janes [Fri, 30 Apr 2021 01:48:03 +0000 (18:48 -0700)]
intel/fs: Lower untyped atomic messages to LSC when available

Bspec programming note metions that "Atomic messages are always forced
to "un-cacheable" in the L1 cache". We can make the L1 cache
un-cacheable and L3 with write-back policy.

v2: (Sagar Ghuge):
 - Fix caching policy for atomic messages
 - Fix simd exec size

v3: (Sagar Ghuge):
 - Add atomic messages to brw_schedule_instructions

v4: (Jason Ekstrand):
 - Rebase on lsc_msg_desc reworks

Co-authored-by: Sagar Ghuge <sagar.ghuge@intel.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/fs: Lower DW untyped r/w messages to LSC when available
Mark Janes [Tue, 26 Jan 2021 22:01:43 +0000 (14:01 -0800)]
intel/fs: Lower DW untyped r/w messages to LSC when available

This puts the basic infrastructure in place for lowering logical
dataport messages to LSC messages.  We start with the two most obvious
opcodes and add more in later patches.

v2 (Sagar Ghuge):
 - Pass required params to message desc
 - Remove duplicate mlen calculation
 - Change commit message.

v3 (Jason Ekstrand):
 - Drop TGM support

Co-authored-by: Jason Ekstrand <mark.a.janes@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Add LSC messages to brw_schedule_instructions
Mark Janes [Thu, 29 Apr 2021 19:48:02 +0000 (12:48 -0700)]
intel/compiler: Add LSC messages to brw_schedule_instructions

v2 (Jason Ekstrand):
 - Use lsc_msg_desc_opcode()
 - Drop all opcodes for now and add them in later patches.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Add LSC to messages brw_ir_performance
Jason Ekstrand [Thu, 24 Jun 2021 22:48:01 +0000 (17:48 -0500)]
intel/compiler: Add LSC to messages brw_ir_performance

This adds framework only.  No opcodes.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/disasm: Disassemble LSC message extended descriptors
Sagar Ghuge [Wed, 5 Aug 2020 06:04:52 +0000 (23:04 -0700)]
intel/disasm: Disassemble LSC message extended descriptors

v2 (Mark Janes):
 - changed to lsc convention

v3 (Jason Ekstrand):
 - Use lsc_msg_desc_addr_type

Co-authored-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/disasm: Disassmeble LSC messages
Sagar Ghuge [Sun, 12 Jul 2020 01:35:37 +0000 (18:35 -0700)]
intel/disasm: Disassmeble LSC messages

v2 (Jordan Justen):
 - Use PRIu64

v3 (Jason Ekstrand):
 - Drop ranged fence ops, Jason

v4: (Mark Janes)
 - fixed missing parameter to brw_message_desc_cmask_or_vector
 - changed to use lsc methods to extract fields

v5 (Jason Ekstrand):
 - Squash original disassembler patch and fixes togetherk
 - Use lsc_opcode_has_cmask
 - Prefix atomic ops with "atomic_"

Co-authored-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Add getter helpers for LSC message descriptor fields
Mark Janes [Fri, 12 Feb 2021 21:20:44 +0000 (13:20 -0800)]
intel/compiler: Add getter helpers for LSC message descriptor fields

v2: (Sagar Ghuge):
 - rename addr_reg_size to src0_len to match with bspec

v3 (Jason Ekstrand):
 - Re-arrange things in increasing bit order

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Add helpers for LSC message descriptors
Sagar Ghuge [Tue, 28 Jul 2020 23:10:25 +0000 (16:10 -0700)]
intel/compiler: Add helpers for LSC message descriptors

v2 (Jason Ekstrand):
 - Squash all the similar patches together
 - Re-arrange and rename some things to be more consistent
 - Add a lsc_opcode_has_cmask helper
 - Drop is_one_addr_reg

v3 (Jason Ekstrand):
 - Add transpose
 - Re-order arguments to make more logical sense
 - Switch from `write` to `has_dest`

Co-authored-by: Mark Janes <mark.a.janes@intel.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Add support for LSC fence operations
Sagar Ghuge [Sun, 12 Jul 2020 01:33:05 +0000 (18:33 -0700)]
intel/compiler: Add support for LSC fence operations

v2 (Jason Ekstrand):
 - Squash SLM and global fence ops together

v3 (Jason Ekstrand):
 - Rework to use message descriptors instead of instruction fields

v4 (Jason Ekstrand):
 - Don't pass BTI into back-end emit function.  Always use FLAT.

Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/compiler: Define new LSC data port encodings
Sagar Ghuge [Sat, 11 Jul 2020 23:37:29 +0000 (16:37 -0700)]
intel/compiler: Define new LSC data port encodings

Xe-HPG comes with a massively reworked dataport.  The new thing, called
Load/Store Cache or LSC, has a significantly improved interface.
Instead of bespoke messages for every case, there's basically one or two
messages with different bits to control things like address size, how
much data is read/written, etc.  It's way nicer but also means we get to
rewrite all our dataport encoding/decoding code.  This patch kicks off
the party with all of the new enums.

v2 (Jason Ekstrand, Mark Janes):
 - Rename to LSC

v3 (Jason Ekstrand):
 - Add numbers to all enums

Co-authored-by: Mark Janes <mark.a.janes@intel.com>
Co-authored-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agointel/devinfo: Add a has_lsc bit
Jason Ekstrand [Thu, 24 Jun 2021 20:13:57 +0000 (15:13 -0500)]
intel/devinfo: Add a has_lsc bit

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11600>

3 years agoradeon/vcn: calc_dpb_size should be based on dpb_type
SureshGuttula [Tue, 29 Jun 2021 05:11:14 +0000 (10:41 +0530)]
radeon/vcn: calc_dpb_size should be based on dpb_type

This patch will fix the dpb size calculated for each dpb_type.
Current implementaion always calculating based on DPB_MAX_RES.To fix
this dpb_type should be decided before calc_dpb_size.

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11633>

3 years agoradv: pre-calc vertex buffer descriptor size on pipeline object
Mike Blumenkrantz [Wed, 2 Jun 2021 16:55:34 +0000 (12:55 -0400)]
radv: pre-calc vertex buffer descriptor size on pipeline object

util_bitcount has a nonzero cost, and calling it like this in a hotpath
generates unnecessary overhead

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

3 years agozink: attempt to handle some resource unmap cases in 32bit envs
Mike Blumenkrantz [Fri, 7 May 2021 23:08:18 +0000 (19:08 -0400)]
zink: attempt to handle some resource unmap cases in 32bit envs

address space is limited here, so in some cases it's worthwhile to
unmap resources

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

3 years agozink: cache visible vram
Mike Blumenkrantz [Fri, 7 May 2021 21:51:02 +0000 (17:51 -0400)]
zink: cache visible vram

yolo

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

3 years agozink: uncap mem caching
Mike Blumenkrantz [Fri, 7 May 2021 21:24:53 +0000 (17:24 -0400)]
zink: uncap mem caching

if it fits, it sits

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

3 years agozink: make mem cache limits dynamically scalable
Mike Blumenkrantz [Fri, 7 May 2021 20:05:51 +0000 (16:05 -0400)]
zink: make mem cache limits dynamically scalable

this removes the hardcoded count of 5 mem blocks to cache and replaces
it with a value that's based on the number of allocations seen

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

3 years agozink: don't align device-local buffer memory
Mike Blumenkrantz [Fri, 7 May 2021 20:07:47 +0000 (16:07 -0400)]
zink: don't align device-local buffer memory

this can't be mapped

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

3 years agozink: try for better buffer allocation heaps
Mike Blumenkrantz [Thu, 6 May 2021 13:53:37 +0000 (09:53 -0400)]
zink: try for better buffer allocation heaps

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

3 years agor600/sfn: initialize all texture lower options
Gert Wollny [Wed, 30 Jun 2021 09:06:11 +0000 (11:06 +0200)]
r600/sfn: initialize all texture lower options

Fixes: d1edf3cdf285f62c153c6bb910fc0a2c40c4e159
    r600/sfn: Lower offset in TXF instructions

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11650>

3 years agoanv: drop unused argument of anv_descriptor_set_address
Marcin Ślusarz [Mon, 28 Jun 2021 15:14:08 +0000 (17:14 +0200)]
anv: drop unused argument of anv_descriptor_set_address

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

3 years agoanv: handle push descriptor sets when they are sent with push constants
Marcin Ślusarz [Mon, 28 Jun 2021 11:06:07 +0000 (13:06 +0200)]
anv: handle push descriptor sets when they are sent with push constants

When vkCmdPushDescriptorSetKHR is used, the descriptor set is allocated
internally without belonging to any pool. Such descriptor set will be
visible on the GPU side because it's a part of the dynamic state stream,
but we still have to store its address in the array of descriptor sets.

Complements: 379b9bb7b04 ("anv: Support fetching descriptor addresses from push constants")

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

3 years agoanv: keep descriptor set's address directly in anv_descriptor_set
Marcin Ślusarz [Mon, 28 Jun 2021 10:56:31 +0000 (12:56 +0200)]
anv: keep descriptor set's address directly in anv_descriptor_set

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

3 years agoutil/disk_cache: delete more cache items in one go when full
Timothy Arceri [Tue, 22 Jun 2021 09:50:47 +0000 (19:50 +1000)]
util/disk_cache: delete more cache items in one go when full

Currently the cache just deletes enough items when the cache is
full to make room for the new item being stored. This hasn't
been too much of a problem in practice but for things like running
piglit where we have thousands of unique shaders and all threads
being utilised we end up with a pretty big bottle neck.

With this change rather than just brute forcing our way to having
enough room for the new item, we instead grab 10% of the least
recently used items in the random directory we chose and delete
them all. This should only be around 0.04% of total cache items
but should hopefully releave some of the pressure on system calls
like fstatat().

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

3 years agoCI: Disable LAVA devices for maintenance
Daniel Stone [Wed, 30 Jun 2021 06:43:47 +0000 (07:43 +0100)]
CI: Disable LAVA devices for maintenance

LAVA will be unavailable for probably most of the day today due to
scheduled maintenance; doing some spring cleaning to upgrade to a new
version, clean out the database, etc.

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

3 years agoradv: fix fd leak in vkAcquireImageANDROID()
Samuel Pitoiset [Tue, 22 Jun 2021 06:36:16 +0000 (08:36 +0200)]
radv: fix fd leak in vkAcquireImageANDROID()

Copied from ANV.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4915
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11518>

3 years agovulkan/wsi: prefer the Wayland linux-dmabuf protocol
Simon Ser [Thu, 28 May 2020 17:59:35 +0000 (19:59 +0200)]
vulkan/wsi: prefer the Wayland linux-dmabuf protocol

When the linux-dmabuf protocol is available, prefer it over the old
wl_drm protocol. Previously wl_drm was used when modifiers aren't
supported, however linux-dmabuf supports formats without modifiers too.
In this case, linux-dmabuf will send a DRM_FORMAT_MOD_INVALID modifier
for each supported format [1].

All of this allows compositors to better handle these buffers, getting a
DMA-BUF and implementing features like direct scan-out.

A similar logic has been implemented for EGL [2].

In this patch, we bind to linux-dmabuf even if the driver doesn't support
modifiers. In this case the formats advertised by the compositor will
still be added to the display->dmabuf.formats list.

In wsi_wl_image_init, drop the assertions that display->drm_wrapper and
display->dmabuf.wl_dmabuf can't be both present. If the driver doesn't
support modifiers, the modifier is already set to DRM_FORMAT_MOD_INVALID.
If the parent compositor doesn't support modifiers, the modifiers list
passed to wsi_create_native_image will be empty, and the common code
will ensure that the image's modifier is set to DRM_FORMAT_MOD_INVALID.

In wsi_wl_surface_create_swapchain, create the wl_proxy proxy if we've
bound to it earlier. Don't decide to create the proxy depending on the
number of supported modifiers.

[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/commit/fb9b2a87317c77e26283da5f6c9559d709f6fdcd
[2]: https://gitlab.freedesktop.org/mesa/mesa/-/commit/c376865f5eeca535c4aa8e33bcf166052c1ce2f2

Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4942>

3 years agovulkan/wsi: unify format logic in dmabuf_handle_modifier
Simon Ser [Thu, 28 May 2020 17:54:49 +0000 (19:54 +0200)]
vulkan/wsi: unify format logic in dmabuf_handle_modifier

This function has a switch which currently duplicates the format
handling logic.

Move this logic out of the switch.

This avoids repeating the same code for each supported format and
prepares the work for proper DRM_FORMAT_MOD_INVALID handling.

Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4942>

3 years agozink: split dummy buffer creation and populate
Mike Blumenkrantz [Thu, 6 May 2021 19:26:54 +0000 (15:26 -0400)]
zink: split dummy buffer creation and populate

populate requires the queue to be set up, but the resources must be created
before descriptor init

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