platform/upstream/mesa.git
2 years agovirgl/ci: Update virglrenderer
Corentin Noël [Tue, 28 Jun 2022 15:57:33 +0000 (17:57 +0200)]
virgl/ci: Update virglrenderer

Update virglrenderer to the latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16401>

2 years agokmsro: add 'imx-lcdif' driver support
Lucas Stach [Thu, 12 May 2022 11:10:54 +0000 (13:10 +0200)]
kmsro: add 'imx-lcdif' driver support

This is the scanout engine found on the NXP i.MX8MP SoC.

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

2 years agodzn: Add ABI helpers for D3D12 functions returning structs
Jesse Natalie [Sat, 2 Jul 2022 14:34:07 +0000 (07:34 -0700)]
dzn: Add ABI helpers for D3D12 functions returning structs

The currently available D3D12 API headers have incorrect C function
prototypes for these functions when compiling for non-Windows platforms.

Future changes here will move these helpers into the DirectX-Headers
project, but:
* The process of getting a fix into the headers is still ongoing
* I'd prefer to avoid taking an immediate dependency on just-published
  headers again

So, for now add some helpers to work around this problem in Dozen

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Add a DXCore enumeration path
Jesse Natalie [Fri, 1 Jul 2022 20:38:14 +0000 (13:38 -0700)]
dzn: Add a DXCore enumeration path

WSL doesn't have DXGI, but it does have DXCore. DXCore also has a nice
property that it filters to only D3D12-capable adapters. We can rely
on DXCore as a first option even for Windows, because we'll be able
to let the Vulkan loader do preference sorting, instead of having to
rely on DXGI to do it for us.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Move DXGI code to a separate file and only build it on Windows
Jesse Natalie [Fri, 1 Jul 2022 16:39:03 +0000 (09:39 -0700)]
dzn: Move DXGI code to a separate file and only build it on Windows

The prototypes for physical device enumeration are moved to a new
dedicated header so that it can be included from a DXCore path,
which will C++, in the next commit

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Use a custom adapter desc instead of DXGI adapter desc
Jesse Natalie [Tue, 5 Jul 2022 20:44:45 +0000 (13:44 -0700)]
dzn: Use a custom adapter desc instead of DXGI adapter desc

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Don't hash adapter LUID as part of device UUID
Jesse Natalie [Tue, 5 Jul 2022 20:43:17 +0000 (13:43 -0700)]
dzn: Don't hash adapter LUID as part of device UUID

Per the Vulkan spec, the device UUID should be identical between reboots.
It should also uniquely identify different instances of the same device,
e.g. 2 identical GPUs connected to different PCI ports, but D3D doesn't
currently expose a way to do both of these things. Prefer persistence
over uniqueness here.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Use IUnknown instead of IDXGIAdapter1 as the stored adapter
Jesse Natalie [Fri, 1 Jul 2022 16:01:03 +0000 (09:01 -0700)]
dzn: Use IUnknown instead of IDXGIAdapter1 as the stored adapter

WSL doesn't support DXGI, and DirectX-Headers used to build for WSL
doesn't have the DXGI headers, so we need to isolate DXGI usage
and only build it on Windows

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Skip dxil validator and some Windows-only debug flags for Linux
Jesse Natalie [Fri, 1 Jul 2022 16:06:55 +0000 (09:06 -0700)]
dzn: Skip dxil validator and some Windows-only debug flags for Linux

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Fix maybe-uninitialized warning
Jesse Natalie [Fri, 1 Jul 2022 16:05:39 +0000 (09:05 -0700)]
dzn: Fix maybe-uninitialized warning

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Add an eventfd sync implementation
Jesse Natalie [Fri, 1 Jul 2022 16:05:25 +0000 (09:05 -0700)]
dzn: Add an eventfd sync implementation

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Use u_dl to load D3D12
Jesse Natalie [Fri, 1 Jul 2022 16:05:01 +0000 (09:05 -0700)]
dzn: Use u_dl to load D3D12

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Use os_time_sleep instead of Win32 Sleep
Jesse Natalie [Fri, 1 Jul 2022 16:04:02 +0000 (09:04 -0700)]
dzn: Use os_time_sleep instead of Win32 Sleep

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Define COBJMACROS before any includes
Jesse Natalie [Fri, 1 Jul 2022 16:28:52 +0000 (09:28 -0700)]
dzn: Define COBJMACROS before any includes

Otherwise the IUnknown definition might get included before it.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agodzn: Annotate sometimes-unused variables.
Jesse Natalie [Fri, 1 Jul 2022 03:49:43 +0000 (20:49 -0700)]
dzn: Annotate sometimes-unused variables.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17340>

2 years agonir: Use util_mask_sign_extend when serializing constants
Jason Ekstrand [Fri, 1 Jul 2022 18:50:58 +0000 (13:50 -0500)]
nir: Use util_mask_sign_extend when serializing constants

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

2 years agopanfrost,asahi: Use util_sign_extend for unpacking
Jason Ekstrand [Thu, 23 Jun 2022 18:19:12 +0000 (13:19 -0500)]
panfrost,asahi: Use util_sign_extend for unpacking

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agointel/decoder: Use util_mask_sign_extend()
Jason Ekstrand [Thu, 23 Jun 2022 18:05:14 +0000 (13:05 -0500)]
intel/decoder: Use util_mask_sign_extend()

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoisl: Use util_sign_extend
Jason Ekstrand [Thu, 23 Jun 2022 18:00:36 +0000 (13:00 -0500)]
isl: Use util_sign_extend

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoutil,nir: Move mask_sign_extend from opt_load_store_vectorize to util
Jason Ekstrand [Thu, 23 Jun 2022 17:55:40 +0000 (12:55 -0500)]
util,nir: Move mask_sign_extend from opt_load_store_vectorize to util

While we're moving it, reformat a bit to make it match util_sign_extend
better.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agomesa/bptc: Use util_sign_extend
Jason Ekstrand [Thu, 23 Jun 2022 17:52:27 +0000 (12:52 -0500)]
mesa/bptc: Use util_sign_extend

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoutil: Use util_sign_extend in fast_idiv_by_const
Jason Ekstrand [Thu, 23 Jun 2022 17:34:51 +0000 (12:34 -0500)]
util: Use util_sign_extend in fast_idiv_by_const

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoutil: Use shifts in util_sign_extend
Jason Ekstrand [Thu, 23 Jun 2022 17:30:48 +0000 (12:30 -0500)]
util: Use shifts in util_sign_extend

As long as we left-shift the unsigned version, this has no undefined
behavior and is fewer instructions.  The only tricky bit is that a right
shift of a negative number is technically implementation-defined (not
undefined) behavior in C.  However, if it's ever anything other than an
arithmatic right-shift, there's lots of other places where Mesa will
break today.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoutil: Re-indent util_sign_extend, comment, and add asserts
Jason Ekstrand [Thu, 23 Jun 2022 17:23:24 +0000 (12:23 -0500)]
util: Re-indent util_sign_extend, comment, and add asserts

The current implementation depends on both of these things for
correctness.  If width > 64, you get UB wrap-around and, if
val >= (1 << width), the subtract trick won't work.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>

2 years agoanv: Replace an assert() with unreachable()
Jason Ekstrand [Fri, 1 Jul 2022 17:10:49 +0000 (12:10 -0500)]
anv: Replace an assert() with unreachable()

Also move it to the end of the switch as is more conventional.  For some
reason, later patches in the series make ANV fail to build because GCC
stops detecting the assert(!"str") as not returning.

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

2 years agoaco/optimizer: Optimize SOPC with literal to SOPK.
Georg Lehmann [Sun, 17 Apr 2022 20:14:30 +0000 (22:14 +0200)]
aco/optimizer: Optimize SOPC with literal to SOPK.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoaco/optimizer: Convert s_add_u32 with literals to s_add_i32 if carry is not used.
Georg Lehmann [Sun, 17 Apr 2022 12:32:34 +0000 (14:32 +0200)]
aco/optimizer: Convert s_add_u32 with literals to s_add_i32 if carry is not used.

To allow further optimizations to s_addk_i32.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoaco/ra: Optimize some SOP2 instructions with literal to SOPK.
Georg Lehmann [Sun, 17 Apr 2022 11:17:20 +0000 (13:17 +0200)]
aco/ra: Optimize some SOP2 instructions with literal to SOPK.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoaco/ir: Pad SOP2 and SOPC to the same size as SOPK.
Georg Lehmann [Sun, 17 Apr 2022 19:09:15 +0000 (21:09 +0200)]
aco/ir: Pad SOP2 and SOPC to the same size as SOPK.

Being able to directly cast instructions simplifies optimizations.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoaco/ra: Move mac encoding optimization to its own function.
Georg Lehmann [Thu, 19 May 2022 13:50:30 +0000 (15:50 +0200)]
aco/ra: Move mac encoding optimization to its own function.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoaco/ra: Static assert that changing instruction type to VOP2 is valid.
Georg Lehmann [Sun, 17 Apr 2022 19:17:18 +0000 (21:17 +0200)]
aco/ra: Static assert that changing instruction type to VOP2 is valid.

It's not obvious that this is correct.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15999>

2 years agoradv/ci: update list of failures against CTS 1.3.3.0
Samuel Pitoiset [Wed, 6 Jul 2022 05:49:54 +0000 (07:49 +0200)]
radv/ci: update list of failures against CTS 1.3.3.0

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

2 years agozink/ci: update list of failures
Samuel Pitoiset [Wed, 6 Jul 2022 05:52:22 +0000 (07:52 +0200)]
zink/ci: update list of failures

These regressions aren't related to LLVM at all and they are fixed
with recent 16-bit related fixes for ACO.

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

2 years agoetnaviv: drop scanout assumption for resources allocated via modifier interface
Lucas Stach [Tue, 5 Jul 2022 16:15:27 +0000 (18:15 +0200)]
etnaviv: drop scanout assumption for resources allocated via modifier interface

Now that usage flags can be specified even when using the modifier path for
allocation and frontends like GBM and EGL wayland do this properly, we can
drop the assumption that all resources allocated through the modifier
enabled path need to be SCANOUT capable.

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

2 years agodzn: Take VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT into account
Boris Brezillon [Thu, 30 Jun 2022 13:55:23 +0000 (06:55 -0700)]
dzn: Take VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT into account

Use a typeless format when VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT is
set, so we can cast to compatible types at least. Still doesn't
work when formats are of the same size but from incompatible
types (like R32_FLOAT and RGBA8_UNORM), which Vulkan considers
as compatible while D3D12 doesn't, but it gets us closer to what
the Vulkan API wants.

D3D12_FEATURE_DATA_D3D12_OPTIONS12::RelaxedFormatCastingSupported
should address the remaining limitations.

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

2 years agodzn: Support native image copies when formats are compatible
Boris Brezillon [Thu, 30 Jun 2022 11:17:12 +0000 (04:17 -0700)]
dzn: Support native image copies when formats are compatible

CopyTextureRegion() works fine if the formats belong to the
same group (matching the same _TYPELESS type), so let's avoid
creating a temporary resource in that case.

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

2 years agodzn: Provide a helper to check if 2 formats are compatible
Boris Brezillon [Thu, 30 Jun 2022 11:12:45 +0000 (04:12 -0700)]
dzn: Provide a helper to check if 2 formats are compatible

D3D12 supports fomat casting through optional features. Let's
add a helper to query whether 2 formats are compatible or not.
The compatibility depends on the formats+usage pair
(CopyTextureRegion() is less strict than the texture sampling
logic).

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

2 years agodzn: Query D3D12_FEATURE_D3D12_OPTIONS3 features
Boris Brezillon [Thu, 30 Jun 2022 08:13:25 +0000 (01:13 -0700)]
dzn: Query D3D12_FEATURE_D3D12_OPTIONS3 features

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

2 years agov3dv: fix merge jobs
Iago Toral Quiroga [Tue, 5 Jul 2022 07:04:41 +0000 (09:04 +0200)]
v3dv: fix merge jobs

This only works if the framebuffer config is exactly the same so
testing both subpasses have the same attachments is not enough,
they also need to be exactly in the same order.

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

2 years agoanv: use the right helper to invalidate memory
Lionel Landwerlin [Sun, 12 Jun 2022 19:18:45 +0000 (22:18 +0300)]
anv: use the right helper to invalidate memory

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

2 years agozink: use a std430 interface for bo types
Mike Blumenkrantz [Wed, 29 Jun 2022 23:23:45 +0000 (19:23 -0400)]
zink: use a std430 interface for bo types

no functional changes but is technically more correct

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

2 years agozink: use std430 packing by default
Mike Blumenkrantz [Fri, 24 Jun 2022 16:16:29 +0000 (12:16 -0400)]
zink: use std430 packing by default

this reduces bo size a bit

Reviewed-by: Dave Airlie <airlied@redhat.com>
fixes:
spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object

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

2 years agozink: add an optimizer pass to enforce bo bounds
Mike Blumenkrantz [Fri, 24 Jun 2022 15:23:16 +0000 (11:23 -0400)]
zink: add an optimizer pass to enforce bo bounds

this eliminates (some) out-of-bounds bo access and will ensure that
bo sizing is always accurate by breaking all the cases where it isn't

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

2 years agozink: pass zink_shader to optimize_nir during final optimize pass
Mike Blumenkrantz [Fri, 24 Jun 2022 15:22:45 +0000 (11:22 -0400)]
zink: pass zink_shader to optimize_nir during final optimize pass

no functional changes

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

2 years agozink: don't run nir_lower_uniforms_to_ubo repeatedly
Mike Blumenkrantz [Sun, 26 Jun 2022 13:06:51 +0000 (09:06 -0400)]
zink: don't run nir_lower_uniforms_to_ubo repeatedly

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

2 years agozink: handle bitsizes in get_bo_vars() analysis
Mike Blumenkrantz [Sun, 26 Jun 2022 13:06:26 +0000 (09:06 -0400)]
zink: handle bitsizes in get_bo_vars() analysis

this allows it to be run repeatedly

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

2 years agozink: move/refactor bo_vars struct creation in compiler
Mike Blumenkrantz [Fri, 24 Jun 2022 15:22:07 +0000 (11:22 -0400)]
zink: move/refactor bo_vars struct creation in compiler

no functional changes

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

2 years agozink: force unsized array in bo creation using the last block member type
Mike Blumenkrantz [Fri, 24 Jun 2022 15:20:33 +0000 (11:20 -0400)]
zink: force unsized array in bo creation using the last block member type

if the last member of a block is an unsized array then the bo needs to have
an unsized array

cc: mesa-stable

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

2 years agozink: further improve bo sizing
Mike Blumenkrantz [Fri, 24 Jun 2022 15:19:14 +0000 (11:19 -0400)]
zink: further improve bo sizing

using the attribute slot size isn't sufficient in this case, as the layout
rules may have additional effects upon sizing

instead, just use the explicit size

cc: mesa-stable

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

2 years agozink: size uniform_0 ubo accurately
Mike Blumenkrantz [Fri, 24 Jun 2022 12:51:20 +0000 (08:51 -0400)]
zink: size uniform_0 ubo accurately

this one is always identifiable from lower_uniforms_to_ubo, so the
info should always be reliable

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

2 years agottn: Set nir->info.separate_shader
Alyssa Rosenzweig [Tue, 21 Jun 2022 17:00:42 +0000 (13:00 -0400)]
ttn: Set nir->info.separate_shader

TGSI has no legitimate[1] notion of linked shaders, which means tgsi_to_nir
should conservatively assume everything all shaders are separable. This requires
setting nir->info.separate_shader to warn drivers that shader CSOs might be
mixed and matched. Otherwise, the driver might enable optimizations that
are invalid for separate shaders, causing issues when the shaders are
later treated as separable.

This will fix varying linking with u_blitter's shaders on Panfrost (Bifrost and
older), when util_blitter_clear is used with Panfrost.

[1] There was a TGSI property added recently to forward
nir->info.separate_shader up to virglrenderer, but it's not actually used for
anything in virglrenderer and I am still struggling to understand what the use
case would be. My gut says we should revert b63403054237 ("tgsi: Add
SEPARABLE_PROGRAM property"), but I'm not interested in fighting that yak right
now. Notably, the u_blitter and hud shaders are separable but are not marked
with this property.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17282>

2 years agoci/llvmpipe: Skip ssbo.layout.random.all_shared_buffer.36
Emma Anholt [Tue, 5 Jul 2022 04:50:17 +0000 (21:50 -0700)]
ci/llvmpipe: Skip ssbo.layout.random.all_shared_buffer.36

This became too slow with the llvm uprev and now flakes as a timeout.

Fixes: 4d7c11aa8d73 ("ci/x86: update to llvm 13")
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17304>

2 years agoci: Uprev deqp to 1.3.3.0.
Emma Anholt [Wed, 29 Jun 2022 05:24:44 +0000 (22:24 -0700)]
ci: Uprev deqp to 1.3.3.0.

New tests, dEQP line rasterization test fix that lets Intel pass.

Clears out bogus xfails from 1.3.2.0 uprev on a630, which I suspect were
"we lost the device twice on a full run once, and those fails got pasted
in without checking if it happened a full run again" (since we haven't
seen them in other full run attempts).

Also clears out the a630 vk asan xfails (essentially all tests run) by
turning off leak detection which was just catching leaks in vkcts.

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

2 years agoaco/tests: add vop3p constant combine tests
Rhys Perry [Mon, 2 May 2022 17:21:56 +0000 (18:21 +0100)]
aco/tests: add vop3p constant combine tests

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

2 years agoaco: don't use 32-bit fp inline constants for fp16 vop3p literals
Rhys Perry [Mon, 2 May 2022 13:21:21 +0000 (14:21 +0100)]
aco: don't use 32-bit fp inline constants for fp16 vop3p literals

If we're applying the literal 0x3f800000 to a fp16 vop3p instruction, we
shouldn't use the 1.0 inline constant, because the hardware will use the
16-bit 1.0: 0x00003c00.

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

2 years agoaco: try sign-extending or shifting constants in propagate_constants_vop3p
Rhys Perry [Mon, 2 May 2022 13:07:03 +0000 (14:07 +0100)]
aco: try sign-extending or shifting constants in propagate_constants_vop3p

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

2 years agoaco: fix redirect combine in propagate_constants_vop3p() with negatives
Rhys Perry [Mon, 2 May 2022 12:16:54 +0000 (13:16 +0100)]
aco: fix redirect combine in propagate_constants_vop3p() with negatives

This previously didn't correctly consider negative integers when bits=16
(which sign-extend) and would have combined 0xfffe0000.xy as -2.yx. Now it
combines 0xfffeffff.xy as that instead. It was also skipped when bits=32.

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

2 years agoaco: don't use opsel to fold constants into dot accumulation sources
Rhys Perry [Mon, 2 May 2022 12:19:45 +0000 (13:19 +0100)]
aco: don't use opsel to fold constants into dot accumulation sources

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

2 years agoaco: fix propagate_constants_vop3p with integer vop3p and 16-bit constants
Rhys Perry [Mon, 2 May 2022 12:10:47 +0000 (13:10 +0100)]
aco: fix propagate_constants_vop3p with integer vop3p and 16-bit constants

This would have created a 1.0.xx operand from 0x3c00.xx or 0x3c003c00.xy
for vop3p instructions which have 32-bit operands.

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

2 years agoaco: fix single-alignbyte do_pack_2x16() path with fp inline constants
Rhys Perry [Fri, 29 Apr 2022 16:37:51 +0000 (17:37 +0100)]
aco: fix single-alignbyte do_pack_2x16() path with fp inline constants

We were using a 16-bit inline constant with a 32-bit instruction and the
test would have created
"v1: %_:v[0] = v_alignbyte_b32 0.5, %_:v[1][16:32], 2" instead.

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

2 years agoaco: ignore precise flag when optimizing integer clamps
Rhys Perry [Fri, 29 Apr 2022 16:23:20 +0000 (17:23 +0100)]
aco: ignore precise flag when optimizing integer clamps

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

2 years agoaco: include _e64 variants of 16-bit min/max in minmax optimizations
Rhys Perry [Fri, 29 Apr 2022 16:19:09 +0000 (17:19 +0100)]
aco: include _e64 variants of 16-bit min/max in minmax optimizations

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

2 years agoaco: don't accept med3 opcodes in get_minmax_info()
Rhys Perry [Fri, 29 Apr 2022 16:21:01 +0000 (17:21 +0100)]
aco: don't accept med3 opcodes in get_minmax_info()

I don't think the presence of med3 here breaks anything, but it shouldn't
be here anyway.

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

2 years agoaco: add and use constantValue16()
Rhys Perry [Fri, 29 Apr 2022 15:45:17 +0000 (16:45 +0100)]
aco: add and use constantValue16()

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

2 years agopan/va: Handle terminal barriers
Alyssa Rosenzweig [Mon, 27 Jun 2022 19:37:49 +0000 (15:37 -0400)]
pan/va: Handle terminal barriers

If a shader ends with a workgroup barrier, it must wait for slot #7 at the end
to finish the barrier. After inserting flow control, we get:

   BARRIER
   NOP.wait
   NOP.end

Currently, the flow control pass assumes that .end implies all other control
flow, and will merge this down to

   BARRIER.end

However, this is incorrect. Slot #7 is no longer waited on. In theory, this
cannot affect the correctness of the shader. In practice, the hardware checks
that all barriers are reached. Terminating without waiting on slot #7 first
raises an INSTR_BARRIER_FAULT. We need to weaken the flow control merging
slightly to avoid this incorrect merge, instead emitting:

   BARRIER.wait
   NOP.end

Of course, all of these cases are inefficient: terminal barriers shouldn't be
emitted in the first place. I wrote out an optimization for this. We can merge
it if we find a workload that it actually helps.

Fixes test_half.vstore_half.

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

2 years agonouveau: Drop C++03 compat code
M Henning [Sat, 18 Jun 2022 20:45:53 +0000 (16:45 -0400)]
nouveau: Drop C++03 compat code

Mesa as a whole requires C++14 nowadays, so this isn't needed any more.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17307>

2 years agoradv: always enable VK_EXT_debug_utils
Samuel Pitoiset [Mon, 4 Jul 2022 11:34:30 +0000 (13:34 +0200)]
radv: always enable VK_EXT_debug_utils

Instead of enabling it conditionally for SQTT. Other Vulkan drivers
always expose it as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6772
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17355>

2 years agoir3: Retire the cp postsched pass now that we do RA in SSA.
Emma Anholt [Thu, 30 Jun 2022 18:50:11 +0000 (11:50 -0700)]
ir3: Retire the cp postsched pass now that we do RA in SSA.

Before, we needed CP post-sched to copy-propagate references to NIR
registers produced by out-of-ssa.  Now that we're in SSA, this pass ends
up not doing anything useful, and actually gets in the way by occasionally
creating a cycle in the DAG.

The entire shader-db impact is:

instructions HURT:   shaders/closed/steam/tropico-5/78.shader_test FRAG: 238 -> 242 (1.68%)

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

2 years agoRevert "ci/freedreno: temporary disable AmnesiaTDD"
David Heidelberg [Mon, 4 Jul 2022 11:10:38 +0000 (13:10 +0200)]
Revert "ci/freedreno: temporary disable AmnesiaTDD"

This reverts commit f77695d13fb60b86b434183ac465f5321f0cbb90.

Acked-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17353>

2 years agoradv: disable DCC for Melty Blood Actress Again Current Code
Samuel Pitoiset [Mon, 4 Jul 2022 14:40:44 +0000 (16:40 +0200)]
radv: disable DCC for Melty Blood Actress Again Current Code

A D3D9 game that uses feedback loops again.

See https://github.com/ValveSoftware/Proton/issues/271

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17356>

2 years agozink/ci: update list of failures for piglit with RADV
Samuel Pitoiset [Mon, 4 Jul 2022 08:53:57 +0000 (10:53 +0200)]
zink/ci: update list of failures for piglit with RADV

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17354>

2 years agoradv: remove old workaround for HTILE layers with F1 2021
Samuel Pitoiset [Wed, 29 Jun 2022 12:41:34 +0000 (14:41 +0200)]
radv: remove old workaround for HTILE layers with F1 2021

Turns out this was likely a vkd3d-proton issue because it can no
longer be reproduced since it switched to dynamic rendering by default.
AMDGPU-PRO was also affected by the same issue at that time.

According to Hans-Kristian, some bugs related to that have also been
fixed at the same time.

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

2 years agoradv: do not abort if SPM isn't supported for the current GPU
Samuel Pitoiset [Wed, 29 Jun 2022 09:04:00 +0000 (11:04 +0200)]
radv: do not abort if SPM isn't supported for the current GPU

In a mixed GFX9/GFX10 setup, this would crash for the GFX9 logical
device. Just print a message intead of aborting.

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

2 years agoradv: use LOAD_CONTEXT_REG to load the opaque buffer size on GFX10+
Samuel Pitoiset [Wed, 29 Jun 2022 07:43:53 +0000 (09:43 +0200)]
radv: use LOAD_CONTEXT_REG to load the opaque buffer size on GFX10+

For unknown reasons, COPY_DATA can hang on GFX10+ while it doesn't
hang on GFX9. Adding PFP_SYNC_ME before/after the COPY_DATA doesn't
fix the hang either.

Using a LOAD_CONTEXT_REG_INDEX packet shouldn't be needed unless the
driver supports preemption (shadow memory) which RADV doesn't support.

I don't have a real explanation but PFP_SYNC_ME+LOAD_CONTEXT_REG_INDEX
fixes a GPU hang with Space Engineers (game uses a bunch of consecutive
calls to vkCmdDrawIndirectByteCountEXT without anything in-between).

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5838
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17290>

2 years agost/glsl: fix broken vertex attrib mapping
Timothy Arceri [Fri, 1 Jul 2022 02:33:08 +0000 (12:33 +1000)]
st/glsl: fix broken vertex attrib mapping

Here we move the nir_get_single_slot_attribs_mask() call that sets the
inputs_read mask after NIR optimisations have finished and after
st_nir_assign_vs_in_locations() has been called.

Besides fixing a bug where the mappings would be missaligned if
further NIR optimisations resulted in less inputs being read, it
also allows us to drop an additional nir gather info call.

Fixes: 0909a57b631f ("radeonsi/nir: Set vs_inputs_dual_locations and let NIR do the remap")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6240

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

2 years agofreedreno/a6xx: Initialize VFD_FETCH[n].SIZE to zero
Rob Clark [Thu, 30 Jun 2022 17:44:20 +0000 (10:44 -0700)]
freedreno/a6xx: Initialize VFD_FETCH[n].SIZE to zero

Avoid inheriting VBOs from other processes/submits (ie. anywhere it
might not be an actual valid iova).

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

2 years agofreedreno/a6xx: Split VFD_FETCH[] if needed
Rob Clark [Thu, 30 Jun 2022 17:06:21 +0000 (10:06 -0700)]
freedreno/a6xx: Split VFD_FETCH[] if needed

Avoid overflowing max pkt4 size by splitting VFD_FETCH[] emit.
Otherwise the maximum size of 32 VBOs would overflow and wrap to
zero.

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

2 years agofreedreno/registers: Small cleanup
Rob Clark [Thu, 30 Jun 2022 16:05:18 +0000 (09:05 -0700)]
freedreno/registers: Small cleanup

Whitespace fix plus move a couple regs that ended split apart from the
rest of the VFD regs.

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

2 years agofreedreno: Add pkt4 assert
Rob Clark [Thu, 30 Jun 2022 15:53:11 +0000 (08:53 -0700)]
freedreno: Add pkt4 assert

Add assert to catch places where we overflow max PKT4 size

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

2 years agofreedreno/registers: add missing varset="chip" for new enum values
Jonathan Marek [Sun, 3 Jul 2022 17:32:35 +0000 (13:32 -0400)]
freedreno/registers: add missing varset="chip" for new enum values

Fixes: de8c769d1168 ("freedreno/registers: add a7xx registers for drm/msm kernel driver")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6788
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17351>

2 years agoetnaviv: rework resource status tracking (again)
Lucas Stach [Fri, 7 Jan 2022 20:18:31 +0000 (21:18 +0100)]
etnaviv: rework resource status tracking (again)

While a resource might be shared across different contexts all synchronization
of commands is the resposibility of the user (OpenGL spec Chapter 5 "Shared
Objects and Multiple Contexts").

Currently etnaviv tries to be extremely helpful by flushing foreign contexts
when using a resource that is still pending there. This introduces a lot of
issues, as context flushes can now happen at basically any time and also
introduces a lot of overhead due to the needed tracking and locking. Get rid
of all this cross-context tracking and flushing.

The only real requirement here is that we need to track pending resources
without mutating the state of the etna_resource, as this might be shared
across multiple contexts and thus be used by multiple threads concurrently.
Introduce a hash table to track the current pending resources and their
states in the local context.

A side-effect of this change is that we don't need to keep all used
resources referenced until context flush time, as we don't need to mutate
them anymore to track the status. This allows to free some of them a bit
earlier. Note that this introduces a small possibility of a new resource
matching the key of a already destroyed resource still in the
pending_resources hashtable, but even if we get such a collision the worst
outcome is a not strictly necessary flush of the local context being
performed, which is acceptable if it doesn't happen very often.

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

2 years agoetnaviv: add function to get resource status
Lucas Stach [Fri, 7 Jan 2022 19:30:11 +0000 (20:30 +0100)]
etnaviv: add function to get resource status

Don't access the status member of etna_resource directly, as this
go away to get rid of shared mutable state. Add a wrapper function
that allows to plug in the new status 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/14466>

2 years agoetnaviv: drm: rename etna_drm_table_lock
Lucas Stach [Thu, 6 Jan 2022 20:56:14 +0000 (21:56 +0100)]
etnaviv: drm: rename etna_drm_table_lock

This lock is used to serialize much more than just the lookup tables. In
fact it's used for all device global state including the bo cache. Rename
it to better reflect its real usage.

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

2 years agoetnaviv: drm: make etna_bo_map thread safe
Lucas Stach [Thu, 6 Jan 2022 20:46:25 +0000 (21:46 +0100)]
etnaviv: drm: make etna_bo_map thread safe

This might be called from multiple threads at the same time. To avoid
taking a global lock just to guard against the fairly low chance of
multiple threads calling this on the same BO at the same time, we allow
for the threads to race. All threads will set up a mapping, but only
the first thread is able to set the map member of the etna_bo, all other
threads just roll back and use the mapping set up by the winning thread.

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

2 years agoetnaviv: drm: don't cache mmap offset
Lucas Stach [Thu, 6 Jan 2022 20:38:43 +0000 (21:38 +0100)]
etnaviv: drm: don't cache mmap offset

The mmap offset is the only information we currently get from
DRM_ETNAVIV_GEM_INFO and there is no point in storing this
offset after the mapping has been established. Reduce the
shared mutable state on the etna_bo by inlining fetching the
offset into etna_bo_map.

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

2 years agoetnaviv: drm: always use hash to track BO index
Lucas Stach [Fri, 10 Dec 2021 20:35:11 +0000 (21:35 +0100)]
etnaviv: drm: always use hash to track BO index

Currently the buffer index hash is only used if the BO is used in
multiple streams and the current index is cached on the BO. This
introduces some shared state on the BO, which necessitates the use
of a lock to keep this state consistent across threads, which
negates some of the benefits of caching the index.

Always use the hash to keep track of the submit BOs, to get rid
of the shared state and simplify the code.

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

2 years agoetnaviv: allow mapped buffers during execution
Lucas Stach [Fri, 1 Jul 2022 22:20:44 +0000 (00:20 +0200)]
etnaviv: allow mapped buffers during execution

Etnaviv has no restrictions on buffers being mapped during execution. In
fact most buffers are already always mapped during their lifetime as the
unmap is a no-op. Let the frontend know that it doesn't need to bother
with unmapping buffers.

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

2 years agoetnaviv: expose real map buffer alignment
Lucas Stach [Fri, 1 Jul 2022 22:16:30 +0000 (00:16 +0200)]
etnaviv: expose real map buffer alignment

As we do not suballocate any buffers, the real map buffer alignment
is determined by the GEM BO map alignment, which is at least 4KB.

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

2 years agoradv/ci: do not reboot on soft-recovered hangs, just warn
Martin Roukala (né Peres) [Mon, 20 Jun 2022 14:06:00 +0000 (17:06 +0300)]
radv/ci: do not reboot on soft-recovered hangs, just warn

The job will still fail, but it will at least go through until the end.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16841>

2 years agoradv/ci: allow specifying a warning pattern
Martin Roukala (né Peres) [Mon, 20 Jun 2022 13:53:51 +0000 (16:53 +0300)]
radv/ci: allow specifying a warning pattern

This will be used to detect soft resets without aborting the run, but
still make the job fail.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16841>

2 years agoradv/ci: add CI lists for LLVM on NAVI21
Samuel Pitoiset [Mon, 20 Jun 2022 11:32:14 +0000 (13:32 +0200)]
radv/ci: add CI lists for LLVM on NAVI21

Copied and adjusted from the ACO lists.

v2: Martin Roukala
 - add an extra test in the list of timeouts
 - add an extra test in the list of flakes
 - remove a fail

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16841>

2 years agoradv/ci: test the llvm backend on navi21
Martin Roukala (né Peres) [Thu, 2 Jun 2022 16:10:15 +0000 (19:10 +0300)]
radv/ci: test the llvm backend on navi21

The LLVM backend is not officially supported by the RADV developers,
but it has been useful early during bring-up, or later when users are
experiencing what looks like a compiler bug. It is thus beneficial to
keep it working.

However, maintaining the vkcts expectations for every platform requires
more work and machine time than what we would like to commit to. This
is why we agreed that we would only keep LLVM tested on the latest
family of Radeon GPUs.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16841>

2 years agogallium/util: Move u_dl and u_pointer to src/util
Jesse Natalie [Fri, 1 Jul 2022 02:25:19 +0000 (19:25 -0700)]
gallium/util: Move u_dl and u_pointer to src/util

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17327>

2 years agoetnaviv: async shader compile
Christian Gmeiner [Mon, 31 Jan 2022 15:40:45 +0000 (16:40 +0100)]
etnaviv: async shader compile

Passes following piglit:
 - spec@khr_parallel_shader_compile@basic

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16172>

2 years agoetnaviv: factor out shader screen related init/deint
Christian Gmeiner [Tue, 1 Feb 2022 13:45:42 +0000 (14:45 +0100)]
etnaviv: factor out shader screen related init/deint

This is a prep step for the next changes.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16172>

2 years agoci/x86: update to llvm 13
Martin Roukala (né Peres) [Tue, 21 Jun 2022 07:37:04 +0000 (10:37 +0300)]
ci/x86: update to llvm 13

Most CI tests are currently running on LLVM 11 (released over 2 years
ago), which predates some of the GPUs we have in CI and prevents
testing RADV's LLVM backend.

LLVM 13 is known to work for RADV, released almost 8 months ago, and
is already available in most distributions. Fedora 36 is even already
on LLVM 14.

So this commit updates x86 testing on llvm 13.

v2:
 - store the llvm apt repo key locally (Michel Dänzer)

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17188>

2 years agoradv: Use NIR optimization to move discards to the top.
Timur Kristóf [Mon, 2 May 2022 12:26:54 +0000 (14:26 +0200)]
radv: Use NIR optimization to move discards to the top.

Fossil stats on Sienna Cichlid:

Totals from 1988 (1.55% of 128653) affected shaders:
VGPRs: 68096 -> 67928 (-0.25%); split: -0.61%, +0.36%
CodeSize: 5391936 -> 5391312 (-0.01%); split: -0.11%, +0.10%
MaxWaves: 53020 -> 52946 (-0.14%); split: +0.05%, -0.19%
Instrs: 992413 -> 992509 (+0.01%); split: -0.10%, +0.11%
Latency: 8643141 -> 8789295 (+1.69%); split: -0.31%, +2.00%
InvThroughput: 1680195 -> 1680605 (+0.02%); split: -0.04%, +0.07%
SClause: 50886 -> 51318 (+0.85%); split: -0.73%, +1.57%
Copies: 57017 -> 56741 (-0.48%); split: -1.28%, +0.80%
PreSGPRs: 66766 -> 67048 (+0.42%); split: -0.24%, +0.66%
PreVGPRs: 56832 -> 56935 (+0.18%); split: -0.44%, +0.62%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13037>

2 years agovenus: swizzle the chroma channels for YVU420 to match the VkFormat
Yiwei Zhang [Thu, 30 Jun 2022 22:06:05 +0000 (22:06 +0000)]
venus: swizzle the chroma channels for YVU420 to match the VkFormat

Test:
- testVP8EncodeDecodeVideoFromBufferToSurface
- android.media.cts.DecodeAccuracyTest

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17323>

2 years agoradv: Add CULL_PRIMITIVE to special output mask.
Timur Kristóf [Sat, 25 Jun 2022 21:21:34 +0000 (23:21 +0200)]
radv: Add CULL_PRIMITIVE to special output mask.

It isn't compiled to an output param, so can be safely ignored
from the param assignment.

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

2 years agoradv: Don't assign driver locations to mesh shader outputs.
Timur Kristóf [Sat, 25 Jun 2022 21:20:36 +0000 (23:20 +0200)]
radv: Don't assign driver locations to mesh shader outputs.

Set all driver locations to zero.
These are ignored by ac_nir_lower_ngg anyway.

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