platform/upstream/mesa.git
3 years agoradv: Refactor some nir_channels usage to use nir_channel.
Bas Nieuwenhuizen [Mon, 26 Jul 2021 09:01:38 +0000 (11:01 +0200)]
radv: Refactor some nir_channels usage to use nir_channel.

cleanup, nir_channels wasn't needed as these were only accessing a
single channel.

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

3 years agoaco: Implement call scope.
Bas Nieuwenhuizen [Mon, 26 Jul 2021 10:05:38 +0000 (12:05 +0200)]
aco: Implement call scope.

Since we do no repacking yet, just use invocation.

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

3 years agoradv: Modify load_sbt_amd intrinsic to get the descriptor.
Bas Nieuwenhuizen [Mon, 19 Jul 2021 23:21:11 +0000 (01:21 +0200)]
radv: Modify load_sbt_amd intrinsic to get the descriptor.

That way we can get the address to the entry, which is needed for
some nir builtins because extra data in the entry can be used as
shader input.

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

3 years agoradv: Add bvh node definitions to a header.
Bas Nieuwenhuizen [Wed, 11 Aug 2021 00:24:01 +0000 (02:24 +0200)]
radv: Add bvh node definitions to a header.

So that we can avoid some magic numbers in the pipeline creation.

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

3 years agoradv: Add optimized CPU BVH builds.
Bas Nieuwenhuizen [Sun, 1 Aug 2021 12:47:20 +0000 (14:47 +0200)]
radv: Add optimized CPU BVH builds.

This trivial sorting helps speed up bad cases (like in CTS significantly).

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

3 years agoradv: Add more acceleration structure formats.
Bas Nieuwenhuizen [Sat, 31 Jul 2021 01:43:52 +0000 (03:43 +0200)]
radv: Add more acceleration structure formats.

These are required ...

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

3 years agoradv: Add accel struct build support for the object-to-world matrix.
Bas Nieuwenhuizen [Wed, 28 Jul 2021 01:04:18 +0000 (03:04 +0200)]
radv: Add accel struct build support for the object-to-world matrix.

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

3 years agoradv: Fix arrayOfPointers for instances in accel struct build.
Bas Nieuwenhuizen [Sat, 24 Jul 2021 12:07:17 +0000 (14:07 +0200)]
radv: Fix arrayOfPointers for instances in accel struct build.

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

3 years agoradv: Fix CPU AABB build.
Bas Nieuwenhuizen [Thu, 24 Jun 2021 23:23:12 +0000 (01:23 +0200)]
radv: Fix CPU AABB build.

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

3 years agomeson: introduce option vmware-mks-stats controlling the instrumentations of gallium...
Martin Krastev [Tue, 30 Mar 2021 15:56:47 +0000 (18:56 +0300)]
meson: introduce option vmware-mks-stats controlling the instrumentations of gallium svga driver

The new boolean option controls the instrumentations of gallium svga driver for mksGuestStats.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit 57760b7fe4eeb80acc8d6cd8bf6ec609a11a11dc)
(cherry picked from commit 12aed00f08bd95afd605cab34c833e81a4957dbd)

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

3 years agosvga: enable DRM mks-stats via hooking to the corresponding DRM ioctls
Martin Krastev [Sun, 31 Jan 2021 13:34:36 +0000 (15:34 +0200)]
svga: enable DRM mks-stats via hooking to the corresponding DRM ioctls

SVGA DRM stat calls were situated but did not actually register with the mks-stats
mechanism due to absence of corresponding ioctls. The employed new ioctls in vmwgfx
are DRM_VMW_MKSSTAT_ADD and DRM_VMW_MKSSTAT_REMOVE, subject to version check.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit be47c077cc927c27a8c36342b47697aa81719677)
(cherry picked from commit 0388afc67b830f6ab916d0839c33eb1d91d6353f)

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

3 years agobuild: fix nine compilation with only zink enabled as a gallium driver
Mike Blumenkrantz [Mon, 20 Sep 2021 18:59:38 +0000 (14:59 -0400)]
build: fix nine compilation with only zink enabled as a gallium driver

fixes #5360

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12943>

3 years agozink: fix regex syntax from previous ci commit
Mike Blumenkrantz [Mon, 20 Sep 2021 22:31:31 +0000 (18:31 -0400)]
zink: fix regex syntax from previous ci commit

argh

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

3 years agozink: disable miplevel tests in ci completely for now
Mike Blumenkrantz [Mon, 20 Sep 2021 22:00:49 +0000 (18:00 -0400)]
zink: disable miplevel tests in ci completely for now

I still can't repro, and I'm running these regularly on multiple platforms,
so they're not going to get any worse for the time being

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

3 years agoetnaviv: add mov for direct depth store output from load input
Philipp Zabel [Wed, 15 Sep 2021 16:19:02 +0000 (18:19 +0200)]
etnaviv: add mov for direct depth store output from load input

If the fragment shader writes fragment depth from an ALU instruction,
the register allocator makes sure that the instruction is pointed to the
correct register and write mask (t0.__z_).
If there is no instruction emitted because the source is an input
load intrinsic, or if the source instruction does not support swizzle
and write mask, we have to add a mov instruction for this to work.

Fixes piglit test spec@glsl-1.10@execution@glsl-1.10-fragdepth.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12891>

3 years agonir_to_tgsi: Remove the abs on fcsel's bool src.
Emma Anholt [Sat, 18 Sep 2021 02:50:12 +0000 (19:50 -0700)]
nir_to_tgsi: Remove the abs on fcsel's bool src.

While the nir fcsel opcode specifies src0 != 0.0, as the comment says,
it's only ever used on bools-as-floats, so we know that src0 is
non-negative.  This saves an instruction per CMP on i915.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12921>

3 years agoci/freedreno: Update restricted trace sha1s.
Emma Anholt [Mon, 20 Sep 2021 17:46:45 +0000 (10:46 -0700)]
ci/freedreno: Update restricted trace sha1s.

Rendering changed slightly recently, but the diffs look fine.

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

3 years agoci/baremetal: Retry if our network device spontaneously fails.
Emma Anholt [Mon, 20 Sep 2021 17:07:40 +0000 (10:07 -0700)]
ci/baremetal: Retry if our network device spontaneously fails.

Seen in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/13824132.  It's
unlikely that graphics would kill the network, so just assume it's not our
fault and keep going.

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

3 years agoci/freedreno: Add some cubearray piglit flakes on a630 I noticed.
Emma Anholt [Mon, 20 Sep 2021 17:04:08 +0000 (10:04 -0700)]
ci/freedreno: Add some cubearray piglit flakes on a630 I noticed.

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

3 years agofreedreno: Assert to check for the previous regression.
Emma Anholt [Mon, 20 Sep 2021 18:13:44 +0000 (11:13 -0700)]
freedreno: Assert to check for the previous regression.

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

3 years agofreedreno: Fix autotune regression since batch-cache rework.
Emma Anholt [Mon, 20 Sep 2021 18:11:30 +0000 (11:11 -0700)]
freedreno: Fix autotune regression since batch-cache rework.

I freed the key that autotune needed a little early.

Fixes: b2349a46715e ("freedreno: Move the batch cache to the context.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12942>

3 years agoturnip: Fix a6xx gen4 compute shaders
Rob Clark [Tue, 14 Sep 2021 17:06:06 +0000 (10:06 -0700)]
turnip: Fix a6xx gen4 compute shaders

Port of 74d10525374 freedreno/a6xx: ("Fix a6xx gen4 compute shaders")

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

3 years agoturnip: Rast updates for a6xx gen4
Rob Clark [Tue, 14 Sep 2021 16:11:38 +0000 (09:11 -0700)]
turnip: Rast updates for a6xx gen4

Port of 219e12b7f39 ("freedreno/a6xx: Rast updates for a6xx gen3")

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

3 years agoturnip: Fix unitialized cs->device
Rob Clark [Tue, 14 Sep 2021 18:16:59 +0000 (11:16 -0700)]
turnip: Fix unitialized cs->device

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

3 years agofreedreno: Add info->a6xx.has_shading_rate
Rob Clark [Tue, 14 Sep 2021 18:29:00 +0000 (11:29 -0700)]
freedreno: Add info->a6xx.has_shading_rate

@flto noticed these registers seem to be related to GL_QCOM_shading_rate

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

3 years agoturnip: consider multiview_mask when clearing depth-stencil attachment
Danylo Piliaiev [Fri, 17 Sep 2021 14:06:41 +0000 (17:06 +0300)]
turnip: consider multiview_mask when clearing depth-stencil attachment

Otherwise only first layer is being cleared.

Would fix several VK_EXT_multi_draw tests:
 dEQP-VK.draw.multi_draw.overlapping.normal.max_draws.*.vert_only.multiview.no_offset

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

3 years agonir: Exclude non-generic patch variables from get_variable_io_mask.
Timur Kristóf [Fri, 3 Sep 2021 11:05:47 +0000 (13:05 +0200)]
nir: Exclude non-generic patch variables from get_variable_io_mask.

These are I/O variables which are not going to be removed anyway.
However, get_variable_io_mask handles their location incorrectly.

Found using the GCC undefined behavior sanitizer.
Fixes the following error:

runtime error:
shift exponent 4294967258 is too large
for 64-bit type 'long unsigned int'

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

3 years agoac/nir: Fix match_mask to work correctly for VS outputs.
Timur Kristóf [Fri, 3 Sep 2021 10:21:47 +0000 (12:21 +0200)]
ac/nir: Fix match_mask to work correctly for VS outputs.

match_mask checks the intrinsic type and decides whether it's
per-patch or not. VS don't have per-patch outputs,
so this causes wrong behaviour there.

Found using the GCC undefined behavior sanitizer.
Fixes the following error:

runtime error:
shift exponent 18446744073709551584 is too large
for 64-bit type 'long unsigned int'

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

3 years agomesa/st: Allow loops in GLSL when NIR is enabled, even if the HW can't.
Emma Anholt [Fri, 17 Sep 2021 17:50:32 +0000 (10:50 -0700)]
mesa/st: Allow loops in GLSL when NIR is enabled, even if the HW can't.

The jump lowering enabled by EmitNoLoops breaks GLSL's loop unrolling on
various obviously unrollable loops, resulting in a lot of deqp-gles2 and
piglit failures.  NIR will help unroll whatever GLSL doesn't, so we can
trust the driver to apply that after GLSL's unrolling, so no need to ask
GLSL to lower all loops.

Fixes: #4979
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12917>

3 years agoci/i915g: Clarify failure happening in fbo-fragcoord2.
Emma Anholt [Fri, 17 Sep 2021 00:13:48 +0000 (17:13 -0700)]
ci/i915g: Clarify failure happening in fbo-fragcoord2.

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

3 years agoetnaviv: fix dirty bit check for baselod emission
Philipp Zabel [Thu, 16 Sep 2021 16:33:51 +0000 (18:33 +0200)]
etnaviv: fix dirty bit check for baselod emission

Since baselod is stored in sampler state, not sampler view, we should
check the ETNA_DIRTY_SAMPLERS bit instead of ETNA_DIRTY_SAMPLER_VIEWS.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12916>

3 years agoX11: Ensure that VK_SUBOPTIMAL_KHR propagates to user code
Zachary Michaels [Wed, 8 Sep 2021 23:34:17 +0000 (16:34 -0700)]
X11: Ensure that VK_SUBOPTIMAL_KHR propagates to user code

Commit 0245b825 switched from returning the error code VK_ERROR_OUT_OF_DATE_KHR
to returning the success code VK_SUBOPTIMAL_KHR. Prior to that commit, the error
code caused all code paths to fail immediately, but the success code does not.

Currently the success code is not recorded in some scenarios, resulting in a
result of VK_SUCCESS instead. This breaks applications that rely on the
result (per the spec) to trigger resizes.

This commit ensures that the proper VK_SUBOPTIMAL_KHR success code is set as a
sticky status (as comments indicate was intended), ensuring that it is
propagated to user code.

Fixes #5331

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12782>

3 years agoradv: keep depth/stencil images compressed for TRANSFER_DST on compute
Samuel Pitoiset [Wed, 18 Aug 2021 15:25:22 +0000 (17:25 +0200)]
radv: keep depth/stencil images compressed for TRANSFER_DST on compute

Only if the image is TC-compat HTILE because it can be decompressed
on compute for partial copies.

This should remove few depth/stencil decompressions for RAGE2 and Red
Dead Redemption 2 because they declare all images as concurrent but
never use the compute queue for them.

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

3 years agoradv: add support for copying compressed depth/stencil images on compute
Samuel Pitoiset [Wed, 18 Aug 2021 15:22:07 +0000 (17:22 +0200)]
radv: add support for copying compressed depth/stencil images on compute

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

3 years agoradv: implement depth/stencil expand on compute
Samuel Pitoiset [Wed, 18 Aug 2021 15:02:09 +0000 (17:02 +0200)]
radv: implement depth/stencil expand on compute

This works as long as the image is TC-compatible HTILE.

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

3 years agoradv: rename radv_decompress_depth_stencil()
Samuel Pitoiset [Wed, 18 Aug 2021 14:48:31 +0000 (16:48 +0200)]
radv: rename radv_decompress_depth_stencil()

To radv_expand_depth_stencil() for consistency.

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

3 years agopanfrost/ci: Skip the indirect_draw+XFB tests
Boris Brezillon [Mon, 20 Sep 2021 12:43:05 +0000 (14:43 +0200)]
panfrost/ci: Skip the indirect_draw+XFB tests

We lack a dependency between the vertex job filling the indirect draw
buffers and the indirect draw compute job reading from these buffers,
leading to unreliable results (the tests pass if the vertex job is
done before the compute job starts, and fail otherwise). Let's disable
those tests until we sort it out.

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

3 years agopanfrost: Fix collision in the indirect draw shader table
Boris Brezillon [Mon, 20 Sep 2021 11:51:10 +0000 (13:51 +0200)]
panfrost: Fix collision in the indirect draw shader table

Min/max index search shaders are different for the !primitive_restart
and primitive_restart. We need to add entries for the primitive restart
cases otherwise we might retrieve a wrong shader from the cache.

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

3 years agopanfrost: Fix indirect draws when vertex or instance count is 0
Boris Brezillon [Tue, 24 Aug 2021 08:48:40 +0000 (10:48 +0200)]
panfrost: Fix indirect draws when vertex or instance count is 0

In that case we should just skip the vertex/tiler jobs as done in the
direct draw path.

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

3 years agopanfrost: fix null deref when no color buffer is attached
Italo Nicola [Mon, 20 Sep 2021 07:18:56 +0000 (07:18 +0000)]
panfrost: fix null deref when no color buffer is attached

Do not dereference color buffer #0 in the SFBD code path if no color buffer is
attached, as with depth-only attachments. Fixes a crash running glmark2 -b
shadow on Mali T720.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Fixes: c746747cb82 ("panfrost: fix GL_EXT_multisampled_render_to_texture regression")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12927>

3 years agopanfrost: Prepare shader helpers to per-gen XML
Boris Brezillon [Wed, 4 Aug 2021 11:45:47 +0000 (13:45 +0200)]
panfrost: Prepare shader helpers to per-gen XML

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

3 years agopanfrost: Prepare texture helpers to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 12:24:31 +0000 (14:24 +0200)]
panfrost: Prepare texture helpers to per-gen XML

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

3 years agopanfrost: Prepare pan_encoder.h to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 12:09:43 +0000 (14:09 +0200)]
panfrost: Prepare pan_encoder.h to per-gen XML

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

3 years agopanfrost: Prepare scoreboard helpers to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 12:03:25 +0000 (14:03 +0200)]
panfrost: Prepare scoreboard helpers to per-gen XML

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

3 years agopanfrost: Prepare pandecode to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 08:22:28 +0000 (10:22 +0200)]
panfrost: Prepare pandecode to per-gen XML

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

3 years agopanfrost: Move panfrost_major_version() to gen_macros.h
Boris Brezillon [Fri, 6 Aug 2021 08:12:31 +0000 (10:12 +0200)]
panfrost: Move panfrost_major_version() to gen_macros.h

So we can use this function in decode_common.c when transitioning to
per-gen XML. While at it rename the function pan_arch().

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

3 years agopanfrost: Prepare pan_cs helpers to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 11:31:47 +0000 (13:31 +0200)]
panfrost: Prepare pan_cs helpers to per-gen XML

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

3 years agopanfrost: Prepare blend helpers to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 09:46:20 +0000 (11:46 +0200)]
panfrost: Prepare blend helpers to per-gen XML

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

3 years agopanfrost: Prepare blitter helpers to per-gen XML
Boris Brezillon [Fri, 6 Aug 2021 09:33:17 +0000 (11:33 +0200)]
panfrost: Prepare blitter helpers to per-gen XML

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

3 years agopanfrost: RGB332_UNORM is not a valid texture format on v6+
Boris Brezillon [Mon, 20 Sep 2021 09:53:23 +0000 (11:53 +0200)]
panfrost: RGB332_UNORM is not a valid texture format on v6+

Cc: mesa-stable
Fixes: c6bdd976e611 ("panfrost: Split out v6/v7 format tables")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12508>

3 years agopanfrost: Drop the R and T flags on SCALED formats
Boris Brezillon [Tue, 7 Sep 2021 12:22:59 +0000 (14:22 +0200)]
panfrost: Drop the R and T flags on SCALED formats

Sampling from SCALED textures / rendering to SCALED FBOs is a bit tricky
(requires extra int <-> float conversions in a few places).
mesa/st only use SCALED formats as vertex formats, and those formats
are optional in Vulkan, so let's drop the RENDER/TEXTURE flags to keep
things simple.

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

3 years agopanfrost: RGB10_A2_SNORM is not a valid texture format on v6+
Boris Brezillon [Tue, 7 Sep 2021 09:16:50 +0000 (11:16 +0200)]
panfrost: RGB10_A2_SNORM is not a valid texture format on v6+

Cc: mesa-stable
Fixes: c6bdd976e611 ("panfrost: Split out v6/v7 format tables")
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/12508>

3 years agopanfrost: Fix the Z32_S8X24 and X32_S8X24 definitions
Boris Brezillon [Wed, 19 May 2021 09:38:14 +0000 (11:38 +0200)]
panfrost: Fix the Z32_S8X24 and X32_S8X24 definitions

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

3 years agopanfrost: Patch Z32_S8X24 format when creating a sampler view
Boris Brezillon [Mon, 23 Aug 2021 15:46:18 +0000 (17:46 +0200)]
panfrost: Patch Z32_S8X24 format when creating a sampler view

The gallium driver always stores Z32_S8X24 textures on 2 different
planes. Let's fix the create_sampler_view() logic so we can support
single-planar Z32_S8X24 in the vulkan driver.

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

3 years agoac/nir: Remove byte permute from prefix sum of the repack sequence.
Timur Kristóf [Thu, 9 Sep 2021 08:33:50 +0000 (10:33 +0200)]
ac/nir: Remove byte permute from prefix sum of the repack sequence.

The byte-permute instruction v_perm_b32 is not exposed by older
LLVM releases (only available on LLVM 13 and later), therefore a new
sequence is needed which we can use with these LLVM versions too.

The prefix sum is replaced by two alternatives:

1. For GPUs that support v_dot, we shift 0x01 to the wanted byte
positions and then use v_dot to sum the results.

2. For older GPUs (Navi 10), we simply shift out the unwanted bytes
and use v_sad_u8 to produce the sum.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12786>

3 years agoaco/isel: Fix emit_vop2_instruction to apply 16/24-bit flags properly.
Timur Kristóf [Thu, 9 Sep 2021 06:27:21 +0000 (08:27 +0200)]
aco/isel: Fix emit_vop2_instruction to apply 16/24-bit flags properly.

Previously it used a builder function but didn't use the return
value from that function, so the flags were not applied.

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

3 years agoaco: Add ability to optimize v_lshl + v_sub into v_mad_i32_i24.
Timur Kristóf [Thu, 9 Sep 2021 06:38:41 +0000 (08:38 +0200)]
aco: Add ability to optimize v_lshl + v_sub into v_mad_i32_i24.

Also change combine_add_lshl to use check_vop3_operands instead
of its own checks of the operands.

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

3 years agomesa: fix timestamp enum with EXT_disjoint_timer_query
Tapani Pälli [Thu, 16 Sep 2021 05:48:52 +0000 (08:48 +0300)]
mesa: fix timestamp enum with EXT_disjoint_timer_query

Extension implementation missed GL_TIMESTAMP_EXT for Get* functions,
commit 5d58fea660c added GetInteger64vEXT support but obviously we need
to support the enum as well ...

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5361
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12890>

3 years agobin/khronos-update.py: add upstream for vulkan_directfb.h & vulkan_screen.h
Eric Engestrom [Wed, 15 Sep 2021 21:07:11 +0000 (22:07 +0100)]
bin/khronos-update.py: add upstream for vulkan_directfb.h & vulkan_screen.h

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12877>

3 years agobin/khronos-update.py: update the branch name (s/master/main/)
Eric Engestrom [Wed, 15 Sep 2021 21:04:12 +0000 (22:04 +0100)]
bin/khronos-update.py: update the branch name (s/master/main/)

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12877>

3 years agoradeonsi: fix ps SI_PARAM_LINE_STIPPLE_TEX arg
Qiang Yu [Sat, 18 Sep 2021 06:41:22 +0000 (14:41 +0800)]
radeonsi: fix ps SI_PARAM_LINE_STIPPLE_TEX arg

This arg size should be 1 instead of 3. It does not affect functionality
because we does not enable it in SPI_PS_INPUT_ADDR. But it does affect
the VGPR number that LLVM produce when LLVM still count with all PS
function arguments.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12922>

3 years agofreedreno/computerator/a4xx: Fix enum mismatch warning
Rob Clark [Sat, 18 Sep 2021 16:39:01 +0000 (09:39 -0700)]
freedreno/computerator/a4xx: Fix enum mismatch warning

Fixes: fb5deb2b4a0 ("a4xx/computerator: add initial backend")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12923>

3 years agofreedreno/ir3: Fix generation check
Rob Clark [Sat, 18 Sep 2021 16:35:37 +0000 (09:35 -0700)]
freedreno/ir3: Fix generation check

Fixes: fb5deb2b4a0 ("a4xx/computerator: add initial backend")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12923>

3 years agofreedreno/ir3: Cleanup liveness lifetime
Rob Clark [Sat, 18 Sep 2021 16:32:21 +0000 (09:32 -0700)]
freedreno/ir3: Cleanup liveness lifetime

I'm going to want to use this in other passes, so lets let the
allocation hang off the pass's context.  Also, while we're at it,
fix the error path leak in ir3_ra().

Fixes: 0ffcb19b9d9 ("ir3: Rewrite register allocation")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12923>

3 years agofreedreno/ir3: Fix sched debug msgs
Rob Clark [Tue, 31 Aug 2021 20:52:22 +0000 (13:52 -0700)]
freedreno/ir3: Fix sched debug msgs

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

3 years agofdno/resource: Rewrite layout selection for allocation
Daniel Stone [Fri, 27 Aug 2021 15:52:31 +0000 (16:52 +0100)]
fdno/resource: Rewrite layout selection for allocation

The previous code had a number of errors, the most glaring of which was
forcing linear when it was one of the possible layouts requested.

When modifiers are being used, a list of _acceptable_ modifiers is
supplied; it's up to the driver to then make a decision as to which it
thinks is most optimal.

Normally we would select between linear/tiled/UBWC in ascending order of
preference according to what's possible, however we can't use a tiled
layout with explicit modifiers as there is no modifier token defined for
it.

Rewrite the layout-selection mechanism to always try to do the most
optimal thing. If the use flags force us to, or we have a shared
resource without explicit modifiers, we use linear. Failing that, we use
UBWC wherever possible; if this is not possible, we use tiled for
internal resources only or linear for shared resources.

v2 (Rob): respect FD_FORMAT_MOD_QCOM_TILED; do not print perf warning on
user choice of disabling UBWC;

v3: fix several issues breaking CI tests: revert removal of using
MOD_INVALID in various places, and assume implicit modifiers if present;
do not attempt to set UBWC flags when screen->tile_mode(prsc) falls back
to LINEAR (e.g. for small mip-maps levels); use TILED for implicit
modifier case with non-shared resources

v4: fix unintended demotion of UBWC, i.e. only check QCOM_COMPRESSED
modifier and demote UBWC to less optimal format when using explicit
modifiers

Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Heinrich Fink <hfink@snap.com>
Signed-off-by: Heinrich Fink <hfink@snap.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12595>

3 years agolima: fix leak of the screen hash table
Christian Gmeiner [Thu, 16 Sep 2021 16:52:39 +0000 (18:52 +0200)]
lima: fix leak of the screen hash table

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12902>

3 years agodocs/panfrost: Remove obsolete note on Android.mk
Alyssa Rosenzweig [Fri, 17 Sep 2021 15:08:42 +0000 (11:08 -0400)]
docs/panfrost: Remove obsolete note on Android.mk

Android.mk was removed, so remove a reference to it from Panfrost
documentation. We should document building for Android, but it'll be
through meson. This note as-is adds more confusion than note.

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

3 years agoaco: cleanup assignment of unique_ptrs
Filip Gawin [Thu, 16 Sep 2021 18:50:29 +0000 (20:50 +0200)]
aco: cleanup assignment of unique_ptrs

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

3 years agoradv: Expose modifiers that support DCC image stores with STORAGE_IMAGE_BIT
Joshua Ashton [Tue, 14 Sep 2021 03:07:35 +0000 (04:07 +0100)]
radv: Expose modifiers that support DCC image stores with STORAGE_IMAGE_BIT

Some games, ie. Doom Eternal, present from compute following compute post-fx and would benefit from having DCC image stores available.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12862>

3 years agoac/surface: Add ac_modifier_supports_dcc_image_stores helper
Joshua Ashton [Tue, 14 Sep 2021 03:00:34 +0000 (04:00 +0100)]
ac/surface: Add ac_modifier_supports_dcc_image_stores helper

Helper function to check if a modifier supports DCC image stores.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12862>

3 years agoac/surface: Add modifiers capable of DCC image stores
Joshua Ashton [Fri, 10 Sep 2021 21:34:35 +0000 (22:34 +0100)]
ac/surface: Add modifiers capable of DCC image stores

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12862>

3 years agoiris: Add finalize_nir
Ian Romanick [Tue, 7 Sep 2021 20:52:05 +0000 (13:52 -0700)]
iris: Add finalize_nir

Improves performance of SynMark OglDrvShComp by +241.879%±1.01366% (n=5)
on a random KBL desktop that I have.  That seems to put it at about the
same performance as i965, but I did not test that in a statistically
sound way.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agoiris: Move iris_set_max_shader_compiler_threads and iris_is_parallel_shader_compilati...
Ian Romanick [Tue, 7 Sep 2021 20:50:27 +0000 (13:50 -0700)]
iris: Move iris_set_max_shader_compiler_threads and iris_is_parallel_shader_compilation_finished

There's going to be at least one more shader function set in
pipe_screen, so it makes more sense to do it in iris_program.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agoiris: Eliminate iris_uncompiled_shader::needs_edge_flag
Ian Romanick [Thu, 12 Aug 2021 22:48:10 +0000 (15:48 -0700)]
iris: Eliminate iris_uncompiled_shader::needs_edge_flag

Use the flag that was set by nir_lower_passthrough_edgeflags.  The
lowering passes will soon be moved to a finalize_nir hook, so there
won't be any choice.  Ideally we'd like to eliminate iris_fix_edge_flags
completely, and this is a first step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agonir/edgeflags: Add a flag to indicate the edge flag input is needed
Ian Romanick [Tue, 24 Aug 2021 22:34:13 +0000 (15:34 -0700)]
nir/edgeflags: Add a flag to indicate the edge flag input is needed

Most modern hardware needs the edge flag added as a hidden vertex input
and needs code added to the vertex shader to copy the input to an
output.  Intel hardware is a little different.  Gfx4 and Gfx5 hardware
works in the previously described mannter.  Gfx6+ hardware needs the
edge flag as a specific vertex shader input, and that input is magically
processed by fixed-function hardware without need for extra shader code.

This flag signals only that the vertex shader input is needed.  It would
be nice if we could decouple adding the vertex shader input from
generating the copy-to-output code, but that has proven to be
challenging.  Not having that code causes other passes to want to
eliminate that shader input.

v2: Convert conditional to assertion.  This pass is only called for
vertex shaders.  Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agoiris: Calculate uses_atomic_load_store after all lowering
Ian Romanick [Wed, 11 Aug 2021 00:30:13 +0000 (17:30 -0700)]
iris: Calculate uses_atomic_load_store after all lowering

The lowering passes will soon be moved to another function, so there
won't be any choice.

As a side benefit, this allows eliminating the uses_atomic_load_store
**pointer** parameter from brw_nir_lower_storage_image.  For some reason
crocus was passing false instead of NULL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agoiris: crocus: Use shader_info::is_arb_asm flag
Ian Romanick [Tue, 10 Aug 2021 23:46:09 +0000 (16:46 -0700)]
iris: crocus: Use shader_info::is_arb_asm flag

...instead of looking for "ARB" in the name of the shader.  This matches
the behavior of i965.  Using "ARB" was added in a1ebac3750e ("iris:
Implement ALT mode for ARB_{vertex,fragment}_shader"), but there's no
explanation of why that method was used.

v2: Just use shader_info::is_arb_asm everywhere instead of
iris_uncompiled_shader::use_alt_mode.  Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>

3 years agofreedreno/a6xx: Pre-bake SO-disable stateobj
Rob Clark [Fri, 17 Sep 2021 19:22:30 +0000 (12:22 -0700)]
freedreno/a6xx: Pre-bake SO-disable stateobj

No need to re-create this every time we transition from stream-out
enabled to disabled.

Creation of streamout_disable_stateobj is deferred until we create
a program state using streamout to avoid creating it unnecessarily
and because fd6_prog_init() is called before ctx->pipe is created.
(Changing that ordering is complicated by the fact that u_blitter
copies pctx->bind_fs_state(), and friends.)

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

3 years agozink: don't leak drm fd on drmPrimeFDToHandle failure
Mike Blumenkrantz [Fri, 17 Sep 2021 12:22:48 +0000 (08:22 -0400)]
zink: don't leak drm fd on drmPrimeFDToHandle failure

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12911>

3 years agofreedreno: Add perf warning for WC readback
Rob Clark [Fri, 18 Jun 2021 18:37:11 +0000 (11:37 -0700)]
freedreno: Add perf warning for WC readback

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

3 years agofreedreno: Used cached coherent for staging resources
Rob Clark [Fri, 18 Jun 2021 17:59:40 +0000 (10:59 -0700)]
freedreno: Used cached coherent for staging resources

These are really only accessed by the GPU once, so CPU access speed is
more important.  Especially for PIPE_MAP_READ.

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

3 years agofreedreno/drm: Use cached-coherent for control bo
Rob Clark [Sun, 6 Jun 2021 19:31:36 +0000 (12:31 -0700)]
freedreno/drm: Use cached-coherent for control bo

Userspace frequently reads the elapsed fence, but the GPU only writes it
once per submit.  So this should be another useful place for cached-
coherent.

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

3 years agofreedreno/drm: Use cached-coherent cmdstream buffers
Rob Clark [Wed, 2 Jun 2021 18:45:29 +0000 (11:45 -0700)]
freedreno/drm: Use cached-coherent cmdstream buffers

Some more extreme examples, like gl_driver2_off, can be bottlenecked on
writes to cmdstream.  OTOH the CP is pretty pipelined in how it slurps
in memory, so the penalty of using coherent buffers should not be so
much.

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

3 years agofreedreno/drm: Add cached-coherent bo support
Rob Clark [Wed, 2 Jun 2021 18:44:54 +0000 (11:44 -0700)]
freedreno/drm: Add cached-coherent bo support

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

3 years agofreedreno/drm: Don't return shared/control bo's to cache
Rob Clark [Wed, 15 Sep 2021 22:16:48 +0000 (15:16 -0700)]
freedreno/drm: Don't return shared/control bo's to cache

They can never be allocated from the cache, as fd_bo_state() would
return FD_BO_STATE_UNKNOWN

Fixes: 7dabd624649 ("freedreno/drm: Userspace fences")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>

3 years agofreedreno/drm: Consider allocation flags in bo-cache
Rob Clark [Fri, 18 Jun 2021 16:58:11 +0000 (09:58 -0700)]
freedreno/drm: Consider allocation flags in bo-cache

It hasn't really mattered until now, as we keep a separate cache for
cmdstream (which is FD_BO_GPU_READONLY), and the only other flag so
far is FD_BO_SCANOUT (which the bo cache probably messes up, but it
does not matter on most hw, and on hw where it does the scanout buffer
will be imported (and therefore won't end up in the bo cache).

But when we add cached-coherent (or if we wanted to use GPU_READONLY
more) it starts to matter.

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

3 years agofreedreno/drm: Rename bo->flags to bo->reloc_flags
Rob Clark [Fri, 18 Jun 2021 16:53:22 +0000 (09:53 -0700)]
freedreno/drm: Rename bo->flags to bo->reloc_flags

Next patch adds alloc_flags, lets rename bo->flags first to make it
clear *which* flags these are.

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

3 years agofreedreno/drm: Garbage collect unused bo_cache
Rob Clark [Sun, 6 Jun 2021 19:11:28 +0000 (12:11 -0700)]
freedreno/drm: Garbage collect unused bo_cache

The ring_cache that is actually used is in fd_device.

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

3 years agoci/bare-metal: add etnaviv
Christian Gmeiner [Fri, 12 Jun 2020 11:23:44 +0000 (13:23 +0200)]
ci/bare-metal: add etnaviv

Add deqp gles2 CI run for GC2000.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>

3 years agoci/bare-metal: add support for eth008 power relay
Christian Gmeiner [Mon, 6 Apr 2020 19:59:14 +0000 (21:59 +0200)]
ci/bare-metal: add support for eth008 power relay

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>

3 years agoci/bare-metal: add telnet based serial
Christian Gmeiner [Sat, 9 May 2020 19:53:24 +0000 (21:53 +0200)]
ci/bare-metal: add telnet based serial

Makes it possible to use e.g. a ser2net server in the lan.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>

3 years agoci: update kernel
Christian Gmeiner [Tue, 14 Sep 2021 08:39:24 +0000 (10:39 +0200)]
ci: update kernel

Switch to v5.13-rc5-for-mesa-ci-2bb5d9ffd79c branch, which includes
etnaviv MMU patches.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>

3 years agoci: include etnaviv support in ARMHF container.
Christian Gmeiner [Mon, 21 Dec 2020 12:37:38 +0000 (13:37 +0100)]
ci: include etnaviv support in ARMHF container.

Build the kernel with CONFIG_DRM_ETNAVIV=y and include
imx6q-cubox-i.dtb.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>

3 years agonir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants
Rhys Perry [Thu, 5 Nov 2020 13:18:08 +0000 (13:18 +0000)]
nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants

This allows for more MAD/FMA instructions to be created.

fossil-db (Sienna Cichlid):
Totals from 50134 (33.46% of 149839) affected shaders:
VGPRs: 2436536 -> 2436000 (-0.02%); split: -0.05%, +0.03%
SpillSGPRs: 13136 -> 13135 (-0.01%); split: -0.02%, +0.02%
CodeSize: 206621424 -> 206278292 (-0.17%); split: -0.23%, +0.07%
MaxWaves: 1116804 -> 1117448 (+0.06%); split: +0.07%, -0.01%
Instrs: 38977460 -> 38862886 (-0.29%); split: -0.33%, +0.04%
Latency: 832425389 -> 827432260 (-0.60%); split: -0.63%, +0.03%
InvThroughput: 184193457 -> 183563350 (-0.34%); split: -0.37%, +0.03%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7458>

3 years agofreedreno: Remove dead fd_batch_reset().
Emma Anholt [Thu, 9 Sep 2021 23:50:33 +0000 (16:50 -0700)]
freedreno: Remove dead fd_batch_reset().

Unused since 58f5605124a7 ("freedreno: Handle full blit discards by
invalidating the resource.")

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

3 years agofreedreno: Use a BO bitset for faster checks for resource referenced.
Emma Anholt [Wed, 30 Jun 2021 23:33:22 +0000 (16:33 -0700)]
freedreno: Use a BO bitset for faster checks for resource referenced.

When moving the batch cache to the context, I added hash table lookups
from batch to rsc for "is this resource in use" because we could no longer
store data in the rsc bo under the batch cache's lock.

We can save that cost by tracking a bitfield of resources referenced by
the batch, which gives us very cheap checks in the draw path at a minor
cost in memory.  We can just use the GEM BO handle, since it's a nice
small integer already (we can't use the TC buffer ID, because the frontend
changes that, and we're in the driver thread).

This required moving the !pending() assert up in resource shadowing, since
the BO swap meant we were checking pending on the wrong resource.

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

3 years agofreedreno: Remove the submit lock locking.
Emma Anholt [Mon, 25 Jan 2021 20:04:48 +0000 (12:04 -0800)]
freedreno: Remove the submit lock locking.

I think the whole submit lock thing should be possible to remove now, but
just getting rid of the lock since we're no longer sharing batches between
ctxes means another several percent draw overhead improvement.

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

3 years agofreedreno: Move the batch cache to the context.
Emma Anholt [Tue, 15 Jun 2021 20:44:27 +0000 (13:44 -0700)]
freedreno: Move the batch cache to the context.

Our draw call rate was significantly limited by the atomics we had to do
to manage access to the batch cache.

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

3 years agofreedreno: Use TC's flag for whether get_query is in the driver thread.
Emma Anholt [Thu, 16 Sep 2021 18:46:27 +0000 (11:46 -0700)]
freedreno: Use TC's flag for whether get_query is in the driver thread.

In moving batch cache to the context, the check for whether there's
pending work being done to this resources ends up accessing the context,
so we can't do it outside of the fd_context_access_begin().  This flag
lets us do the driver-thread asserts before we've decided whether we need
to flush.

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