platform/upstream/mesa.git
2 years agonouveau/nir: Enable nir_opt_move/sink.
Emma Anholt [Thu, 24 Mar 2022 05:13:20 +0000 (22:13 -0700)]
nouveau/nir: Enable nir_opt_move/sink.

NIR load_consts/inputs tend to happen together at the top of the program.
In the TGSI backend the loads got emitted at use time, while the NIR
backend was emitting the loads at load intrinsic time.  By sinking the
intrinsics, we can greatly reduce register pressure.

nv92 NIR results:

total local in shared programs: 2024 -> 2020 (-0.20%)
local in affected programs: 4 -> 0
total gpr in shared programs: 790424 -> 735455 (-6.95%)
gpr in affected programs: 215968 -> 160999 (-25.45%)
total instructions in shared programs: 6058339 -> 6051208 (-0.12%)
instructions in affected programs: 410795 -> 403664 (-1.74%)
total bytes in shared programs: 41820104 -> 41660304 (-0.38%)
bytes in affected programs: 7147296 -> 6987496 (-2.24%)

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15542>

2 years agopvr: Use vk_common_GetDeviceQueue API.
Rajnesh Kanwal [Thu, 10 Mar 2022 13:01:27 +0000 (13:01 +0000)]
pvr: Use vk_common_GetDeviceQueue API.

Removes pvr_GetDeviceQueue implementation. As we are now
using the common vk_queue structure as a base for pvr_queue,
we can use vk_common_GetDeviceQueue implementation instead.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15574>

2 years agodzn: Compile-test the driver
Boris Brezillon [Fri, 28 Jan 2022 12:32:46 +0000 (04:32 -0800)]
dzn: Compile-test the driver

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>

2 years agomicrosoft: Initial vulkan-on-12 driver
Erik Faye-Lund [Thu, 24 Jun 2021 11:09:35 +0000 (13:09 +0200)]
microsoft: Initial vulkan-on-12 driver

This is Dozen, the Vulkan on DirectX 12 driver. Not to be confused with
DirectEggs.

This is an early prototype, and not meant to be upstreamed as-is.

Co-Authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-Authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Co-Authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Co-Authored-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>

2 years agomicrosoft/spirv_to_dxil: Add missing ralloc_free
Enrico Galli [Tue, 8 Feb 2022 23:08:01 +0000 (15:08 -0800)]
microsoft/spirv_to_dxil: Add missing ralloc_free

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>

2 years agovulkan/util: Make STACK_ARRAY() work for arrays of pointers
Boris Brezillon [Wed, 16 Mar 2022 09:21:39 +0000 (02:21 -0700)]
vulkan/util: Make STACK_ARRAY() work for arrays of pointers

And add an explicit cast on the pointer returned by malloc() to
make C++ happy.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>

2 years agovulkan/image: Make MSVC C++ compiler happy
Boris Brezillon [Fri, 25 Mar 2022 12:17:21 +0000 (05:17 -0700)]
vulkan/image: Make MSVC C++ compiler happy

Fix 'error C4576: a parenthesized type followed by an initializer
list is a non-standard explicit type conversion syntax' errors by
declaring an actual variable and returning it in
vk_image_view_subresource_range().

All those MSVC/c++ related-constraints are quite annoying to be honest,
but it looks like the D3D12 headers have been updated to plain C
recently, which will allow us to write the driver in C, and hopefully
get all this sort of issues behind us.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>

2 years agozink: add anv cts skips from waiver
Mike Blumenkrantz [Fri, 25 Mar 2022 14:15:48 +0000 (10:15 -0400)]
zink: add anv cts skips from waiver

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

2 years agozink: update radv fails
Mike Blumenkrantz [Fri, 25 Mar 2022 12:58:15 +0000 (08:58 -0400)]
zink: update radv fails

this should be the exact current baseline

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

2 years agopvr: Implement vkCreateSampler and vkDestroySampler APIs.
Rajnesh Kanwal [Thu, 17 Feb 2022 09:45:18 +0000 (09:45 +0000)]
pvr: Implement vkCreateSampler and vkDestroySampler APIs.

Implements vkCreateSampler and vkDestroySampler APIs.

Also fixes maxSamplerLodBias value from 15.0f to 16.0f
as it's the max supported by our hardware.

Also changing maxSamplerAnisotropy from 16.0f to 1.0f to
temporarily disable anisotropy as we are missing software
support for it.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15557>

2 years agovulkan/util: Get rid of VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 13:09:50 +0000 (14:09 +0100)]
vulkan/util: Get rid of VK_OUTARRAY_MAKE()

Get rid of VK_OUTARRAY_MAKE() so people don't get tempted to
use it and produce code that doesn't compile with MSVC, which
doesn't support typeof().

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agovulkan/wsi: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 13:06:00 +0000 (14:06 +0100)]
vulkan/wsi: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agovulkan/device_select: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:59:40 +0000 (13:59 +0100)]
vulkan/device_select: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agovenus: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:57:41 +0000 (13:57 +0100)]
venus: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agopanvk: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:54:26 +0000 (13:54 +0100)]
panvk: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agoanv: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:50:34 +0000 (13:50 +0100)]
anv: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agopvr: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:40:46 +0000 (13:40 +0100)]
pvr: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agoturnip: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:37:47 +0000 (13:37 +0100)]
turnip: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agov3dv: Stop using VK_OUTARRAY_MAKE()
Boris Brezillon [Wed, 23 Mar 2022 12:28:36 +0000 (13:28 +0100)]
v3dv: Stop using VK_OUTARRAY_MAKE()

We're trying to replace VK_OUTARRAY_MAKE() by VK_OUTARRAY_MAKE_TYPED()
so people don't get tempted to use it and make things incompatible with
MSVC (which doesn't support typeof()).

Suggested-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15522>

2 years agointel/fs: Fix IsHelperInvocation for the case no discard/demote are used
Caio Oliveira [Wed, 16 Mar 2022 00:04:04 +0000 (17:04 -0700)]
intel/fs: Fix IsHelperInvocation for the case no discard/demote are used

Use emit_predicate_on_sample_mask() helper that does check where to
get the correct mask depending on whether discard/demote was used or
not.

Fixes: 45f5db5a84a ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>

2 years agointel/fs: Initialize the sample mask in flags register when using demote
Caio Oliveira [Wed, 16 Mar 2022 00:15:17 +0000 (17:15 -0700)]
intel/fs: Initialize the sample mask in flags register when using demote

Without this change, a check for "is helper invocation" could read
uninitialized values.

Fixes: 45f5db5a84a ("intel/fs: Implement "demote to helper invocation"")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15400>

2 years agonir: Use const for nir_shader_get_entrypoint(..)
Christian Gmeiner [Sun, 13 Mar 2022 11:40:24 +0000 (12:40 +0100)]
nir: Use const for nir_shader_get_entrypoint(..)

nir_shader_get_entrypoint(..) should not modify the passed nir_shader
object. Enforce this by marking shader paramenter as const.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15362>

2 years agomesa/st: add special casing for pointsize constant updating during validate
Mike Blumenkrantz [Fri, 25 Mar 2022 01:45:32 +0000 (21:45 -0400)]
mesa/st: add special casing for pointsize constant updating during validate

the previous method of using affected_states to trigger constant updates
was ineffectual in the scenario where a ubo pointsize was needed on
the first time a non-precompiled shader was used after being the not-last
vertex stage:

* have vs+gs -> gs precompiles with pointsize lowering -> gs constants get updated
* remove gs -> vs was precompiled without pointsize lowering -> vs constants broken

now just do a quick check as in st_atom_shader.c and set the flag manually to
ensure the update is done correctly every time

cc: mesa-stable

fixes #6207

fixes (radv):
KHR-GL46.texture_cube_map_array.image_op_fragment_sh
KHR-GL46.texture_cube_map_array.sampling
KHR-GL46.texture_cube_map_array.texture_size_fragment_sh
KHR-GL46.constant_expressions*

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

2 years agozink: update anv icl ci list
Mike Blumenkrantz [Fri, 25 Mar 2022 01:22:09 +0000 (21:22 -0400)]
zink: update anv icl ci list

praise be to dynamic state fixes!

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

2 years agozink: flush clears before toggling color write
Mike Blumenkrantz [Thu, 24 Mar 2022 21:31:36 +0000 (17:31 -0400)]
zink: flush clears before toggling color write

ensure these sync up onto the expected buffers

Fixes: 3892c133811 ("zink: add an alternate path for EXT_color_write_enable usage")

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

2 years agozink: fix up color_write_enable workaround
Mike Blumenkrantz [Thu, 24 Mar 2022 19:44:02 +0000 (15:44 -0400)]
zink: fix up color_write_enable workaround

this needs to only swizzle to dummy surfaces if it's the workaround,
not just if color_write_enable is active

Fixes: 3892c133811 ("zink: add an alternate path for EXT_color_write_enable usage")

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

2 years agofreedreno/ci: Update a306 expectations
Rob Clark [Fri, 25 Mar 2022 00:11:44 +0000 (17:11 -0700)]
freedreno/ci: Update a306 expectations

These have started to flakey UnexpectedPass somewhere along the way.

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

2 years agopipe-loader: Try loading freedreno for virtgpu device
Rob Clark [Wed, 2 Feb 2022 19:53:36 +0000 (11:53 -0800)]
pipe-loader: Try loading freedreno for virtgpu device

Freedreno will check if the virtgpu supports the pass-thru context, and
if not will bail, falling back to virgl.

TODO this requires that virgl is also enabled in the mesa build, even if
it is not needed.. maybe there is a better way to handle this?

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

2 years agofreedreno/drm: Add virtio backend
Rob Clark [Wed, 2 Feb 2022 18:56:26 +0000 (10:56 -0800)]
freedreno/drm: Add virtio backend

Add a new backend to enable using native driver in a VM guest, via a new
virtgpu context type which (indirectly) makes host kernel interface
available in guest and handles the details of mapping buffers to guest,
etc.

Note that fence-fd's are currently a bit awkward, in that they get
signaled by the guest kernel driver (drm/virtio) once virglrenderer in
the host has processed the execbuf, not when host kernel has signaled
the submit fence.  For passing buffers to the host (virtio-wl) the egl
context in virglrenderer is used to create a fence on the host side.
But use of out-fence-fd's in guest could have slightly unexpected
results.  For this reason we limit all submitqueues to default priority
(so they cannot be preepmted by host egl context).  AFAICT virgl and
venus have a similar problem, which will eventually be solveable once we
have RESOURCE_CREATE_SYNC.

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

2 years agofreedreno/drm: Reorder device destroy
Rob Clark [Fri, 18 Mar 2022 21:34:21 +0000 (14:34 -0700)]
freedreno/drm: Reorder device destroy

Call backend specific cleanup fxn earlier.  This is needed if the
backend has things like bo's to delete, otherwise the handle_table
will already be destroyed causing problems in bo_del()

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

2 years agofreedreno/drm: Extract out "softpin" submit/ringbuffer base class
Rob Clark [Tue, 15 Mar 2022 00:14:59 +0000 (17:14 -0700)]
freedreno/drm: Extract out "softpin" submit/ringbuffer base class

We are going to want basically the identical thing, other than
flush_submit_list, for virtio backend.  Now that we've moved various
other dependencies into the base classes, extract out an abstract base
class for submit/ringbuffer.

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

2 years agofreedreno/drm: Move ring_pool slab parent to base
Rob Clark [Mon, 14 Mar 2022 23:56:55 +0000 (16:56 -0700)]
freedreno/drm: Move ring_pool slab parent to base

Prep to move most of sp submit/ringbuffer to something that can be
re-used by virtio backend.

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

2 years agofreedreno/drm: Move bo idx to base
Rob Clark [Mon, 14 Mar 2022 23:31:00 +0000 (16:31 -0700)]
freedreno/drm: Move bo idx to base

The virtio backend will want this too, and it will make it easier to
share most of the submit/ringbuffer implementation with the virtio
backend.

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

2 years agofreedreno/drm: Move submit_queue to base
Rob Clark [Mon, 14 Mar 2022 23:23:08 +0000 (16:23 -0700)]
freedreno/drm: Move submit_queue to base

The virtio backend will want this too.

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

2 years agofreedreno/drm: Avoid CPU_PREP ioctl if bo is idle
Rob Clark [Thu, 10 Feb 2022 17:31:16 +0000 (09:31 -0800)]
freedreno/drm: Avoid CPU_PREP ioctl if bo is idle

With userspace fences, if we know definitely that the buffer is idle
(which implies that it is not shared with other processes, etc), then
skip the ioctl.

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

2 years agofreedreno/drm: Add fd_bo_upload()
Rob Clark [Wed, 9 Feb 2022 19:02:21 +0000 (11:02 -0800)]
freedreno/drm: Add fd_bo_upload()

There are some buffers that we mmap just to write to them a single time.
Add the possibility of the drm backend to provide an alternate upload
path to avoid these mmap's.

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

2 years agofreedreno/drm: Add FD_BO_SHARED hint
Rob Clark [Sun, 6 Feb 2022 17:22:59 +0000 (09:22 -0800)]
freedreno/drm: Add FD_BO_SHARED hint

With the virtio backend we will need to pass an extra flag when
allocating buffers that will be shared cross-device (such as with
virtio-wl for passing between host and guest)

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

2 years agofreedreno/drm: Add FD_BO_NOMAP hint
Rob Clark [Fri, 4 Feb 2022 19:36:40 +0000 (11:36 -0800)]
freedreno/drm: Add FD_BO_NOMAP hint

Add a hint for buffers that we won't need to mmap.  With the virtio
backend, virglrenderer needs to create a dmabuf fd for mapping into
the host, which we want to avoid when possible.

Low hanging fruit is to use this hint for anything tiled/ubwc.  There
are probably more bo's that can be flagged as such.

TODO add fd_bo_upload() for memcpy to bo.. this would be useful for
uploads, for example, shaders which we just write once and never touch
again.. for virtio this could be implemented with a TRANSFER_TO_HOST
ioctl.

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

2 years agofreedreno/drm: Rework bo creation path
Rob Clark [Fri, 4 Feb 2022 00:00:09 +0000 (16:00 -0800)]
freedreno/drm: Rework bo creation path

Decoupling handle and fd_bo creation simplifies things for "normal" drm
drivers, avoiding duplication for the create vs import paths.  But this
is awkward for the virtio backend when wants to do multiple things in
the same guest<->host round trip.

So instead, split the paths in the interface backend and move the code
sharing for the two different paths into the msm backend itself.

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

2 years agofreedreno/drm: Add fd_device_open() helper
Rob Clark [Wed, 2 Feb 2022 17:46:55 +0000 (09:46 -0800)]
freedreno/drm: Add fd_device_open() helper

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

2 years agofreedreno/drm: Split msm backend into subdir
Rob Clark [Wed, 2 Feb 2022 17:45:57 +0000 (09:45 -0800)]
freedreno/drm: Split msm backend into subdir

Let's keep things a bit better organized when we add a new backend.

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

2 years agozink: update radv ci
Mike Blumenkrantz [Thu, 24 Mar 2022 21:32:25 +0000 (17:32 -0400)]
zink: update radv ci

bunch of these I just removed by mistake

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

2 years agovenus: update protocol to remove redundant decoders
Yiwei Zhang [Wed, 23 Mar 2022 22:32:11 +0000 (22:32 +0000)]
venus: update protocol to remove redundant decoders

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15537>

2 years agovenus: Increase the base sleep of vn_relax
Renato Pereyra [Thu, 24 Mar 2022 23:12:43 +0000 (16:12 -0700)]
venus: Increase the base sleep of vn_relax

Based on profiling, these 10us sleeps are behaving closer to ~60us
and causing higher-than-necessary CPU overhead. 120us seems like a
good balance between latency management and overhead.

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

2 years agolavapipe: Delete render passes
Jason Ekstrand [Wed, 16 Mar 2022 19:31:20 +0000 (14:31 -0500)]
lavapipe: Delete render passes

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

2 years agoc11: Fixes unused parameter warnings
Yonggang Luo [Thu, 24 Mar 2022 16:59:24 +0000 (00:59 +0800)]
c11: Fixes unused parameter warnings

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15553>

2 years agoutil: Fixes unused parameter warnings
Yonggang Luo [Fri, 18 Feb 2022 19:38:29 +0000 (03:38 +0800)]
util: Fixes unused parameter warnings

The compiler warning:
```
../src/mesa/util/u_thread.h: In function 'util_thread_get_time_nano':
../src/mesa/util/u_thread.h:239:34: warning: unused parameter 'thread' [-Wunused-parameter]
  239 | util_thread_get_time_nano(thrd_t thread)
      |                           ~~~~~~~^~~~~~
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15553>

2 years agozink: update resource layout in copy_scanout
Dave Airlie [Thu, 24 Mar 2022 06:43:57 +0000 (16:43 +1000)]
zink: update resource layout in copy_scanout

This transitions the resource to TRANSFER_SRC_OPTIMAL, but
never updates the res->layout field, so subsequent transitions
are wrong and throw validation errors.

UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC): msgNum: 1303270965 - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x6660f60, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x6660f60[] expects VkImage 0x2f000000002f[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL.

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

2 years agolavapipe: Use vk_image_subresource_layer/level_count
Jason Ekstrand [Thu, 17 Mar 2022 18:10:06 +0000 (13:10 -0500)]
lavapipe: Use vk_image_subresource_layer/level_count

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

2 years agolavapipe: Use vk_image_view
Jason Ekstrand [Thu, 17 Mar 2022 18:07:22 +0000 (13:07 -0500)]
lavapipe: Use vk_image_view

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

2 years agovulkan: Add a vk_image_view_subresource_range helper
Jason Ekstrand [Wed, 23 Mar 2022 22:52:55 +0000 (17:52 -0500)]
vulkan: Add a vk_image_view_subresource_range helper

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

2 years agovulkan/runtime: Add vk_cmd_queue.h to idep_vulkan_runtime_headers
Boris Brezillon [Thu, 24 Mar 2022 09:11:56 +0000 (10:11 +0100)]
vulkan/runtime: Add vk_cmd_queue.h to idep_vulkan_runtime_headers

If we don't do that, meson might start compiling source files
including vk_command_buffer.h which in turn includes vk_cmd_queue.h
before this file is even generated, and we end up with errors like
that https://gitlab.freedesktop.org/mesa/mesa/-/jobs/20157936#L1119.

Fixes: 6bd8a3c7e434 ("vulkan/runtime: Add a vk_cmd_queue object to vk_command_buffer")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15546>

2 years agovenus: add VK_EXT_extended_dynamic_state2 extension
Igor Torrente [Thu, 17 Mar 2022 13:30:03 +0000 (10:30 -0300)]
venus: add VK_EXT_extended_dynamic_state2 extension

Implements all the necessary code in the device initialization
and extension functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15428>

2 years agopvr: ci: Initial freedesktop CI integration
Matt Coster [Mon, 7 Mar 2022 11:25:17 +0000 (11:25 +0000)]
pvr: ci: Initial freedesktop CI integration

This patch adds the PowerVR driver to the following shared builds:

 * debian-arm64
 * debian-clang
 * debian-release
 * debian-vulkan
 * fedora-release

It also adds the associated "tools" to these builds:

 * debian-arm64-build-test
 * debian-release (already uses -Dtools=all)
 * fedora-release

And removes them from these builds by expanding -Dtools=all:

 * debian-gallium

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15284>

2 years agopvr: Gate offline compiler build behind -Dtools=imagination
Matt Coster [Mon, 7 Mar 2022 14:45:51 +0000 (14:45 +0000)]
pvr: Gate offline compiler build behind -Dtools=imagination

This matches the behavior of e.g. panfrost's bifrost_compiler target.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15284>

2 years agopvr: do not use fallthrough for unreachable code
Erik Faye-Lund [Wed, 23 Mar 2022 17:34:26 +0000 (18:34 +0100)]
pvr: do not use fallthrough for unreachable code

unreachable() doesn't lead to executing the code that follows it,
neither in debug nor release builds. So falling through doesn't make any
sense.

This fixes a compile-error on clang.

Let's move the default-block to the end to make it clearer that there's
no intended fallthrough.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531>

2 years agopvr: do not use fallthrough for unreachable code
Erik Faye-Lund [Wed, 23 Mar 2022 17:34:26 +0000 (18:34 +0100)]
pvr: do not use fallthrough for unreachable code

unreachable() doesn't lead to executing the code that follows it,
neither in debug nor release builds. So falling through doesn't make any
sense.

This fixes a compile-error on clang.

Let's move the default-block to the end to make it clearer that there's
no intended fallthrough.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531>

2 years agoanv: don't store sample location sample count
Lionel Landwerlin [Tue, 15 Mar 2022 21:35:24 +0000 (23:35 +0200)]
anv: don't store sample location sample count

This information should match the current pipeline sample count.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: fix dynamic sample locations on Gen7/7.5
Lionel Landwerlin [Tue, 15 Mar 2022 22:25:17 +0000 (00:25 +0200)]
anv: fix dynamic sample locations on Gen7/7.5

3DSTATE_MULTISAMPLE should be baked into the pipeline if not dynamic.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 27ee40f4c9d8 ("anv: Add support for sample locations")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: use local dynamic pointer more
Lionel Landwerlin [Tue, 15 Mar 2022 19:28:48 +0000 (21:28 +0200)]
anv: use local dynamic pointer more

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: fix color write enable interaction with color mask
Lionel Landwerlin [Mon, 14 Mar 2022 07:52:35 +0000 (09:52 +0200)]
anv: fix color write enable interaction with color mask

Color writes & color masks occupy the same fields in the BLEND_STATE
structure. So we need to store color mask (which are not dynamic) on
the pipeline to merge that information with color writes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b15bfe92f7f8 ("anv: implement VK_EXT_color_write_enable")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6111
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: fix VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT state
Lionel Landwerlin [Mon, 11 Oct 2021 15:31:26 +0000 (18:31 +0300)]
anv: fix VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT state

First, there is a problem if you do the following

 vkCmdSetColorWriteEnableEXT(attachmentCount = 8)
 vkCmdBindPipeline(GFX, with attachmentCount = 4)
 vkCmdDraw()
 vkCmdBindPipeline(GFX, with attachmentCount = 8)
 vkCmdDraw()

Because in the dynamic state emission code we rely on the first
pipeline to figure the number of BLEND_STATE entries to prepare. This
is wrong, we should fill all entries so that the dynamic state works
regardless of the number of attachments in the pipeline. With regard
to the dynamic values, we should retain enable/disable values that do
not concern the current pipeline.

Second, 3DSTATE_WM was not always reemitted when the pipeline changed.
But since it is not emitted as part of the pipeline, this results in
inconsistent state being programmed.

Third, we end up disabling the fragment stage completely in some
cases. And that is programming the pipeline inconsistently and
triggering a hang on TGL.

v2: Fix comment (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b15bfe92f7f8 ("anv: implement VK_EXT_color_write_enable")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: fix dynamic state emission
Lionel Landwerlin [Wed, 9 Mar 2022 08:38:01 +0000 (10:38 +0200)]
anv: fix dynamic state emission

The problem is that we missed looking at pipeline changes. Pipelines
hold bits of dynamic states and when it changes we might need to
reemit a packet.

v2: fix comment (Tapani)
    Add missing anv_cmd_buffer_needs_dynamic_state() use (Tapani)

Cc: mesa-stable
Fixes: 505d176a8ebf ("anv: disable baked in pipeline bits from dynamic emission path")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agoanv: allow baking of 3DSTATE_DEPTH_BOUNDS in pipeline batch
Lionel Landwerlin [Wed, 9 Mar 2022 14:37:49 +0000 (16:37 +0200)]
anv: allow baking of 3DSTATE_DEPTH_BOUNDS in pipeline batch

If it's not dynamic.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15310>

2 years agodocs: add a minimal docs page for radv
Erik Faye-Lund [Mon, 21 Mar 2022 19:33:25 +0000 (20:33 +0100)]
docs: add a minimal docs page for radv

RADV is the last driver in Mesa that doesn't have a webpage somewhere
that we can link to from mesa3d.org. So let's make a minimal docs article
for it where we link to relevant information elsewhere.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15494>

2 years agovirgl: Update virgl_protocol and use the provided constants
Corentin Noël [Wed, 5 Jan 2022 11:33:43 +0000 (12:33 +0100)]
virgl: Update virgl_protocol and use the provided constants

Allow for better readability of the code.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14473>

2 years agoRevert "ci: Disable windows-vs2019"
Boris Brezillon [Tue, 22 Mar 2022 10:53:16 +0000 (11:53 +0100)]
Revert "ci: Disable windows-vs2019"

This reverts commit 04b80489d575dab7ed2cd3714d60d32e91e26589.

Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

2 years agolavapipe: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()
Boris Brezillon [Wed, 23 Mar 2022 09:40:09 +0000 (02:40 -0700)]
lavapipe: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()

MSVC doesn't support typeof(). If we want to keep compiling radv on
windows we need to use the typed variants of those macros.

Fixes: dc8fdab71efd ("lavapipe: Use VK_OUTARRAY for GetPhysicalDeviceQueueFamilyProperties[2]")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

2 years agoradv: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()
Boris Brezillon [Wed, 23 Mar 2022 09:36:00 +0000 (02:36 -0700)]
radv: Don't use VK_OUTARRAY_MAKE()/vk_outarray_append()

MSVC doesn't support typeof(). If we want to keep compiling radv on
windows we need to use the typed variants of those macros.

Fixes: 10d69d5f0bcc ("radv: fix returning empty drmFormatModifierTilingFeatures")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

2 years agoamd: Fix ac_gpu_info.c compilation on windows
Boris Brezillon [Tue, 22 Mar 2022 11:16:17 +0000 (12:16 +0100)]
amd: Fix ac_gpu_info.c compilation on windows

Fixes: 75a783ea73e8 ("ac: Query the amdgpu MEC firmware version.")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

2 years agoaco: Fix an MSVC warning
Boris Brezillon [Tue, 22 Mar 2022 11:05:03 +0000 (12:05 +0100)]
aco: Fix an MSVC warning

'warning C4804: '<<': unsafe use of type 'bool' in operation'

Fixes: 9934c8676132 ("aco: use v_fma_mix to combine mul/add/fma input conversions")
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15518>

2 years agovirgl/ci: Add support for dEQP GL vtest-ing
Cristian Ciocaltea [Mon, 21 Mar 2022 11:53:41 +0000 (13:53 +0200)]
virgl/ci: Add support for dEQP GL vtest-ing

Provide the 'virpipe-on-gl' job for running dEQP GL tests on
virpipe/vtest.

The rationale is to help reducing the regressions in Virglrenderer CI
due to sharing the Mesa CI infrastructure.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15490>

2 years agoci/freedreno: Increase console timeout for perf jobs
Tomeu Vizoso [Wed, 23 Mar 2022 16:07:20 +0000 (17:07 +0100)]
ci/freedreno: Increase console timeout for perf jobs

Piglit is very sparse in its status output and downloads of big traces
can take a while.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15527>

2 years agoci/iris: Increase console timeout for perf jobs
Tomeu Vizoso [Wed, 23 Mar 2022 16:06:13 +0000 (17:06 +0100)]
ci/iris: Increase console timeout for perf jobs

Piglit is very sparse in its status output and downloads of big traces
can take a while.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15527>

2 years agoiris: don't synchronize BO for batch decoding
Lionel Landwerlin [Wed, 23 Mar 2022 09:10:08 +0000 (11:10 +0200)]
iris: don't synchronize BO for batch decoding

We don't need to go to the kernel to synchronize the BO we want to
decode with INTEL_DEBUG=bat, mostly because we'll decode what was
written by the driver in the batch.

This also works around an issue in the simulation environment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac81f189050 ("iris: decoder fixes")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15517>

2 years agoi915: Use the sin/cos lowering in nir_opt_algebraic.py
Jason Ekstrand [Wed, 23 Mar 2022 22:42:46 +0000 (17:42 -0500)]
i915: Use the sin/cos lowering in nir_opt_algebraic.py

It's nearly identical.

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

2 years agoci/freedreno: Update checksum for GolfWithYourFriends trace
Tomeu Vizoso [Wed, 23 Mar 2022 15:53:24 +0000 (16:53 +0100)]
ci/freedreno: Update checksum for GolfWithYourFriends trace

The MR below changed the rendering slightly and the checksum isn't valid
any more:

"ir3, turnip, freedreno: Shader preambles"

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15526>

2 years agozink: lower txp for array textures
Mike Blumenkrantz [Tue, 22 Mar 2022 14:59:09 +0000 (10:59 -0400)]
zink: lower txp for array textures

this is also illegal according to spirv spec

fixes #6177

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

2 years agozink: lower txp for cube and ms textures
Mike Blumenkrantz [Tue, 22 Mar 2022 14:57:20 +0000 (10:57 -0400)]
zink: lower txp for cube and ms textures

this is illegal according to spirv spec

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

2 years agonir/lower_tex: add txp lowering option for arrays
Mike Blumenkrantz [Tue, 22 Mar 2022 14:56:43 +0000 (10:56 -0400)]
nir/lower_tex: add txp lowering option for arrays

this is illegal in vulkan, so zink needs to be able to lower these

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15510>

2 years agogallium: Remove unused macro PIPE_ARCH_SSSE3
Yonggang Luo [Mon, 21 Mar 2022 20:38:49 +0000 (04:38 +0800)]
gallium: Remove unused macro PIPE_ARCH_SSSE3

After removal inline function `_mm_shuffle_epi8`, the
macro `PIPE_ARCH_SSSE3` have no need anymore, remove it too.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14077>

2 years agollvmpipe: Revise u_sse.h to remove unused _mm_shuffle_epi8 inline function
Yonggang Luo [Mon, 21 Mar 2022 19:53:20 +0000 (03:53 +0800)]
llvmpipe: Revise u_sse.h to remove unused _mm_shuffle_epi8 inline function

error log:
```
[2/43] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj
FAILED: src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj
"cc" "-Isrc/gallium/drivers/llvmpipe/libllvmpipe.a.p" "-Isrc/gallium/drivers/llvmpipe" "-I../../src/gallium/drivers/llvmpipe" "-I../../src/gallium/include" "-Isrc/gallium/auxiliary" "-I../../src/gallium/auxiliary" "-Iinclude" "-I../../include" "-Isrc" "-I../../src" "-Isrc/compiler/nir" "-I../../src/compiler/nir" "-Isrc/util" "-I../../src/util" "-IC:/CI-Tools/msys64/clang64/include" "-fvisibility=hidden" "-fcolor-diagnostics" "-Wall" "-Winvalid-pch" "-std=c11" "-O0" "-g" "-DPACKAGE_VERSION=\"22.0.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DHAVE_WINDOWS_PLATFORM" "-DHAVE_SURFACELESS_PLATFORM" "-DUSE_ELF_TLS" "-DUSE_TLS_BEHIND_FUNCTIONS" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-DDEBUG" "-DHAVE___BUILTIN_BSWAP32" "-DHAVE___BUILTIN_BSWAP64" "-DHAVE___BUILTIN_CLZ" "-DHAVE___BUILTIN_CLZLL" "-DHAVE___BUILTIN_CTZ" "-DHAVE___BUILTIN_EXPECT" "-DHAVE___BUILTIN_FFS" "-DHAVE___BUILTIN_FFSLL" "-DHAVE___BUILTIN_POPCOUNT" "-DHAVE___BUILTIN_POPCOUNTLL" "-DHAVE___BUILTIN_UNREACHABLE" "-DHAVE___BUILTIN_TYPES_COMPATIBLE_P" "-DHAVE_FUNC_ATTRIBUTE_CONST" "-DHAVE_FUNC_ATTRIBUTE_FLATTEN" "-DHAVE_FUNC_ATTRIBUTE_MALLOC" "-DHAVE_FUNC_ATTRIBUTE_PURE" "-DHAVE_FUNC_ATTRIBUTE_UNUSED" "-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT" "-DHAVE_FUNC_ATTRIBUTE_WEAK" "-DHAVE_FUNC_ATTRIBUTE_FORMAT" "-DHAVE_FUNC_ATTRIBUTE_PACKED" "-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL" "-DHAVE_FUNC_ATTRIBUTE_ALIAS" "-DHAVE_FUNC_ATTRIBUTE_NORETURN" "-DHAVE_FUNC_ATTRIBUTE_VISIBILITY" "-DHAVE_UINT128" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-DUSE_SSE41" "-DUSE_GCC_ATOMIC_BUILTINS" "-DHAS_SCHED_H" "-DHAVE_CET_H" "-DHAVE_STRTOF" "-DHAVE_STRTOK_R" "-DHAVE_QSORT_S" "-DHAVE_ZLIB" "-DHAVE_ZSTD" "-DHAVE_COMPRESSION" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"13.0.0\"" "-DLLVM_IS_SHARED=1" "-DDRAW_LLVM_AVAILABLE" "-DMESA_EXECMEM" "-DVK_USE_PLATFORM_WIN32_KHR" "-Werror=implicit-function-declaration" "-Werror=missing-prototypes" "-Werror=return-type" "-Werror=empty-body" "-Werror=incompatible-pointer-types" "-Werror=int-conversion" "-Wimplicit-fallthrough" "-Wno-missing-field-initializers" "-fno-math-errno" "-fno-trapping-math" "-Qunused-arguments" "-fno-common" "-Wno-microsoft-enum-value" "-Werror=format" "-Wformat-security" "-Werror=thread-safety" "-ffunction-sections" "-fdata-sections" "-pthread" "-D_FILE_OFFSET_BITS=64" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-Werror=pointer-arith" "-Werror=gnu-empty-initializer" -MD -MQ src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj -MF "src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj.d" -o src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_tri.c.obj "-c" ../../src/gallium/drivers/llvmpipe/lp_setup_tri.c
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup_tri.c:37:
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup_context.h:38:
In file included from ../../src/gallium/drivers/llvmpipe/lp_setup.h:31:
In file included from ../../src/gallium/drivers/llvmpipe/lp_jit.h:40:
In file included from ../../src/gallium/auxiliary/gallivm/lp_bld_limits.h:37:
In file included from ../../src/util/u_cpu_detect.h:41:
In file included from ../../src/util/u_thread.h:35:
In file included from ../../include/c11/threads.h:64:
In file included from ../../include/c11/threads_win32.h:58:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/windows.h:69:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/windef.h:9:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/minwindef.h:163:
In file included from C:/CI-Tools/msys64/clang64/x86_64-w64-mingw32/include/winnt.h:1555:
In file included from C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/x86intrin.h:15:
In file included from C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/immintrin.h:37:
C:/CI-Tools/msys64/clang64/lib/clang/13.0.0/include/tmmintrin.h:582:1: error: redefinition of '_mm_shuffle_epi8'
_mm_shuffle_epi8(__m128i __a, __m128i __b)
^
../../src/gallium/auxiliary/util/u_sse.h:159:1: note: previous definition is here
_mm_shuffle_epi8(__m128i a, __m128i mask)
^
1 error generated.

```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14077>

2 years agonir/legalize_16bit_sampler_srcs: Don't guess source type.
Georg Lehmann [Thu, 24 Feb 2022 20:43:28 +0000 (21:43 +0100)]
nir/legalize_16bit_sampler_srcs: Don't guess source type.

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

2 years agonir/fold_16bit_sampler_conversions: Fix src type mismatches.
Georg Lehmann [Thu, 24 Feb 2022 20:35:43 +0000 (21:35 +0100)]
nir/fold_16bit_sampler_conversions: Fix src type mismatches.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5996
Fixes: fb29cef8 ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
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/14895>

2 years agonir/fold_16bit_sampler_conversions: Fix dest type mismatches.
Georg Lehmann [Sat, 5 Feb 2022 22:03:32 +0000 (23:03 +0100)]
nir/fold_16bit_sampler_conversions: Fix dest type mismatches.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5996
Fixes: fb29cef8dda ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
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/14895>

2 years agonir/fold_16bit_sampler_conversions: Don't fold dest upcasts.
Georg Lehmann [Wed, 23 Mar 2022 10:44:57 +0000 (11:44 +0100)]
nir/fold_16bit_sampler_conversions: Don't fold dest upcasts.

This is not a valid optimization.

Fixes: fb29cef8dda ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
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/14895>

2 years agoRevert "ci: Convert generate-env.sh to a POSIX compliant script"
Cristian Ciocaltea [Wed, 23 Mar 2022 14:29:34 +0000 (16:29 +0200)]
Revert "ci: Convert generate-env.sh to a POSIX compliant script"

This reverts commit 9904ea2c76e246629fab8bda455eec07aa84f3f9 since it is
not able to properly escape all special characters (i.e. [']).

The POSIX conversion is not needed anymore, as we have made 'bash'
available in LAVA rootfs.

Reported-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15524>

2 years agoci: Make bash available in LAVA rootfs
Cristian Ciocaltea [Wed, 23 Mar 2022 15:51:24 +0000 (17:51 +0200)]
ci: Make bash available in LAVA rootfs

Ensure 'bash' shell interpreter is available in LAVA rootfs since it is
going to be a dependency requirement from several scripts, e.g.
generate-env.sh.

Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15524>

2 years agofix(clover): FTBFS: Added missing include for ConstantInt for LLVM 15
Kai Wasserbäch [Thu, 3 Mar 2022 14:17:07 +0000 (15:17 +0100)]
fix(clover): FTBFS: Added missing include for ConstantInt for LLVM 15

With LLVM 15 the include of llvm/IR/Constants.h is required for
ConstantInt.

This commit fixes an FTBFS.

Cc: mesa-stable
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15232>

2 years agodocs: fixup breakage in release-calendar
Erik Faye-Lund [Wed, 23 Mar 2022 16:52:47 +0000 (17:52 +0100)]
docs: fixup breakage in release-calendar

Seems the branch was accidentally changed to no longer match the
release. Let's fix that.

Fixes: 9ba636cdc76 ("docs: update calendar and link releases notes for 21.3.8")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15528>

2 years agoRevert "intel/fs: handle interpolation modes for at_sample and at_offset too"
Mark Janes [Wed, 23 Mar 2022 18:03:47 +0000 (11:03 -0700)]
Revert "intel/fs: handle interpolation modes for at_sample and at_offset too"

This reverts commit 5afbb0e7308de59dce8f5d3afde2ffc79d552ed7.

Closes: #6198
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15534>

2 years agopvr: zero-initialize variable
Erik Faye-Lund [Wed, 23 Mar 2022 14:40:09 +0000 (15:40 +0100)]
pvr: zero-initialize variable

Because of incomplete codepaths further down in this function, we end up
trying to use this variable without initialization. Let's initialize it
to zero, just to keep the compiler happy.

This avoids a compile-time warning, which would get treated as an error
on CI.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>

2 years agopvr: use a helper to translate stencil-ops
Erik Faye-Lund [Wed, 23 Mar 2022 14:39:16 +0000 (15:39 +0100)]
pvr: use a helper to translate stencil-ops

This gives us a single place to handle the conversion, and fixes a
compilation warning by adding an explicit cast.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>

2 years agopvr: use a helper to translate compare-ops
Erik Faye-Lund [Wed, 23 Mar 2022 14:37:32 +0000 (15:37 +0100)]
pvr: use a helper to translate compare-ops

This gives us a single place to handle the conversion, and fixes a
compilation warning by adding an explicit cast.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>

2 years agomicrosoft/compiler: remove phi-value limit
Erik Faye-Lund [Wed, 23 Mar 2022 10:06:30 +0000 (11:06 +0100)]
microsoft/compiler: remove phi-value limit

There's no guarantee that we don't have more than 128 PHI values either,
so let's stop asuming so.

We do this by changing dxil_phi_set_incoming to dxil_phi_add_incoming,
which lets us add more incoming phi-values to the current one instead of
setting a new set of them.

This also lets us reduce these stack-arrays a bit, down to something
much more reasonable.

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

2 years agomicrosoft/compiler: ralloc incoming phi-values
Erik Faye-Lund [Wed, 23 Mar 2022 09:38:27 +0000 (10:38 +0100)]
microsoft/compiler: ralloc incoming phi-values

Reserving 127 incoming values for every phi instruction is neither
robust nor memory efficient.

Let's ralloc this array instead when filling it. This way, we only pay
for what we use here.

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

2 years agopan/va: Add atomic instructions
Alyssa Rosenzweig [Wed, 23 Mar 2022 01:00:04 +0000 (21:00 -0400)]
pan/va: Add atomic instructions

Equivalent to their Bifrost counterparts, with a much more sensible encoding.

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

2 years agopan/va: Allow omitting staging registers
Alyssa Rosenzweig [Wed, 23 Mar 2022 01:34:01 +0000 (21:34 -0400)]
pan/va: Allow omitting staging registers

It's not usually valid, but sr_count == 0 is encodable and used for the
non-RETURN variant of ATOM1. Allow dis/assembling this syntax.

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

2 years agopan/va: Allow forcing staging flags to read-write
Alyssa Rosenzweig [Wed, 23 Mar 2022 01:13:21 +0000 (21:13 -0400)]
pan/va: Allow forcing staging flags to read-write

Required for the correct encoding of atomics.

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

2 years agonir: rename nir_src_is_dynamically_uniform to nir_src_is_always_uniform
Daniel Schürmann [Fri, 11 Feb 2022 10:18:51 +0000 (11:18 +0100)]
nir: rename nir_src_is_dynamically_uniform to nir_src_is_always_uniform

As this function doesn't check for any control-flow
dependence, it only returns true for statically
(or globally) uniform values.
The same holds true for is_binding_dynamically_uniform()
in nir_opt_gcm().
Rename to better reflect that property.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14994>