platform/upstream/mesa.git
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>

3 years agopps: Gfx-pps v0.3.0
Antonio Caggiano [Thu, 18 Mar 2021 17:30:45 +0000 (18:30 +0100)]
pps: Gfx-pps v0.3.0

Add the gfx-pps backbone in `src/pps`.

v2: Simplify supported drivers creation.
v3: No default getter is provided for counters.
v4: Open DRM device in read/write mode.
v5: Wait for datasource to be started.
v6: Set FIFO scheduler while sampling counters.

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>

3 years agoutil: Perfetto SDK v15.0
Antonio Caggiano [Mon, 15 Mar 2021 15:07:39 +0000 (16:07 +0100)]
util: Perfetto SDK v15.0

Add Perfetto SDK v15.0 as a dependency using a meson wrap.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@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>

3 years agoutil/hash_table: _mesa_hash_table_create_u32_keys()
Mike Blumenkrantz [Sat, 1 May 2021 19:08:31 +0000 (15:08 -0400)]
util/hash_table: _mesa_hash_table_create_u32_keys()

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

3 years agov3d: re-enable GLSL loop unrolling
Iago Toral Quiroga [Fri, 7 May 2021 10:32:40 +0000 (12:32 +0200)]
v3d: re-enable GLSL loop unrolling

Disabling it that made us start to fail register allocation for a
few tests. Re-enable it until we figure out what is causing that.

Fixes: ca9e0871fb294 ('v3d: enable NIR loop unrolling')

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

3 years agor600/sfn: lower to scalar with filter applied
Gert Wollny [Wed, 31 Mar 2021 08:55:57 +0000 (10:55 +0200)]
r600/sfn: lower to scalar with filter applied

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>

3 years agogallium: pass lower_to_scalar_filter to lower_to_scalar pass
Gert Wollny [Wed, 31 Mar 2021 08:55:18 +0000 (10:55 +0200)]
gallium: pass lower_to_scalar_filter to lower_to_scalar pass

v2: Fix the callback name

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>

3 years agonir: Add filter callback for lower_to_scalar to the options
Gert Wollny [Wed, 31 Mar 2021 08:54:47 +0000 (10:54 +0200)]
nir: Add filter callback for lower_to_scalar to the options

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9943>

3 years agogallivm: handle texture arrays in non-fragment shaders with lod.
Dave Airlie [Fri, 7 May 2021 01:26:35 +0000 (11:26 +1000)]
gallivm: handle texture arrays in non-fragment shaders with lod.

We have to unwind the lod into the scalar path correctly.

Fixes a crash with renderdoc demo

Fixes: e168d148d76d ("gallivm/nir: handle non-uniform texture offsets")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10676>

3 years agozink: start using dynamic front face state
Mike Blumenkrantz [Tue, 2 Mar 2021 16:21:58 +0000 (11:21 -0500)]
zink: start using dynamic front face state

this doesn't actually do anything other than test the codepath since
the hashed pipeline state will still change on every frontface change,
but it's a start

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

3 years agozink: hook up dynamic dsa states
Mike Blumenkrantz [Tue, 2 Mar 2021 16:20:39 +0000 (11:20 -0500)]
zink: hook up dynamic dsa states

this is pretty straightforward, just adding some extra calls

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

3 years agozink: return current pipeline object if state hasn't changed
Mike Blumenkrantz [Tue, 19 Jan 2021 16:43:03 +0000 (11:43 -0500)]
zink: return current pipeline object if state hasn't changed

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

3 years agozink: flag pipeline for change more often when vbos change without dynamic state
Mike Blumenkrantz [Thu, 1 Apr 2021 20:36:01 +0000 (16:36 -0400)]
zink: flag pipeline for change more often when vbos change without dynamic state

this is always going to be bad for perf, but we still need to force updates anytime
we know for sure they'll be needed

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

3 years agozink: split vertex state pipeline hashing into its own value
Mike Blumenkrantz [Thu, 1 Apr 2021 20:52:27 +0000 (16:52 -0400)]
zink: split vertex state pipeline hashing into its own value

by creating a separate hash value for vertex state, changes to the vbos and
bindings requires massively less overhead as it doesn't require the rest of
the pipeline state to be rehashed

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

3 years agozink: move more vertex state stuff into the hw state
Mike Blumenkrantz [Thu, 1 Apr 2021 20:50:45 +0000 (16:50 -0400)]
zink: move more vertex state stuff into the hw state

this simplifies a lot of the hashing since only the vertex state pointer
needs to be hashed

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

3 years agozink: check descriptor layout support before creating it
Mike Blumenkrantz [Fri, 8 Jan 2021 12:59:51 +0000 (07:59 -0500)]
zink: check descriptor layout support before creating it

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

3 years agozink: use explicit types during descriptor updates
Mike Blumenkrantz [Fri, 1 Jan 2021 17:11:39 +0000 (12:11 -0500)]
zink: use explicit types during descriptor updates

less derefs

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

3 years agozink: abstract descriptor pool usage for programs
Mike Blumenkrantz [Fri, 1 Jan 2021 16:20:43 +0000 (11:20 -0500)]
zink: abstract descriptor pool usage for programs

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

3 years agozink: abstract descriptor usage for programs
Mike Blumenkrantz [Fri, 1 Jan 2021 16:06:25 +0000 (11:06 -0500)]
zink: abstract descriptor usage for programs

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

3 years agozink: abstract descriptor init
Mike Blumenkrantz [Fri, 1 Jan 2021 15:57:30 +0000 (10:57 -0500)]
zink: abstract descriptor init

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

3 years agozink: unify pipeline layout creation functions
Mike Blumenkrantz [Thu, 31 Dec 2020 15:38:09 +0000 (10:38 -0500)]
zink: unify pipeline layout creation functions

these codepaths are almost identical

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

3 years agozink: split off descriptor layout from descriptor pools
Mike Blumenkrantz [Tue, 5 Jan 2021 19:36:22 +0000 (14:36 -0500)]
zink: split off descriptor layout from descriptor pools

in theory we could have multiple pools per layout, but really it just makes
more sense to make the layouts persistent since they're more likely to be
reused

32bit compile fixes by Witold Baryluk

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

3 years agopanfrost: Enable 16-bit support on Bifrost
Alyssa Rosenzweig [Fri, 9 Apr 2021 19:44:34 +0000 (15:44 -0400)]
panfrost: Enable 16-bit support on Bifrost

Remove the PAN_MESA_DEBUG=fp16 flag that was hiding it.

Skip two buggy dEQP tests. See linked discussion. We'll need to make
sure this gets sorted out before submitting conformance, but I don't see
a test with a fix in the pipeline as valid reason to hold back valid
code.

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

3 years agopan/bi: Enable mediump BLEND lowering
Alyssa Rosenzweig [Tue, 4 May 2021 20:05:38 +0000 (16:05 -0400)]
pan/bi: Enable mediump BLEND lowering

Other lowerings will wait until we iron out various missing features.

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

3 years agopan/bi: Garbage collect bifrost_nir.h
Alyssa Rosenzweig [Tue, 4 May 2021 19:52:08 +0000 (15:52 -0400)]
pan/bi: Garbage collect bifrost_nir.h

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

3 years agopan/bi: Copyprop constants
Alyssa Rosenzweig [Tue, 13 Apr 2021 22:54:31 +0000 (18:54 -0400)]
pan/bi: Copyprop constants

Needed for constant folding to be effective. But don't copyprop into
instructions already reading from FAU, that will just end up adding more
moves!

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

3 years agopan/bi: Fix int<-->float size converts
Alyssa Rosenzweig [Tue, 13 Apr 2021 17:22:18 +0000 (13:22 -0400)]
pan/bi: Fix int<-->float size converts

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

3 years agopan/bi: Enable NIR vectorization
Alyssa Rosenzweig [Thu, 31 Dec 2020 20:00:24 +0000 (15:00 -0500)]
pan/bi: Enable NIR vectorization

We don't vectorize transcendentals, since those are scalar only in
hardware. Also don't vectorize a few places where impedance mismatches
between NIR and the hardware make handling vectors infeasible for now.

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

3 years agopan/bi: Temporarily switch back to 0/~0 bools
Alyssa Rosenzweig [Thu, 6 May 2021 22:43:00 +0000 (18:43 -0400)]
pan/bi: Temporarily switch back to 0/~0 bools

Keeps things simpler while debugging vectorization woes.

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

3 years agopan/bi: Handle make_vec with 1-bit bools
Alyssa Rosenzweig [Thu, 6 May 2021 21:57:17 +0000 (17:57 -0400)]
pan/bi: Handle make_vec with 1-bit bools

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

3 years agopan/bi: Adapt branching for 1-bit bools
Alyssa Rosenzweig [Wed, 5 May 2021 16:51:30 +0000 (12:51 -0400)]
pan/bi: Adapt branching for 1-bit bools

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

3 years agopan/bi: Change swizzled scalars to identity
Alyssa Rosenzweig [Tue, 4 May 2021 16:01:06 +0000 (12:01 -0400)]
pan/bi: Change swizzled scalars to identity

Allows packing for things like IADD.v2s16

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

3 years agopanfrost: Fix typo handling blend types
Alyssa Rosenzweig [Wed, 5 May 2021 15:27:32 +0000 (11:27 -0400)]
panfrost: Fix typo handling blend types

This was right in my head.

Fixes: 93a176b6cff ("panfrost: Key blend shaders to the input types")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9239>

3 years agopan/mdg: Model blend shader interference
Alyssa Rosenzweig [Thu, 6 May 2021 23:16:33 +0000 (19:16 -0400)]
pan/mdg: Model blend shader interference

Backport of 4439757db23 ("pan/bi: Use the interference mechanism
to describe blend shader reg use") to Midgard.

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

3 years agomesa: s/malloc/calloc/ to silence a warning
Adam Jackson [Thu, 6 May 2021 17:26:10 +0000 (13:26 -0400)]
mesa: s/malloc/calloc/ to silence a warning

gcc 11 warns:

[846/1506] Compiling C object src/mesa/libmesa_common.a.p/main_shaderapi.c.o
In function ‘shader_source’,
    inlined from ‘_mesa_ShaderSource_no_error’ at ../src/mesa/main/shaderapi.c:2137:4:
../src/mesa/main/shaderapi.c:2095:25: warning: ‘*offsets_10 + _130’ may be used uninitialized [-Wmaybe-uninitialized]
 2095 |    totalLength = offsets[count - 1] + 2;

I can't really see how it's getting to that conclusion, but allocating
`offsets` with calloc is both natural to do here and guarantees
initialization.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10671>

3 years agoformat/fxt1: Clean up fxt1_variance's argument list
Adam Jackson [Thu, 6 May 2021 16:04:33 +0000 (12:04 -0400)]
format/fxt1: Clean up fxt1_variance's argument list

gcc 11 warns:

../src/util/format/u_format_fxt1.c:940:22: warning: ‘fxt1_variance.constprop’ accessing 128 bytes in a region of size 64 [-Wstringop-overflow=]
  940 |    int32_t maxVarR = fxt1_variance(NULL, &input[N_TEXELS / 2], n_comp);

But, suspiciously, if you inline fxt1_variance the warning goes away.
What's happening is that the 2nd arg is uint8_t[N_TEXELS][MAX_COMP], so
it looks like we're passing too small of an array in since gcc knows
that `input` is also [N_TEXELS][MAX_COMP]. Fair enough. Fix the
signature to reflect what's actually going on, and remove some unused
arguments while we're at it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10671>

3 years agoradv: advertise VK_EXT_extended_dynamic_state2
Samuel Pitoiset [Mon, 15 Mar 2021 17:56:02 +0000 (18:56 +0100)]
radv: advertise VK_EXT_extended_dynamic_state2

This only implements dynamic primitive restart enable, depth bias
enable and rasterizer discard enable. I leave logic op and patch
control points for later.

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

3 years agoradv: implement dynamic rasterizer discard enable
Samuel Pitoiset [Mon, 15 Mar 2021 18:38:50 +0000 (19:38 +0100)]
radv: implement dynamic rasterizer discard enable

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

3 years agoradv: implement dynamic primitive restart enable
Samuel Pitoiset [Mon, 15 Mar 2021 17:51:28 +0000 (18:51 +0100)]
radv: implement dynamic primitive restart enable

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

3 years agoradv: implement dynamic depth bias enable
Samuel Pitoiset [Mon, 15 Mar 2021 17:29:44 +0000 (18:29 +0100)]
radv: implement dynamic depth bias enable

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