platform/upstream/mesa.git
2 years agomicrosoft/spirv_to_dxil: Remove dead variables after the struct split pass
Boris Brezillon [Mon, 24 Jan 2022 10:49:33 +0000 (11:49 +0100)]
microsoft/spirv_to_dxil: Remove dead variables after the struct split pass

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agoanv/image: Call into WSI to create swapchain images
Jason Ekstrand [Fri, 23 Jul 2021 05:30:16 +0000 (00:30 -0500)]
anv/image: Call into WSI to create swapchain images

This guarantees that we get an image that's created with exactly the
swapchain image creation parameters instead of trying to emulate it
inside the driver.  Ideally, we'd use the fancy new bind helper too but
our magic ANV_IMAGE_MEMORY_BINDING_PRIVATE gets in the way and we really
do want to re-bind ourself.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agoanv/image: Add some asserts when binding swapchain images
Jason Ekstrand [Fri, 23 Jul 2021 05:30:04 +0000 (00:30 -0500)]
anv/image: Add some asserts when binding swapchain images

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Add image create and bind helpers
Jason Ekstrand [Fri, 23 Jul 2021 04:58:14 +0000 (23:58 -0500)]
vulkan/wsi: Add image create and bind helpers

These are needed to properly implement the Vulkan 1.1 swapchain image
create/bind functionality.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agowsi/common: Set VK_IMAGE_CREATE_ALIAS_BIT
Jason Ekstrand [Mon, 9 Aug 2021 15:23:18 +0000 (10:23 -0500)]
wsi/common: Set VK_IMAGE_CREATE_ALIAS_BIT

With Vulkan 1.1, we have a VkImageSwapchainCreateInfoKHR struct which
lets you create a new VkImage which aliases a swapchain image.  However,
there is no corresponding swapchain create flag so we have to set
VK_IMAGE_CREATE_ALIAS_BIT all the time.

We need to do a bit of work in ANV to prevent it from asserting the
moment it sees one of these.  Fortunately, they're already safe because
WSI images go through a different bind path for
VkBindImageMemorySwapchainInfoKHR.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Drop wsi_create_native/prime_image
Jason Ekstrand [Fri, 23 Jul 2021 04:50:22 +0000 (23:50 -0500)]
vulkan/wsi/drm: Drop wsi_create_native/prime_image

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/win32: Break create_win32_image in pieces
Jason Ekstrand [Fri, 23 Jul 2021 03:14:55 +0000 (22:14 -0500)]
vulkan/wsi/win32: Break create_win32_image in pieces

This is similar to the previous two commits that we did for DRM native
images.  It breaks it into configure/create/bind and calls
wsi_create_image to walk through the three-step process.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/win32: Delete unnecessary copy+paste from DRM
Jason Ekstrand [Thu, 22 Jul 2021 23:27:09 +0000 (18:27 -0500)]
vulkan/wsi/win32: Delete unnecessary copy+paste from DRM

The Win32 WSI just does a copy into the window on the CPU.  There's no
need for external memory or modifiers or implicit sync or any of that.
While we're at it, rename to create_win32_image.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/display: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:49:09 +0000 (23:49 -0500)]
vulkan/wsi/display: Split image creation

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/wayland: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:44:25 +0000 (23:44 -0500)]
vulkan/wsi/wayland: Split image creation

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/x11: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:10:39 +0000 (23:10 -0500)]
vulkan/wsi/x11: Split image creation

Store the wsi_image_create_info in the swapchain and call
wsi_configure_*_image once per swapchain and then use wsi_create_image
for each image.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Break create_prime_image in pieces
Jason Ekstrand [Thu, 22 Jul 2021 23:24:02 +0000 (18:24 -0500)]
vulkan/wsi/drm: Break create_prime_image in pieces

This is similar to the previous two commits that we did for DRM native
images.  It breaks it into configure/create/bind/finish and calls
wsi_create_image to walk through the process.  The primary difference is
that prime images need fifth step in the process to set up the blit
command buffer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Add a helper for the configure/create/bind pattern
Jason Ekstrand [Fri, 23 Jul 2021 03:31:57 +0000 (22:31 -0500)]
vulkan/wsi: Add a helper for the configure/create/bind pattern

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Break create_native_image in pieces
Jason Ekstrand [Thu, 22 Jul 2021 22:50:38 +0000 (17:50 -0500)]
vulkan/wsi/drm: Break create_native_image in pieces

Instead of making create_native_image one monolithic function, break it
into a configure stage and a create stage.  The configure stage is
further broken up, first into a common piece that constructs a simple
VkImageCreateInfo and a couple chain-ins.  The second adds the extra
stuff for create_native_image.  This is to prepare for eventually
storing those structs in the swapchain itself.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path
Jason Ekstrand [Thu, 22 Jul 2021 23:38:20 +0000 (18:38 -0500)]
vulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path

Fixes: 4bdf8547f4dc "vulkan/wsi: Implement VK_KHR_swapchain_mutable_format"

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/overlay: revise and reformat README
Caleb Callaway [Fri, 28 Jan 2022 20:15:59 +0000 (12:15 -0800)]
vulkan/overlay: revise and reformat README

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

2 years agoturnip: respect buf->bo_offset in transform feedback
Chia-I Wu [Sat, 29 Jan 2022 00:53:48 +0000 (16:53 -0800)]
turnip: respect buf->bo_offset in transform feedback

buf->bo->iova should always be offset by buf->bo_offset.

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

2 years agovulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.
Georg Lehmann [Mon, 17 Jan 2022 23:38:10 +0000 (00:38 +0100)]
vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.

This had the opposite problem of the shm path. R8G8B8A8 was always support if
either DRM_FORMAT_XBGR8888 or DRM_FORMAT_ABGR8888 was supported, but we need
both.

Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agovulkan/wsi/wayland: Add modifiers for RGB formats.
Georg Lehmann [Tue, 18 Jan 2022 10:19:34 +0000 (11:19 +0100)]
vulkan/wsi/wayland: Add modifiers for RGB formats.

These formats get overwritten after the FALLTHROUGH, so no modifers got added
to them at all.

Fixes: 151b65b2119 ("vulkan/wsi/wayland: generalize modifier handling")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agovulkan/wsi/wayland: Convert missing vulkan formats to shm formats.
Georg Lehmann [Mon, 17 Jan 2022 23:40:00 +0000 (00:40 +0100)]
vulkan/wsi/wayland: Convert  missing vulkan formats to shm formats.

Fixes: 6b36f35734a ("vulkan/wsi/wl: add wl_shm support for lavapipe.")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agovulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.
Georg Lehmann [Mon, 17 Jan 2022 23:13:09 +0000 (00:13 +0100)]
vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.

We need both the SHM format with alpha and the opaque format to fully support
a vulkan format with alpha. Previously no surface format was reported because
the vulkan formats with aplha were never added as opaque.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5879
Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agoetnaviv: add support for INTEL_blackhole_render
Christian Gmeiner [Sat, 29 Jan 2022 16:24:29 +0000 (17:24 +0100)]
etnaviv: add support for INTEL_blackhole_render

Passes the following piglits:
 - spec@intel_blackhole_render@intel_blackhole-draw_gles2
 - spec@intel_blackhole_render@intel_blackhole-draw_gles3

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

2 years agomicrosoft/compiler: textureLoad() doesn't take a LOD on MS textures
Boris Brezillon [Wed, 8 Dec 2021 09:50:41 +0000 (10:50 +0100)]
microsoft/compiler: textureLoad() doesn't take a LOD on MS textures

Make sure the LOD is zero in that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Skip images in redirect_texture_derefs()
Boris Brezillon [Wed, 1 Dec 2021 08:19:06 +0000 (09:19 +0100)]
microsoft/compiler: Skip images in redirect_texture_derefs()

The input attachment lowering pass turns input attachment loads into
texel fetch operation, and insert an image -> texture deref cast along
the way. In this situation, we can end up with a texture deref chain
pointing to an image variable, which is not a combined sampler+texture
object. Bail out when an image type is found, like we do for bare
textures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Fix sampler/texture array emission
Boris Brezillon [Wed, 1 Dec 2021 08:13:26 +0000 (09:13 +0100)]
microsoft/compiler: Fix sampler/texture array emission

Those need to be declared as sampler/SRV arrays, as we do for UAVs and
CBVs.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Use SRVs for read-only images
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:51:02 +0000 (22:51 -0500)]
microsoft/compiler: Use SRVs for read-only images

Acked-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Add subpass input types
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:43:41 +0000 (22:43 -0500)]
microsoft/compiler: Add subpass input types

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

2 years agomicrosoft/compiler: add support for load_layer_id
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:14:04 +0000 (22:14 -0500)]
microsoft/compiler: add support for load_layer_id

We simply return 0 for now as we don't support multi-view yet.

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

2 years agosvga: silence -Wsometimes-uninitialized
Thomas H.P. Andersen [Thu, 20 Jan 2022 01:04:43 +0000 (02:04 +0100)]
svga: silence -Wsometimes-uninitialized

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoanv: drop a set but unused variable
Thomas H.P. Andersen [Sun, 26 Dec 2021 00:07:41 +0000 (01:07 +0100)]
anv: drop a set but unused variable

Fixes a warning with clang

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoanv: drop a set but unused variable
Thomas H.P. Andersen [Sun, 26 Dec 2021 00:07:47 +0000 (01:07 +0100)]
anv: drop a set but unused variable

Fixes a warning with clang

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agopanfrost: mark two variables as unused
Thomas H.P. Andersen [Tue, 28 Dec 2021 15:31:13 +0000 (16:31 +0100)]
panfrost: mark two variables as unused

The variables are currently unused as panvk does not support
SSBOs yet.

Silences a compile warning with clang

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

2 years agobroadcom: drop unused functions
Thomas H.P. Andersen [Sat, 8 Jan 2022 17:28:48 +0000 (18:28 +0100)]
broadcom: drop unused functions

Fixes a clang warning about unused static inlined functions

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agov3d: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:34:01 +0000 (20:34 +0100)]
v3d: avoid warning about unused function

This function is only used if V3D_VERSION < 40

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agov3d: avoid warning about unused function
Thomas H.P. Andersen [Mon, 17 Jan 2022 18:52:36 +0000 (19:52 +0100)]
v3d: avoid warning about unused function

This function is only used if V3D_VERSION >= 40

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agovc4: drop unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:35:45 +0000 (20:35 +0100)]
vc4: drop unused function

Fixes a clang warning about unused static inlined functions

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoanv: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:36:48 +0000 (20:36 +0100)]
anv: avoid warning about unused function

This function is only used if GFX_VER == 7

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoci/freedreno: properly test sysmem and gmem paths
Danylo Piliaiev [Mon, 27 Dec 2021 11:49:42 +0000 (13:49 +0200)]
ci/freedreno: properly test sysmem and gmem paths

After autotuner introduction most CTS tests are running in
sysmem mode. Now we have to force gmem run and add a small
forced sysmem run since it's not guaranteed that autotuner
would select gmem in future.

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

2 years agotu: add debug option to force gmem
Danylo Piliaiev [Thu, 7 Oct 2021 12:09:32 +0000 (15:09 +0300)]
tu: add debug option to force gmem

With autotuner we now want to be able to force gmem rendering,
it will respect existing constraints though.

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

2 years agofreedreno: Update gmem/sysmem debug options to be in line with turnip
Danylo Piliaiev [Fri, 28 Jan 2022 12:52:23 +0000 (14:52 +0200)]
freedreno: Update gmem/sysmem debug options to be in line with turnip

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

2 years agotu: implement sysmem vs gmem autotuner
Danylo Piliaiev [Thu, 29 Jul 2021 11:21:05 +0000 (14:21 +0300)]
tu: implement sysmem vs gmem autotuner

The implementation is separate from Freedreno due to multithreading
support.

In Vulkan application may fill command buffer from many threads
and expect no locking to occur. We do introduce the possibility of
locking on renderpass end, however assuming that application
doesn't have a huge amount of slightly different renderpasses,
there would be minimal to none contention.

Other assumptions are:
- Application does submit command buffers soon after their creation.

Breaking the above may lead to some decrease in performance or
autotuner turning itself off.

The heuristic is too simplistic at the moment, to find a proper
one - we should run a bunch of traces with sysmem and gmem, and
build better heuristic from gathered data.

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

2 years agoanv: tidy long lines in descriptor code
Lionel Landwerlin [Mon, 31 Jan 2022 07:51:00 +0000 (09:51 +0200)]
anv: tidy long lines in descriptor code

No functional change.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14799>

2 years agod3d12: Fix "use of designated initializers requires at least '/std:c++20'" error
Boris Brezillon [Mon, 24 Jan 2022 09:31:10 +0000 (01:31 -0800)]
d3d12: Fix "use of designated initializers requires at least '/std:c++20'" error

Fixes: 3a8c8d25fd7e ("d3d12: Add a compute transformation to handle indirect draws that need draw params")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14762>

2 years agoaco: preserve pass_flags during format conversions
Rhys Perry [Fri, 28 Jan 2022 14:49:50 +0000 (14:49 +0000)]
aco: preserve pass_flags during format conversions

This helps the "vopc() & exec" optimization.

fossil-db (Sienna Cichlid):
Totals from 1638 (1.21% of 134913) affected shaders:
CodeSize: 3331804 -> 3327520 (-0.13%); split: -0.19%, +0.06%
Instrs: 611807 -> 610096 (-0.28%)
Latency: 5579326 -> 5574874 (-0.08%)
InvThroughput: 936782 -> 936731 (-0.01%); split: -0.01%, +0.00%
Copies: 43324 -> 43302 (-0.05%); split: -0.06%, +0.01%

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

2 years agoaco: optimize abs(mul(a, b))
Rhys Perry [Fri, 28 Jan 2022 13:47:16 +0000 (13:47 +0000)]
aco: optimize abs(mul(a, b))

fossil-db (Sienna Cichlid):
Totals from 18 (0.01% of 134913) affected shaders:
CodeSize: 173924 -> 173852 (-0.04%)
Instrs: 33864 -> 33846 (-0.05%)
Latency: 122233 -> 122211 (-0.02%)
InvThroughput: 22482 -> 22462 (-0.09%)

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

2 years agoaco: fix neg(abs(mul(a, b))) if the mul is not VOP3
Rhys Perry [Fri, 28 Jan 2022 13:48:34 +0000 (13:48 +0000)]
aco: fix neg(abs(mul(a, b))) if the mul is not VOP3

Previously, is_abs was just ignored if mul_instr->isVOP3()==false.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14773>

2 years agovulkan: Allow RegisterDisplayEventEXT before first page flip
Ella Stanforth [Sun, 12 Dec 2021 22:39:55 +0000 (22:39 +0000)]
vulkan: Allow RegisterDisplayEventEXT before first page flip

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14685>

2 years agotu: Initial link-time optimizations
Connor Abbott [Thu, 27 Jan 2022 17:33:55 +0000 (18:33 +0100)]
tu: Initial link-time optimizations

This is mostly taken from radv, and cleaned up a bit: don't explicitly
list every stage at the beginning, and name the shaders "producer" and
"consumer" to reduce confusion. I also stripped out a lot of other stuff
to get to the bare minimum of calling nir_link_opt_varyings,
nir_remove_unused_varyings, and nir_compact_varyings and then cleaning
up the fallout. In the future we may want to temporarily scalarize I/O
like radv does, and add back a few things like the psize optimization.
In the meantime this already provides a lot of benefit.

Results from the radv fossil_db with some apps not compilable by turnip
removed:

Totals:
MaxWaves: 1637288 -> 1668200 (+1.89%); split: +1.89%, -0.00%
Instrs: 54620287 -> 54114442 (-0.93%); split: -0.98%, +0.05%
CodeSize: 92235646 -> 91277584 (-1.04%); split: -1.07%, +0.03%
NOPs: 11176775 -> 11185206 (+0.08%); split: -0.63%, +0.71%
Full: 1689271 -> 1657175 (-1.90%); split: -1.92%, +0.02%
(ss): 1318763 -> 1317757 (-0.08%); split: -1.40%, +1.32%
(sy): 618795 -> 617724 (-0.17%); split: -0.70%, +0.53%
(ss)-stall: 3496370 -> 3470116 (-0.75%); split: -1.37%, +0.62%
(sy)-stall: 23512954 -> 23511164 (-0.01%); split: -1.04%, +1.03%
STPs: 27557 -> 27461 (-0.35%)
LDPs: 22948 -> 22804 (-0.63%)
Cat0: 11823765 -> 11829681 (+0.05%); split: -0.62%, +0.67%
Cat1: 3120042 -> 2991831 (-4.11%); split: -4.43%, +0.32%
Cat2: 28605309 -> 28324829 (-0.98%); split: -0.98%, +0.00%
Cat3: 7334628 -> 7252342 (-1.12%); split: -1.12%, +0.00%
Cat4: 1216514 -> 1204894 (-0.96%)
Cat5: 863976 -> 861926 (-0.24%)
Cat6: 1648571 -> 1641457 (-0.43%)

Totals from 23575 (16.16% of 145856) affected shaders:
MaxWaves: 258806 -> 289718 (+11.94%); split: +11.94%, -0.00%
Instrs: 7571190 -> 7065345 (-6.68%); split: -7.04%, +0.36%
CodeSize: 13864308 -> 12906246 (-6.91%); split: -7.09%, +0.18%
NOPs: 959185 -> 967616 (+0.88%); split: -7.35%, +8.23%
Full: 313335 -> 281239 (-10.24%); split: -10.36%, +0.11%
(ss): 154628 -> 153622 (-0.65%); split: -11.90%, +11.25%
(sy): 69758 -> 68687 (-1.54%); split: -6.21%, +4.67%
(ss)-stall: 322002 -> 295748 (-8.15%); split: -14.92%, +6.76%
(sy)-stall: 3270366 -> 3268576 (-0.05%); split: -7.45%, +7.40%

STPs: 3624 -> 3528 (-2.65%)
LDPs: 1074 -> 930 (-13.41%)
Cat0: 1022684 -> 1028600 (+0.58%); split: -7.13%, +7.71%
Cat1: 531102 -> 402891 (-24.14%); split: -26.04%, +1.90%
Cat2: 4090309 -> 3809829 (-6.86%); split: -6.86%, +0.00%
Cat3: 1449686 -> 1367400 (-5.68%); split: -5.69%, +0.01%
Cat4: 103543 -> 91923 (-11.22%)
Cat5: 57441 -> 55391 (-3.57%)
Cat6: 316096 -> 308982 (-2.25%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14767>

2 years agoglsl/st: move st_nir_opts() into gl compiler common code
Timothy Arceri [Tue, 4 Jan 2022 01:51:56 +0000 (12:51 +1100)]
glsl/st: move st_nir_opts() into gl compiler common code

This will allow us to use this in future NIR linker work. It also makes
more sense to move it here as the classic drivers are gone, tgsi is
going away and we are merging more of the st into the gl common code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14785>

2 years agoetnaviv: add two new HI related perfmon counter
Christian Gmeiner [Sun, 25 Oct 2020 21:40:41 +0000 (22:40 +0100)]
etnaviv: add two new HI related perfmon counter

These counter are available starting with kernel 5.10.

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

2 years agoetnaviv: use bytes for read TX data
Christian Gmeiner [Fri, 28 Jan 2022 20:14:53 +0000 (21:14 +0100)]
etnaviv: use bytes for read TX data

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

2 years agoetnaviv: add multiply_with_8 flag
Christian Gmeiner [Fri, 28 Jan 2022 19:49:56 +0000 (20:49 +0100)]
etnaviv: add multiply_with_8 flag

There are some HW counters that are exposing things in terms of 8bytes bundles.
From a user PoV those counters would be much more useful if we do the scaling
to single bytes internally.

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

2 years agodocs/anv: add descriptor memory layout
Lionel Landwerlin [Tue, 18 Jan 2022 16:25:09 +0000 (18:25 +0200)]
docs/anv: add descriptor memory layout

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14522>

2 years agodocs/anv: list environment variables
Lionel Landwerlin [Wed, 12 Jan 2022 21:39:58 +0000 (23:39 +0200)]
docs/anv: list environment variables

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14522>

2 years agodocs: start some documentation on Anv
Lionel Landwerlin [Wed, 12 Jan 2022 14:44:36 +0000 (16:44 +0200)]
docs: start some documentation on Anv

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14522>

2 years agozink: fix waiting on current batch id
Mike Blumenkrantz [Tue, 18 Jan 2022 22:40:56 +0000 (17:40 -0500)]
zink: fix waiting on current batch id

- the current batch id is always 0
- there is always a current batch
- a batch id can only be set at the time of submit

thus when passing 0 to wait on the current batch, the submit must complete
so that there is a batch id, and this must occur before the timeline wait
path or else the timeline wait does nothing

cc: mesa-stable

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

2 years agozink: print an error when the device is lost
Mike Blumenkrantz [Tue, 18 Jan 2022 22:40:36 +0000 (17:40 -0500)]
zink: print an error when the device is lost

how many hours were lost to this

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

2 years agozink: add vertex shader pipeline bit for generated barrier construction
Mike Blumenkrantz [Tue, 18 Jan 2022 16:17:12 +0000 (11:17 -0500)]
zink: add vertex shader pipeline bit for generated barrier construction

if the vertex buffer resource has writes, it needs this bit too

cc: mesa-stable

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

2 years agozink: clamp tbo creation to maxTexelBufferElements
Mike Blumenkrantz [Tue, 18 Jan 2022 18:06:55 +0000 (13:06 -0500)]
zink: clamp tbo creation to maxTexelBufferElements

for sparse buffers, the total buffer size will be huge, so this needs
to only be the limit that the driver can support to avoid crashing
or whatever

cc: mesa-stable

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

2 years agozink: ci updates
Mike Blumenkrantz [Wed, 26 Jan 2022 21:41:01 +0000 (16:41 -0500)]
zink: ci updates

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

2 years agozink: make pipe_buffer_write usage trigger compiler errors
Mike Blumenkrantz [Wed, 26 Jan 2022 20:00:19 +0000 (15:00 -0500)]
zink: make pipe_buffer_write usage trigger compiler errors

don't want to have to hunt this down ever again

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

2 years agozink: replace other pipe_buffer_write usage with pipe_buffer_write_nooverlap
Mike Blumenkrantz [Wed, 26 Jan 2022 19:58:19 +0000 (14:58 -0500)]
zink: replace other pipe_buffer_write usage with pipe_buffer_write_nooverlap

this is just to be consistent and avoid any pipe_buffer_write() usage
so that grep won't find it

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

2 years agozink: replace qbo pipe_buffer_write usage with tc_buffer_write
Mike Blumenkrantz [Wed, 26 Jan 2022 19:54:55 +0000 (14:54 -0500)]
zink: replace qbo pipe_buffer_write usage with tc_buffer_write

this fixes flakiness with qbo readback due to the buffer being internally
invalidated without tc being aware of it

fixes:
KHR-GL46.direct_state_access.queries_functional

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

2 years agoetnaviv: draw: only mark resources as read/written when the state changed
Lucas Stach [Sat, 29 Jan 2022 13:58:10 +0000 (14:58 +0100)]
etnaviv: draw: only mark resources as read/written when the state changed

If the relevant state for a resource has not been dirtied between the
last and the current draw, we don't need to mark the resource as read
or written, as they are guaranteed to be marked already by the last draw.
This saves quite a bit of hashset operations for the resource tracking
in draw heavy workloads.

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

2 years agomicrosoft/compiler: fix -Wbitwise-instead-of-logical warning
Thomas H.P. Andersen [Wed, 26 Jan 2022 20:31:53 +0000 (21:31 +0100)]
microsoft/compiler: fix -Wbitwise-instead-of-logical warning

Replace the bitwise operation with a more explicit do-while
loop. This fixes a warning with clang, and ensures that
nir_opt_dead_cf and nir_opt_dce are called in the right
order.

Suggested-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14742>

2 years agoetnaviv: fix FRONT_AND_BACK culling
Christian Gmeiner [Fri, 28 Jan 2022 16:56:52 +0000 (17:56 +0100)]
etnaviv: fix FRONT_AND_BACK culling

HW has no value to cull both faces (setting both CW/CCW bits results in
only CCW being culled). The blob just skips triangle draws when FRONT_AND_BACK
culling is enabled. Lets do the same in draw_vbo(..).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14779>

2 years agointel/compiler: Use Task/Mesh InlineData for the first few push constants
Marcin Ślusarz [Mon, 13 Dec 2021 13:11:27 +0000 (14:11 +0100)]
intel/compiler: Use Task/Mesh InlineData for the first few push constants

Replace load_mesh_global_arg_addr_intel with a more general intrinsic
load_mesh_inline_data_intel, since inline data now hold both
a pointer descriptor information and the first few push constants.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14788>

2 years agointel/compiler: handle gl_[Clip|Cull]Distance from mesh in fragment shaders
Marcin Ślusarz [Thu, 9 Dec 2021 15:50:18 +0000 (16:50 +0100)]
intel/compiler: handle gl_[Clip|Cull]Distance from mesh in fragment shaders

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14788>

2 years agointel/compiler: handle gl_[Clip|Cull]Distance in mesh shaders
Marcin Ślusarz [Thu, 9 Dec 2021 15:47:43 +0000 (16:47 +0100)]
intel/compiler: handle gl_[Clip|Cull]Distance in mesh shaders

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14788>

2 years agointel/compiler: Merge Per-Primitive attribute handling in Mesh case
Caio Oliveira [Thu, 27 Jan 2022 08:50:52 +0000 (00:50 -0800)]
intel/compiler: Merge Per-Primitive attribute handling in Mesh case

Just a refactor, no behavior change.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14788>

2 years agointel/compiler: Have specific mesh handling in calculate_urb_setup()
Caio Oliveira [Thu, 27 Jan 2022 08:48:19 +0000 (00:48 -0800)]
intel/compiler: Have specific mesh handling in calculate_urb_setup()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14788>

2 years agoiris: sprinkle some assertions for bufmgr->lock
Paulo Zanoni [Wed, 17 Nov 2021 01:47:56 +0000 (17:47 -0800)]
iris: sprinkle some assertions for bufmgr->lock

Assert the lock is held when we need it to be held. Also hold the lock
during bufmgr destruction to keep the asserts happy.

Now the only place where we're not holding the lock while manipulating
bufmgr data structures is iris_bufmgr_create(), but this shouldn't
trigger any of the new assertions.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13486>

2 years agoiris: improve error checking in functions that call vma_alloc()
Paulo Zanoni [Mon, 11 Oct 2021 21:54:56 +0000 (14:54 -0700)]
iris: improve error checking in functions that call vma_alloc()

On these functions, for vm_bind I want to add another function call
that can fail and needs to be handled. As a preparation for that, add
real error checks around vma_alloc() and try to fix some of the other
error-related issues in these functions. This way, it will be much
simpler to just drop the new vm_bind-related function calls and error
handling code.

My fear is that having vma-related errors (and in the future
vm_bind-related errors) go unannounced may create some hard-to-debug
bugs.

v2: Unlock only after bo_free() (Marcin Ślusarz).
v3: Prefer goto over early returns (Marcin Ślusarz).

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13486>

2 years agointel: Only reserve space for Compute Engine out of URB in Gfx12LP
Caio Oliveira [Thu, 27 Jan 2022 15:50:50 +0000 (07:50 -0800)]
intel: Only reserve space for Compute Engine out of URB in Gfx12LP

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14756>

2 years agovenus: updates to the doc
Chia-I Wu [Fri, 28 Jan 2022 16:57:37 +0000 (08:57 -0800)]
venus: updates to the doc

VIRTGPU_PARAM_CONTEXT_INIT has been upstreamed.  Misc updates to reflect
the current status.

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

2 years agovenus: make vn_QueueSubmit async for native submissions
Yiwei Zhang [Fri, 21 Jan 2022 23:36:33 +0000 (23:36 +0000)]
venus: make vn_QueueSubmit async for native submissions

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

2 years agoRevert "venus: remove vn_ring_wait_all"
Yiwei Zhang [Sat, 22 Jan 2022 00:20:08 +0000 (00:20 +0000)]
Revert "venus: remove vn_ring_wait_all"

This reverts commit 7253e61d9d1a82f1fa0eac087a80c4a0957e1d14.

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

2 years agovenus: track whether a fence is external
Yiwei Zhang [Fri, 21 Jan 2022 21:53:16 +0000 (21:53 +0000)]
venus: track whether a fence is external

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

2 years agovenus: update some obsolete assumptions described
Yiwei Zhang [Fri, 21 Jan 2022 20:07:50 +0000 (20:07 +0000)]
venus: update some obsolete assumptions described

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

2 years agoetnaviv: make use of nir_lower_tex_shadow
Christian Gmeiner [Thu, 23 Dec 2021 13:07:32 +0000 (14:07 +0100)]
etnaviv: make use of nir_lower_tex_shadow

Also force the texture filter to nearest when the lowering
is used.

This enables the GL_ARB_shadow extension for all GPU models.

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

2 years agonir/nir_lower_tex_shadow: support tex_instr without deref src
Christian Gmeiner [Thu, 23 Dec 2021 13:41:39 +0000 (14:41 +0100)]
nir/nir_lower_tex_shadow: support tex_instr without deref src

Use texture_index if there is no deref src.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14308>

2 years agonir: make lower_sample_tex_compare a common pass
Christian Gmeiner [Thu, 23 Dec 2021 12:25:53 +0000 (13:25 +0100)]
nir: make lower_sample_tex_compare a common pass

This pass was originally written for d3d12, but is useful for hardware
that lacks sample compare support like some etnaviv GPU models.

Also rename the lowering pass and some surrounding code to
nir_lower_tex_shadow as suggested by Emma.

I'd like to use the pass that's already in tree.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14308>

2 years agodocs/panfrost: Add new Midgard/Bifrost chips
Alyssa Rosenzweig [Wed, 26 Jan 2022 01:23:46 +0000 (20:23 -0500)]
docs/panfrost: Add new Midgard/Bifrost chips

These should be fine. It's only the early chips that are too broken to see the
light of day.

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

2 years agopanfrost: Add Mali-G51 support
Alyssa Rosenzweig [Wed, 26 Jan 2022 01:06:55 +0000 (20:06 -0500)]
panfrost: Add Mali-G51 support

Just to prove it can be done in one line now :-)

Thanks to Robin Murphy for breaking out the ol' FPGA.

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

2 years agopan/bi: Assume future Valhall is 16-wide warps
Alyssa Rosenzweig [Wed, 26 Jan 2022 01:04:40 +0000 (20:04 -0500)]
pan/bi: Assume future Valhall is 16-wide warps

This is true for v10 at least, per the public data sheet. It seems like a
reasonable default going forward to eliminate a special case.

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

2 years agopan/bi: Clean up quirks
Alyssa Rosenzweig [Wed, 26 Jan 2022 00:56:42 +0000 (19:56 -0500)]
pan/bi: Clean up quirks

NO_PRELOAD isn't actually used. The other quirks are used, but they're
implementation details only affecting a few older models. So we can default to
no quirks and clean up a lot.

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

2 years agopanfrost: Get performance counters from table
Alyssa Rosenzweig [Fri, 28 Jan 2022 16:21:00 +0000 (11:21 -0500)]
panfrost: Get performance counters from table

Avoids yet another open-coded list of GPU IDs.

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

2 years agopanfrost: Make the GPU allowlist implicit
Alyssa Rosenzweig [Wed, 26 Jan 2022 00:20:58 +0000 (19:20 -0500)]
panfrost: Make the GPU allowlist implicit

Allowlist a GPU if and only if it has a model definition in-tree. This replaces
the explicit allowlist, which is somewhat cumbersome to maintain.

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

2 years agopanfrost: Replace panfrost_model_name with model->name
Alyssa Rosenzweig [Wed, 26 Jan 2022 00:19:11 +0000 (19:19 -0500)]
panfrost: Replace panfrost_model_name with model->name

One less place to update GPU IDs.

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

2 years agopanfrost: Centralize our model list
Alyssa Rosenzweig [Wed, 26 Jan 2022 00:15:26 +0000 (19:15 -0500)]
panfrost: Centralize our model list

Replaces panfrost-quirks.h

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

2 years agopanfrost: Don't pass quirks to pan_lower_framebuffer
Alyssa Rosenzweig [Wed, 26 Jan 2022 00:14:17 +0000 (19:14 -0500)]
panfrost: Don't pass quirks to pan_lower_framebuffer

There is a single quirk it cares about. Pass just that, so the relevant quirk
can be made a Midgard compiler quirk and not a global Panfrost quirk.

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

2 years agopanfrost: Fix v9 "Stencil from shader" bit
Alyssa Rosenzweig [Tue, 21 Dec 2021 21:40:52 +0000 (16:40 -0500)]
panfrost: Fix v9 "Stencil from shader" bit

Typo.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 96acad5cd59 ("panfrost: Add XML for Valhall data structures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14776>

2 years agopanfrost: Make primary_shader boolean
Alyssa Rosenzweig [Tue, 21 Dec 2021 17:36:17 +0000 (12:36 -0500)]
panfrost: Make primary_shader boolean

Fixes: 96acad5cd59 ("panfrost: Add XML for Valhall data structures")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14776>

2 years agoisaspec: Add support for special {:align=} field
Christian Gmeiner [Sun, 23 Jan 2022 14:48:27 +0000 (15:48 +0100)]
isaspec: Add support for special {:align=} field

Make it possible to just do alignment handling without an
actual field to print.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14668>

2 years agozink: fix vertex buffer mask computation for null buffers
Mike Blumenkrantz [Tue, 25 Jan 2022 20:20:50 +0000 (15:20 -0500)]
zink: fix vertex buffer mask computation for null buffers

off by N

affects:
KHR-GL46.texture_cube_map_array.sampling

Fixes: 53aade0ef0d ("zink: fix enabled vertex buffer mask calculation")

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

2 years agoaux/tc: add tc_buffer_write to replace pipe_buffer_write usage
Mike Blumenkrantz [Wed, 26 Jan 2022 19:53:44 +0000 (14:53 -0500)]
aux/tc: add tc_buffer_write to replace pipe_buffer_write usage

tc_buffer_write is the tc-safe version of this function which will
avoid accidental invalidations that break behavior

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

2 years agozink: remove tmp buffer rebinds
Mike Blumenkrantz [Fri, 21 Jan 2022 15:35:38 +0000 (10:35 -0500)]
zink: remove tmp buffer rebinds

this is no longer used/necessary

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

2 years agozink: simplify buffer case for zink_resource_object_init_storage()
Mike Blumenkrantz [Fri, 21 Jan 2022 15:32:51 +0000 (10:32 -0500)]
zink: simplify buffer case for zink_resource_object_init_storage()

this is a no-op, but leave the case to simplify the caller

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

2 years agozink: flag all buffer resources with PIPE_BIND_SHADER_IMAGE
Mike Blumenkrantz [Fri, 21 Jan 2022 15:25:33 +0000 (10:25 -0500)]
zink: flag all buffer resources with PIPE_BIND_SHADER_IMAGE

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

2 years agozink: use the storage buffer for bufferview creation when format allows
Mike Blumenkrantz [Fri, 21 Jan 2022 16:15:41 +0000 (11:15 -0500)]
zink: use the storage buffer for bufferview creation when format allows

this avoids issues where a buffer created for storage can't be used
for texturing due to having the storage bit

fixes (anv):
KHR-GL46.texture_buffer.texture_buffer_texture_buffer_range crash -> fail

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