platform/upstream/mesa.git
18 months agoradv: regroup dynamic states initialization
Samuel Pitoiset [Fri, 27 Jan 2023 17:22:32 +0000 (18:22 +0100)]
radv: regroup dynamic states initialization

It should be possible to initialize these inside libraries at some
point.

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

18 months agoradv: ignore all CB dynamic states when there is no color attachments
Samuel Pitoiset [Fri, 27 Jan 2023 17:14:50 +0000 (18:14 +0100)]
radv: ignore all CB dynamic states when there is no color attachments

This simplifies radv_init_dynamic_state() slightly.

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

18 months agoci: Run our manual jobs during the nightly scheduled run.
Emma Anholt [Thu, 26 Jan 2023 21:14:19 +0000 (13:14 -0800)]
ci: Run our manual jobs during the nightly scheduled run.

We have a common pain point with fractional CTS coverage, where the test
list changes on a CTS uprev or board load rebalancing, so you get a
different subset of tests run.  The dev updates the list of xfails (a
pain), but also we end up with xfails left behind that aren't tested any
more and don't reflect reality.

For some drivers (tu, freedreno, zink-anv) we have manual jobs available
for curious devs to look at the current state of the CTS, but without
anyone having to keep the full xfails updated during uprevs, you don't
necessarily know what to do with the results you get on your MR.

So, let's introduce nightly testing for the tests that aren't guaranteed
green by Marge.  With that, Someone (possibly me? sigh) can review the
nightly results and push up updates for full-run xfails so everyone can be
on the same page other than a day or so of delay.  We also have some hope
for automated tooling to do this thanks to what Collabora has been working
on for automated CI uprev MR generation.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>

18 months agoci/zink: Move the zink-anv-tgl manual full run to custom manual deps.
Emma Anholt [Thu, 26 Jan 2023 21:04:57 +0000 (13:04 -0800)]
ci/zink: Move the zink-anv-tgl manual full run to custom manual deps.

Follow-up to !17445, since this run had been added while that MR was
outstanding.  Now it shouldn't show up in unrelated pipelines.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>

18 months agoci/zink: Disable Amnesia trace until the linked issue gets fixed.
Emma Anholt [Thu, 26 Jan 2023 20:13:58 +0000 (12:13 -0800)]
ci/zink: Disable Amnesia trace until the linked issue gets fixed.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>

18 months agoradv: Shift left the tile swizzle more on GFX11.
Bas Nieuwenhuizen [Mon, 30 Jan 2023 01:54:19 +0000 (02:54 +0100)]
radv: Shift left the tile swizzle more on GFX11.

ac/surface puts the raw pip_bank_xor there, which needs the extra
shift for the actual tile_swizzle.

(I think long term we should refactor this in ac/surface but for
 now lets fix like radeonsi to avoid race conditions.)

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>

18 months agoradv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK
Bas Nieuwenhuizen [Mon, 30 Jan 2023 01:31:41 +0000 (02:31 +0100)]
radv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK

Might cause hangs according to comments. Syncs with radeonsi/PAL.

Fixes: e210ffb4d0d ("radv: update framebuffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>

18 months agomailmap: Remap e-mail addresses for Faith Ekstrand
Faith Ekstrand [Mon, 30 Jan 2023 23:02:20 +0000 (17:02 -0600)]
mailmap: Remap e-mail addresses for Faith Ekstrand

Acked-by: Lina Versace <lina@kiwitree.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Lovingly-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21000>

18 months agobroadcom/compiler: fix indentation at v3d_nir_lower_image_load_store
Alejandro Piñeiro [Mon, 22 Nov 2021 14:08:29 +0000 (15:08 +0100)]
broadcom/compiler: fix indentation at v3d_nir_lower_image_load_store

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20972>

18 months agodzn, driconf: Add a driconf entry for NMS to claim wide line support
Jesse Natalie [Fri, 27 Jan 2023 16:50:54 +0000 (08:50 -0800)]
dzn, driconf: Add a driconf entry for NMS to claim wide line support

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20959>

18 months agoiris: Stop marking context unconditionally as guilty
Sagar Ghuge [Thu, 26 Jan 2023 00:10:52 +0000 (16:10 -0800)]
iris: Stop marking context unconditionally as guilty

With this change, we would fetch the reset status and if the context
status is banned or in unknown state, we would just start with the fresh
context.

Also, use the fetched reset status to communicate back to the gallium
frontend.

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20928>

18 months agoCI: Lima farm is offline
Jesse Natalie [Mon, 30 Jan 2023 20:05:12 +0000 (12:05 -0800)]
CI: Lima farm is offline

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

18 months agodocs: Add GL 4.3 support info in mesa docs
Neha Bhende [Mon, 23 Jan 2023 22:22:23 +0000 (14:22 -0800)]
docs: Add GL 4.3 support info in mesa docs

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20964>

18 months agoradeonsi/vcn: validate fence handle before using it
Boyuan Zhang [Mon, 30 Jan 2023 14:28:33 +0000 (09:28 -0500)]
radeonsi/vcn: validate fence handle before using it

Check if picture fence handle pointer is valid before using.

Fixes: 843bdd22 ('radeonsi/vcn: check fence before destroying dpb')

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20986>

18 months agowsi/win32: Use app-provided timeout instead of arbitrary hardcoded value
Jesse Natalie [Fri, 27 Jan 2023 20:06:34 +0000 (12:06 -0800)]
wsi/win32: Use app-provided timeout instead of arbitrary hardcoded value

Prevents returning spurious timeouts when the app wanted to wait
infinitely. Fixes 3DMark Wild Lands which would otherwise attempt
to render/present a buffer it didn't successfully acquire.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>

18 months agowsi/win32: Always use non-SRGB formats for DXGI
Jesse Natalie [Fri, 27 Jan 2023 20:05:35 +0000 (12:05 -0800)]
wsi/win32: Always use non-SRGB formats for DXGI

The actual buffer is always created as non-SRGB, and then SRGB views
can be used to render into it. Fixes a crash trying to launch
3DMark Wild Lands

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>

18 months agofreedreno/drm: Restart import on zombie race
Rob Clark [Fri, 27 Jan 2023 17:50:43 +0000 (09:50 -0800)]
freedreno/drm: Restart import on zombie race

If we hit the race condition of looking up an already imported BO that
is in the process of being destroyed, the handle will be GEM_CLOSE'd,
meaning that the handle that we just got from the kernel is probably not
valid.  So in this case we should retry.

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

18 months agofreedreno/drm/virtio: Flush before CREATE_BLOB
Rob Clark [Fri, 27 Jan 2023 17:43:48 +0000 (09:43 -0800)]
freedreno/drm/virtio: Flush before CREATE_BLOB

The RESOURCE_CREATE_BLOB ioctl can carry a ccmd payload, similarly to
EXECBUF.  But we need to preserve the order of buffered execbuf cmds
which haven't been flushed to the guest kernel yet, rather than let the
CREATE_BLOB payload jump to the head of the queue.  Otherwise, for ex,
the host could see the guest requesting an iova that has not yet been
(from it's perspective) released.

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

18 months agoradv: rename radv_create_shaders() to radv_graphics_pipeline_compile()
Samuel Pitoiset [Thu, 26 Jan 2023 17:12:31 +0000 (18:12 +0100)]
radv: rename radv_create_shaders() to radv_graphics_pipeline_compile()

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

18 months agoradv: split radv_create_shaders() between graphics and compute shaders
Samuel Pitoiset [Thu, 26 Jan 2023 17:11:37 +0000 (18:11 +0100)]
radv: split radv_create_shaders() between graphics and compute shaders

This introduces radv_compute_pipeline_compile() which is used for
compute and ray tracing pipelines. I think it's better than having a
single function for compiling everything, and that will allow us to do
more cleanups.

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

18 months agoradv: pass the number of stages to radv_hash_shaders()
Samuel Pitoiset [Fri, 27 Jan 2023 08:05:08 +0000 (09:05 +0100)]
radv: pass the number of stages to radv_hash_shaders()

This will help for splitting radv_create_shaders().

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

18 months agoradv: simplify VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED
Samuel Pitoiset [Thu, 26 Jan 2023 17:10:57 +0000 (18:10 +0100)]
radv: simplify VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED

The Vulkan spec says:
    "VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT specifies
     that pipeline creation will fail if a compile is required for
     creation of a valid VkPipeline object; VK_PIPELINE_COMPILE_REQUIRED
     will be returned by pipeline creation, and the VkPipeline will be
     set to VK_NULL_HANDLE."

Given the implementation is expected to set the pipeline to
VK_NULL_HANDLE, it's unecessary to handle pipeline feedback.

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

18 months agorusticl: fix build error with valgrind being enabled
Karol Herbst [Wed, 16 Nov 2022 10:50:51 +0000 (11:50 +0100)]
rusticl: fix build error with valgrind being enabled

This bumps the meson requierement to 1.0 because it requires
https://github.com/mesonbuild/meson/pull/11024

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7688
Fixes: 20c90fed5a0 ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19778>

18 months agoasahi: Omit extra call to clock_gettime
Alyssa Rosenzweig [Mon, 23 Jan 2023 05:11:43 +0000 (00:11 -0500)]
asahi: Omit extra call to clock_gettime

It's cheap but it isn't free.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20973>

18 months agogallium/draw: Enable polygon stipple NIR helpers to generate bool1 or bool32 Booleans
Ian Romanick [Mon, 23 Jan 2023 22:59:29 +0000 (14:59 -0800)]
gallium/draw: Enable polygon stipple NIR helpers to generate bool1 or bool32 Booleans

It appears that only softpipe, llvmpipe, and d3d12 hit any of this
code. If some NIR-to-TGSI driver that doesn't have native integers
(e.g., i915 or r300) wants to use this path in the future, it should be
easy to add float32 support.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>

18 months agogallium/draw: Enable aapoint NIR helpers to generate bool1, bool32, or float32 Booleans
Ian Romanick [Mon, 23 Jan 2023 22:46:57 +0000 (14:46 -0800)]
gallium/draw: Enable aapoint NIR helpers to generate bool1, bool32, or float32 Booleans

Fixes arb_point_parameters-point-attenuation on G33. The crash in
point-line-no-cull is fixed, but the test still fails.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>

18 months agoir3: support texture and sampler index with offsets
Amber [Fri, 27 Jan 2023 09:41:06 +0000 (10:41 +0100)]
ir3: support texture and sampler index with offsets

"If this texture instruction has a nir_tex_src_texture_offset source,
then the texture index is given by texture_index + texture_offset."

This fixes the failures for:
spec@arb_arrays_of_arrays@execution@sampler@fs-nested-struct-arrays-nonconst-nested-array
spec@arb_gl_spirv@execution@uniform@sampler2d-nonconst-nested-array

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20954>

18 months agoetnaviv: drm: fix check if BO is on a deferred destroy list
Lucas Stach [Thu, 26 Jan 2023 18:08:14 +0000 (19:08 +0100)]
etnaviv: drm: fix check if BO is on a deferred destroy list

list_is_linked() isn't the right function to use in order to check if
the BO is on a cache bucket or the zombie list, as this checks if the
next pointer of the list isn't NULL. This is always the case with the
BO list item as it's always initialized, so the next pointer points to
the list head itself when the BO isn't on any list.

Use list_is_empty() to check if the BO is actually linked into one
of the deferred destroy lists.

Fixes: 1b1f8592c03c ("etnaviv: drm: properly handle reviving BOs via a lookup")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>

18 months agoetnaviv: free pm queries dynarray on screen destroy
Lucas Stach [Thu, 26 Jan 2023 11:46:25 +0000 (12:46 +0100)]
etnaviv: free pm queries dynarray on screen destroy

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>

18 months agoetnaviv: drm: fix BO array leaks
Lucas Stach [Thu, 26 Jan 2023 11:38:35 +0000 (12:38 +0100)]
etnaviv: drm: fix BO array leaks

Free the both arrays tracking BOs when the etna_cmd_stream is destroyed.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>

18 months agoanv: fix null descriptors
Lionel Landwerlin [Fri, 27 Jan 2023 09:21:54 +0000 (11:21 +0200)]
anv: fix null descriptors

When writing descriptor with a null buffer/image we expect that
writing 0 will point to the null surface. For that to work the null
surface has to be in the bindless surface heap.

This fixes some new failures in dEQP-VK.robustness.* tests once
rewritten from the NV_ray_tracing to KHR_ray_tracing extension.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7762
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20953>

18 months agoturnip: make debug_flags a global variable
Chia-I Wu [Thu, 26 Jan 2023 17:42:06 +0000 (09:42 -0800)]
turnip: make debug_flags a global variable

Add tu_env as a global variable and add tu_env_init to initialize it.
Add TU_DEBUG macro to check debug flags.

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

18 months agoturnip: replace TU_DEBUG_DONT_CARE_AS_LOAD by a bool
Chia-I Wu [Thu, 26 Jan 2023 17:36:07 +0000 (09:36 -0800)]
turnip: replace TU_DEBUG_DONT_CARE_AS_LOAD by a bool

Instead of using TU_DEBUG=dontcare_as_load, it can still be overriden
using vk_dont_care_as_load=true.

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

18 months agodzn: Consider linked shaders when computing DXIL hash
Jesse Natalie [Fri, 27 Jan 2023 20:08:08 +0000 (12:08 -0800)]
dzn: Consider linked shaders when computing DXIL hash

Fixes 3DMark Wild Lands. Otherwise, we'd end up loading a DXIL shader
that had invalid linkage with another shader in the pipeline. We can
only load a DXIL shader if it's being linked against the same before
and after as a previous compilation.

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

18 months agopvr: Process wait event sub command.
Karmjit Mahil [Tue, 1 Nov 2022 09:33:35 +0000 (09:33 +0000)]
pvr: Process wait event sub command.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20862>

18 months agopvr: Process set and reset event sub commands.
Karmjit Mahil [Mon, 31 Oct 2022 15:20:44 +0000 (15:20 +0000)]
pvr: Process set and reset event sub commands.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20862>

18 months agozink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT when using DB
Mike Blumenkrantz [Wed, 25 Jan 2023 16:55:13 +0000 (11:55 -0500)]
zink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT when using DB

cc: mesa-stable

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

18 months agozink: disable bindless texture ext with descriptor buffer
Mike Blumenkrantz [Wed, 25 Jan 2023 16:50:55 +0000 (11:50 -0500)]
zink: disable bindless texture ext with descriptor buffer

it's illegal to mix-and-match DB and non-DB descriptor usage, so disable
this until I finish the implementation

cc: mesa-stable

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

18 months agozink: always set RESOURCE usage for descriptor buffers
Mike Blumenkrantz [Wed, 25 Jan 2023 16:44:06 +0000 (11:44 -0500)]
zink: always set RESOURCE usage for descriptor buffers

all types of descriptors may use buffer-type descriptors, even samplers

cc: mesa-stable

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

18 months agozink: assert that buffer descriptor usage is populated before bind
Mike Blumenkrantz [Wed, 25 Jan 2023 16:20:06 +0000 (11:20 -0500)]
zink: assert that buffer descriptor usage is populated before bind

this is illegal

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

18 months agozink: set vkusage/vkflags for buffer resource objects
Mike Blumenkrantz [Wed, 25 Jan 2023 16:19:07 +0000 (11:19 -0500)]
zink: set vkusage/vkflags for buffer resource objects

this needs to be populated for other places in the driver that need it

cc: mesa-stable

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

18 months agozink: add VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT for buffers if ext is enabled
Mike Blumenkrantz [Wed, 25 Jan 2023 16:13:08 +0000 (11:13 -0500)]
zink: add VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT for buffers if ext is enabled

cc: mesa-stable

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

18 months agozink: fix heap/memory type selection
Mike Blumenkrantz [Wed, 25 Jan 2023 16:10:44 +0000 (11:10 -0500)]
zink: fix heap/memory type selection

the memory type index still needs to be used for suballocation over the
heap since that's the actual type of allocation being used

Fixes: f6d3a5755f6 ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>

18 months agoRevert "zink: allow direct memory mapping for any COHERENT+CACHED buffer"
Mike Blumenkrantz [Fri, 27 Jan 2023 17:52:23 +0000 (12:52 -0500)]
Revert "zink: allow direct memory mapping for any COHERENT+CACHED buffer"

This reverts commit a3552048c7e7b8afebfc99caac6d555439ddf2bc.

on some drivers this catches qbos, which then hits the below assert.
needs more investigation

Fixes: a3552048c7e ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>

18 months agoanv: there's no need to set exec_obj offsets twice
Paulo Zanoni [Sat, 21 Jan 2023 01:38:11 +0000 (17:38 -0800)]
anv: there's no need to set exec_obj offsets twice

The anv_execbuf_add_bo() function already sets the offsets for the
exec_objects. Since we're always using softpin and never using
relocations all these objects should have non-changing offsets, all
set during anv_bo creation and never changed. Not only we should not
change these offsets, we definitely don't change them between
anv_execbuf_add_bo() and this loop we're removing.

Previously, we'd have the offset set as -1 for BOs that had never been
submitted when we were not using softpin.

Notice that with games we can have several hundreds of BOs in this
array.

This loop was added by:
  c5f7e1f5b4a1 ("anv: Delete relocation support from batch submission")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20885>

18 months agoradv: Loop over shader stages in flush_indirect_descriptor_sets.
Tatsuyuki Ishi [Fri, 27 Jan 2023 05:47:39 +0000 (14:47 +0900)]
radv: Loop over shader stages in flush_indirect_descriptor_sets.

Reduces boilerplate.

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

18 months agoradv: Fix emitting tess indirect descriptors twice.
Tatsuyuki Ishi [Thu, 26 Jan 2023 13:18:40 +0000 (22:18 +0900)]
radv: Fix emitting tess indirect descriptors twice.

This fixes a copy-paste error found by manual inspection.

TES may be merged into GS with certain HW stage mappings, which lead to
duplicate set-register commands to be emitted with the old code.

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

18 months agopvr: Split render job submission for multi-layer framebuffers
Matt Coster [Mon, 28 Nov 2022 16:36:57 +0000 (16:36 +0000)]
pvr: Split render job submission for multi-layer framebuffers

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>

18 months agopvr: Rename global_queue_job_count to global_cmd_buffer_submit_count
Matt Coster [Tue, 17 Jan 2023 13:48:11 +0000 (13:48 +0000)]
pvr: Rename global_queue_job_count to global_cmd_buffer_submit_count

This makes the name more accurate, since submits which require multiple
job submissions behind the scenes do not additionally increment this
counter.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>

18 months agopvr: Add pvr_csb_bake()
Matt Coster [Thu, 1 Dec 2022 16:33:45 +0000 (16:33 +0000)]
pvr: Add pvr_csb_bake()

This is a simple helper for minimizing the storage requirements of
control streams. It discards all information required only while
building the control stream and returns just the status and the list of
BOs backing the control stream. The first BO in the list is the start
of the control stream.

Especially for small, deterministically sized control streams, there's
no sense in lugging around an entire builder structure once it's built.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>

18 months agoaco: set has_color_exports with GPL
Rhys Perry [Wed, 25 Jan 2023 19:19:17 +0000 (19:19 +0000)]
aco: set has_color_exports with GPL

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 192486b7aa5 ("aco/gfx11: export mrtz in discard early exit for non-color shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20937>

18 months agoradv: add a layer for fixing rendering issues with RAGE2
Samuel Pitoiset [Wed, 11 Jan 2023 16:04:56 +0000 (17:04 +0100)]
radv: add a layer for fixing rendering issues with RAGE2

This game seems to incorrectly set the render area and since we switched
to full dynamic rendering, the framebuffer dimensions is no longer used.

Forcing the render area to be the framebuffer dimensions restore the
previous logic and it fixes rendering issues.

Fixes: c7d0d328d56 ("radv: Set the window scissor to the render area, not framebuffer")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20900>

18 months agoradv: Optimize emitting prefetches
Turo Lamminen [Tue, 24 Jan 2023 12:25:23 +0000 (14:25 +0200)]
radv: Optimize emitting prefetches

Check the need for emitting prefetch before calling si_emit_cache_flush
to mask a possible cache miss delay and always inline radv_emit_prefetch_L2.
Either change alone is not significant but together they increase
drawcall throughput by 8% on i5-2500.

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

18 months agoradv: Avoid redundant fetch of radv_device
Turo Lamminen [Tue, 24 Jan 2023 12:25:22 +0000 (14:25 +0200)]
radv: Avoid redundant fetch of radv_device

0.6% gain in drawcall throughput on i5-2500.

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

18 months agoradv: Clean up variables in si_get_ia_multi_vgt_param
Turo Lamminen [Tue, 24 Jan 2023 12:25:21 +0000 (14:25 +0200)]
radv: Clean up variables in si_get_ia_multi_vgt_param

8% gain in drawcall throughput on i5-2500. This can significantly change
how compiler allocates registers.

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

18 months agoradv: Change radeon_cmdbuf counters to uint64_t to make alias analysis optimize radeo...
Turo Lamminen [Tue, 24 Jan 2023 12:25:23 +0000 (14:25 +0200)]
radv: Change radeon_cmdbuf counters to uint64_t to make alias analysis optimize radeon_emit better

1% gain in drawcall throughput on i5-2500. Depends quite heavily on
compiler and CPU.

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

18 months agoci/debian/x86_test-vk: drop an outdated dependency
Martin Roukala (né Peres) [Fri, 27 Jan 2023 12:29:32 +0000 (14:29 +0200)]
ci/debian/x86_test-vk: drop an outdated dependency

This was used by the tracing jobs, which we are not running on Mesa
anymore.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20956>

18 months agotrace: Don't use italic escape code.
Jose Fonseca [Tue, 15 Nov 2022 10:18:47 +0000 (10:18 +0000)]
trace: Don't use italic escape code.

It's not widely supported, and often emulated with invert highlight,
which is very distracting.

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

18 months agollvmpipe: Honor zero sample_mask when multisample is disabled.
Jose Fonseca [Wed, 25 Jan 2023 13:54:41 +0000 (13:54 +0000)]
llvmpipe: Honor zero sample_mask when multisample is disabled.

The JIT generated FS shader has logic to obey sample mask when:
multisample is enabled, or multisample is disabled but FS writes sample
mask and pipe_rasterizer_state::no_ms_sample_mask_out.

However it did not handle the case where multisample was disabled, FS
did not write sample_mask, and sample mask was zero.  Instead it relied
upon the setup to discard the primitives, but that went away with commit
da5840f3.

We could restore the discard on zero mask behavior, but we would again
blurring the semantics of rasterization discard.  Instead this change
adds logic to primitive setup to cull the primitives when sample mask is
zero.

Fixes: da5840f3 ("llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20934>

18 months agomeson: do not reconstruct ICD paths
Erik Faye-Lund [Wed, 25 Jan 2023 15:55:32 +0000 (16:55 +0100)]
meson: do not reconstruct ICD paths

Meson will already construct these paths for us, so let's reuse them
instead of throwing away the result and recontstructing them.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>

18 months agofreedreno/meson: simplify script-path logic
Erik Faye-Lund [Wed, 25 Jan 2023 15:31:04 +0000 (16:31 +0100)]
freedreno/meson: simplify script-path logic

When passing this to files(), there's no point in prepending
current_source_dir. Let's simplify this a bit.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>

18 months agomeson: use files() instead of joining paths
Erik Faye-Lund [Wed, 25 Jan 2023 15:10:38 +0000 (16:10 +0100)]
meson: use files() instead of joining paths

The Meson docs points out that it's better to use the files() function
when referring to files in the source tree than manually constructing
paths like this. Let's follow that advice, and get some neat cleanups.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>

18 months agomeson: avoid using deprecated build_root() method
Erik Faye-Lund [Wed, 25 Jan 2023 14:53:18 +0000 (15:53 +0100)]
meson: avoid using deprecated build_root() method

The meson.build_root() method has been deprecated, so let's switch to
meson.project_build_root(), which usually means the same thing. The case
where it doesn't do the same thing is if Mesa is a subproject to some
other project, but in that case I believe we want the build root of Mesa,
not of the parent project anyway.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>

18 months agopvr: small cleanups
Frank Binns [Wed, 18 Jan 2023 12:32:26 +0000 (12:32 +0000)]
pvr: small cleanups

- remove unused PVR_IDF_WDF_IN_REGISTER_CONST_COUNT define
- remove unneeded pvr_compute_ctx forward declaration
- add render context section header to match compute and transfer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20931>

18 months agointel/compiler: fine-grained control of dispatch widths
Marcin Ślusarz [Sat, 21 Jan 2023 11:49:44 +0000 (12:49 +0100)]
intel/compiler: fine-grained control of dispatch widths

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20854>

18 months agomeson: remove deprecated dri-drivers option
Erik Faye-Lund [Wed, 25 Jan 2023 14:26:54 +0000 (15:26 +0100)]
meson: remove deprecated dri-drivers option

This was deprecated in cdde031ac2c ("classic/i965: Remove driver"),
which is almost two years ago, and many major releases ago. Nobody
should be using this any more. Let's remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>

18 months agomeson: remove deprecated osmesa-bits option
Erik Faye-Lund [Wed, 25 Jan 2023 14:16:30 +0000 (15:16 +0100)]
meson: remove deprecated osmesa-bits option

We've released several new major versions since this was deprecated in
202cab3d308 ("meson: deprecate specifying osmesa-bits"), so it's
probably about time to remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>

18 months agomeson: remove dupliace add_devenv call
Erik Faye-Lund [Wed, 25 Jan 2023 15:39:41 +0000 (16:39 +0100)]
meson: remove dupliace add_devenv call

Looks like a bad merge-conflict resolution.

Fixes: 7bed7d94756 ("meson: use sections in summary()")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Thomas Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20908>

18 months agoegl/dri2: Use primary device in EGL device platform for kms_swrast
Lepton Wu [Mon, 9 Jan 2023 20:50:58 +0000 (12:50 -0800)]
egl/dri2: Use primary device in EGL device platform for kms_swrast

For KMS only devices, there is no render node available. Also remove
unused _eglGetDRMDeviceRenderNode function.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20592>

18 months agoci: uprev virglrenderer
Corentin Noël [Thu, 26 Jan 2023 15:32:15 +0000 (16:32 +0100)]
ci: uprev virglrenderer

This change contains a memory unmap fix and makes the render server mandatory.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20938>

18 months agoegl: Rewrite eglGetMscRateANGLE to avoid probes and handle multi-monitor
Kenneth Graunke [Wed, 11 Jan 2023 23:37:22 +0000 (15:37 -0800)]
egl: Rewrite eglGetMscRateANGLE to avoid probes and handle multi-monitor

RRGetScreenInfo re-probes connector status, which may result in an EDID
transfer for every output, which according to Adam Jackson can be on the
order of 100ms for a single EDID block.  So our previous implementation
of this eglGetMscRateANGLE was blocking for excessive periods of time
instead of being a quick query of the refresh rate like users expect.

This changes our eglGetMscRateANGLE implementation from using
RRGetScreenInfo to RRGetScreenResourcesCurrent and RRGetCrtcInfo.
This obtains the same monitor info without re-probing connectors.

Fixes a severe performance regression in Chromium WebGL performance.

While we're re-implementing the extension, we also implement proper
multi-monitor support: if there are multiple active CRTCs, we determine
which contains the largest portion of the surface, as specified in the
EGL_ANGLE_sync_control_rate extension.

We also now report fractional refresh rates correctly rather than
rounding to the nearest Hz.

Fixes: 47526556494 ("egl/x11: implement ANGLE_sync_control_rate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6996
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7038
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>

18 months agoloader: Add infrastructure for tracking active CRTC resources
Kenneth Graunke [Tue, 17 Jan 2023 23:48:20 +0000 (15:48 -0800)]
loader: Add infrastructure for tracking active CRTC resources

This provides a cached view of the current screen resources, with the
coordinates and refresh rate for every active CRTC.  It's currently only
implemented for X11/XCB.

Fixes: 47526556494 ("egl/x11: implement ANGLE_sync_control_rate")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>

18 months agozink: reorder commands more aggressively
Mike Blumenkrantz [Tue, 24 Jan 2023 20:52:58 +0000 (15:52 -0500)]
zink: reorder commands more aggressively

by starting resources in the unordered state in a given batch, they
gain more opportunities to be promoted to the barrier cmdbuf and avoid
breaking renderpasses

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

18 months agoCI/windows: Apply CI_FDO_CONCURRENT to piglit too
Jesse Natalie [Thu, 26 Jan 2023 21:52:08 +0000 (13:52 -0800)]
CI/windows: Apply CI_FDO_CONCURRENT to piglit too

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

18 months agoCI/windows: Don't limit deqp-runner to 4 jobs
Jesse Natalie [Thu, 26 Jan 2023 01:08:26 +0000 (17:08 -0800)]
CI/windows: Don't limit deqp-runner to 4 jobs

If FDO_CI_CONCURRENT is set, use that, otherwise let deqp-runner
choose concurrency based on system CPU cores.

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

18 months agoac/llvm: remove llvm:: now that we use "using namespace llvm"
Marek Olšák [Tue, 13 Dec 2022 16:30:21 +0000 (11:30 -0500)]
ac/llvm: remove llvm:: now that we use "using namespace llvm"

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

18 months agoac/llvm: run the IPSCCP pass
Marek Olšák [Tue, 13 Dec 2022 16:28:24 +0000 (11:28 -0500)]
ac/llvm: run the IPSCCP pass

AMDVLK runs it and it seems useful.

https://en.wikipedia.org/wiki/Sparse_conditional_constant_propagation

58380 shaders in 35438 tests
Totals:
SGPRS: 2709080 -> 2709224 (0.01 %)
VGPRS: 1592972 -> 1592808 (-0.01 %)
Spilled SGPRs: 2420 -> 2420 (0.00 %)
Spilled VGPRs: 1077 -> 1077 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 1232 -> 1232 (0.00 %) dwords per thread
Code Size: 61382088 -> 61356504 (-0.04 %) bytes
Max Waves: 849293 -> 849308 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 5400 -> 5544 (2.67 %)
VGPRS: 6200 -> 6036 (-2.65 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 975824 -> 950240 (-2.62 %) bytes
Max Waves: 1214 -> 1229 (1.24 %)
Outputs: 232 -> 232 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

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

18 months agoac/llvm: run the LLVM sinking pass because LLVM will stop running it
Marek Olšák [Tue, 13 Dec 2022 16:03:21 +0000 (11:03 -0500)]
ac/llvm: run the LLVM sinking pass because LLVM will stop running it

shader-db was run with the sinking pass disabled in LLVM.

58380 shaders in 35438 tests
Totals:
SGPRS: 2730768 -> 2730768 (0.00 %)
VGPRS: 1592932 -> 1592928 (-0.00 %)
Spilled SGPRs: 2687 -> 2687 (0.00 %)
Spilled VGPRs: 551 -> 551 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 700 -> 700 (0.00 %) dwords per thread
Code Size: 61238872 -> 61238868 (-0.00 %) bytes
Max Waves: 849209 -> 849209 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 440 -> 440 (0.00 %)
VGPRS: 396 -> 392 (-1.01 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 49880 -> 49876 (-0.01 %) bytes
Max Waves: 105 -> 105 (0.00 %)
Outputs: 14 -> 14 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

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

18 months agoanv: add a third memory type for LLC configuration
Brian Paul [Wed, 18 Jan 2023 16:01:15 +0000 (09:01 -0700)]
anv: add a third memory type for LLC configuration

Commit 582bf4d9 turned on write-combining for most (all?) memory
allocations.  This caused a fairly large performance drop in some of
our VMware tests (application traces, such as Windows Metro Paint).

This patch adds a third memory type configuration: DEVICE_LOCAL,
HOST_VISIBLE, HOST_COHERENT.  This is uncached.  Then, in
anv_AllocateMemory() we only use write-combining for this uncached
type.  This memory type is found in the Intel Windows Vulkan driver.
And according to
https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
uncached memory correlates to write-combined memory.

This fixes our performance regression (and actually produced the
fastest ever results for our test suite).

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20770>

18 months agofreedreno/drm: Synchronize handle close and lookup
Rob Clark [Thu, 26 Jan 2023 22:05:33 +0000 (14:05 -0800)]
freedreno/drm: Synchronize handle close and lookup

Handle lookup (for example PRIME_FD_TO_HANDLE) must be synchronized with
GEM_CLOSE, otherwise re-import can race with bo_del path, resulting in
the handle of the newly (re)imported BO getting closed.  Now that the
finalize step has been decoupled, fixing this is mostly just deleting
code.

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

18 months agofreedreno/drm: Split out bo->finalize()
Rob Clark [Thu, 26 Jan 2023 21:57:13 +0000 (13:57 -0800)]
freedreno/drm: Split out bo->finalize()

The complexity around batching up handle closing is simply to allow the
virtgpu to back up ccmd's to the host (because virtio/virtgpu is pretty
inefficient when it comes to lots of small msgs to the host, and it is
common that when we are deleting BOs, we delete a lot of them at the
same time.  But that will make the locking fix in the next commit
impossible (without nested locks).  So let's flip this around and do the
step that virtgpu wants to batch up first, before we get into closing
GEM handles, etc.

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

18 months agofreedreno/drm: Remove bo_del_or_recycle()
Rob Clark [Wed, 25 Jan 2023 22:30:31 +0000 (14:30 -0800)]
freedreno/drm: Remove bo_del_or_recycle()

In prep for the next patch, where locking is swapped around to cover the
whole bo_del() path, decouple handling of the recycle-to-BO-cache path.

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

18 months agofreedreno/drm: Detect zombie BOs
Rob Clark [Wed, 25 Jan 2023 19:57:28 +0000 (11:57 -0800)]
freedreno/drm: Detect zombie BOs

When importing from a GEM name or dmabuf fd, we can race with the final
unref of the same BO, in which case we can get a hit in the handle
table for an fd_bo that another thread is about to free().  Detect and
handle this case.

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

18 months agofreedreno/drm: Add some ref/unref debugging
Rob Clark [Wed, 25 Jan 2023 19:39:06 +0000 (11:39 -0800)]
freedreno/drm: Add some ref/unref debugging

Helpful to catch common refcnt issues, like resurrecting a zombie
object.

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

18 months agofreedreno: Don't sync timestamps while perfetto isn't running.
Emma Anholt [Wed, 25 Jan 2023 19:24:18 +0000 (11:24 -0800)]
freedreno: Don't sync timestamps while perfetto isn't running.

This may help with the regression in trace perf testing since enabling
perfetto on the test drivers.

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

18 months agodzn: Report as a software device for non-Windows
Jesse Natalie [Thu, 26 Jan 2023 16:02:50 +0000 (08:02 -0800)]
dzn: Report as a software device for non-Windows

Fixes: 5f1b8b3e6c9 ("dzn: Use DXGI swapchains")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>

18 months agodzn: Don't recursively lock the physical device enum mutex
Jesse Natalie [Thu, 26 Jan 2023 16:01:58 +0000 (08:01 -0800)]
dzn: Don't recursively lock the physical device enum mutex

Fixes: cfa260cd274 ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>

18 months agodzn: Fix Windows WSI
Jesse Natalie [Thu, 26 Jan 2023 18:00:22 +0000 (10:00 -0800)]
dzn: Fix Windows WSI

This was a merge conflict from the Win32 WSI DXGI swapchain changes.
I missed moving a new line of code that was added when rearranging
things for using the common helpers.

Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20944>

18 months agodocs: update calendar for 22.3.4
Eric Engestrom [Thu, 26 Jan 2023 17:37:59 +0000 (17:37 +0000)]
docs: update calendar for 22.3.4

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

18 months agodocs/relnotes: add sha256sum for 22.3.4
Eric Engestrom [Thu, 26 Jan 2023 17:36:37 +0000 (17:36 +0000)]
docs/relnotes: add sha256sum for 22.3.4

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

18 months agodocs: add release notes for 22.3.4
Eric Engestrom [Thu, 26 Jan 2023 17:07:48 +0000 (17:07 +0000)]
docs: add release notes for 22.3.4

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

18 months agofreedreno/registers: Add RBBM_GPR0_CNTL for non-GMU operation
Konrad Dybcio [Wed, 25 Jan 2023 21:42:42 +0000 (22:42 +0100)]
freedreno/registers: Add RBBM_GPR0_CNTL for non-GMU operation

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20925>

18 months agofreedreno/a6xx: Add a few kernel regs/etc
Rob Clark [Wed, 18 Jan 2023 21:53:45 +0000 (13:53 -0800)]
freedreno/a6xx: Add a few kernel regs/etc

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

18 months agovirgl: remove unused virgl_encoder_inline_write
Gert Wollny [Mon, 12 Sep 2022 08:18:44 +0000 (10:18 +0200)]
virgl: remove unused virgl_encoder_inline_write

The only user was removed with

be8eeb3b59abf18d6b706016c5fa05b746d88f65
  virgl: remove unused virgl_transfer_inline_write

so drop this code too.

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

18 months agoir3, isaspec: add raw instruction to assembler/disassembler.
Amber [Thu, 19 Jan 2023 12:59:09 +0000 (13:59 +0100)]
ir3, isaspec: add raw instruction to assembler/disassembler.

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

18 months agofrontends/va: revert commit 0b02db30
Ruijing Dong [Tue, 24 Jan 2023 16:25:47 +0000 (11:25 -0500)]
frontends/va: revert commit 0b02db30

revert commit 0b02db30 as it is not a
proper way to fix av1 decoding 10bit issue.

this is corresponding to the fix in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20911>

18 months agokopper: Do not free the given screen in initScreen implementation
Corentin Noël [Thu, 26 Jan 2023 12:25:57 +0000 (13:25 +0100)]
kopper: Do not free the given screen in initScreen implementation

The given screen is already freed by the caller in case a NULL-pointer is
returned by the implementation.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20933>

18 months agoutil/tests/cache_test: Skip Cache.List if not supported
Juston Li [Mon, 23 Jan 2023 22:24:57 +0000 (14:24 -0800)]
util/tests/cache_test: Skip Cache.List if not supported

FOZ_DB_UTIL_DYNAMIC_LIST depends on inotify support

Fixes: 3b69b67545b ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>

18 months agoutil/fossilize_db: add ifdef for inotify header
Juston Li [Mon, 23 Jan 2023 20:45:56 +0000 (12:45 -0800)]
util/fossilize_db: add ifdef for inotify header

FOZ_DB_UTIL_DYNAMIC_LIST is defined if the inotify header was
detected.

Fixes: 3b69b67545b ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>

18 months agonir: Add algebraic optimization for VKD3D-Proton fp32->fp16 conversion.
Timur Kristóf [Sat, 9 Apr 2022 20:28:28 +0000 (22:28 +0200)]
nir: Add algebraic optimization for VKD3D-Proton fp32->fp16 conversion.

VKD3D-Proton DXBC f32 to f16 conversion implements a float conversion using PackHalf2x16.
Because the spec does not specify a rounding mode, it emits a sequence to ensure
D3D-like behaviour for infinity.

When we know the current backend has pack_half_2x16_rtz_split,
we can eliminate the extra sequence.

Fossil DB stats on GFX11:
Totals from 835 (0.62% of 134913) affected shaders:
VGPRs: 49368 -> 49224 (-0.29%)
CodeSize: 5341956 -> 5124564 (-4.07%)
Instrs: 1024062 -> 987041 (-3.62%)
Latency: 6530956 -> 6465120 (-1.01%); split: -1.01%, +0.00%
InvThroughput: 908189 -> 870253 (-4.18%)
VClause: 18704 -> 18702 (-0.01%); split: -0.02%, +0.01%
SClause: 33406 -> 33284 (-0.37%); split: -0.38%, +0.01%
Copies: 67440 -> 65992 (-2.15%); split: -2.15%, +0.00%
Branches: 18498 -> 18465 (-0.18%)
PreSGPRs: 38409 -> 38331 (-0.20%)
PreVGPRs: 44089 -> 43834 (-0.58%)

Note, some fossils are from before this pattern was added to VKD3D-Proton,
so the above may not reflect real-world impact.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>