platform/upstream/mesa.git
20 months agotu: Implement extendedDynamicState3TessellationDomainOrigin
Connor Abbott [Thu, 29 Sep 2022 12:04:54 +0000 (14:04 +0200)]
tu: Implement extendedDynamicState3TessellationDomainOrigin

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

20 months agotu: Implement extendedDynamicState3PolygonMode
Connor Abbott [Thu, 29 Sep 2022 11:43:46 +0000 (13:43 +0200)]
tu: Implement extendedDynamicState3PolygonMode

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

20 months agotu: Combine GRAS_SU_CNTL drawstate with rast draw state
Connor Abbott [Wed, 28 Sep 2022 16:12:17 +0000 (18:12 +0200)]
tu: Combine GRAS_SU_CNTL drawstate with rast draw state

Emit GRAS_SU_CNTL, GRAS_CL_CNTL, the polygon mode, and the VRS registers
in one draw state. We're running out of draw states, and this saves a
draw state while preparing us for the rest of the rasterization state to
be dynamic.

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

20 months agotu: VK_EXT_extended_dynamic_state3 boilerplate
Connor Abbott [Thu, 29 Sep 2022 10:51:40 +0000 (12:51 +0200)]
tu: VK_EXT_extended_dynamic_state3 boilerplate

Enable the extension but don't enable anything yet.

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

20 months agotu: tu: Clear patchControlPoints dirty state with static patchControlPoints
Connor Abbott [Mon, 10 Oct 2022 20:19:39 +0000 (22:19 +0200)]
tu: tu: Clear patchControlPoints dirty state with static patchControlPoints

Noticed by inspection after the previous issue.

Fixes: 68f3c38c801 ("tu: Implement extendedDynamicState2PatchControlPoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>

20 months agotu: Ignore line stipple dynamic state
Connor Abbott [Fri, 21 Oct 2022 11:59:20 +0000 (13:59 +0200)]
tu: Ignore line stipple dynamic state

At least in the current Vulkan spec there is no validation language
saying that it isn't valid to set this state if stippled lines aren't
supported, so it seems we have to just ignore it. Ignore it if the user
specifies a dynamic line stipple state and don't emit warnings if they
call CmdSetLineStippleEXT because zink will do this.

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

20 months agotu: Clear viewport dirty state with static viewports
Connor Abbott [Mon, 10 Oct 2022 20:05:00 +0000 (22:05 +0200)]
tu: Clear viewport dirty state with static viewports

Vulkan allows the user to set extraneous dynamic state which then gets
ignored if a pipeline with static state is bound. We weren't
implementing this correctly for viewports because we weren't clearing
the dirty bit, but it was happening to work until changes for dynamic
depth negative-one-to-one broke
dEQP-VK.pipeline.*.depth.depth_clip_control.d32_sfloat_less_viewport_before_static.

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

20 months agoradv/rra: Print invalid node types
Konstantin Seurer [Tue, 1 Nov 2022 19:31:22 +0000 (20:31 +0100)]
radv/rra: Print invalid node types

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19465>

20 months agointel: Add and use intel_gem_get_context_param()
José Roberto de Souza [Wed, 5 Oct 2022 16:41:10 +0000 (09:41 -0700)]
intel: Add and use intel_gem_get_context_param()

Again sharing the same function across all Intel drivers.

There is still two additional DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM
calls, one in intel/dev and other in perf.
The first one can't call intel_gem_get_context_param() because of the
build order of libs and the second one because it sets the size
parameter.

Will revisit those calls in future but this is already an improvement.

v2:
- using intel_gem_get_context_param() for the recently added query for
I915_CONTEXT_PARAM_PROTECTED_CONTENT

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agointel: Add and use intel_gem_set_context_param()
José Roberto de Souza [Wed, 5 Oct 2022 16:10:24 +0000 (09:10 -0700)]
intel: Add and use intel_gem_set_context_param()

Again sharing the same function across all Intel drivers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agointel: Add and use intel_gem_destroy_context()
José Roberto de Souza [Wed, 5 Oct 2022 15:49:26 +0000 (08:49 -0700)]
intel: Add and use intel_gem_destroy_context()

Again sharing the same function across all Intel drivers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agointel: Add and use intel_gem_create_context()
José Roberto de Souza [Wed, 5 Oct 2022 15:20:47 +0000 (08:20 -0700)]
intel: Add and use intel_gem_create_context()

Add intel_gem_create_context() to common/intel_gem.c/h and use it
on Iris, Crocus, ANV and HASVK.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agointel: Refactor intel_gem_create_context_engines()
José Roberto de Souza [Wed, 5 Oct 2022 15:20:07 +0000 (08:20 -0700)]
intel: Refactor intel_gem_create_context_engines()

This function was returning a int but there was no meaninfull errno
code being returned, also context_id is a uint32_t what would be
problematic if i915 even returned 2147483648(-1).

So here changing the return type and add context_id pointer parameter.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agoiris: Do not set I915_CONTEXT_PARAM_RECOVERABLE twice
José Roberto de Souza [Thu, 27 Oct 2022 16:57:30 +0000 (09:57 -0700)]
iris: Do not set I915_CONTEXT_PARAM_RECOVERABLE twice

For the protected context path, it was already set.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agointel/common: Add and use intel_gem_create_context_ext()
José Roberto de Souza [Thu, 27 Oct 2022 16:55:39 +0000 (09:55 -0700)]
intel/common: Add and use intel_gem_create_context_ext()

v2:
- added flag mask bit to enable context protected and recoverable
v3:
- added enum intel_gem_create_context_flags

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18974>

20 months agoetnaviv: warn when imported TS buffer is the same as color buffer
Lucas Stach [Tue, 25 Oct 2022 16:38:12 +0000 (18:38 +0200)]
etnaviv: warn when imported TS buffer is the same as color buffer

Color and TS buffers are allocated separately for each etnaviv resource, so
getting the same base and TS buffer at import time is unexpected and a strong
hint at the application doing something wrong, like passing in the same GEM
handle for all planes on a GBM import. Print a warning to give the user some
feedback.

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

20 months agoetnaviv: add support for sharing the TS buffer
Lucas Stach [Wed, 28 Oct 2020 19:13:45 +0000 (20:13 +0100)]
etnaviv: add support for sharing the TS buffer

This adds support for sharing the TS buffer, which up until now has been
an internal implementation detail, with the outside world. This mainly
improves performance with a GPU compositor present, but on i.MX8M also
direct to display use-cases benefit.

The impact of this change depends on the GPU generation:
- old GPUs with a single pipe won't see any difference
- GC2000 can skip the TS resolve in the client and will benefit from a
  more efficient blit into the sampler compatible format when the client
  buffer contains cleared tiles
- GC3000 can directly sample with TS support, so saves both write and read
  memory bandwidth when the client buffer contains cleared tiles
- GC7000 with compression support can keep the client buffer in compressed
  format, thus saving both read and write bandwidth even for fully filled
  client buffers
- GC7000 coupled to a display unit supporting the compression format (DCSS
  on i.MX8M) does not even need to uncompress the render buffer for display
  so will see significant bandwidth saving even when GPU compositing is
  bypassed

There is a slight complication in that the tile clear color isn't part of
the TS buffer, but is programmed into state registers in the GPU. To handle
this externally shared TS buffers now contain a software metadata area,
where the clear color is stored by the driver, so the receiving end of the
TS buffer can retrieve the clear color from this area.

The compression format is handled in the same way by storing it in the SW
meta area. While we can derive the compression format from the color buffer
format in most cases, some users, like weston, expect that they can "upgrade"
ARGB to XRGB color formats. While this works with plain color formats, as
it's just masking a channel, the compression format differs when alpha is in
use. Receivers of the TS buffer should thus not try to infer the compression
format from the color buffer format, but instead fetch it from the SW meta.

The import/export handling of the TS buffer is modelled after the Intel iris
driver: we add a separate plane for the TS buffer and fold it into the base
resource after the import.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

20 months agoetnaviv: canonicalize modifier on import
Lucas Stach [Fri, 14 Oct 2022 14:16:49 +0000 (16:16 +0200)]
etnaviv: canonicalize modifier on import

Unknown modifiers are currently squashed down to linear when transforming
the modifier into our interal layout representation. However, the only real
modifier that we expect to see, which isn't Vivante specific or LINEAR, is
the INVALID modifier. Treat this modifier as linear and reject any other
unexpected modifiers.

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

20 months agodrm-uapi: bump headers
Lucas Stach [Tue, 23 Mar 2021 10:41:55 +0000 (11:41 +0100)]
drm-uapi: bump headers

From drm-next at the following commit:

    commit 7f7a942c0a338c4a2a7b359bdb2b68e9896122ec
    Merge: 0a20a3ea4259 ddcb8fa6514f
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Thu Oct 27 14:44:02 2022 +1000

        Merge tag 'drm-next-20221025' of git://linuxtv.org/pinchartl/media into drm-next

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

20 months agoetnaviv: allocate TS memory from KMS when resource bind is SCANOUT
Lucas Stach [Wed, 13 Jul 2022 18:48:33 +0000 (20:48 +0200)]
etnaviv: allocate TS memory from KMS when resource bind is SCANOUT

Some display engines are able to resolve fast clear and/or compression
on the fly and need access to the TS buffer to do so. As they might
have restrictions on which memory they can access, allocate the TS
buffer memory from the KMS side when the resource should be SCANOUT
capable.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

20 months agoetnaviv: rework modifier queries
Lucas Stach [Wed, 13 Jul 2022 18:14:57 +0000 (20:14 +0200)]
etnaviv: rework modifier queries

Rework the loops in the modifier queries to make them a bit more
straight-forward and use less local variables. Those loops get
much more complex as more variations of the modifiers get added,
so the simplification done here is an attempt to keep the complexity
at bay.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

20 months agoetnaviv: correct comment about tile status size
Lucas Stach [Sat, 13 Aug 2022 13:59:22 +0000 (15:59 +0200)]
etnaviv: correct comment about tile status size

The earlier understanding of how tile status tracks the color/depth
surface was wrong and the TS size calculations have long been fixed,
as we now know that color/depth tiles have a fixed size in bytes and
thus don't depend on the surface format. But nobody changed the comment
explaining how TS works, so it's still around as a trap for the reader.

Reword the comment to not confuse people that aren't intimately
familiar with the inner workings of tile status.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

20 months agodocs: make the "amber" branch's name explicit
Eric Engestrom [Thu, 3 Nov 2022 16:49:53 +0000 (16:49 +0000)]
docs: make the "amber" branch's name explicit

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

20 months agomesa: Add test to prevent windows.h to be included in shared headers
Yonggang Luo [Wed, 2 Nov 2022 20:53:07 +0000 (04:53 +0800)]
mesa: Add test to prevent windows.h to be included in shared headers

This test is hand crafted by running command
find | grep .*h$ >../headers.txt
under src directory, and using find replace to creating
the file list and then removed the files should not be directly included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomesa: #include "util/glheader.h" instead GL/gl.h in shared code
Yonggang Luo [Wed, 2 Nov 2022 19:11:38 +0000 (03:11 +0800)]
mesa: #include "util/glheader.h" instead GL/gl.h in shared code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomapi: #include "util/glheader.h" instead of #include "GL/gl.h"
Yonggang Luo [Wed, 2 Nov 2022 19:09:12 +0000 (03:09 +0800)]
mapi: #include "util/glheader.h" instead of #include "GL/gl.h"

Also add macro to guard windows.h won't be included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agoglapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly
Yonggang Luo [Wed, 2 Nov 2022 16:16:36 +0000 (00:16 +0800)]
glapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly

So that we do not need define GLAPIENTRY repeatedly, always using the
GLAPIENTRY macro comes from GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h
Yonggang Luo [Wed, 2 Nov 2022 14:43:19 +0000 (22:43 +0800)]
mesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h

So it's can be accessed in broader places

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomesa: sync GLAPIENTRY with KHRONOS_APIENTRY in GL/gl.h
Yonggang Luo [Wed, 2 Nov 2022 16:04:55 +0000 (00:04 +0800)]
mesa: sync GLAPIENTRY with KHRONOS_APIENTRY in GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomesa: BUILD_GL32 is not used anymore
Yonggang Luo [Wed, 2 Nov 2022 16:04:08 +0000 (00:04 +0800)]
mesa: BUILD_GL32 is not used anymore

Remove usage of BUILD_GL32 in GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agomesa: Remove out-dated comment in common_x86.c
Yonggang Luo [Thu, 3 Nov 2022 14:44:44 +0000 (22:44 +0800)]
mesa: Remove out-dated comment in common_x86.c

Follow up: 8e3696137f2 ("remove final imports.h and imports.c bits")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agoutil: Prevent glheader.h from including <windows.h> by defining APIENTRY
Yonggang Luo [Wed, 2 Nov 2022 16:00:55 +0000 (00:00 +0800)]
util: Prevent glheader.h from including <windows.h> by defining APIENTRY

When APIENTRY is not defined, GL/gl.h and GL/glext.h will automatically
include <windows.h>, so we save the macro APIENTRY by push_macro and then
define APIENTRY before include of GL/gl.h and GL/glext.h.
After that we use pop_macro to recover the previous macro again.

Because windows.h is not included by glheader.h, mesa/main/errors.c needs
to include <windows.h> directly to prevent the following error:
errors.c:98:10: error: implicit declaration of function 'OutputDebugStringA' [-Werror=implicit-function-declaration]
   98 |          OutputDebugStringA(buf);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agoglapi: Remove duplicated #include "main/glheader.h"
Yonggang Luo [Wed, 2 Nov 2022 14:56:32 +0000 (22:56 +0800)]
glapi: Remove duplicated #include "main/glheader.h"

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agodocs: XFree86 source files in libGL.txt are out date, remove it
Yonggang Luo [Wed, 2 Nov 2022 14:37:57 +0000 (22:37 +0800)]
docs: XFree86 source files in libGL.txt are out date, remove it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

20 months agopvr: Fix NULL pointer indirection in pvr_enable_z_replicate()
Sarah Walker [Wed, 2 Nov 2022 14:24:55 +0000 (14:24 +0000)]
pvr: Fix NULL pointer indirection in pvr_enable_z_replicate()

Check input_subpass->depth_stencil_attachment is non-NULL before indirecting
it.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19475>

20 months agomesa: Use DEBUG_NAMED_VALUE_END for const struct debug_named_value
Yonggang Luo [Tue, 1 Nov 2022 20:19:03 +0000 (04:19 +0800)]
mesa: Use DEBUG_NAMED_VALUE_END for const struct debug_named_value

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19448>

20 months agodocs: Fix features.txt typo
Rob Clark [Thu, 3 Nov 2022 13:52:43 +0000 (06:52 -0700)]
docs: Fix features.txt typo

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

20 months agov3dv: fix event synchronization
Iago Toral Quiroga [Thu, 3 Nov 2022 08:15:20 +0000 (09:15 +0100)]
v3dv: fix event synchronization

Since we now implement events in the GPU we need to be more careful
and insert barriers to honor the dependencies provided by the API
as well as ensuring we are synchronizing these with the compute
queue, since that is how we implement GPU event functionality.

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>

20 months agov3dv: make the helper to emit pipeline barriers public to other files
Iago Toral Quiroga [Thu, 3 Nov 2022 08:14:51 +0000 (09:14 +0100)]
v3dv: make the helper to emit pipeline barriers public to other files

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>

20 months agov3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses
Iago Toral Quiroga [Wed, 2 Nov 2022 13:20:29 +0000 (14:20 +0100)]
v3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses

Fixes: a981ac053964 ('v3dv: skip binning sync if binning shaders don't access external resources')

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

20 months agov3dv: increase limit for active event objects
Iago Toral Quiroga [Wed, 2 Nov 2022 09:53:59 +0000 (10:53 +0100)]
v3dv: increase limit for active event objects

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Fixes: dEQP-VK.api.command_buffers.execute_large_primary

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

20 months agov3dv: do better cleanup on failure during pipeline cache operation
Iago Toral Quiroga [Thu, 3 Nov 2022 10:28:12 +0000 (11:28 +0100)]
v3dv: do better cleanup on failure during pipeline cache operation

Fixes (with disk cache enabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

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

20 months agov3dv: handle allocation failure during pipeline initialization
Iago Toral Quiroga [Wed, 2 Nov 2022 07:53:12 +0000 (08:53 +0100)]
v3dv: handle allocation failure during pipeline initialization

Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

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

20 months agov3dv: fix incorrect return type
Iago Toral Quiroga [Wed, 2 Nov 2022 07:51:23 +0000 (08:51 +0100)]
v3dv: fix incorrect return type

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

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

20 months agov3dv: do a better job at cleaning up the device on init failure
Iago Toral Quiroga [Wed, 2 Nov 2022 07:50:24 +0000 (08:50 +0100)]
v3dv: do a better job at cleaning up the device on init failure

These leaks on device creation failure have been there before, but
were only exposed as CTS failures after the recent event refactoring.

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

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

20 months agov3dv: avoid freeing already-freed memory
Eric Engestrom [Mon, 31 Oct 2022 18:38:25 +0000 (18:38 +0000)]
v3dv: avoid freeing already-freed memory

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>

20 months agov3dv: remove unnecessary check for NULL
Iago Toral Quiroga [Wed, 2 Nov 2022 07:49:37 +0000 (08:49 +0100)]
v3dv: remove unnecessary check for NULL

We are initializing the device, so we know this will be NULL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

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

20 months agovk/runtime: drop incorrect UNUSED annotation
Eric Engestrom [Mon, 31 Oct 2022 18:39:43 +0000 (18:39 +0000)]
vk/runtime: drop incorrect UNUSED annotation

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

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

20 months agoradv/ci: document a recent regression on VanGogh
Martin Roukala (né Peres) [Wed, 2 Nov 2022 15:04:25 +0000 (17:04 +0200)]
radv/ci: document a recent regression on VanGogh

It seems like !19442 may have been introducing a lot of flakes in the
dEQP-VK.query_pool.statistics_query.* tests.

Samuel is looking into it right now, but let's document the flakes in
the mean time so that we can get back to a green baseline.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>

20 months agoradv/ci: document a flake on VanGogh
Martin Roukala (né Peres) [Wed, 2 Nov 2022 15:03:03 +0000 (17:03 +0200)]
radv/ci: document a flake on VanGogh

Seen only once, so not really worth filing a bug for.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>

20 months agoradv/ci: document some VanGogh flakes that came from splitting the job
Martin Roukala (né Peres) [Wed, 2 Nov 2022 14:58:07 +0000 (16:58 +0200)]
radv/ci: document some VanGogh flakes that came from splitting the job

These tests are also flaky on NAVI21, which were also introduced when
the job was split in two.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19470>

20 months agoradv: fix fallback for extreme geometry with tessellation on GFX11
Samuel Pitoiset [Thu, 3 Nov 2022 08:53:40 +0000 (09:53 +0100)]
radv: fix fallback for extreme geometry with tessellation on GFX11

It would assert anyways. Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19495>

20 months agoanv: Reduce RHWO optimization (Wa_1508744258)
Lionel Landwerlin [Mon, 24 Oct 2022 18:29:04 +0000 (21:29 +0300)]
anv: Reduce RHWO optimization (Wa_1508744258)

Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces.

v2: Move stalling to genX(cmd_buffer_apply_pipe_flushes) for clarity (Mark)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19450>

20 months agoradv: Make the compute scratch waves per SE as well.
Bas Nieuwenhuizen [Sun, 30 Oct 2022 22:33:34 +0000 (23:33 +0100)]
radv: Make the compute scratch waves per SE as well.

Fixes: 278e533ec9c ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>

20 months agoradv: Fix compute scratch buffer emission.
Bas Nieuwenhuizen [Sun, 30 Oct 2022 22:29:53 +0000 (23:29 +0100)]
radv: Fix compute scratch buffer emission.

Copied wrong from radeonsi. The registers following the scratch
buffer address are the shader rsrc1/rsrc2. Not the user SGPR0
containing the ring resource word 1.

Fixes: 278e533ec9c ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>

20 months agoradv: Style cleanup.
Bas Nieuwenhuizen [Sun, 30 Oct 2022 22:29:31 +0000 (23:29 +0100)]
radv: Style cleanup.

Now have a local info ptr.

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

20 months agodocs/isl: remove empty headings
Erik Faye-Lund [Wed, 2 Nov 2022 13:00:31 +0000 (14:00 +0100)]
docs/isl: remove empty headings

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>

20 months agodocs/isl: put emphasis on unit names
Erik Faye-Lund [Tue, 25 Oct 2022 11:07:47 +0000 (13:07 +0200)]
docs/isl: put emphasis on unit names

This convinces the spell-checker that this is something meaniningful, it
seems...

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>

20 months agodocs/isl: correct rst-syntax
Erik Faye-Lund [Wed, 19 Oct 2022 11:32:41 +0000 (13:32 +0200)]
docs/isl: correct rst-syntax

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19461>

20 months agodocs/tgsi: quote literal numbers
Erik Faye-Lund [Wed, 2 Nov 2022 14:50:28 +0000 (15:50 +0100)]
docs/tgsi: quote literal numbers

This makes them stand out a bit, and render using a monospace font.

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

20 months agodocs/tgsi: mark pseudocode as such
Erik Faye-Lund [Wed, 19 Oct 2022 13:40:55 +0000 (15:40 +0200)]
docs/tgsi: mark pseudocode as such

This is more semantically strong.

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

20 months agodocs/tgsi: always use uppercase for instruction names
Erik Faye-Lund [Wed, 19 Oct 2022 13:38:32 +0000 (15:38 +0200)]
docs/tgsi: always use uppercase for instruction names

This reads a bit cleaner.

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

20 months agodocs/tgsi: use src1 instead of "second arg"
Erik Faye-Lund [Wed, 19 Oct 2022 13:32:55 +0000 (15:32 +0200)]
docs/tgsi: use src1 instead of "second arg"

This is more consistent with what we do elsewhere here.

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

20 months agodocs/tgsi: put emphasis on src etc
Erik Faye-Lund [Wed, 19 Oct 2022 13:25:33 +0000 (15:25 +0200)]
docs/tgsi: put emphasis on src etc

This makes them stand out a bit more.

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

20 months agodocs/gallium: use math-role for zero and one also
Erik Faye-Lund [Wed, 19 Oct 2022 12:20:04 +0000 (14:20 +0200)]
docs/gallium: use math-role for zero and one also

Without this, the zero and one renders with a different font than the
other equations. There's no good reason for this, so let's just use the
math-role for these too.

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

20 months agodocs/gallium: use table instead of list
Erik Faye-Lund [Wed, 19 Oct 2022 12:18:49 +0000 (14:18 +0200)]
docs/gallium: use table instead of list

This makes this a bit easer to read, as the equations line up properly.

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

20 months agodocs/gallium: use definition-lists for member-lists
Erik Faye-Lund [Wed, 19 Oct 2022 12:13:56 +0000 (14:13 +0200)]
docs/gallium: use definition-lists for member-lists

For some reason, we started with headings for some of these, and then
switched to definition lists midway though.

Let's stick with the definition lists, as that looks a bit more tidy.

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

20 months agoac/nir: create gs copy shader with scalar outputs
Qiang Yu [Wed, 2 Nov 2022 02:45:42 +0000 (10:45 +0800)]
ac/nir: create gs copy shader with scalar outputs

radeonsi assume IO has been scalarized, this simplify the code
and radeonsi implementation.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19455>

20 months agorusticl: remove Option from set_global_binding
Karol Herbst [Thu, 22 Sep 2022 11:14:42 +0000 (13:14 +0200)]
rusticl: remove Option from set_global_binding

We never bind NULL resources through set_global_binding and drivers depend
on this behaviour already.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agopanfrost: Don't merge workgroups with variable shared mem
Alyssa Rosenzweig [Mon, 19 Sep 2022 15:06:12 +0000 (11:06 -0400)]
panfrost: Don't merge workgroups with variable shared mem

If nir->info.shared_size = 0 but grid->variable_shared_mem > 0, the shader uses
shared memory but the compiler may not realize that. We need to disable
workgroup merging even in this case. The alternate approach is to statically
check for shared intrinsics in the compiler, but this is a bit easier all things
considered.

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

20 months agorusticl: create the constant buffer ahead of launches
Karol Herbst [Wed, 14 Sep 2022 23:53:26 +0000 (01:53 +0200)]
rusticl: create the constant buffer ahead of launches

v2: don't bind a const buffer if there is none

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agorusticl: create the CSO ahead of launches
Karol Herbst [Wed, 14 Sep 2022 23:30:32 +0000 (01:30 +0200)]
rusticl: create the CSO ahead of launches

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agorusticl: unbind compute state before deleting
Karol Herbst [Sat, 17 Sep 2022 15:54:55 +0000 (17:54 +0200)]
rusticl: unbind compute state before deleting

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agoiris: invalidate sysvals if grid dimension changes
Karol Herbst [Sat, 17 Sep 2022 17:59:56 +0000 (19:59 +0200)]
iris: invalidate sysvals if grid dimension changes

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agogallium: split up req_local_mem
Karol Herbst [Wed, 14 Sep 2022 18:37:55 +0000 (20:37 +0200)]
gallium: split up req_local_mem

This will be required if a frontend has to request additional shared mem
on top of the shader declared one, but wants to create the CSO before
knowing the total amount.

In OpenCL applications can bind additional shared mem through kernel
arguments and this happens quite late.

Note: Clover sets the req_local_mem incorrectly before so we can leave it
as broken.

v2: fix panfrost code (Alyssa)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agorusticl: use real constant buffer for cb0
Karol Herbst [Wed, 14 Sep 2022 15:53:18 +0000 (17:53 +0200)]
rusticl: use real constant buffer for cb0

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agorusticl/nir: add load_kernel_input lowering pass
Karol Herbst [Thu, 20 Oct 2022 00:54:55 +0000 (02:54 +0200)]
rusticl/nir: add load_kernel_input lowering pass

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agonir: set range and base for load_kernel_input
Karol Herbst [Thu, 20 Oct 2022 00:54:39 +0000 (02:54 +0200)]
nir: set range and base for load_kernel_input

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

20 months agogallium: drop pipe_compute_state.req_private_mem
Karol Herbst [Tue, 13 Sep 2022 16:58:07 +0000 (18:58 +0200)]
gallium: drop pipe_compute_state.req_private_mem

nothing used it and nothing will use it, so just drop it and clean up some
dead struct fields in drivers.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agogallium/tests: drop compute test
Karol Herbst [Sat, 1 Oct 2022 13:22:41 +0000 (15:22 +0200)]
gallium/tests: drop compute test

The TGSIs don't compile and are rather an annoyence when touching gallium
APIs.

Originally they were written with adding CL support to TGSI, but that
never panned out.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

20 months agonouveau/nvc0: Remove unused validate_zcull function
António Monteiro [Mon, 24 Oct 2022 11:25:34 +0000 (12:25 +0100)]
nouveau/nvc0: Remove unused validate_zcull function

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

20 months agonouveau/nv50: Remove unused alternative sample position ms8
António Monteiro [Mon, 24 Oct 2022 14:50:40 +0000 (15:50 +0100)]
nouveau/nv50: Remove unused alternative sample position ms8

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

20 months agonouveau/nvc0: Remove unused alternative sample position ms8
António Monteiro [Mon, 24 Oct 2022 14:50:00 +0000 (15:50 +0100)]
nouveau/nvc0: Remove unused alternative sample position ms8

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

20 months agoglx: Fixes apple/apple_visual.c that include non-exist util/debug.h
Yonggang Luo [Wed, 2 Nov 2022 21:19:29 +0000 (05:19 +0800)]
glx: Fixes apple/apple_visual.c that include non-exist util/debug.h

Fixes: aa4ac5ff8bb ("utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19486>

20 months agopanfrost: Replace resource shadowing flush
Alyssa Rosenzweig [Sat, 29 Oct 2022 18:42:36 +0000 (14:42 -0400)]
panfrost: Replace resource shadowing flush

The entire point of resource shadowing is to avoid unnecessary flushing.
Flushing readers after shadowing is counterproductive. A refresher on
how resource shadowing is supposed to work:

First, we determine if it's beneficial to shadow resources. If so, we
create a new backing buffer object. We flush the current writer of the
resource, if there is one, so the current contents become known to the
CPU. If we are not discarding the original resource, we then copy the
existing contents of the buffer to the new shadow buffer on the CPU.
Finally, we swap the resource's backing buffer for our shadow. Any batch
that reads the resource will continue to read the old copy of the
resource, and any future draw calls will see the new copy with the
change implemented.

Where did we go wrong?

In 988d5aae74d ("panfrost: Flush resources when shadowing"), we started
flushing all readers. We didn't actually need to flush, we just needed
to avoid dangling references on the batches reading the old copy of the
resource. But that's easily enough avoided: just remove the references.
The batches still hold a reference to the underlying BO, which will be
freed at the right time regardless.

Originally motivated by glmark2 -bbuffer:update-method=subdata, which
has some pathological access paterns.

Firefox is a lot faster anecdotally (now scrolling at 60fps in firefox).

But what actually motivated this is an apitrace from Duckstation's GLES
renderer. With this patch, the in-game portion is improved 3fps to 21fps.

Closes: #4028
Fixes: 988d5aae74d ("panfrost: Flush resources when shadowing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>

20 months agopanfrost: Don't copy resources if replaced
Alyssa Rosenzweig [Wed, 2 Nov 2022 17:43:11 +0000 (13:43 -0400)]
panfrost: Don't copy resources if replaced

If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

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

20 months agozink: add missing build_id linker args
Eric Engestrom [Wed, 2 Nov 2022 21:38:53 +0000 (21:38 +0000)]
zink: add missing build_id linker args

Fixes: 4e14da056d623ababf7c ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19485>

20 months agodocs: update calendar for 22.3.0-rc1
Eric Engestrom [Wed, 2 Nov 2022 21:18:02 +0000 (21:18 +0000)]
docs: update calendar for 22.3.0-rc1

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

20 months agointel/dev: Set has_lsc in XEHP_FEATURES rather than DG2_FEATURES
Jordan Justen [Tue, 24 May 2022 00:02:31 +0000 (17:02 -0700)]
intel/dev: Set has_lsc in XEHP_FEATURES rather than DG2_FEATURES

MTL will want this set as well.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19447>

20 months agodocs: reset new_features.txt
Eric Engestrom [Wed, 2 Nov 2022 19:19:44 +0000 (19:19 +0000)]
docs: reset new_features.txt

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
20 months agoVERSION: bump to 22.4
Eric Engestrom [Wed, 2 Nov 2022 19:19:35 +0000 (19:19 +0000)]
VERSION: bump to 22.4

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
20 months agoRevert "etnaviv: completely turn off MSAA"
Christian Gmeiner [Sat, 2 Jul 2022 11:59:18 +0000 (13:59 +0200)]
Revert "etnaviv: completely turn off MSAA"

This reverts commit 044b238507bb54ff8b6129c9754f1efc0f0834b9 and extends it with
 - putting the comments directly in front of the if's
 - do not support 2x MSAA on SMALL_MSAA hardware
 - checking if blt/rs supports the format

MSAA should work as expected now. Tested with kmscube and qt5.

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

20 months agoetnaviv: blt: Directly call etna_try_blt_blit(..)
Christian Gmeiner [Sat, 13 Aug 2022 18:03:23 +0000 (20:03 +0200)]
etnaviv: blt: Directly call etna_try_blt_blit(..)

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

20 months agoetnaviv: blt: Add color resolve support
Christian Gmeiner [Sat, 13 Aug 2022 17:55:03 +0000 (19:55 +0200)]
etnaviv: blt: Add color resolve support

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

20 months agoetnaviv: Update headers from rnndb
Christian Gmeiner [Fri, 7 Oct 2022 06:19:27 +0000 (08:19 +0200)]
etnaviv: Update headers from rnndb

Update to rnndb commit fff078b61ceb.

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

20 months agoetnaviv: rs: msaa: Set cache mode for SMALL_MSAA
Christian Gmeiner [Thu, 11 Aug 2022 14:27:30 +0000 (16:27 +0200)]
etnaviv: rs: msaa: Set cache mode for SMALL_MSAA

If the GPU supports SMALL_MSAA and does not support CACHE128B256BPERLINE we
need to set the cache mode to CACHE_MODE_256B.

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

20 months agoetnaviv: rs: Directly call etna_try_rs_blit(..)
Christian Gmeiner [Thu, 14 Jul 2022 19:45:44 +0000 (21:45 +0200)]
etnaviv: rs: Directly call etna_try_rs_blit(..)

Also remove some old comments.

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

20 months agoetnaviv: rs: Color resolve works
Christian Gmeiner [Sun, 17 Nov 2019 19:37:40 +0000 (20:37 +0100)]
etnaviv: rs: Color resolve works

No special treatment is needed and is helps MSAA.

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

20 months agoetnaviv: Create MSAA surfaces with PE compatible tiling
Gert Wollny [Sun, 3 Jul 2022 05:37:06 +0000 (07:37 +0200)]
etnaviv: Create MSAA surfaces with PE compatible tiling

MSAA surfaces are always used for rendering, and only as blit sources,
so the need to be allocated with PE compatible tiling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-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/19013>

20 months agoetnaviv: Remove possibility to force MSAA
Christian Gmeiner [Tue, 5 Jul 2022 12:12:57 +0000 (14:12 +0200)]
etnaviv: Remove possibility to force MSAA

st/mesa does not know anything about the forced MSAA and we end with
the following assert:
etna_try_rs_blit: Assertion `(blit_info->src.box.x + blit_info->src.box.width) * msaa_xscale <= src_lev->padded_width' failed

Let the application do its thing regarding MSAA and remove this 'debug'
feature.

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