platform/upstream/mesa.git
3 years agomesa: Stop tracking visual rating in gl_config
Adam Jackson [Wed, 24 Mar 2021 16:48:21 +0000 (12:48 -0400)]
mesa: Stop tracking visual rating in gl_config

We never create non-conformant configs, and we can predict slow-or-not
purely from the accum-buffer-ness of the config.

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

3 years agomesa: Remove the pretense of aux buffer support
Adam Jackson [Wed, 24 Mar 2021 16:40:51 +0000 (12:40 -0400)]
mesa: Remove the pretense of aux buffer support

This might be nice to hook up at some point, but it's doing nothing at
the moment and it's not clear to me that it belongs as GL state instead
of winsys state.

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

3 years agomesa: Remove unused gl_config::level
Adam Jackson [Wed, 24 Mar 2021 16:29:02 +0000 (12:29 -0400)]
mesa: Remove unused gl_config::level

This is the (GLX) framebuffer overlay level, and it's never set to
anything interesting.

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

3 years agomesa: Remove transparency state from struct gl_config
Adam Jackson [Wed, 24 Mar 2021 16:16:51 +0000 (12:16 -0400)]
mesa: Remove transparency state from struct gl_config

We never set this to anything interesting, and this is really winsys
state not GL state anyway.

Nota bene: __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE is set to GLX_NONE
instead of the GLX_DONT_CARE we looked like we were doing before. This
is to preserve backward compatibility with older (technically, all
current) X servers, which when building their fbconfigs initialize a
field named 'transparentPixel' _twice_, and the second time from
__DRI_ATTRIB_TRANSPARENT_INDEX_VALUE, but then uses 'transparentPixel's
value for GLX_TRANSPARENT_TYPE. Which, GLX_DONT_CARE isn't a valid value
for that, so glx-fbconfig-sanity fails among much else.

This is harmless, in that I don't think any DRI driver has ever wired
this up (I can't find any evidence in r100 or mga history) and certainly
none that we can currently load have this working.

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

3 years agomesa: Remove the texture-from-pixmap state from struct gl_config
Adam Jackson [Wed, 24 Mar 2021 15:57:11 +0000 (11:57 -0400)]
mesa: Remove the texture-from-pixmap state from struct gl_config

This never varies at all, let alone per-config. GLX does read these
values out though so hardwire the values in a different place.

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

3 years agomesa: Remove misc pbuffer attributes from struct gl_config
Adam Jackson [Tue, 23 Mar 2021 17:15:50 +0000 (13:15 -0400)]
mesa: Remove misc pbuffer attributes from struct gl_config

pbuffers aren't a first-class object in mesa, they're just funnily-named
framebuffers. It's thus somewhat silly to track this state separately
when it's effectively identical to GL_MAX_RENDERBUFFER_SIZE, and there's
never been a DRI driver that's ever set these values to anything
interesting. Drop them from mesa (but leave the tokens defined for
compatibility).

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

3 years agodri: Fold attribMap into the code
Adam Jackson [Sat, 27 Mar 2021 02:34:17 +0000 (22:34 -0400)]
dri: Fold attribMap into the code

This table is mostly a mapping into struct gl_config, which is about to
get radically simplified, so we're going to need code to compute values
here instead of just looking up fields in a struct. Keeping the __ATTRIB
bit is somewhat ugly, but we'll expand it back out after the gl_config
changes settle.

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

3 years agodri: Explicitly handle all the config attributes
Adam Jackson [Fri, 26 Mar 2021 19:52:26 +0000 (15:52 -0400)]
dri: Explicitly handle all the config attributes

The code is broken elsewhere and requires that the attrib map actually
be large enough.

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

3 years agoRemove Scons leftovers
Matt Turner [Sun, 21 Mar 2021 17:27:57 +0000 (13:27 -0400)]
Remove Scons leftovers

Fixes: 6e6cd7d93cc54fc8c279 ("scons: Remove.")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9738>

3 years agoci: Disable panfrost g52
Matt Turner [Tue, 30 Mar 2021 19:38:37 +0000 (15:38 -0400)]
ci: Disable panfrost g52

The runners appear to be down at the moment.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4538
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9930>

3 years agoci: skip pipeline_barrier tests that currently crash on RADV
Tony Wasserka [Mon, 29 Mar 2021 11:17:50 +0000 (13:17 +0200)]
ci: skip pipeline_barrier tests that currently crash on RADV

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4511
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9893>

3 years agofrontends/omx/h265: search entire dpb list
Boyuan Zhang [Mon, 15 Mar 2021 17:28:11 +0000 (13:28 -0400)]
frontends/omx/h265: search entire dpb list

When more than 1 idr frames have been added to dpb list, there might be 2
frames with same poc in the dpb list. In this case, driver needs to search
the entire dpb list in order to get newly added reference frame with given poc

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9881>

3 years agoradeon/vcn: release si buffer for encoding at the end.
Ruijing Dong [Fri, 5 Mar 2021 15:39:51 +0000 (10:39 -0500)]
radeon/vcn: release si buffer for encoding at the end.

Signed-off-by: Ruijing Dong <Ruijing.Dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9882>

3 years agocompiler/glsl: avoid null-pointer deref
Erik Faye-Lund [Mon, 29 Mar 2021 11:21:47 +0000 (13:21 +0200)]
compiler/glsl: avoid null-pointer deref

When we encounter a bindless image here, lower_deref returns a
NULL-pointer, and calling record_images_used will try to dereference
that NULL-pointer.

So let's dig out the var from the source instruction instead of the
result of the lowering.

Fixes: 5910c938a29 ("nir/glsl: gather bitmask of images used by program")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9895>

3 years agozink: remove zink_create_fence()
Mike Blumenkrantz [Mon, 22 Mar 2021 17:58:37 +0000 (13:58 -0400)]
zink: remove zink_create_fence()

merge this down into batch state creation to keep fence file complexity down

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

3 years agozink: also check for device lost reset on flush
Mike Blumenkrantz [Mon, 22 Mar 2021 15:39:21 +0000 (11:39 -0400)]
zink: also check for device lost reset on flush

if there's a reset callback available, call that instead of cycling

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

3 years agozink: break out queue submit into separate functions
Mike Blumenkrantz [Mon, 22 Mar 2021 15:36:18 +0000 (11:36 -0400)]
zink: break out queue submit into separate functions

to be used with async submission

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

3 years agozink: move VkQueue to batch object
Mike Blumenkrantz [Mon, 22 Mar 2021 15:33:38 +0000 (11:33 -0400)]
zink: move VkQueue to batch object

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

3 years agozink: remove zink_fence_init()
Mike Blumenkrantz [Mon, 22 Mar 2021 15:28:07 +0000 (11:28 -0400)]
zink: remove zink_fence_init()

contents moved to more correct places

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

3 years agozink: make a local screen pointer in zink_flush
Mike Blumenkrantz [Mon, 22 Mar 2021 15:18:36 +0000 (11:18 -0400)]
zink: make a local screen pointer in zink_flush

no functional changes

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

3 years agozink: store context to batch state
Mike Blumenkrantz [Mon, 22 Mar 2021 15:09:18 +0000 (11:09 -0400)]
zink: store context to batch state

this will be used for post-flush device resets when device is lost

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

3 years agozink: rename init_batch_state to get_batch_state
Mike Blumenkrantz [Mon, 22 Mar 2021 15:05:19 +0000 (11:05 -0400)]
zink: rename init_batch_state to get_batch_state

more sensible, no functional changes

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

3 years agozink: assume fence has already completed if a batch state isn't found
Mike Blumenkrantz [Mon, 29 Mar 2021 03:34:28 +0000 (23:34 -0400)]
zink: assume fence has already completed if a batch state isn't found

we're not going to be waiting on fences from the future, so if we can't
find a fence then it must have completed

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

3 years agozink: explicitly reset a couple more batch state members
Mike Blumenkrantz [Mon, 22 Mar 2021 14:58:26 +0000 (10:58 -0400)]
zink: explicitly reset a couple more batch state members

no functional changes at this time

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

3 years agozink: add locking for fence resources
Mike Blumenkrantz [Mon, 22 Mar 2021 14:54:14 +0000 (10:54 -0400)]
zink: add locking for fence resources

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

3 years agozink: split fence finish func
Mike Blumenkrantz [Mon, 22 Mar 2021 14:39:42 +0000 (10:39 -0400)]
zink: split fence finish func

one part of this will be used to handle tc mechanics, the other part is for
internal use

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

3 years agozink: add function for checking whether a batch is done
Mike Blumenkrantz [Mon, 22 Mar 2021 14:33:34 +0000 (10:33 -0400)]
zink: add function for checking whether a batch is done

this is like wait_on_batch, but without the waiting

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

3 years agozink: add locking for batch states
Mike Blumenkrantz [Mon, 22 Mar 2021 14:27:50 +0000 (10:27 -0400)]
zink: add locking for batch states

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

3 years agozink: manually invoke cpu detection during screen init
Mike Blumenkrantz [Wed, 6 Jan 2021 18:05:41 +0000 (13:05 -0500)]
zink: manually invoke cpu detection during screen init

ensure this gets populated before using it

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

3 years agozink: add locking for resource maps
Mike Blumenkrantz [Fri, 25 Dec 2020 00:43:10 +0000 (19:43 -0500)]
zink: add locking for resource maps

vulkan prohibits multiple maps on a resource, so these have to be locked
down

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

3 years agozink: add locking for descriptor pools
Mike Blumenkrantz [Wed, 23 Dec 2020 20:28:52 +0000 (15:28 -0500)]
zink: add locking for descriptor pools

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

3 years agov3dv: fix unused value
Juan A. Suarez Romero [Tue, 30 Mar 2021 09:00:01 +0000 (11:00 +0200)]
v3dv: fix unused value

Do not assign to a variable that won't be used.

Fixes CID#1468098 "Unused value (UNUSED_VALUE)".

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

3 years agobroadcom/compiler: fix unused value
Juan A. Suarez Romero [Tue, 30 Mar 2021 08:57:15 +0000 (10:57 +0200)]
broadcom/compiler: fix unused value

Do not assign to a variable that won't be used.

Fixes CID#1451708 and CID#1451710 "Unused value (UNUSED_VALUE)".

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

3 years agodocs: do not try to copy missing file
Erik Faye-Lund [Tue, 30 Mar 2021 10:42:13 +0000 (12:42 +0200)]
docs: do not try to copy missing file

This file was removed, but the inclusion in the docs build was missed.

Fixes: 6e6cd7d93cc ("scons: Remove.")
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9913>

3 years agoradv: do not fixup DCC after compute color resolves if DCC stores enabled
Samuel Pitoiset [Tue, 30 Mar 2021 07:50:24 +0000 (09:50 +0200)]
radv: do not fixup DCC after compute color resolves if DCC stores enabled

With compressed DCC writes supported, the image should still be
compressed after resolving using the compute path.

Fixes various dEQP-VK.api.copy_and_blit.core.resolve_image.*
failures with RADV_DEBUG=forcecompress on GFX10.

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

3 years agolavapipe: report correct value for maxTexelBufferElements
Erik Faye-Lund [Mon, 29 Mar 2021 08:42:11 +0000 (10:42 +0200)]
lavapipe: report correct value for maxTexelBufferElements

We already have a pipe_cap for this, so let's use that to report the
correct value.

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

3 years agoci/v3d: run full GLES3 and GLES31 testsuite
Juan A. Suarez Romero [Mon, 29 Mar 2021 14:41:59 +0000 (16:41 +0200)]
ci/v3d: run full GLES3 and GLES31 testsuite

There is margin in the time budget to run the full GLES3 and GLES31 CTS
instead of only 50%.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9899>

3 years agoci/broadcom: update piglit expected results
Juan A. Suarez Romero [Mon, 29 Mar 2021 14:36:36 +0000 (16:36 +0200)]
ci/broadcom: update piglit expected results

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9899>

3 years agoiris: disable dynamic VAO fastpath on GFX version 9
Marcin Ślusarz [Thu, 25 Mar 2021 16:29:11 +0000 (17:29 +0100)]
iris: disable dynamic VAO fastpath on GFX version 9

Enabling this fast path, while making CPU side simpler
(and thus reducing driver's CPU overhead), forces us to
generate multiple VERTEX_BUFFER_STATE packets pointing to
the same buffer, but with slightly shifted BufferStartingAddress.
This is fine on GFX version >= 11 and < 8, but on version
8 and 9, thanks to internal details of the VF cache, vertex
data from each VERTEX_BUFFER_STATE is cached separately
and this results in a lot of cache misses.

Disabling this fast path restores previous performance levels.

On my SKL GT2 machine this improves performance in:
- GLB27 Egypt offscreen by 37%
- GLB27 TRex offscreen by 22%
- gfxbench5 Manhattan offscreen by 1.75%
- gfxbench5 Manhattan31 offscreen by 1.9%
- gfxbench5 Aztec Ruins high by 2.3%

In Intel performance CI on GFX version 9 it improves performance in:
- gfxbench5 Manhattan offscreen by 1.65%
- gfxbench5 Aztec Ruins normal offscreen by 1.33%

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3277
Fixes: 42842306d3c ("mesa,st/mesa: add a fast path for non-static VAOs")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9857>

3 years agogallium: add PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH
Marcin Ślusarz [Mon, 8 Mar 2021 11:30:58 +0000 (12:30 +0100)]
gallium: add PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH

Fixes: 42842306d3c ("mesa,st/mesa: add a fast path for non-static VAOs")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9857>

3 years agozink: rework memory_barrier hook
Mike Blumenkrantz [Thu, 10 Dec 2020 16:13:23 +0000 (11:13 -0500)]
zink: rework memory_barrier hook

this is a bit more sensible all around without being too much hammer
and not enough nail

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

3 years agozink: rework some includes
Mike Blumenkrantz [Tue, 15 Dec 2020 17:48:22 +0000 (12:48 -0500)]
zink: rework some includes

descriptors.h requires stuff from context.h and vice versa, so there's
a little redefinition here to work around that

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

3 years agozink: use GENERAL layout for sampler images that are also bound as shader images
Mike Blumenkrantz [Mon, 14 Dec 2020 02:33:29 +0000 (21:33 -0500)]
zink: use GENERAL layout for sampler images that are also bound as shader images

we can't have the same image with 2 layouts, so just go with the more global one

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

3 years agozink: simplify some descriptor update function parameters
Mike Blumenkrantz [Fri, 4 Dec 2020 16:32:46 +0000 (11:32 -0500)]
zink: simplify some descriptor update function parameters

just removing unused params

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

3 years agozink: move descriptor barrier handling to main update function
Mike Blumenkrantz [Mon, 30 Nov 2020 17:09:28 +0000 (12:09 -0500)]
zink: move descriptor barrier handling to main update function

no functional changes

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

3 years agozink: move update_descriptors & related funcs to zink_descriptors.c
Mike Blumenkrantz [Mon, 30 Nov 2020 16:18:52 +0000 (11:18 -0500)]
zink: move update_descriptors & related funcs to zink_descriptors.c

keep zink_draw.c for draw stuff

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

3 years agozink: rework texture_barrier hook
Mike Blumenkrantz [Thu, 10 Dec 2020 16:13:05 +0000 (11:13 -0500)]
zink: rework texture_barrier hook

we can be more precise with this and avoid flushing unnecessarily

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

3 years agonir: Unify memory atomics
Alyssa Rosenzweig [Wed, 3 Feb 2021 17:06:34 +0000 (12:06 -0500)]
nir: Unify memory atomics

Avoids some copypaste and makes it easier to see how the different types
relate.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8847>

3 years agolavapipe: ignore unused clearvalues when beginning renderpass
Mike Blumenkrantz [Mon, 29 Mar 2021 15:04:39 +0000 (11:04 -0400)]
lavapipe: ignore unused clearvalues when beginning renderpass

according to spec, unused clearvalues aren't accessed

> Only elements corresponding to cleared attachments are used. Other elements of pClearValues are ignored.

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

3 years agolavapipe: Free sorted descriptor array.
Bas Nieuwenhuizen [Sun, 28 Mar 2021 20:50:02 +0000 (22:50 +0200)]
lavapipe: Free sorted descriptor array.

Fixes: abc724e440e ("lavapipe: sort bindings before creating descriptor set")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9880>

3 years agovulkan: Fix descriptor set creation with zero bindings.
Bas Nieuwenhuizen [Sun, 28 Mar 2021 20:46:19 +0000 (22:46 +0200)]
vulkan: Fix descriptor set creation with zero bindings.

MAX2(count * struct size, 1) results in 1 for count=0, not the size of a struct.

Since this MAX only seems to exist so we can keep using NULL for error reporting,
just refactor to return a VkResult.

Fixes: ad241b15a9e ("vk: consolidate dynamic descriptor binding sorting")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4522
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9880>

3 years agopanfrost: Implement panfrost_set_global_binding
Icecream95 [Tue, 22 Dec 2020 10:16:34 +0000 (23:16 +1300)]
panfrost: Implement panfrost_set_global_binding

This is enough OpenCL support to pass the Piglit test
cl-custom-run-simple-kernel with PAN_MESA_DEBUG=deqp.

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

3 years agopipe-loader: Stop trying to use kmsro for vgem
Icecream95 [Tue, 2 Mar 2021 20:11:17 +0000 (09:11 +1300)]
pipe-loader: Stop trying to use kmsro for vgem

Fixes two OpenCL devices being created for a single kmsro-using GPU
when vgem is enabled in the kernel.

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

3 years agopipe-loader,gallium/drm: Fix the kmsro pipe_loader target
Icecream95 [Sun, 28 Feb 2021 21:51:45 +0000 (10:51 +1300)]
pipe-loader,gallium/drm: Fix the kmsro pipe_loader target

Include drm_helper.h to define the driver descriptor again, but with a
new define GALLIUM_KMSRO_ONLY to disable defining descriptors for the
drivers that kmsro uses.

Fixes clinfo on Panfrost.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4002
Fixes: 9ec28b8d226 ("gallium/drm: Deduplicate screen creation for the dynamic (clover) pipe loader.")
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9380>

3 years agointel/fs/copy_prop: check stride constraints with actual final type
Lionel Landwerlin [Wed, 24 Mar 2021 07:56:42 +0000 (09:56 +0200)]
intel/fs/copy_prop: check stride constraints with actual final type

In some cases we will change the type of the destination register of
an instruction. This is the type we should use to verify that we're
allow to do the replacement.

Otherwise we can hit restrictions on CHV and upcoming Xe-Hp for
instance where the copy propagation transforms this :

send(16) (mlen: 2) vgrf10:UD, 0u, 0u, vgrf35:D, null:UD
mov(16) vgrf11:UW, vgrf10<2>:UW
mov(16) vgrf12:UW, vgrf10+0.2<2>:UW
mov(16) vgrf15:HF, |vgrf11|:HF
mov(16) vgrf16:HF, |vgrf12|:HF
mov(8) vgrf41<2>:UW, vgrf15+0.0:UW group0
mov(8) vgrf42<2>:UW, vgrf15+0.16:UW group8
mov(8) vgrf45<2>:UW, vgrf16+0.0:UW group0
mov(8) vgrf46<2>:UW, vgrf16+0.16:UW group8

into this :

send(16) (mlen: 2) vgrf10:UD, 0u, 0u, vgrf35:D, null:UD
mov(8) vgrf41<2>:HF, |vgrf10+0.0|<2>:HF group0
mov(8) vgrf42<2>:HF, |vgrf10+1.0|<2>:HF group8
mov(8) vgrf45<2>:HF, |vgrf10+0.2|<2>:HF group0
mov(8) vgrf46<2>:HF, |vgrf10+1.2|<2>:HF group8

Because of the floating point use, stride and offets should be the
same.

v2: Fix final destination type selection (Curro)

v3: constify (Curro)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9832>

3 years agotu: Skip tu_tiling_config_update_tile_layout() if not using gmem
Matt Turner [Mon, 15 Mar 2021 18:54:23 +0000 (18:54 +0000)]
tu: Skip tu_tiling_config_update_tile_layout() if not using gmem

Otherwise pass->tile_align_w will be 0, leading to a divide by zero and
undefined behavior. In practice, I saw this lead to an infinite loop in
tests like

dEQP-VK.draw.instanced.draw_indexed_indirect_vk_primitive_topology_line_list_attrib_divisor_0_multiview

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9606>

3 years agofreedreno/a5xx: Use VALIDREG/CONDREG like a6xx do.
Eric Anholt [Mon, 29 Mar 2021 20:54:15 +0000 (13:54 -0700)]
freedreno/a5xx: Use VALIDREG/CONDREG like a6xx do.

Fewer magic numbers and less to diff between the two.

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

3 years agofreedreno/a5xx: Add support for clip distances and use them for userclip.
Eric Anholt [Fri, 26 Mar 2021 23:28:46 +0000 (16:28 -0700)]
freedreno/a5xx: Add support for clip distances and use them for userclip.

A little low-stakes RE effort as I unwind from fighting CI all day.  Comes
from diffing dEQP-VK.clipping.user_defined.clip_distance.vert.* on the
blob and comparing to a6xx behavior.  (My blob doesn't do tess, so if
there are equivalent tess fields for some of these, I didn't find them)

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

3 years agolavapipe: enable KHR_shader_atomic_int64
Dave Airlie [Mon, 15 Mar 2021 01:44:17 +0000 (11:44 +1000)]
lavapipe: enable KHR_shader_atomic_int64

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9591>

3 years agogallivm: add 64-bit atomic global support
Dave Airlie [Wed, 17 Mar 2021 00:12:52 +0000 (10:12 +1000)]
gallivm: add 64-bit atomic global support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9591>

3 years agogallivm: add 64-bit atomic support for ssbo/shared.
Dave Airlie [Mon, 15 Mar 2021 01:43:43 +0000 (11:43 +1000)]
gallivm: add 64-bit atomic support for ssbo/shared.

This just fixes things up to handle bit-size

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9591>

3 years agoac/surface: do not allocate FMASK or CMASK for stencil-only surfaces on GFX9+
Samuel Pitoiset [Mon, 15 Mar 2021 21:24:41 +0000 (22:24 +0100)]
ac/surface: do not allocate FMASK or CMASK for stencil-only surfaces on GFX9+

FMASK/CMASK make no sense with depth/stencil or stencil-only surfaces.
gfx9_compute_miptree() was called twice for stencil-only surfaces,
and the first call was allocating FMASK/CMASK.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9612>

3 years agoci: Enable iris testing in meson-release
Kenneth Graunke [Fri, 26 Mar 2021 15:08:07 +0000 (08:08 -0700)]
ci: Enable iris testing in meson-release

This should catch any build breaks in release mode.  iris was already
build tested in debug builds, but not release mode.

Suggested by Michel Dänzer.

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

3 years agointel: Mark an otherwise unused variable in intel_dump_gpu as ASSERTED
Kenneth Graunke [Fri, 26 Mar 2021 18:04:49 +0000 (11:04 -0700)]
intel: Mark an otherwise unused variable in intel_dump_gpu as ASSERTED

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

3 years agoradv: require DRM 3.35+
Samuel Pitoiset [Wed, 24 Mar 2021 08:54:28 +0000 (09:54 +0100)]
radv: require DRM 3.35+

Linux Kernel 4.15+ is now required for RADV, this kernel has been
released 3 years ago and should be in most modern distros.

This allows us to remove a lot of legacy code for fence/semaphore.

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

3 years agoradv: Only set WRITE_COMPRESS_ENABLE on supported HW.
Bas Nieuwenhuizen [Sat, 27 Mar 2021 21:38:26 +0000 (22:38 +0100)]
radv: Only set WRITE_COMPRESS_ENABLE on supported HW.

Fixes: a7c0cf500b3 ("radv: Enable DCC for image stores on GFX10.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9876>

3 years agor600/sfn: allocate number of VS outputs based on max driver_location
Gert Wollny [Sun, 28 Mar 2021 18:03:33 +0000 (20:03 +0200)]
r600/sfn: allocate number of VS outputs based on max driver_location

It seems that when the linker optimized the IO it might leave gaps
in the driver output locations, therefore set the size of the output
array based on the highest driver location occupied by a store_output.

Fixes #4520

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9879>

3 years agor600: Don't advertise support for scaled int16 vertex formats
Gert Wollny [Sat, 27 Mar 2021 18:17:07 +0000 (19:17 +0100)]
r600: Don't advertise support for scaled int16 vertex formats

They are not supported by the hardware.
Fixes:
  dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_32_short3_vec4_dynamic_draw_quads_1
  dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_32_short3_vec4_dynamic_draw_quads_256

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>

3 years agor600: don't set an index_bias for indirect draw calls
Gert Wollny [Sun, 28 Mar 2021 08:27:20 +0000 (10:27 +0200)]
r600: don't set an index_bias for indirect draw calls

The indirect draw call already encodes the index bias so that no
additional encoding in the hardware is needed in this case.

This fixes a regression with a number of tests from
   dEQP-GLES31.functional.draw_indirect.random.*

Fixes: c6c532faa8cf172715b38783ec7175b626a63944
  "gallium/u_vbuf: use updated pipe_draw_start_count while using draw_vbo"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>

3 years agor600: Fix texture buffer offset alignment
Gert Wollny [Sun, 28 Mar 2021 09:03:35 +0000 (11:03 +0200)]
r600: Fix texture buffer offset alignment

It seems that this has to be 4 (radeonsi also sets this value to 4)

Fixes deqp-gles31:
 functional.texture.texture_buffer.modify.bufferdata.offset_1_alignments
 functional.texture.texture_buffer.modify.bufferdata.offset_7_alignments

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>

3 years agofreedreno: Fix file descriptor leak.
Vinson Lee [Mon, 29 Mar 2021 03:24:27 +0000 (20:24 -0700)]
freedreno: Fix file descriptor leak.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

Fixes: 5a13507164a ("freedreno/perfcntrs: add fdperf")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9889>

3 years agozink: use pre-populated shader-locations
Erik Faye-Lund [Thu, 4 Feb 2021 16:27:49 +0000 (17:27 +0100)]
zink: use pre-populated shader-locations

This is the final step of this little journey, which allows us to no
longer deal with the shader-slot mapping inside the NIR to SPIR-V
translation.

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

3 years agozink: do not depend on shader_slots_reserved for xfb
Erik Faye-Lund [Thu, 4 Feb 2021 15:58:52 +0000 (16:58 +0100)]
zink: do not depend on shader_slots_reserved for xfb

This will be helpful in ripping this out later on.

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

3 years agozink: pre-populate locations in variables
Erik Faye-Lund [Thu, 4 Feb 2021 15:11:00 +0000 (16:11 +0100)]
zink: pre-populate locations in variables

These locations should match what we get out of the pre-existing pass,
and are currently unused. They will be used in a later commit in this
series, but is left like this because this code is fairly fragile.

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

3 years agozink: handle errors in nir_to_spirv
Erik Faye-Lund [Thu, 4 Feb 2021 13:28:46 +0000 (14:28 +0100)]
zink: handle errors in nir_to_spirv

We already have some appropriate error-handling further down here.

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

3 years agoaco/tests: fix isel.sparse.clause for LLVM 12+
Rhys Perry [Thu, 18 Mar 2021 19:14:24 +0000 (19:14 +0000)]
aco/tests: fix isel.sparse.clause for LLVM 12+

Seems disassembly of this instruction was fixed in LLVM 12.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4154
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9694>

3 years agofrontends/va: correct check for invalid format
Erik Faye-Lund [Mon, 29 Mar 2021 13:09:19 +0000 (15:09 +0200)]
frontends/va: correct check for invalid format

We need to check against the correct define, DRM_FORMAT_INVALID.
Checking an uint32_t against DRM_FORMAT_MOD_INVALID will always produce
false anyway.

Caught by Coverity.

Fixes: b85c6531f6d ("frontends/va: add support for VA_EXPORT_SURFACE_COMPOSED_LAYERS")
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9897>

3 years agoandroid: panfrost: Use the blend shader cache attached to the device
Mauro Rossi [Mon, 29 Mar 2021 11:25:19 +0000 (13:25 +0200)]
android: panfrost: Use the blend shader cache attached to the device

pan_blend_shaders.{c,h} files are removed from Makefile.sources
in order to avoid the following building error:

FAILED: out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_pipe_panfrost_intermediates/pan_blend_shaders.o
...
clang: error: no such file or directory: 'external/mesa/src/gallium/drivers/panfrost/pan_blend_shaders.c'
clang: error: no input files

Fixes: 7994929e84a3 ("panfrost: Use the blend shader cache attached to the device")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9894>

3 years agoturnip,ir3: account for dispatch group offsets
Danylo Piliaiev [Mon, 1 Mar 2021 15:31:56 +0000 (17:31 +0200)]
turnip,ir3: account for dispatch group offsets

Fixes tests:
 dEQP-VK.compute.device_group.dispatch_base

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

3 years agoetnaviv/drm: only print out fence error on non timeout
Lionel Landwerlin [Mon, 29 Mar 2021 09:48:21 +0000 (11:48 +0200)]
etnaviv/drm: only print out fence error on non timeout

While looking at the traces emitted by chromium, I saw a lot of those
errors. But looking at the value of ns, it is 0, so it's probably just
the application checking whether work is done or not. Not much point
in printing out an error.

v2: check ret value (Christian)
    check both timeout codes (Lionel)

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9875>

3 years agoutil: rework AMD cpu L3 cache affinity code.
Dave Airlie [Thu, 25 Mar 2021 06:59:50 +0000 (16:59 +1000)]
util: rework AMD cpu L3 cache affinity code.

This changes how the L3 cache affinity code works out the affinity
masks. It works better with multi-CPU systems and should also be
capable of handling big/little type situations if they appear in
the future.

It now iterates over all CPU cores, gets the core count for each
CPU, and works out the L3_ID from the physical CPU ID, and
the current cores L3 cache. It then tracks how many L3 caches
it has seen and reallocate the affinity masks for each one.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4496
Fixes: d8ea5099658 ("util: completely rewrite and do AMD Zen L3 cache pinning correctly")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9782>

3 years agost/glthread: allow for invalid L3 cache id.
Dave Airlie [Thu, 25 Mar 2021 03:40:51 +0000 (13:40 +1000)]
st/glthread: allow for invalid L3 cache id.

If we get 0xffffffff consider L3 cache info invalid and
don't continue.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4496
Fixes: d8ea5099658 ("util: completely rewrite and do AMD Zen L3 cache pinning correctly")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9782>

3 years agollvmpipe: fix cube image size query
Dave Airlie [Mon, 22 Mar 2021 05:31:45 +0000 (15:31 +1000)]
llvmpipe: fix cube image size query

The 3rd coord wasn't being handled properly

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

3 years agollvmpipe: increase PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE value
Timothee Chabat [Mon, 22 Mar 2021 09:46:26 +0000 (10:46 +0100)]
llvmpipe: increase PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE value

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

3 years agollvmpipe: stop flattening multidraws
Mike Blumenkrantz [Thu, 25 Mar 2021 19:24:20 +0000 (15:24 -0400)]
llvmpipe: stop flattening multidraws

these are now handled in the draw module

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

3 years agoaux/draw: pass full draw params to draw_pt_arrays()
Mike Blumenkrantz [Thu, 25 Mar 2021 19:23:33 +0000 (15:23 -0400)]
aux/draw: pass full draw params to draw_pt_arrays()

multidraw depth maximum: loop directly around the llvmpipe call

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

3 years agoaux/draw: track increment_draw_id value from draw info
Mike Blumenkrantz [Thu, 25 Mar 2021 19:22:27 +0000 (15:22 -0400)]
aux/draw: track increment_draw_id value from draw info

need this in order to accurately update drawid

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

3 years agoaux/draw: move draw param sanitization to end of function
Mike Blumenkrantz [Thu, 25 Mar 2021 19:08:18 +0000 (15:08 -0400)]
aux/draw: move draw param sanitization to end of function

this triggers more work if sanitizing no-ops the draw, but the rest of the
time it won't matter

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

3 years agoaux/draw: pass the full draw params through to draw_pt_arrays_restart()
Mike Blumenkrantz [Thu, 25 Mar 2021 19:04:43 +0000 (15:04 -0400)]
aux/draw: pass the full draw params through to draw_pt_arrays_restart()

multidraw depth 1.5: loop in draw_pt_arrays_restart()

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

3 years agoaux/draw: pass the full draw params through to draw_instances()
Mike Blumenkrantz [Thu, 25 Mar 2021 19:04:43 +0000 (15:04 -0400)]
aux/draw: pass the full draw params through to draw_instances()

multidraw depth 1: loop in draw_instances()

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

3 years agoaux/draw: rewrite PRIM_RESTART_LOOP macro as a function
Mike Blumenkrantz [Thu, 25 Mar 2021 18:58:22 +0000 (14:58 -0400)]
aux/draw: rewrite PRIM_RESTART_LOOP macro as a function

this was a bit too intense to work with

no functional changes

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

3 years agoaux/draw: stop copying draw params unnecessarily
Mike Blumenkrantz [Thu, 25 Mar 2021 18:17:50 +0000 (14:17 -0400)]
aux/draw: stop copying draw params unnecessarily

resolve_draw_info() is only for drawing from streamout, so this check
can be moved forward to avoid overwriting draw params when not necessary

no functional changes at this time

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

3 years agopanfrost: Use the blend shader cache attached to the device
Boris Brezillon [Tue, 23 Mar 2021 11:20:35 +0000 (12:20 +0100)]
panfrost: Use the blend shader cache attached to the device

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

3 years agopanfrost: Move the blend shader cache at the device level
Boris Brezillon [Tue, 23 Mar 2021 11:17:03 +0000 (12:17 +0100)]
panfrost: Move the blend shader cache at the device level

So we can re-use it in the Vulkan driver.

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

3 years agobroadcom/compiler: flag TMU reads with a read dependency on last TMU config
Iago Toral Quiroga [Thu, 25 Mar 2021 13:43:20 +0000 (14:43 +0100)]
broadcom/compiler: flag TMU reads with a read dependency on last TMU config

We were using a write dependency to ensure ordering since LDTMUs sequences
are ordered, but by using a write dependency with TMU config we were also
preserving ordering with TMU config writes that are not a sequence
terminator, which is not required and reduces scheduling flexibility.
Instead, use a write dependency to ensure strict ordering of TMU reads,
but only a read depdency with TMU config.

With this change we also need to update CS barriers to also have a write
dependency with TMU reads to ensure that we don't move TMU reads around
CS barriers.

total instructions in shared programs: 13602500 -> 13597851 (-0.03%)
instructions in affected programs: 2681428 -> 2676779 (-0.17%)
helped: 6567
HURT: 4960
Instructions are helped.

total max-temps in shared programs: 2317927 -> 2317914 (<.01%)
max-temps in affected programs: 13861 -> 13848 (-0.09%)
helped: 355
HURT: 300
Inconclusive result (value mean confidence interval includes 0).

total sfu-stalls in shared programs: 32074 -> 32247 (0.54%)
sfu-stalls in affected programs: 848 -> 1021 (20.40%)
helped: 160
HURT: 327
Inconclusive result (%-change mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13634574 -> 13630098 (-0.03%)
inst-and-stalls in affected programs: 2703041 -> 2698565 (-0.17%)
helped: 6558
HURT: 5020
Inst-and-stalls are helped.

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

3 years agobroadcom/compiler: flag TMU read dependencies against last TMU config
Iago Toral Quiroga [Thu, 25 Mar 2021 10:36:03 +0000 (11:36 +0100)]
broadcom/compiler: flag TMU read dependencies against last TMU config

Instead of last TMU write. According to the documentation, the entries
in the output FIFO are pushed with the *final* input write for the
lookup, which is the one terminating the sequence. We flag these
with last_tmu_config.

This will allow us to move all TMU register writes for a lookup except
the last one ahead of the LDTMUs for the previous lookup, possibly
allowing us to pair up these writes the wrtmuc instructions for the
same lookup, turning code like this:

nop                  ; nop               ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmut, rf11
nop                  ; mov  tmus, rf0

into:

nop                  ; mov  tmut, rf11   ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmus, rf0

total instructions in shared programs: 13648140 -> 13602500 (-0.33%)
instructions in affected programs: 3497402 -> 3451762 (-1.30%)
helped: 12044
HURT: 3484
Instructions are helped.

total max-temps in shared programs: 2318687 -> 2317927 (-0.03%)
max-temps in affected programs: 17234 -> 16474 (-4.41%)
helped: 615
HURT: 198
Max-temps are helped.

total sfu-stalls in shared programs: 32354 -> 32074 (-0.87%)
sfu-stalls in affected programs: 1462 -> 1182 (-19.15%)
helped: 461
HURT: 188
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 13680494 -> 13634574 (-0.34%)
inst-and-stalls in affected programs: 3514405 -> 3468485 (-1.31%)
helped: 12062
HURT: 3486
Inst-and-stalls are helped.

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

3 years agolavapipe: refactor indexed draw dispatch to handle multidraws
Mike Blumenkrantz [Thu, 25 Mar 2021 17:54:01 +0000 (13:54 -0400)]
lavapipe: refactor indexed draw dispatch to handle multidraws

each indexed direct draw cmd now contains n draws (though right now n=1)

indexed draws now also have a flag used to avoid recalculating start index if
a cmdbuf is submitted multiple times

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

3 years agolavapipe: refactor base draw dispatch to handle multidraws
Mike Blumenkrantz [Thu, 25 Mar 2021 17:54:01 +0000 (13:54 -0400)]
lavapipe: refactor base draw dispatch to handle multidraws

each direct draw cmd now contains n draws (though right now n=1)

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

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 24 Mar 2021 19:24:26 +0000 (15:24 -0400)]
zink: ci updates

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

3 years agozink: remove explicit fencing for query results
Mike Blumenkrantz [Fri, 12 Mar 2021 14:00:16 +0000 (09:00 -0500)]
zink: remove explicit fencing for query results

now that the results are automatically being copied to internal buffers,
mapping the buffers will handle any fencing that's required

the only caveat is that the query still needs to be flushed for a result
to be returned

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