platform/upstream/mesa.git
3 years agonir/lower_idiv: make lowered divisions exact
Rhys Perry [Wed, 7 Apr 2021 18:45:57 +0000 (19:45 +0100)]
nir/lower_idiv: make lowered divisions exact

I can't imagine any reasonable optimization which could break this, but
since it's lowered from an integer instructions, we shouldn't do anything
which could change the result.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081>

3 years agonir/lower_idiv: add options to use fp32 for 8-bit division lowering
Rhys Perry [Wed, 7 Apr 2021 18:17:46 +0000 (19:17 +0100)]
nir/lower_idiv: add options to use fp32 for 8-bit division lowering

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10081>

3 years agoradv: remove second nir_lower_idiv
Rhys Perry [Wed, 7 Apr 2021 18:58:19 +0000 (19:58 +0100)]
radv: remove second nir_lower_idiv

nir_lower_idiv now lowers 8/16-bit divisions.

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

3 years agopanfrost: Enable AFBC buffer sharing
Alyssa Rosenzweig [Fri, 9 Apr 2021 23:18:48 +0000 (19:18 -0400)]
panfrost: Enable AFBC buffer sharing

This was hidden originally to workaround a bug in the RK3399 display
driver. The patch resolving this issue has been merged in the upstream
kernel, and in fact...

1. The issue was visible on 21.0 even with this workaround under certain
   configurations (sway with an external monitor).
2. Even on buggy kernels, due to other platform details this is an
   obscure bug to hit (not aware of any ways to trigger it OOTB with
   current userspaces other than sway with an external monitor)

So why bother? Let's just delete the hack and let AFBC be used freely.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10148>

3 years agopanfrost: Fix AFBC body_size for shared resources
Alyssa Rosenzweig [Fri, 9 Apr 2021 23:14:14 +0000 (19:14 -0400)]
panfrost: Fix AFBC body_size for shared resources

Accidental read-before-write due to incorrect statement ordering. I love
SSA as much as anyone, but not everything is a parallel copy.

Fixes faults in glamor in 21.0 when using GIMP on v5.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: e8b997e1758 ("panfrost: Add AFBC slice.body_size and slice.{row,surface}_stride fields")
Closes: #4389
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10148>

3 years agozink: disable mutable formats for zs formats and scanout images
Mike Blumenkrantz [Fri, 9 Apr 2021 20:39:57 +0000 (16:39 -0400)]
zink: disable mutable formats for zs formats and scanout images

swapchain images are never going to be used as texture views, and zs formats
aren't compatible with any other formats

this enables implicit modifiers in some cases, and more work can be done in the future
to eliminate mutable format usage to further improve performance

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

3 years agozink: flag anv for mesa image create wsi
Mike Blumenkrantz [Fri, 9 Apr 2021 19:12:46 +0000 (15:12 -0400)]
zink: flag anv for mesa image create wsi

the image creation wsi is used, but the memory creation wsi isn't

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

3 years agozink: create separate linear tiling image for scanout
Mike Blumenkrantz [Fri, 9 Apr 2021 14:23:48 +0000 (10:23 -0400)]
zink: create separate linear tiling image for scanout

rendering onto a linear-tiled image is unbelievably slow if any sort of
blending is enabled, so instead always render to optimal tiling and then
copy to linear for scanout

this doubles performance for now and can be deleted in its entirety along
with the rest of the related hacks once real wsi support is implemented

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

3 years agobroadcom/compiler: use signed pointers for packed condition
Juan A. Suarez Romero [Fri, 9 Apr 2021 08:59:14 +0000 (10:59 +0200)]
broadcom/compiler: use signed pointers for packed condition

`qpu.raddr_b` is an unsigned int, so it is always positive, even after
casting to signed int.

Fixes CID#1438117 "Operands don't affect result
(CONSTANT_EXPRESSION_RESULT)":

   "result_independent_of_operands: (int)inst->qpu.raddr_b >= -16 is
    always true regardless of the values of its operands. This occurs as
    the logical first operand of "&&".

v2:
 - Use signed pointers (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10131>

3 years agoturnip: support copying both aspects of D32_SFLOAT_S8_UINT
Danylo Piliaiev [Fri, 9 Apr 2021 15:02:26 +0000 (18:02 +0300)]
turnip: support copying both aspects of D32_SFLOAT_S8_UINT

We cannot copy both aspects at the same time, so copy them one by one.

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

3 years agovtn: Add a cap for CL drivers to support read-write images
Jesse Natalie [Sun, 11 Apr 2021 21:09:58 +0000 (14:09 -0700)]
vtn: Add a cap for CL drivers to support read-write images

This is a required CL2.0, optional CL3.0 feature

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10181>

3 years agovtn: Don't warn about linkage capability if we're creating a NIR library
Jesse Natalie [Sun, 11 Apr 2021 21:09:09 +0000 (14:09 -0700)]
vtn: Don't warn about linkage capability if we're creating a NIR library

We've supported this for a while now for libclc

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10181>

3 years agozink: make a bunch of descriptor functions static
Mike Blumenkrantz [Thu, 31 Dec 2020 14:24:03 +0000 (09:24 -0500)]
zink: make a bunch of descriptor functions static

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

3 years agozink: move descriptor state management to descriptors.c
Mike Blumenkrantz [Thu, 31 Dec 2020 14:15:37 +0000 (09:15 -0500)]
zink: move descriptor state management to descriptors.c

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

3 years agoradeonsi/rgp: export compute shader programs
Pierre-Eric Pelloux-Prayer [Wed, 7 Apr 2021 13:28:46 +0000 (15:28 +0200)]
radeonsi/rgp: export compute shader programs

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

3 years agoradeonsi/rgp: export barriers
Pierre-Eric Pelloux-Prayer [Mon, 15 Mar 2021 11:49:49 +0000 (12:49 +0100)]
radeonsi/rgp: export barriers

Wrap the si_cp_wait_mem call to emit RGP_SQTT_MARKER_IDENTIFIER_BARRIER_START and
RGP_SQTT_MARKER_IDENTIFIER_BARRIER_END events.

Only for gfx9+ for now.

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

3 years agoRevert "ci: Disable panfrost t760"
Tomeu Vizoso [Mon, 12 Apr 2021 07:30:10 +0000 (09:30 +0200)]
Revert "ci: Disable panfrost t760"

The devices have been running KernelCI jobs for a good while without
glitches, let's reenable Mesa jobs on them now.

This reverts commit c6fbbbbf70be2d4d8c20999a65d6f8de993608eb.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10173>

3 years agoRevert "ci: Disable panfrost g52"
Tomeu Vizoso [Mon, 12 Apr 2021 07:30:08 +0000 (09:30 +0200)]
Revert "ci: Disable panfrost g52"

The devices have been running KernelCI jobs for a good while without
glitches, let's reenable Mesa jobs on them now.

This reverts commit 40647fcc3dbe582e91913271cebd6b2b7c5f8584.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10173>

3 years agoRevert "ci: Disable t720 LAVA jobs"
Tomeu Vizoso [Mon, 12 Apr 2021 07:29:26 +0000 (09:29 +0200)]
Revert "ci: Disable t720 LAVA jobs"

The maintenance window is closed.

This reverts commit 4fa9c359426254d01f2a6ee61d1868adb8d980fa.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10173>

3 years agoci: Disable t720 LAVA jobs
Tomeu Vizoso [Mon, 12 Apr 2021 07:09:02 +0000 (09:09 +0200)]
ci: Disable t720 LAVA jobs

As the devices providing the testing are going down due to a planned
maintenance window of 4 hours.

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

3 years agovbo: inline vbo_primitive_restart in brw_primitive_restart
Pierre-Eric Pelloux-Prayer [Tue, 6 Apr 2021 19:09:52 +0000 (21:09 +0200)]
vbo: inline vbo_primitive_restart in brw_primitive_restart

This is the only user of this code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10066>

3 years agost/draw: remove st_draw_vbo
Pierre-Eric Pelloux-Prayer [Tue, 6 Apr 2021 19:01:04 +0000 (21:01 +0200)]
st/draw: remove st_draw_vbo

Driver.Draw is now unused for Gallium drivers - except for st_cb_feedback which
sets its own Draw function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10066>

3 years agovulkan/util: Use util_bitcount
James Park [Sun, 11 Apr 2021 04:31:19 +0000 (21:31 -0700)]
vulkan/util: Use util_bitcount

__builtin_popcount is not available on all compilers.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10159>

3 years agost/mesa: adapt for the case where buffers are not supported in frag
Ilia Mirkin [Wed, 24 Feb 2021 23:39:25 +0000 (18:39 -0500)]
st/mesa: adapt for the case where buffers are not supported in frag

Some logic was tuned to buffers / atomics / images being supported in
frag stages in order to expose any support at all. Fix some of these
assumptions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10161>

3 years agonv50/ir: fix emission of ld/st lock/unlock
Ilia Mirkin [Mon, 1 Mar 2021 23:59:27 +0000 (18:59 -0500)]
nv50/ir: fix emission of ld/st lock/unlock

This is necessary to implement shared atomics.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: avoid inlining results of a locked load
Ilia Mirkin [Mon, 1 Mar 2021 23:57:56 +0000 (18:57 -0500)]
nv50/ir: avoid inlining results of a locked load

These are a bit special. Among other things, removing them will cause us
to potentially remove the load itself, defeating the purpose of the
locking. Also it's unclear whether it's legal to access the shared
memory directly when it's locked like this.

This only comes up on nv50, since on nvc0+, shared memory can't be
loaded from random ops.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: fix expression for ucp offset
Ilia Mirkin [Sat, 27 Feb 2021 01:45:21 +0000 (20:45 -0500)]
nv50: fix expression for ucp offset

It doesn't matter since it's 0, but all the offsets are in bytes whereas
the method expects words. So adjust by 2.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of cas without a destination
Ilia Mirkin [Sat, 27 Feb 2021 23:24:44 +0000 (18:24 -0500)]
nv50/ir: fix emission of cas without a destination

We were previously dumping $r127 in there. This has a bad effect on
nv50, so make sure we allocate an actual register for it, even if
there's nothing using the result.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of 16-bit add
Ilia Mirkin [Mon, 1 Mar 2021 01:08:25 +0000 (20:08 -0500)]
nv50/ir: fix emission of 16-bit add

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: add support for 16-bit immediates
Ilia Mirkin [Thu, 25 Feb 2021 03:21:24 +0000 (22:21 -0500)]
nv50/ir: add support for 16-bit immediates

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: logic ops on half-regs can't take an immediate
Ilia Mirkin [Thu, 25 Feb 2021 03:18:37 +0000 (22:18 -0500)]
nv50/ir: logic ops on half-regs can't take an immediate

There does not appear to be an instruction form for this. Prevent an
immediate from being loaded into place.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of shifts on half-regs
Ilia Mirkin [Thu, 25 Feb 2021 03:15:32 +0000 (22:15 -0500)]
nv50/ir: fix emission of shifts on half-regs

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of logic ops on half-regs
Ilia Mirkin [Thu, 25 Feb 2021 03:15:04 +0000 (22:15 -0500)]
nv50/ir: fix emission of logic ops on half-regs

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of cvt with half-reg destinations
Ilia Mirkin [Thu, 25 Feb 2021 03:14:16 +0000 (22:14 -0500)]
nv50/ir: fix emission of cvt with half-reg destinations

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emitting movs from imm to short registers
Ilia Mirkin [Wed, 24 Feb 2021 19:17:55 +0000 (14:17 -0500)]
nv50/ir: fix emitting movs from imm to short registers

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: lower buffer to global
Ilia Mirkin [Mon, 15 Feb 2021 17:24:54 +0000 (12:24 -0500)]
nv50/ir: lower buffer to global

The idea is that buffers will be bound to the appropriate indices. That
means that we can just rename them to global.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: fix emission of RED
Ilia Mirkin [Mon, 15 Feb 2021 17:22:02 +0000 (12:22 -0500)]
nv50/ir: fix emission of RED

When the atomic result is unused, the opcode form needs to be a bit
different.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: do not use inline offsets for global, ensure indirect access
Ilia Mirkin [Tue, 2 Mar 2021 00:51:14 +0000 (19:51 -0500)]
nv50/ir: do not use inline offsets for global, ensure indirect access

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: force shared memory indirect to be an address
Ilia Mirkin [Fri, 26 Feb 2021 04:08:00 +0000 (23:08 -0500)]
nv50/ir: force shared memory indirect to be an address

The upstream logic will not end up using an address, so we have to force
it here. The other backends don't care either.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50/ir: retrieve (n)ctaid.z from first user param
Ilia Mirkin [Thu, 25 Feb 2021 03:16:52 +0000 (22:16 -0500)]
nv50/ir: retrieve (n)ctaid.z from first user param

The driver is responsible for feeding this in.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: pass in third axis via user param
Ilia Mirkin [Thu, 25 Feb 2021 00:34:05 +0000 (19:34 -0500)]
nv50: pass in third axis via user param

This is probably not the most efficient way to go for all geometries,
but the assumption is that kernels tend to be x/y-heavy rather than
z-heavy. Iterates over each z slice and passes in the current value via
user param. (And bump all user params by a dword.)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: add texture, constbuf, image, buffer validation
Ilia Mirkin [Thu, 25 Feb 2021 02:04:25 +0000 (21:04 -0500)]
nv50: add texture, constbuf, image, buffer validation

This makes compute mostly work. For now we're laying out images/buffers
in a fixed offset from each other in the globals "array", but this
should be done dynamically. We're also missing passing image info to
shaders, as well as adding image formats to a shader key.

Heavily inspired by nvc0 variants of these.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: implement memory barrier handling
Ilia Mirkin [Thu, 25 Feb 2021 00:42:03 +0000 (19:42 -0500)]
nv50: implement memory barrier handling

With shader images / buffers, we can get more complex barrier requests.
This mirrors the logic in nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: add resource tracking for shader images and buffers
Ilia Mirkin [Thu, 25 Feb 2021 00:29:57 +0000 (19:29 -0500)]
nv50: add resource tracking for shader images and buffers

Heavily inpsired by the nvc0 code. Note that these only exist for the
compute stage, so there is no shared-based indexing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: adapt texture and constbuf paths for compute shaders
Ilia Mirkin [Thu, 25 Feb 2021 00:27:49 +0000 (19:27 -0500)]
nv50: adapt texture and constbuf paths for compute shaders

This contains the logic updates necessary to perform necessary resource
tracking and emit update / flush commands for the relevant stages.

Inspired by some changes from Pierre Moreau.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: Update texture indices to match stage indices
Pierre Moreau [Wed, 29 Jul 2020 08:18:59 +0000 (10:18 +0200)]
nv50: Update texture indices to match stage indices

For legacy reasons, we were using the PIPE order, instead of the
hardware order. Reorder the stages to match the order of the
BIND_TIC/etc methods, and adjust internal usage to match.

Signed-off-by: Pierre Moreau <dev@pmoreau.org>
[imirkin: fixed numbering, removed TODO comments]

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agonv50: Replace hardcoded texture/constbuf count with define
Pierre Moreau [Wed, 29 Jul 2020 07:33:38 +0000 (09:33 +0200)]
nv50: Replace hardcoded texture/constbuf count with define

Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>

3 years agolima: enable rg formats for fp16 render
Erico Nunes [Mon, 29 Mar 2021 23:04:56 +0000 (01:04 +0200)]
lima: enable rg formats for fp16 render

These were noticed by trial and error after fixing the fp16 render
setup.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9916>

3 years agolima: fix half float render
Erico Nunes [Mon, 29 Mar 2021 23:03:34 +0000 (01:03 +0200)]
lima: fix half float render

Format 0x26 is invalid, formats are in a 4 bit field so they repeat
in increments of 16.
Frame reg flags needs to set 0x01 to actually enable fp16.
The clear color setup is also a bit different for fp16, need to use
the 16 bit values in the first two clear color registers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9916>

3 years agopan/bi: Determine block successors correctly
Alyssa Rosenzweig [Fri, 9 Apr 2021 22:03:38 +0000 (18:03 -0400)]
pan/bi: Determine block successors correctly

Fixes GPU timeouts in Google Maps.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Icecream95 <ixn@disroot.org>
Tested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10145>

3 years agocompiler/glsl: fix include for Android build
Mauro Rossi [Sat, 10 Apr 2021 11:18:31 +0000 (13:18 +0200)]
compiler/glsl: fix include for Android build

Sources outside of src/util path should include "util/string_buffer.h"

Fixes the following building error in Android:

external/mesa/src/compiler/glsl/ast_type.cpp:25:10: fatal error: 'string_buffer.h' file not found
         ^~~~~~~~~~~~~~~~~
1 error generated.

Fixes: eeec9d56ad32 ("compiler/glsl: clean up output")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10156>

3 years agogallium/tools: update trace scripts to Python 3
Matti Hamalainen [Thu, 25 Mar 2021 12:36:54 +0000 (14:36 +0200)]
gallium/tools: update trace scripts to Python 3

Bring the scripts for parsing, dumping state and diffing of Gallium
trace files to modern day by updating them to Python 3.

Add option '-p' to some tools for outputting only plaintext
instead of ANSI / colorized format.

Also fix state parsing of some dumps by adding 'clear_render_target'
and 'get_disk_shader_cache' to ignored calls list.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4321
Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9830>

3 years agozink: fix typo in function name
Erik Faye-Lund [Sat, 10 Apr 2021 09:09:02 +0000 (11:09 +0200)]
zink: fix typo in function name

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

3 years agozink: document scalarBlockLayout requirement
Erik Faye-Lund [Fri, 9 Apr 2021 07:53:31 +0000 (09:53 +0200)]
zink: document scalarBlockLayout requirement

We're currently using uint arrays instead of uvec4 arrays for UBOs and
SSBOs, which requires scalarBlockLayout. Fixing this is a lot of work,
so let's just document it for now.

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

3 years agogallium/st: correct range for int16
Erik Faye-Lund [Fri, 9 Apr 2021 06:35:02 +0000 (08:35 +0200)]
gallium/st: correct range for int16

This fixes the following dEQP tests:

- dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uvec2_fragment
- dEQP-GLES3.functional.shaders.operator.unary_operator.minus.lowp_uvec4_fragment
- dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uvec2_fragment
- dEQP-GLES3.functional.shaders.operator.unary_operator.minus.mediump_uvec4_fragment

Fixes: 1af8fe4ed52 ("gallium: add shader caps INT16 and FP16_DERIVATIVES")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10128>

3 years agogallium/st: correct range for float16
Erik Faye-Lund [Fri, 9 Apr 2021 06:41:07 +0000 (08:41 +0200)]
gallium/st: correct range for float16

Fixes: b83f4b9fa23 ("glsl: Add an IR lowering pass to convert mediump operations to 16-bit")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10128>

3 years agoglsl: tolerate int16 loop counters
Erik Faye-Lund [Fri, 9 Apr 2021 05:25:03 +0000 (07:25 +0200)]
glsl: tolerate int16 loop counters

When lowering precision on integers from GLSL ES, we can end up with
16 bit integer loop counters. So let's tolerate this as well.

This was probably not caught earlier because most NIR drivers disable
GLSL-level loop-unrolling, and no non-NIR driver sets LowerPrecisionInt16
to true. This was discovered while trying to wire up int16 support for
Zink, which doesn't currently disable GLSL loop-unrolling.

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

3 years agoglsl: fix int16 type
Erik Faye-Lund [Fri, 9 Apr 2021 05:22:53 +0000 (07:22 +0200)]
glsl: fix int16 type

This shouldn't be unsigned, or else we'll trigger asserts.

Fixes: 7f00d4dac81 ("glsl: Handle 16-bit types in loop analysis")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>

3 years agoglsl: fix is_integer_16_32
Erik Faye-Lund [Fri, 9 Apr 2021 05:15:36 +0000 (07:15 +0200)]
glsl: fix is_integer_16_32

This shouldn't check for 64-bit...

Fixes: a052a9c2777 ("glsl: handle int16 and uint16 types and add instructions for mediump")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10125>

3 years agopanfrost: Only do point coord replacement for PIPE_PRIM_POINTS
Icecream95 [Sat, 10 Apr 2021 03:28:15 +0000 (15:28 +1200)]
panfrost: Only do point coord replacement for PIPE_PRIM_POINTS

Fixes rendering in Terraria on Midgard.

Thanks to macc24 for reporting this and to HdkR for pointing me to a
similar issue for virgl.

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10154>

3 years agoanv: Use vk_object_alloc/free
Jason Ekstrand [Thu, 8 Apr 2021 21:12:27 +0000 (16:12 -0500)]
anv: Use vk_object_alloc/free

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

3 years agovulkan: Add a vk_object_multialloc helper
Jason Ekstrand [Thu, 8 Apr 2021 21:46:04 +0000 (16:46 -0500)]
vulkan: Add a vk_object_multialloc helper

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

3 years agoanv: Clean up anv_semaphore::base on the error path
Jason Ekstrand [Thu, 8 Apr 2021 21:40:45 +0000 (16:40 -0500)]
anv: Clean up anv_semaphore::base on the error path

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Clean up anv_descriptor_pool::base on the error path
Jason Ekstrand [Thu, 8 Apr 2021 21:27:02 +0000 (16:27 -0500)]
anv: Clean up anv_descriptor_pool::base on the error path

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoanv: Refactor framebuffer creation
Jason Ekstrand [Thu, 8 Apr 2021 21:17:22 +0000 (16:17 -0500)]
anv: Refactor framebuffer creation

This avoids having the create call duplicated.

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

3 years agoanv: Clean up anv_device_memory::base on failure
Jason Ekstrand [Thu, 8 Apr 2021 21:10:26 +0000 (16:10 -0500)]
anv: Clean up anv_device_memory::base on failure

Fixes: 682c81bdfb7 "vulkan,anv: Add a base object struct type"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10123>

3 years agoradv: Update editorconfig.
Bas Nieuwenhuizen [Thu, 8 Apr 2021 00:54:40 +0000 (02:54 +0200)]
radv: Update editorconfig.

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

3 years agoradv: Format.
Bas Nieuwenhuizen [Sat, 10 Apr 2021 01:24:05 +0000 (03:24 +0200)]
radv: Format.

Using

find ./src/amd/vulkan -regex '.*/.*\.\(c\|h\|cpp\)' | xargs -P8 -n1 clang-format --style=file -i

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

3 years agoradv: Add clang-format for AMD code.
Bas Nieuwenhuizen [Wed, 7 Apr 2021 20:52:55 +0000 (22:52 +0200)]
radv: Add clang-format for AMD code.

Copied from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8883
with increased colum width as 80 really made a mess.

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

3 years agopanfrost: Flush output after disassembling shaders
Icecream95 [Wed, 7 Apr 2021 11:51:01 +0000 (23:51 +1200)]
panfrost: Flush output after disassembling shaders

Fixes text printed to stderr appearing in the middle of disassembly
when piping stdout and stderr to the same place.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10088>

3 years agoandroid: anv: fix build error in anv_android.c
Mauro Rossi [Thu, 8 Apr 2021 21:32:14 +0000 (23:32 +0200)]
android: anv: fix build error in anv_android.c

Fixes the following building error:

external/mesa/src/intel/vulkan/anv_android.c:568:13: error: no member named 'stride' in 'struct anv_image_create_info'
   anv_info.stride = gralloc_info->stride *
   ~~~~~~~~ ^
1 error generated.

Fixes: afd2f489d338 ("anv: Drop unused anv_image_create_info::stride")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10119>

3 years agoandroid: anv: Remove anv_intel.c from Makefile.sources
Mauro Rossi [Thu, 8 Apr 2021 21:29:12 +0000 (23:29 +0200)]
android: anv: Remove anv_intel.c from Makefile.sources

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/intel/vulkan/anv_intel.c'
clang: error: no input files

Fixes: 5e6db1916860 "anv: Remove vkCreateDmaBufINTEL (v4)"
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10119>

3 years agoci: enable venus in some meson build jobs
Chia-I Wu [Fri, 9 Apr 2021 04:01:58 +0000 (21:01 -0700)]
ci: enable venus in some meson build jobs

Enable it in meson-{android,clang,vulkan,i386}.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10124>

3 years agoetnaviv: remove stale comment in etna_resource_copy_region
Lucas Stach [Fri, 26 Feb 2021 20:48:42 +0000 (21:48 +0100)]
etnaviv: remove stale comment in etna_resource_copy_region

The comment about using the RS engine was correct before the code got
changed to use the 3D blitter and a fallback before etnaviv was merged
into upstream Mesa. It has been incorrect ever since. As it's just
adding confusion, instead of being helpful, remove it.

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

3 years agoetnaviv: don't try to copy PIPE_BUFFER with the 3D engine
Lucas Stach [Fri, 26 Feb 2021 20:28:20 +0000 (21:28 +0100)]
etnaviv: don't try to copy PIPE_BUFFER with the 3D engine

PIPE_BUFFER layout is incompatible with the 3D pipe, so don't try to
blit it via a 3D engine blit, but fall back to the software copy.

Fixes crashes in piglit tests arb_copy_buffer and arb_map_buffer_range.

Fixes: c9e8b49b8852 (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
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/9310>

3 years agovenus: include individual venus-protcol headers
Chia-I Wu [Thu, 8 Apr 2021 00:53:44 +0000 (17:53 -0700)]
venus: include individual venus-protcol headers

Include individual headers than vn_protocol_driver.h to save compile
time.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_queue.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:44:41 +0000 (17:44 -0700)]
venus: split out vn_queue.[ch]

Move VkQueue, VkFence, VkSemaphore, and VkEvent functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_device_memory.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:30:54 +0000 (17:30 -0700)]
venus: split out vn_device_memory.[ch]

Move VkDeviceMemory functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_image.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:27:26 +0000 (17:27 -0700)]
venus: split out vn_image.[ch]

Move VkImage{,View} and VkSampler{,YcbcrConversion} functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_buffer.[ch]
Chia-I Wu [Thu, 8 Apr 2021 00:25:40 +0000 (17:25 -0700)]
venus: split out vn_buffer.[ch]

Move VkBuffer{,View} functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_descriptor_set.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:48:25 +0000 (16:48 -0700)]
venus: split out vn_descriptor_set.[ch]

Move VkDescriptor{Pool,Set,SetLayout,UpdateTemplate} functions to the
new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_render_pass.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:42:37 +0000 (16:42 -0700)]
venus: split out vn_render_pass.[ch]

Move VkRenderPass and VkFramebuffer functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_query_pool.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:37:33 +0000 (16:37 -0700)]
venus: split out vn_query_pool.[ch]

Move VkQueryPool functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_pipeline.[ch]
Chia-I Wu [Wed, 7 Apr 2021 23:29:38 +0000 (16:29 -0700)]
venus: split out vn_pipeline.[ch]

Move VkShaderModule and VkPipeline{,Layout,Cache} functions to the new
files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: split out vn_command_buffer.[ch]
Chia-I Wu [Wed, 7 Apr 2021 22:19:46 +0000 (15:19 -0700)]
venus: split out vn_command_buffer.[ch]

Move VkCommand{Pool,Buffer} functions to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: prepare for splitting vn_device.[ch]
Chia-I Wu [Wed, 7 Apr 2021 22:26:15 +0000 (15:26 -0700)]
venus: prepare for splitting vn_device.[ch]

Make virtqueue/ring sync functions available to other files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agovenus: update venus-protocol headers
Chia-I Wu [Wed, 7 Apr 2021 22:01:06 +0000 (15:01 -0700)]
venus: update venus-protocol headers

This takes vn_protocol_driver_{structs,commands,calls}.h and split them
by Vulkan handle types.  This enables us to split up vn_device.c in the
following commits without slowing down compile time too much.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10117>

3 years agoir3/postsched: Make sure to schedule inputs before kill
Connor Abbott [Thu, 25 Feb 2021 10:14:53 +0000 (11:14 +0100)]
ir3/postsched: Make sure to schedule inputs before kill

Before, we would prefer to schedule inputs before kills, which works
assuming that the live range of the bary_ij system value don't get
split and therefore all bary.f are ready at the start of the block.
However live range splitting can mess up that assumption and cause a
kill to get scheduled before a move that leads to a bary.f.

This fixes even e.g. dEQP-GLES2.functional.shaders.discard.basic_always
on a3xx before introducing CSE of collect instructions, but even after
that it could be a problem theoretically as the register allocator
doesn't guarantee that any live ranges aren't split.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10143>

3 years agoanv: fix debugoptimized build compile
Mike Blumenkrantz [Fri, 9 Apr 2021 15:35:59 +0000 (11:35 -0400)]
anv: fix debugoptimized build compile

this function is only needed for asserts

Fixes: 2e4c153c6ba ("anv/image: Refactor check_memory_bindings()")

fixes #4599

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

3 years agodri: Use __DRI_BUFFER_COUNT consistently internally
Adam Jackson [Thu, 8 Apr 2021 22:46:02 +0000 (18:46 -0400)]
dri: Use __DRI_BUFFER_COUNT consistently internally

These arrays were all sized with insufficiently large magic numbers,
which is probably not a good idea.

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

3 years agozink: don't lose existing pNext when using wsi_image_create_info in image creation
Mike Blumenkrantz [Fri, 9 Apr 2021 14:43:59 +0000 (10:43 -0400)]
zink: don't lose existing pNext when using wsi_image_create_info in image creation

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10138>

3 years agoegl/haiku: Fix ConfigID naming inline with mesa
Alexander von Gluck IV [Sun, 7 Mar 2021 22:57:17 +0000 (16:57 -0600)]
egl/haiku: Fix ConfigID naming inline with mesa

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

3 years agomeson: Refuse to build lavapipe without llvmpipe
Jesse Natalie [Thu, 8 Apr 2021 16:33:46 +0000 (09:33 -0700)]
meson: Refuse to build lavapipe without llvmpipe

This config doesn't work, and as of recently it no longer links.
Let's fail it early.

Fixes: 7b79db11c2e ("lavapipe: enable correct workgroup sizing")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10107>

3 years agoir3: Don't count (nopX) towards the wrong category
Matt Turner [Thu, 8 Apr 2021 20:31:14 +0000 (20:31 +0000)]
ir3: Don't count (nopX) towards the wrong category

Prior to this commit

   (nop3) mad.f32 r0.y, c0.x, r1.w, c0.y

was counted as 4 cat3 instructions (and still 3 cat0/nops) in shader-db
results. With this change, it is counted as only 1 cat3 instruction.

Probably never going to have better shader-db results than this in my
career:

total cat2 in shared programs: 1214667 -> 732058 (-39.73%)
cat2 in affected programs: 1194729 -> 712120 (-40.39%)
helped: 8551
HURT: 0

total cat3 in shared programs: 376448 -> 274745 (-27.02%)
cat3 in affected programs: 344918 -> 243215 (-29.49%)
helped: 7222
HURT: 0

Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10116>

3 years agozink: only unmap PIPE_MAP_ONCE in synchronous mode
Mike Blumenkrantz [Thu, 8 Apr 2021 18:52:47 +0000 (14:52 -0400)]
zink: only unmap PIPE_MAP_ONCE in synchronous mode

this flag cannot be used to infer that a transfer_map call will be matched
by a transfer_unmap call when tc reordering is active

fixes #4600

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

3 years agozink: handle checking batch completion from other contexts without timelines
Mike Blumenkrantz [Thu, 8 Apr 2021 14:08:00 +0000 (10:08 -0400)]
zink: handle checking batch completion from other contexts without timelines

if a batch state can't be found, it may exist on a different context, so the screen
value needs to be checked

if the screen value indicates that the batch hasn't completed and we're waiting,
force a flush so there's a fence that can be waited upon

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

3 years agozink: make timeline semaphores per-screen
Mike Blumenkrantz [Thu, 8 Apr 2021 14:52:55 +0000 (10:52 -0400)]
zink: make timeline semaphores per-screen

I misread the spec, and it turns out timeline ids can't be reused across
semaphores. This is obvious in retrospect, but what can be done?

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

3 years agoradv: allow to force VRS rates on GFX10.3 with RADV_FORCE_VRS
Samuel Pitoiset [Tue, 19 Jan 2021 15:12:01 +0000 (16:12 +0100)]
radv: allow to force VRS rates on GFX10.3 with RADV_FORCE_VRS

This allows to force the VRS rates via RADV_FORCE_VRS, the supported
values are 2x2, 1x2 and 2x1. This supports the primitive shading rate
mode for non GUI elements.

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

3 years agoradv: use explicit VRS mode when configuring PA_CL_VRS_CNTL
Samuel Pitoiset [Tue, 19 Jan 2021 13:58:59 +0000 (14:58 +0100)]
radv: use explicit VRS mode when configuring PA_CL_VRS_CNTL

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

3 years agomicrosoft: fixup clc_log() define
Lionel Landwerlin [Fri, 9 Apr 2021 11:58:19 +0000 (14:58 +0300)]
microsoft: fixup clc_log() define

The local msg variable shadows one of the argument of
SPIRVMessageConsumer making the error message "(null)".

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10133>