platform/upstream/mesa.git
3 years agofreedreno: Add perfetto renderpass support
Rob Clark [Mon, 22 Mar 2021 22:52:15 +0000 (15:52 -0700)]
freedreno: Add perfetto renderpass support

Add a custom DataSource to provide trace events for render stages.

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

3 years agofreedreno: Moar header C++-proofing
Rob Clark [Mon, 22 Mar 2021 22:33:36 +0000 (15:33 -0700)]
freedreno: Moar header C++-proofing

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

3 years agofreedreno/pps: Detect GPU suspend on newer kernels
Rob Clark [Wed, 24 Mar 2021 23:02:06 +0000 (16:02 -0700)]
freedreno/pps: Detect GPU suspend on newer kernels

We can avoid re-sending the configuration cmdstream constantly if we
know the device has not suspended since the last sampling period.

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

3 years agofreedreno/drm: Add support to query device suspend count
Rob Clark [Wed, 24 Mar 2021 22:48:37 +0000 (15:48 -0700)]
freedreno/drm: Add support to query device suspend count

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

3 years agogallium/aux: Add perfetto support to u_trace
Rob Clark [Mon, 22 Mar 2021 20:25:49 +0000 (13:25 -0700)]
gallium/aux: Add perfetto support to u_trace

Not really direct perfetto support, but add a way that tracepoints can
be associated with a driver provided callback which can generate
perfetto events using the timestamps collected on the GPU.

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

3 years agofreedreno: Add freedreno pps driver
Rob Clark [Wed, 17 Mar 2021 18:27:30 +0000 (11:27 -0700)]
freedreno: Add freedreno pps driver

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>

3 years agoutil/perfetto: Add one-time init
Rob Clark [Mon, 22 Mar 2021 17:55:35 +0000 (10:55 -0700)]
util/perfetto: Add one-time init

Various places around mesa which might want to register a data-source,
etc, should call util_perfetto_init() first to ensure we connect to the
tracing service.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>

3 years agopps: Lower min sampling interval
Rob Clark [Thu, 25 Mar 2021 18:56:37 +0000 (11:56 -0700)]
pps: Lower min sampling interval

A shorter interval lets us have more granularity to see counter changes
per tile pass.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>

3 years agoradv: stop special-casing multi-planar formats in radv_get_modifier_flags
Simon Ser [Tue, 4 May 2021 15:18:51 +0000 (17:18 +0200)]
radv: stop special-casing multi-planar formats in radv_get_modifier_flags

In radv_get_modifier_flags, we had a special case for multi-planar
formats. However ac_is_modifier_supported should already take care of
rejecting unsupported modifiers for multi-planar buffers.

Some time ago, ac_is_modifier_supported rejected any non-linear modifier
for multi-planar formats. 35e25ea1d07c ("ac/surface: allow non-DCC modifiers
for YUV on GFX9+") changed that to allow non-DCC modifiers with
multi-planar formats on GFX9+. Since then, the radv check has been out
of sync.

A similar patch was applied to radeonsi in 979e13869538 ("radeonsi: stop
special-casing YUV formats in si_query_dmabuf_modifiers").

This fixes tiling artifacts with NV12 buffers.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10623>

3 years agonouveau/mm: remove unused nouveau_mm_allocation.next field
Karol Herbst [Wed, 28 Apr 2021 12:39:06 +0000 (14:39 +0200)]
nouveau/mm: remove unused nouveau_mm_allocation.next field

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8765>

3 years agonouveau/mm: pass mm_bucket to mm_slab_new
Karol Herbst [Wed, 27 Jan 2021 09:43:06 +0000 (10:43 +0100)]
nouveau/mm: pass mm_bucket to mm_slab_new

We relied on mm_slab_new choosing the same bucket the caller used, just
pass it in.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8765>

3 years agonouveau: fix race in nouveau_screen_get_name
Karol Herbst [Tue, 26 Jan 2021 14:36:05 +0000 (15:36 +0100)]
nouveau: fix race in nouveau_screen_get_name

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

3 years agoclover/memory: fix data race in buffer subclasses
Karol Herbst [Wed, 27 Jan 2021 21:09:16 +0000 (22:09 +0100)]
clover/memory: fix data race in buffer subclasses

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8765>

3 years agoradv,aco: compact vertex buffer descriptors
Rhys Perry [Tue, 1 Dec 2020 17:05:14 +0000 (17:05 +0000)]
radv,aco: compact vertex buffer descriptors

It seems common for there to be holes.

fossil-db (GFX10.3, robustBufferAccess enabled):
Totals from 33791 (23.10% of 146267) affected shaders:
(no statistics changed)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7871>

3 years agoRevert "radv,aco: don't use MUBUF for multi-channel loads on GFX8 with robustness2"
Rhys Perry [Wed, 20 Jan 2021 16:05:04 +0000 (16:05 +0000)]
Revert "radv,aco: don't use MUBUF for multi-channel loads on GFX8 with robustness2"

This reverts commit a8a6b9fb2fdcb1bea55707fa0c2b8e96f03c6b5b.

This is no longer necessary now that we fixup the size when creating the
descriptors.

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

3 years agoradv,aco: use per-attribute vertex descriptors for robustness
Rhys Perry [Tue, 1 Dec 2020 17:41:16 +0000 (17:41 +0000)]
radv,aco: use per-attribute vertex descriptors for robustness

We have to use a different num_records for each attribute to correctly
implement robust buffer access.

fossil-db (GFX10.3, robustBufferAccess enabled):
Totals from 60059 (41.06% of 146267) affected shaders:
VGPRs: 2169040 -> 2169024 (-0.00%); split: -0.02%, +0.02%
CodeSize: 79473128 -> 81156016 (+2.12%); split: -0.00%, +2.12%
MaxWaves: 1635360 -> 1635258 (-0.01%); split: +0.00%, -0.01%
Instrs: 15559040 -> 15793205 (+1.51%); split: -0.01%, +1.52%
Latency: 90954792 -> 91308768 (+0.39%); split: -0.30%, +0.69%
InvThroughput: 14937873 -> 14958761 (+0.14%); split: -0.04%, +0.18%
VClause: 444280 -> 412074 (-7.25%); split: -9.22%, +1.97%
SClause: 588545 -> 644141 (+9.45%); split: -0.54%, +9.99%
Copies: 1010395 -> 1011232 (+0.08%); split: -0.44%, +0.53%
Branches: 274279 -> 274282 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1431171 -> 1405056 (-1.82%); split: -2.89%, +1.07%
PreVGPRs: 1575253 -> 1575259 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7871>

3 years agoaco: group loads from the same vertex binding into the same clause
Rhys Perry [Mon, 30 Nov 2020 17:53:23 +0000 (17:53 +0000)]
aco: group loads from the same vertex binding into the same clause

In the future, we might have vertex attribute loads from the same binding
but with different descriptors. Since they will be loading from the same
buffer, we should continue grouping them into clauses.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7871>

3 years agoradv: Properly enable Wave32 mode for NGG GS.
Timur Kristóf [Fri, 7 May 2021 11:09:19 +0000 (13:09 +0200)]
radv: Properly enable Wave32 mode for NGG GS.

The condition for enabling it was incorrect, and was always false.
Therefore, it was never really enabled.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10683>

3 years agoradv: Ignore GS copy shader when determining NGG GS wave size.
Timur Kristóf [Fri, 7 May 2021 11:06:08 +0000 (13:06 +0200)]
radv: Ignore GS copy shader when determining NGG GS wave size.

The GS copy shader is not used with NGG GS.
This fixes a big bug when NGG GS is running in Wave32 mode.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10683>

3 years agoci/broadcom: update expected results
Juan A. Suarez Romero [Fri, 7 May 2021 15:32:48 +0000 (17:32 +0200)]
ci/broadcom: update expected results

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10694>

3 years agonir: skip assert check with empty structs
Tapani Pälli [Fri, 7 May 2021 07:33:07 +0000 (10:33 +0300)]
nir: skip assert check with empty structs

Fixes issues with upcoming CTS test testing empty structs.

v2: decorate with UNUSED as only used in assert (Timothy)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10681>

3 years agoagx: Set reads_tib appropriately
Alyssa Rosenzweig [Mon, 10 May 2021 01:05:07 +0000 (21:05 -0400)]
agx: Set reads_tib appropriately

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Implement load_output
Alyssa Rosenzweig [Wed, 5 May 2021 03:00:55 +0000 (23:00 -0400)]
agx: Implement load_output

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Condition writeout ops on already being emitted
Alyssa Rosenzweig [Mon, 10 May 2021 01:01:34 +0000 (21:01 -0400)]
agx: Condition writeout ops on already being emitted

There's a lot of r/e waiting here, but will be needed for ld_tile. Match
the Metal blob.

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

3 years agoagx: Assume lower_fragcolor has been called
Alyssa Rosenzweig [Wed, 5 May 2021 02:55:37 +0000 (22:55 -0400)]
agx: Assume lower_fragcolor has been called

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Add ld_tile opcode
Alyssa Rosenzweig [Wed, 5 May 2021 02:50:25 +0000 (22:50 -0400)]
agx: Add ld_tile opcode

Variant of st_tile.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Rename blend -> st_tile
Alyssa Rosenzweig [Wed, 5 May 2021 02:44:54 +0000 (22:44 -0400)]
agx: Rename blend -> st_tile

For symmetry.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Implement blend constant color sysvals
Alyssa Rosenzweig [Wed, 5 May 2021 02:37:15 +0000 (22:37 -0400)]
agx: Implement blend constant color sysvals

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoagx: Return agx_instr* from emit_intrinsic
Alyssa Rosenzweig [Wed, 5 May 2021 02:42:07 +0000 (22:42 -0400)]
agx: Return agx_instr* from emit_intrinsic

Aesthetically useful.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Pass through "reads tilebuffer?" bit
Alyssa Rosenzweig [Mon, 10 May 2021 01:04:38 +0000 (21:04 -0400)]
asahi: Pass through "reads tilebuffer?" bit

To be determined if there's more to this, but it's the only bit I see
varying with Metal when blending is enabled.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Fix shader key hash function
Alyssa Rosenzweig [Mon, 10 May 2021 00:56:27 +0000 (20:56 -0400)]
asahi: Fix shader key hash function

Fixes: 080b05e29e1 ("asahi: Add Gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Call nir_lower_fragcolor
Alyssa Rosenzweig [Wed, 5 May 2021 02:55:26 +0000 (22:55 -0400)]
asahi: Call nir_lower_fragcolor

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Add blend constant system value
Alyssa Rosenzweig [Wed, 5 May 2021 02:33:35 +0000 (22:33 -0400)]
asahi: Add blend constant system value

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Implement set_blend_color
Alyssa Rosenzweig [Wed, 5 May 2021 02:29:18 +0000 (22:29 -0400)]
asahi: Implement set_blend_color

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Garbage collect bind_state
Alyssa Rosenzweig [Wed, 5 May 2021 02:27:46 +0000 (22:27 -0400)]
asahi: Garbage collect bind_state

From noop.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Call nir_lower_blend with selected key
Alyssa Rosenzweig [Mon, 10 May 2021 00:57:54 +0000 (20:57 -0400)]
asahi: Call nir_lower_blend with selected key

Also need to key to pipe formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Augment Gallium key with blend state
Alyssa Rosenzweig [Wed, 5 May 2021 02:20:39 +0000 (22:20 -0400)]
asahi: Augment Gallium key with blend state

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agoasahi: Translate blend CSO to lower_blend options
Alyssa Rosenzweig [Wed, 5 May 2021 02:20:50 +0000 (22:20 -0400)]
asahi: Translate blend CSO to lower_blend options

We'll just stick this in the key.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10720>

3 years agozink: rework memory_barrier hook again (third time's the charm)
Mike Blumenkrantz [Wed, 7 Apr 2021 15:00:06 +0000 (11:00 -0400)]
zink: rework memory_barrier hook again (third time's the charm)

this improves granularity for the barriers and is more in line with the
spec for glMemoryBarrier

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

3 years agozink: fix texture barriers for real this time
Mike Blumenkrantz [Thu, 8 Apr 2021 16:38:06 +0000 (12:38 -0400)]
zink: fix texture barriers for real this time

according to spec, this is supposed to handle fragment shader fetch
from previous draw output, not color output readback from previous
color output write

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

3 years agozink: break out draw dispatch into separate functions
Mike Blumenkrantz [Mon, 18 Jan 2021 21:00:19 +0000 (16:00 -0500)]
zink: break out draw dispatch into separate functions

this is much easier to read and is going to greatly simplify the eventual
multidraw implementation which will be dropped in

also it allows moving conditionals outside of loops to very slightly improve
drawoverhead performance (with multidraw)

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

3 years agozink: remove compute cruft from resource mapping
Mike Blumenkrantz [Mon, 19 Apr 2021 20:34:56 +0000 (16:34 -0400)]
zink: remove compute cruft from resource mapping

this used to sync the compute batch, now it does nothing

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

3 years agozink: add debug assert to verify that zink_clear_framebuffer() is accurate
Mike Blumenkrantz [Thu, 8 Apr 2021 17:47:12 +0000 (13:47 -0400)]
zink: add debug assert to verify that zink_clear_framebuffer() is accurate

this should never be called for buffers that don't have pending clears

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

3 years agozink: break zs clear loop once both bits are set when beginning renderpass
Mike Blumenkrantz [Thu, 8 Apr 2021 17:42:46 +0000 (13:42 -0400)]
zink: break zs clear loop once both bits are set when beginning renderpass

no point in looping this any more than we have to

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

3 years agozink: handle in-renderpass clears in fb_clears_apply_internal()
Mike Blumenkrantz [Wed, 7 Apr 2021 18:02:54 +0000 (14:02 -0400)]
zink: handle in-renderpass clears in fb_clears_apply_internal()

this isn't used yet, but it may as well be handled in case that changes

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

3 years agozink: only set layer info for samplerviews if there are multiple layers
Mike Blumenkrantz [Fri, 2 Apr 2021 18:51:17 +0000 (14:51 -0400)]
zink: only set layer info for samplerviews if there are multiple layers

fixes a bunch of validation errors

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

3 years agozink: simplify samplerview surface creation
Mike Blumenkrantz [Fri, 2 Apr 2021 18:49:56 +0000 (14:49 -0400)]
zink: simplify samplerview surface creation

instead of manually creating the ivci, there's already a util function for
that which will handle everything

also only set layer info if there are multiple layers

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

3 years agozink: add a target param to create_ivci()
Mike Blumenkrantz [Sat, 3 Apr 2021 14:57:33 +0000 (10:57 -0400)]
zink: add a target param to create_ivci()

allow creating views of different types than the base resource

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

3 years agozink: clamp 3D surface viewtype to 2D only in the create_surface hook
Mike Blumenkrantz [Fri, 2 Apr 2021 18:53:31 +0000 (14:53 -0400)]
zink: clamp 3D surface viewtype to 2D only in the create_surface hook

this is only applicable to things that go through the hook, not for internal
surfaces

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

3 years agozink: make ZINK_INLINE_UNIFORMS more standardized in function
Mike Blumenkrantz [Tue, 29 Dec 2020 18:30:24 +0000 (13:30 -0500)]
zink: make ZINK_INLINE_UNIFORMS more standardized in function

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10696>

3 years agoandroid: nir: add nir_lower_fragcolor.c to Makefile.sources
Mauro Rossi [Sat, 8 May 2021 10:42:10 +0000 (12:42 +0200)]
android: nir: add nir_lower_fragcolor.c to Makefile.sources

Fixes the following building error:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: nir_lower_fragcolor
>>> referenced by pan_assemble.c:81 (external/mesa/src/gallium/drivers/panfrost/pan_assemble.c:81)

Cc: 21.0 21.1 <mesa-stable@lists.freedesktop.org>
Fixes: 1fd356302590 ("nir: add lowering pass for fragcolor -> fragdata")
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10712>

3 years agobroadcom/compiler: change register allocation policy for accumulators
Iago Toral Quiroga [Thu, 6 May 2021 09:32:46 +0000 (11:32 +0200)]
broadcom/compiler: change register allocation policy for accumulators

The current policy is to always favor accumulators if possible, however,
this is not always optimal.

Particularly, accumulators play a crucial role in enabling QPU instruction
merges, since these are limited to both the ADD and the ALU instructions
addressing at most 2 physical registers. For 2-src instructions, this means
that to be able to merge we need them to address at least 2 accumulators.

While favoring accumulators does help the case for instruction merges in
general, it is risky to assign accumulators to variables that have
long life spans. Doing so will make the accumulator unavailable for
any other instructions during that life span, and since we only have a few
accumulators, we can quickly run out and losing our capacity to merge
instructions for large parts of the qpu program.

On the other hand, we also want to avoid the extreme case were we keep
allocating physical registers to the point we run out, even if we have
accumulators available, since accumulators have additional restrictions
and may not be suitable for everything.

This change continues the policy of favoring accumulators, but it only
does so if the life span of the temps is short, to ensure that we can
recycle accumulators often across instructions and avoid running out
for sections of the QPU code, unless we are already running out of
physical registers.

total instructions in shared programs: 13654647 -> 13336921 (-2.33%)
instructions in affected programs: 11015919 -> 10698193 (-2.88%)
helped: 39758
HURT: 17325
Instructions are helped.

total threads in shared programs: 412046 -> 412038 (<.01%)
threads in affected programs: 16 -> 8 (-50.00%)
helped: 0
HURT: 4
Threads are HURT.

total uniforms in shared programs: 3745726 -> 3746003 (<.01%)
uniforms in affected programs: 17296 -> 17573 (1.60%)
helped: 76
HURT: 99
Uniforms are HURT.

total max-temps in shared programs: 2364430 -> 2359942 (-0.19%)
max-temps in affected programs: 109117 -> 104629 (-4.11%)
helped: 2893
HURT: 772
Max-temps are helped.

total spills in shared programs: 5727 -> 5746 (0.33%)
spills in affected programs: 221 -> 240 (8.60%)
helped: 1
HURT: 2

total fills in shared programs: 13121 -> 13139 (0.14%)
fills in affected programs: 466 -> 484 (3.86%)
helped: 1
HURT: 2

total sfu-stalls in shared programs: 33432 -> 34491 (3.17%)
sfu-stalls in affected programs: 18219 -> 19278 (5.81%)
helped: 4459
HURT: 5087
Inconclusive result

total inst-and-stalls in shared programs: 13688079 -> 13371412 (-2.31%)
inst-and-stalls in affected programs: 11030017 -> 10713350 (-2.87%)
helped: 39630
HURT: 17429
Inst-and-stalls are helped.

total nops in shared programs: 335753 -> 333708 (-0.61%)
nops in affected programs: 112659 -> 110614 (-1.82%)
helped: 8726
HURT: 7383
Inconclusive result

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

3 years agolavapipe: Fix lvp_pipeline_compile's nir_xfb_info leak.
Jose Fonseca [Fri, 7 May 2021 10:53:28 +0000 (11:53 +0100)]
lavapipe: Fix lvp_pipeline_compile's nir_xfb_info leak.

v2: Cleanup, as suggested by Mike Blumenkrantz.

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

3 years agolavapipe: Fix lvp_execute_cmds' pipe_stream_output_target leak.
Jose Fonseca [Fri, 7 May 2021 10:48:20 +0000 (11:48 +0100)]
lavapipe: Fix lvp_execute_cmds' pipe_stream_output_target leak.

v2: Unbind SO targets, as suggested by Mike Blumenkrantz.

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

3 years agonv50/ir: Initialize CodeEmitterNV50 member progType.
Vinson Lee [Sat, 1 May 2021 01:24:52 +0000 (18:24 -0700)]
nv50/ir: Initialize CodeEmitterNV50 member progType.

Make progType a constructor argument.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member progType is not initialized
in this constructor nor in any functions that it calls.

Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10562>

3 years agonv50/ir: Initialize BuildUtil member tail.
Vinson Lee [Sat, 1 May 2021 01:03:09 +0000 (18:03 -0700)]
nv50/ir: Initialize BuildUtil member tail.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member tail is not initialized in
this constructor nor in any functions that it calls.

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

3 years agonvc0: Remove unnecessary bsp_bo NULL check.
Vinson Lee [Sat, 1 May 2021 03:52:27 +0000 (20:52 -0700)]
nvc0: Remove unnecessary bsp_bo NULL check.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking bsp_bo suggests that it may be
null, but it has already been dereferenced on all paths leading
to the check.

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

3 years agonv50/ir: Initialize Graph::Node member tag.
Vinson Lee [Sat, 1 May 2021 01:49:59 +0000 (18:49 -0700)]
nv50/ir: Initialize Graph::Node member tag.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member tag is not initialized in
this constructor nor in any functions that it calls.

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

3 years agozink: never use LINEAR for VK_EXT_4444_formats
Mike Blumenkrantz [Wed, 3 Feb 2021 22:27:39 +0000 (17:27 -0500)]
zink: never use LINEAR for VK_EXT_4444_formats

we shouldn't be reading these back, and some drivers lie about what features
are supported in linear tiling anyway

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10702>

3 years agogallium: Remove unused st_visual::render_buffer
Adam Jackson [Thu, 6 May 2021 21:09:23 +0000 (17:09 -0400)]
gallium: Remove unused st_visual::render_buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10675>

3 years agonv50: Fix use of initializers on older compilers
Ernst Sjöstrand [Thu, 6 May 2021 13:22:54 +0000 (15:22 +0200)]
nv50: Fix use of initializers on older compilers

Fixes the following error on Ubuntu 18.04 with GCC 7.

src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:1448:72:
sorry, unimplemented: non-trivial designated initializers not supported
info_out->prop.cp.gmem[gmemSlot++] = {.valid = 1, .slot = i};

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Fixes: f451854f3 ("nv50: add remapping of buffers/images into unified space")
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10668>

3 years agofreedreno/a5xx: SP_BLEND_CNTL has per-mrt blend enable bit
Danylo Piliaiev [Fri, 7 May 2021 10:03:36 +0000 (13:03 +0300)]
freedreno/a5xx: SP_BLEND_CNTL has per-mrt blend enable bit

Blending in SP_BLEND_CNTL is not a binary flag but the same
mask as in RB_BLEND_CNTL. It is a per-mrt enable bit for blending.

Copied form a6xx, on a5xx it should be have the same since it seems
to have the same structure layout.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10682>

3 years agoturnip,freedreno/a6xx: SP_BLEND_CNTL has per-mrt blend enable bit
Danylo Piliaiev [Fri, 7 May 2021 09:45:47 +0000 (12:45 +0300)]
turnip,freedreno/a6xx: SP_BLEND_CNTL has per-mrt blend enable bit

Blending in SP_BLEND_CNTL is not a binary flag but the same
mask as in RB_BLEND_CNTL. It is a per-mrt enable bit for blending.

Example SP_BLEND_CNTL produced by blob on a630 and different MRT
blendings:
  SP_BLEND_CNTL: { UNK8 | 0x6 }
  SP_BLEND_CNTL: { ENABLED | UNK8 | 0xe }
(Decoded before this commit)

Fixes mis-rendering with D3D11 game "Spelunky 2".

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

3 years agolavapipe: fix fsum with swizzle
Erik Faye-Lund [Fri, 7 May 2021 12:04:14 +0000 (14:04 +0200)]
lavapipe: fix fsum with swizzle

We can do stuff like this:

vec1 32 ssa_207 = fsum3 ssa_209.xxx

In this case, we'd end up not swizzling in get_alu_src, and reading
components out-of-bounds, which LLVM isn't very happy about, and thus
takes punitive actions, in the form of a segfault.

We don't want that, and we already know from the opcode what the
component counts should be here.

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

3 years agopan/bi: Add divergent intrinsic lowering pass
Alyssa Rosenzweig [Sat, 3 Apr 2021 20:06:04 +0000 (16:06 -0400)]
pan/bi: Add divergent intrinsic lowering pass

This is undefined behaviour in the hardware but perfectly legal NIR, so
lower to an if ladder predicated on the lane ID (the blob's preferred
strategy).

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

3 years agopan/bi: Add "lanes per warp" accessor
Alyssa Rosenzweig [Fri, 7 May 2021 14:16:50 +0000 (10:16 -0400)]
pan/bi: Add "lanes per warp" accessor

Varies by architecture version.

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

3 years agopan/bi: Map load_subgroup_invocation to FAU
Alyssa Rosenzweig [Thu, 6 May 2021 20:48:31 +0000 (16:48 -0400)]
pan/bi: Map load_subgroup_invocation to FAU

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

3 years agopan/bi: Drop load_sampler_lod_parameters_pan
Alyssa Rosenzweig [Sat, 3 Apr 2021 20:05:32 +0000 (16:05 -0400)]
pan/bi: Drop load_sampler_lod_parameters_pan

Only used for an erratum workaround on Mali T720.

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

3 years agonir/divergence_anlysis: Add intrinsics for Bifrost
Alyssa Rosenzweig [Sat, 3 Apr 2021 20:05:09 +0000 (16:05 -0400)]
nir/divergence_anlysis: Add intrinsics for Bifrost

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10022>

3 years agoradv: fix extending the dirty bits to 64-bit
Samuel Pitoiset [Fri, 7 May 2021 16:07:12 +0000 (18:07 +0200)]
radv: fix extending the dirty bits to 64-bit

New dynamic states added for VK_EXT_extended_dynamic_state2 causes
GPU hangs with vkd3d-proton.

Fixes: 7bdd569d7e1 ("radv: extend the dirty bits to 64-bit")
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/10693>

3 years agopanfrost: Use common blend lowering
Alyssa Rosenzweig [Fri, 23 Apr 2021 13:42:02 +0000 (09:42 -0400)]
panfrost: Use common blend lowering

Contains a number of bugfixes.

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

3 years agonir: Add blend lowering pass
Alyssa Rosenzweig [Tue, 4 May 2021 18:11:12 +0000 (14:11 -0400)]
nir: Add blend lowering pass

This pass was originally developed for Panfrost, where it passes the
relevant dEQP tests. Upstreaming so it can be extended and then shared
with:

* Asahi, for blending
* Zink, for logic ops
* Lavapipe, for advanced blending

Note that using this with MRT in a fragment shader (as non-panfrost
drivers will) has not yet been tested. Logic ops with integer
framebuffers are probably todo. It's been enough for Panfrost, will
suffice for ES2 on Asahi, and provides an upstream base for kusma's work
on advanced blending, so overall the merge is a net benefit.

v2: Remove bogus assert that the format layout is PLAIN. We need to
render R11G11B10, which Mesa reports as layout OTHER. The code is still
correct.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10601>

3 years agopan/lower_framebuffer: Fix bitsize mismatch
Alyssa Rosenzweig [Fri, 7 May 2021 16:23:34 +0000 (12:23 -0400)]
pan/lower_framebuffer: Fix bitsize mismatch

No idea why this never manifested before.

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

3 years agozink: add a pipe_context::clear_buffer hook
Mike Blumenkrantz [Thu, 6 May 2021 14:44:21 +0000 (10:44 -0400)]
zink: add a pipe_context::clear_buffer hook

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

3 years agomesa: add an extension MESA_bgra
Gert Wollny [Tue, 4 May 2021 08:59:31 +0000 (10:59 +0200)]
mesa: add an extension MESA_bgra

This GLES extension allows to combine the formats BGR and BGRA
as host-side formatsto be combined with the  internal formats
RGB8/SRGB8 and RGBA8/SRGB8_ALPHA8 respectively.

This extension is of interest to support a subset of OpenGL in
virtualized environments where the host only supports GLES.

Initial mesa/glformat.c patch: rohan.garg@collabora.com

v2: - Correct names for ClearTexture calls
    - Add BGR(A)_EXT tokens
    - Add format check for BGR_EXT
      (All Adam Jackson)

v3: Fix ordering in extension table (Marge)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com> (v2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10613>

3 years agopanfrost: Use pan_blit() when PAN_MESA_DEBUG=panblit
Boris Brezillon [Wed, 28 Apr 2021 10:51:13 +0000 (12:51 +0200)]
panfrost: Use pan_blit() when PAN_MESA_DEBUG=panblit

Hook-up support for native blits. We keep using u_blitter by default
for now.

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

3 years agopanfrost: Extend pan_blitter to support blit/resolve operations
Boris Brezillon [Wed, 28 Apr 2021 10:49:15 +0000 (12:49 +0200)]
panfrost: Extend pan_blitter to support blit/resolve operations

Right now the lib is just used for TB preloads. Let's make it generic
to support actual blits.

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

3 years agopanfrost: Stop assuming the viewport will always cover the framebuffer
Boris Brezillon [Fri, 30 Apr 2021 13:24:01 +0000 (15:24 +0200)]
panfrost: Stop assuming the viewport will always cover the framebuffer

That's not necessarily true for actual blits, so let's pass the min/max
coords to pan_blitter_emit_viewport().

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

3 years agopanfrost: Don't select the blit shader fragout type twice
Boris Brezillon [Fri, 30 Apr 2021 13:17:50 +0000 (15:17 +0200)]
panfrost: Don't select the blit shader fragout type twice

The type has already been selected when forging the key, no need to do
it again pan_blitter_emit_bifrost_blend().

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

3 years agopanfrost: Shrink the number of args passed to prepare_{bifrost,midgard}_rsd()
Boris Brezillon [Fri, 30 Apr 2021 13:15:42 +0000 (15:15 +0200)]
panfrost: Shrink the number of args passed to prepare_{bifrost,midgard}_rsd()

There's clearly no need to pass RTs/ZS views around, pass only what we
really need.

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

3 years agopanfrost: Rename pan_preload_emit_varying()
Boris Brezillon [Wed, 28 Apr 2021 11:31:44 +0000 (13:31 +0200)]
panfrost: Rename pan_preload_emit_varying()

This function will be used for blits too.

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

3 years agopanfrost: Make pan_preload_emit_viewport() applicable to blits
Boris Brezillon [Wed, 28 Apr 2021 11:23:39 +0000 (13:23 +0200)]
panfrost: Make pan_preload_emit_viewport() applicable to blits

We will emit one viewport and attach it to several DCDs for multi-layer
blits. Make that possible by adjusting the prototype and rename the
function along the way.

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

3 years agopanfrost: Make pan_preload_emit_*_textures() applicable to blits
Boris Brezillon [Wed, 28 Apr 2021 11:12:10 +0000 (13:12 +0200)]
panfrost: Make pan_preload_emit_*_textures() applicable to blits

The texture descriptors will be emitted once and re-used in several
DCDs when blitting more than one layer. Rename the functions and make
them return a GPU pointer instead of filling the DCD directly.

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

3 years agopanfrost: Stop assigning ->position in pan_preload_emit_varying()
Boris Brezillon [Wed, 28 Apr 2021 11:09:10 +0000 (13:09 +0200)]
panfrost: Stop assigning ->position in pan_preload_emit_varying()

It doesn't make sense to have it done in pan_preload_emit_varying().

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

3 years agopanfrost: Make pan_preload_emit_*_sampler() applicable to blits
Boris Brezillon [Wed, 28 Apr 2021 11:06:37 +0000 (13:06 +0200)]
panfrost: Make pan_preload_emit_*_sampler() applicable to blits

The sampler descriptors will be emitted once and re-used in
several DCDs for the multi-layer blit case. We will also need
to select the filter. Let's adjust the pan_preload_emit_*_sampler()
functions to support that and rename them along the way.

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

3 years agopanfrost: Get rid of the vertex_count arg in pan_preload_emit_varying()
Boris Brezillon [Wed, 28 Apr 2021 10:52:57 +0000 (12:52 +0200)]
panfrost: Get rid of the vertex_count arg in pan_preload_emit_varying()

We always pass 4 anyway.

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

3 years agopanfrost: Pack pan_blit_surface fields
Boris Brezillon [Wed, 28 Apr 2021 10:37:06 +0000 (12:37 +0200)]
panfrost: Pack pan_blit_surface fields

It should speed up a bit hash calculation and allow us to add extra
info without changing the structure size.

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

3 years agopanfrost: Fix blit shader names
Boris Brezillon [Wed, 28 Apr 2021 10:34:10 +0000 (12:34 +0200)]
panfrost: Fix blit shader names

first should be initialized to true if we want to get rid of the leading
';' in the shader name.

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

3 years agopanfrost: Pass an image view to panfrost_estimate_texture_payload_size()
Boris Brezillon [Wed, 28 Apr 2021 10:32:12 +0000 (12:32 +0200)]
panfrost: Pass an image view to panfrost_estimate_texture_payload_size()

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

3 years agogallium/tools: add option to use Meld for diffing
Matti Hamalainen [Thu, 22 Apr 2021 11:05:46 +0000 (14:05 +0300)]
gallium/tools: add option to use Meld for diffing

Add option -m/--meld to tracediff.sh to use Meld
<https://meldmerge.org/> instead of sdiff for comparing
traces.

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

3 years agogallium/tools: improve pointer type tracking in parse.py
Matti Hamalainen [Thu, 22 Apr 2021 09:49:58 +0000 (12:49 +0300)]
gallium/tools: improve pointer type tracking in parse.py

In our simplistic model of assigning types to pointer, we treat
return values specially because their "type" can't be known
easily before their first use. Improve the "ret" handling by
removing one from their count when we reassign the type to
something else.

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

3 years agogallium/tools: implement "high-level" overview mode option in dump scripts
Matti Hamalainen [Wed, 21 Apr 2021 14:12:26 +0000 (17:12 +0300)]
gallium/tools: implement "high-level" overview mode option in dump scripts

As per the suggestion in #4609, implement mode/option -M/--method-only
which only prints call method names, for quick overview of what is
happening in the trace. The same option can be used with both
dump.py and tracediff.sh.

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

3 years agogallium/tools: improve tracediff.sh argument handling
Matti Hamalainen [Wed, 21 Apr 2021 10:23:57 +0000 (13:23 +0300)]
gallium/tools: improve tracediff.sh argument handling

Implement better argument parsing/handling in tracediff.sh
so that the options passed to dump.py and sdiff are not required
to be positional.

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

3 years agogallium/tools: use left-column output mode of sdiff in tracediff.sh
Matti Hamalainen [Tue, 20 Apr 2021 12:35:54 +0000 (15:35 +0300)]
gallium/tools: use left-column output mode of sdiff in tracediff.sh

Enabling --left-column option for sdiff inside tracediff.sh we
get output that only shows the differing lines on the right column.

This, when used with the -N/--named option should make many
trace diffs more understandable.

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

3 years agogallium/tools: implement 'named' pointers option in dump.py
Matti Hamalainen [Tue, 20 Apr 2021 12:32:20 +0000 (15:32 +0300)]
gallium/tools: implement 'named' pointers option in dump.py

As suggested by zmike in issue #4609, raw pointer values in
are problematic for diffing state dumps. In attempt to remedy
this, we implement an option --named/-N in dump.py that
generates symbolic names for all pointers based on the context.

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

3 years agogallium/tools: implement better suppression of variants
Matti Hamalainen [Tue, 20 Apr 2021 12:24:42 +0000 (15:24 +0300)]
gallium/tools: implement better suppression of variants

Previously some variants (such as execution time and call number
were suppressed in tracediff.sh via a sed script. It makes sense
to implement an option to leave out such variants to begin with
in dump.py, so let's do so and use it.

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

3 years agogallium/tools: improve option handling in dump_state.py
Matti Hamalainen [Tue, 20 Apr 2021 12:15:59 +0000 (15:15 +0300)]
gallium/tools: improve option handling in dump_state.py

Previously we inherited some options from parse.py, but
that made no sense for some of the options that are not
needed for dump_state.py (such as --plain, as we output
only JSON format text.)

So, remove the inherit and implement filename argument
here independantly.

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

3 years agogallium/tools: clean up tracediff.sh a bit
Matti Hamalainen [Tue, 20 Apr 2021 12:10:48 +0000 (15:10 +0300)]
gallium/tools: clean up tracediff.sh a bit

Clean up tracediff.sh shellscript slightly, partially in preparation
for upcoming changes. Also add a signal handler for removing the
created temporary directory and files if we are interrupted.

Also, use the new --plain option of dump.py to suppress output
of ANSI color/formatting codes, so we do not have to post-filter
them later.

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

3 years agopps: Documentation
Antonio Caggiano [Mon, 22 Mar 2021 15:37:27 +0000 (16:37 +0100)]
pps: Documentation

Add documentation for Perfetto and Gfx-pps, together with some perfetto
config files to use as a starting point.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9652>

3 years agopps: Gfx-pps config tool
Antonio Caggiano [Tue, 30 Mar 2021 16:03:33 +0000 (18:03 +0200)]
pps: Gfx-pps config tool

Add helpful tool to query pps capabilites such as supported devices,
counters and counter groups, and to dump counter values to stdout.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9652>