platform/upstream/mesa.git
3 years agofreedreno: Make a bunch of the batch cache take ctx as the arg.
Emma Anholt [Mon, 14 Jun 2021 18:48:14 +0000 (11:48 -0700)]
freedreno: Make a bunch of the batch cache take ctx as the arg.

As we move the batch cache from screen to context, it cleans up the diff a
ton to separate this mechanical change out, and makes the API generally
more consistent (since you usually have to pass the ctx anyway).

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

3 years agofreedreno: Drop batch-cache orphan tracking.
Emma Anholt [Mon, 14 Jun 2021 18:42:43 +0000 (11:42 -0700)]
freedreno: Drop batch-cache orphan tracking.

Let's let valgrind/asan handle leak detection.  This means you can use the
flag even on non-DEBUG builds.

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

3 years agopan/bi: Fuse abs into FCMP/FMIN/FMAX.v2f16
Alyssa Rosenzweig [Fri, 11 Jun 2021 16:43:41 +0000 (12:43 -0400)]
pan/bi: Fuse abs into FCMP/FMIN/FMAX.v2f16

Needs to be aware of an encoding restriction here.

No shader-db changes.

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

3 years agopan/bi: Schedule FCMP.v2f16 with abs modifier
Alyssa Rosenzweig [Fri, 11 Jun 2021 16:43:21 +0000 (12:43 -0400)]
pan/bi: Schedule FCMP.v2f16 with abs modifier

So many encoding restrictions, because Bifrost.

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

3 years agopan/bi: Fuse fclamp_pos and fsat_signed
Alyssa Rosenzweig [Fri, 11 Jun 2021 00:37:35 +0000 (20:37 -0400)]
pan/bi: Fuse fclamp_pos and fsat_signed

Mostly interesting now that we fuse clamps.

total instructions in shared programs: 149562 -> 148927 (-0.42%)
instructions in affected programs: 37195 -> 36560 (-1.71%)
helped: 233
HURT: 0
helped stats (abs) min: 1 max: 10 x̄: 2.73 x̃: 2
helped stats (rel) min: 0.22% max: 17.39% x̄: 2.19% x̃: 1.72%
95% mean confidence interval for instructions value: -2.97 -2.48
95% mean confidence interval for instructions %-change: -2.44% -1.94%
Instructions are helped.

total tuples in shared programs: 130487 -> 130122 (-0.28%)
tuples in affected programs: 25693 -> 25328 (-1.42%)
helped: 179
HURT: 12
helped stats (abs) min: 1 max: 10 x̄: 2.11 x̃: 2
helped stats (rel) min: 0.26% max: 25.00% x̄: 2.52% x̃: 1.70%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.61% max: 0.68% x̄: 0.65% x̃: 0.66%
95% mean confidence interval for tuples value: -2.15 -1.68
95% mean confidence interval for tuples %-change: -2.74% -1.91%
Tuples are helped.

total clauses in shared programs: 27827 -> 27761 (-0.24%)
clauses in affected programs: 1407 -> 1341 (-4.69%)
helped: 56
HURT: 0
helped stats (abs) min: 1 max: 4 x̄: 1.18 x̃: 1
helped stats (rel) min: 1.79% max: 14.29% x̄: 6.11% x̃: 5.26%
95% mean confidence interval for clauses value: -1.32 -1.03
95% mean confidence interval for clauses %-change: -7.00% -5.23%
Clauses are helped.

total quadwords in shared programs: 118563 -> 118248 (-0.27%)
quadwords in affected programs: 19859 -> 19544 (-1.59%)
helped: 144
HURT: 16
helped stats (abs) min: 1 max: 10 x̄: 2.30 x̃: 2
helped stats (rel) min: 0.29% max: 16.00% x̄: 2.65% x̃: 2.13%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.47% max: 2.00% x̄: 0.80% x̃: 0.76%
95% mean confidence interval for quadwords value: -2.27 -1.66
95% mean confidence interval for quadwords %-change: -2.67% -1.93%
Quadwords are helped.

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

3 years agopan/bi: Add back custom algebraic opts
Alyssa Rosenzweig [Fri, 11 Jun 2021 00:21:28 +0000 (20:21 -0400)]
pan/bi: Add back custom algebraic opts

Right now just do a trivial one to test the infrastructure. In the next
commit we'll use this for a more interesting optimization that's a bit
painful in BIR but trivial with nir_search.

total instructions in shared programs: 149566 -> 149562 (<.01%)
instructions in affected programs: 502 -> 498 (-0.80%)
helped: 3
HURT: 0
helped stats (abs) min: 1 max: 2 x̄: 1.33 x̃: 1
helped stats (rel) min: 0.38% max: 1.30% x̄: 0.97% x̃: 1.21%

total tuples in shared programs: 130957 -> 130487 (-0.36%)
tuples in affected programs: 54752 -> 54282 (-0.86%)
helped: 303
HURT: 2
helped stats (abs) min: 1 max: 29 x̄: 1.56 x̃: 1
helped stats (rel) min: 0.13% max: 7.14% x̄: 1.08% x̃: 0.92%
HURT stats (abs)   min: 1 max: 2 x̄: 1.50 x̃: 1
HURT stats (rel)   min: 1.89% max: 2.99% x̄: 2.44% x̃: 2.44%
95% mean confidence interval for tuples value: -1.79 -1.30
95% mean confidence interval for tuples %-change: -1.17% -0.95%
Tuples are helped.

total clauses in shared programs: 27877 -> 27827 (-0.18%)
clauses in affected programs: 1556 -> 1506 (-3.21%)
helped: 45
HURT: 0
helped stats (abs) min: 1 max: 2 x̄: 1.11 x̃: 1
helped stats (rel) min: 1.43% max: 9.52% x̄: 3.88% x̃: 3.57%
95% mean confidence interval for clauses value: -1.21 -1.02
95% mean confidence interval for clauses %-change: -4.38% -3.39%
Clauses are helped.

total quadwords in shared programs: 119058 -> 118563 (-0.42%)
quadwords in affected programs: 33777 -> 33282 (-1.47%)
helped: 250
HURT: 2
helped stats (abs) min: 1 max: 29 x̄: 1.99 x̃: 1
helped stats (rel) min: 0.23% max: 11.11% x̄: 1.67% x̃: 1.40%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 1.64% max: 2.00% x̄: 1.82% x̃: 1.82%
95% mean confidence interval for quadwords value: -2.27 -1.66
95% mean confidence interval for quadwords %-change: -1.80% -1.49%
Quadwords are helped.

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

3 years agopan/bi: Propagate fabs/neg/sat
Alyssa Rosenzweig [Thu, 10 Jun 2021 23:05:29 +0000 (19:05 -0400)]
pan/bi: Propagate fabs/neg/sat

Initial support for modifier propagation. Bifrost makes this
unreasonably hard.

total instructions in shared programs: 151604 -> 150761 (-0.56%)
instructions in affected programs: 48773 -> 47930 (-1.73%)
helped: 212
HURT: 0
helped stats (abs) min: 1 max: 28 x̄: 3.98 x̃: 1
helped stats (rel) min: 0.29% max: 12.70% x̄: 1.75% x̃: 1.26%
95% mean confidence interval for instructions value: -4.71 -3.25
95% mean confidence interval for instructions %-change: -1.97% -1.53%
Instructions are helped.

total tuples in shared programs: 131876 -> 131560 (-0.24%)
tuples in affected programs: 25393 -> 25077 (-1.24%)
helped: 104
HURT: 3
helped stats (abs) min: 1 max: 28 x̄: 3.08 x̃: 2
helped stats (rel) min: 0.34% max: 8.57% x̄: 1.55% x̃: 1.04%
HURT stats (abs)   min: 1 max: 2 x̄: 1.33 x̃: 1
HURT stats (rel)   min: 0.51% max: 2.86% x̄: 1.30% x̃: 0.53%
95% mean confidence interval for tuples value: -3.63 -2.28
95% mean confidence interval for tuples %-change: -1.73% -1.21%
Tuples are helped.

total clauses in shared programs: 28122 -> 28032 (-0.32%)
clauses in affected programs: 2720 -> 2630 (-3.31%)
helped: 58
HURT: 1
helped stats (abs) min: 1 max: 6 x̄: 1.57 x̃: 1
helped stats (rel) min: 0.88% max: 14.29% x̄: 4.06% x̃: 3.67%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 7.69% max: 7.69% x̄: 7.69% x̃: 7.69%
95% mean confidence interval for clauses value: -1.85 -1.20
95% mean confidence interval for clauses %-change: -4.60% -3.13%
Clauses are helped.

total quadwords in shared programs: 119778 -> 119509 (-0.22%)
quadwords in affected programs: 20698 -> 20429 (-1.30%)
helped: 95
HURT: 1
helped stats (abs) min: 1 max: 28 x̄: 2.85 x̃: 2
helped stats (rel) min: 0.38% max: 7.14% x̄: 1.50% x̃: 1.13%
HURT stats (abs)   min: 2 max: 2 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 3.23% max: 3.23% x̄: 3.23% x̃: 3.23%
95% mean confidence interval for quadwords value: -3.49 -2.11
95% mean confidence interval for quadwords %-change: -1.71% -1.20%
Quadwords are helped.

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

3 years agopan/bi: Report tuples, not nops, in shader-db
Alyssa Rosenzweig [Thu, 10 Jun 2021 23:28:05 +0000 (19:28 -0400)]
pan/bi: Report tuples, not nops, in shader-db

More useful in practice, I find.

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

3 years agopan/bi: Handle fsat_signed and fclamp_pos
Alyssa Rosenzweig [Fri, 11 Jun 2021 00:37:12 +0000 (20:37 -0400)]
pan/bi: Handle fsat_signed and fclamp_pos

Translates to Mali-specific clamps.

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

3 years agopan/bi: Track instruction size in opcode table
Alyssa Rosenzweig [Fri, 11 Jun 2021 00:08:18 +0000 (20:08 -0400)]
pan/bi: Track instruction size in opcode table

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

3 years agopan/bi: Move typesize to common code
Alyssa Rosenzweig [Fri, 11 Jun 2021 00:07:50 +0000 (20:07 -0400)]
pan/bi: Move typesize to common code

Useful for the opcode table.

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

3 years agopan/bi: Move bi_word_node to common code
Alyssa Rosenzweig [Thu, 10 Jun 2021 23:05:14 +0000 (19:05 -0400)]
pan/bi: Move bi_word_node to common code

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

3 years agopan/bi: Include modifier info in opcode table
Alyssa Rosenzweig [Fri, 5 Mar 2021 23:10:39 +0000 (23:10 +0000)]
pan/bi: Include modifier info in opcode table

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

3 years agoutil: Consider CPU affinity when detecting number of CPUs
Ian Romanick [Mon, 7 Jun 2021 20:06:22 +0000 (13:06 -0700)]
util: Consider CPU affinity when detecting number of CPUs

A similar path can be used on at least FreeBSD using cpuset_getaffinity.
This is how Ninja determines the number of available CPUs on that
platform.  See the GetProcessorCount function in util.cc:

https://github.com/ninja-build/ninja/blob/master/src/util.cc

v2: Fix counting the number of available CPUs.  The CPU_COUNT API does
not work the way I thought it did. :face_palm: Noticed by Marek.

Reviewed-by: Adam Jackson <ajax@redhat.com> [v1]
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> [v1]
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11228>

3 years agoutil: Use maximum number of CPUs for determining cache topology
Ian Romanick [Wed, 9 Jun 2021 16:24:45 +0000 (09:24 -0700)]
util: Use maximum number of CPUs for determining cache topology

This prevents problems when some CPUs are offline.  In a four CPU
system, if CPUs 1 and 2 are offline, the cache topology code would
only examine CPUs 0 and 1... giving incorrect information.

The types are changed to int16_t so that the offset of num_L3_caches
does not change.  This triggered a STATIC_ASSERT failure:

STATIC_ASSERT(offsetof(struct util_cpu_caps_t, num_L3_caches) == 5 * sizeof(uint32_t));

I'm assuming there's some assembly code or something that depends on
this offset, and I don't feel like messing with it.

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

3 years agoutil: Set util_cpu_caps.num_cpu_mask_bits based on total CPUs in the system
Ian Romanick [Tue, 8 Jun 2021 23:36:32 +0000 (16:36 -0700)]
util: Set util_cpu_caps.num_cpu_mask_bits based on total CPUs in the system

In the current code, this prevents a very unlikely corner case.  More
importantly, it should prevent the next commit from breaking the
universe.

Imagine a system with 64 CPUs configured, but first 32 CPUs are offline.
_SC_NPROCESSORS_CONF will return 32.  All of the surrounding code will
interpret this as meaning CPUs 0 through 31, but all of those CPUs are
offline.  Nothing good can happen then.

The problem cases require systems with more than 32 CPUs because
util_cpu_caps.num_cpu_mask_bits is always rounded up to a multiple of
32.

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

3 years agoutil: Fix setting nr_cpus on some BSD variants
Ian Romanick [Tue, 8 Jun 2021 22:39:20 +0000 (15:39 -0700)]
util: Fix setting nr_cpus on some BSD variants

Linux, FreeBSD, and DragonFly should have _SC_NOPROCESSORS_ONLN.  NetBSD
and OpenBSD should have HW_NCPUONLINE.  This is what FFmpeg uses on
those platforms.

FreeBSD sysconf(3) manual page:

https://www.freebsd.org/cgi/man.cgi?query=sysconf&sektion=3&apropos=0&manpath=freebsd

The FFmpeg patch is at:

https://patchwork.ffmpeg.org/project/ffmpeg/patch/YGi4sJx3trG3Yn7c@humpty.home.comstyle.com/

OpenBSD sysctl(2) manual page:

https://man.openbsd.org/sysctl.2

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

3 years agoutil: Trivial cleanup in the BSD code of util_cpu_detect_once
Ian Romanick [Tue, 8 Jun 2021 22:33:39 +0000 (15:33 -0700)]
util: Trivial cleanup in the BSD code of util_cpu_detect_once

This code is going to be replicated in future commits, so tidy up a bit
first.

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

3 years agoutil: Change order of PIPE_OS_UNIX code in util_cpu_detect_once
Ian Romanick [Tue, 8 Jun 2021 21:40:19 +0000 (14:40 -0700)]
util: Change order of PIPE_OS_UNIX code in util_cpu_detect_once

This makes it easier to add preferred vs. fallback paths later.

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

3 years agoutil: Zero out all of mask in util_set_thread_affinity
Ian Romanick [Tue, 8 Jun 2021 22:08:50 +0000 (15:08 -0700)]
util: Zero out all of mask in util_set_thread_affinity

memset operates in bytes, and there are 8-bits in a byte.  This is a
very easy to miss typo. :(

Fixes: 9758b1d416a1 ("util: add util_set_thread_affinity helpers including Windows support")

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

3 years agoradeonsi: Use util_cpu_caps to detect number of CPUs
Ian Romanick [Mon, 7 Jun 2021 19:15:20 +0000 (12:15 -0700)]
radeonsi: Use util_cpu_caps to detect number of CPUs

The next patch will change the way the number of CPUs is detected, and
this change prevents some code duplication.

v2: Add missing #include.  Noticed by Pierre-Eric... not sure how I
missed it. :(

Reviewed-by: Adam Jackson <ajax@redhat.com> [v1]
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11228>

3 years agovenus: moves GPU rendering off CPU timeline for Android WSI
Yiwei Zhang [Tue, 15 Jun 2021 07:00:09 +0000 (07:00 +0000)]
venus: moves GPU rendering off CPU timeline for Android WSI

When globalFencing is supported, we can export a native sync fd for
presentation to move rendering off CPU timeline.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11342>

3 years agovenus: refactor vn_AcquireImageANDROID with globalFencing
Yiwei Zhang [Sat, 12 Jun 2021 23:17:44 +0000 (23:17 +0000)]
venus: refactor vn_AcquireImageANDROID with globalFencing

This patch refactors to use vn_Import*FdKHR for Android WSI native sync
fence import when globalFencing is supported. Currently there's no perf
win from this, but will move the composer release fence waiting to the
GPU device side automatically when the entire Venus fencing support is
improved.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11342>

3 years agovenus: silence a build warning
Yiwei Zhang [Tue, 15 Jun 2021 16:33:29 +0000 (16:33 +0000)]
venus: silence a build warning

Address -Wsometimes-uninitialized

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11342>

3 years agoaux/indices: include provoking vertex check in prim type conversion
Neha Bhende [Mon, 14 Jun 2021 22:49:15 +0000 (15:49 -0700)]
aux/indices: include provoking vertex check in prim type conversion

Include provoking vertex checking in u_index_prim_type_convert() to make sure
the right primitive type is returned from the generator function.

Fixes google earth running on VMware svga device on hw version 11.

Fixes: cad2026b72cf ("aux/indices: break out primitive type conversion to separate function")

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11367>

3 years agofreedreno: Fallback to sw for copy_image with compressed
Rob Clark [Tue, 15 Jun 2021 14:24:54 +0000 (07:24 -0700)]
freedreno: Fallback to sw for copy_image with compressed

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

3 years agofreedreno: Flush batches on shadow/uncompress
Rob Clark [Mon, 14 Jun 2021 22:18:25 +0000 (15:18 -0700)]
freedreno: Flush batches on shadow/uncompress

Normally when we shadow a resource (whether it is changing the modifier
or not) we do not need to flush existing batches, since they reference
the original version of the resource.  There is a special case for
resources that are referenced by a batches framebuffer state, because
this state is emitted when the batch is flushed.  Because of this, we
need those batches to be flushed before we shadow the resource.

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

3 years agofreedreno/a6xx: Also validate format in blitter path
Rob Clark [Sun, 13 Jun 2021 20:34:27 +0000 (13:34 -0700)]
freedreno/a6xx: Also validate format in blitter path

Since we can be blitting using a format that is different from the
resource's native format, we also need to validate and demote if
necessary, similar to sampler-views, image-views, and fb state.

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

3 years agofreedreno/a6xx: Handle R8G8 sharp edges in validate_format()
Rob Clark [Sun, 13 Jun 2021 20:27:33 +0000 (13:27 -0700)]
freedreno/a6xx: Handle R8G8 sharp edges in validate_format()

Because R8G8 has a different layout from R16, we not only need to demote
to uncompressed to (for example) sample R8G8 as R16 (or visa versa) but
we also need to demote further to linear.

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

3 years agofreedreno: Avoid recursive re-entry of u_blitter
Rob Clark [Sun, 13 Jun 2021 18:02:59 +0000 (11:02 -0700)]
freedreno: Avoid recursive re-entry of u_blitter

Normally when demotion to uncompressed is required, it is handled when
various state is attached (sampler-view, framebuffer, etc).  But in this
one path into u_blitter we need to handle it up front, to avoid
recursing back into u_blitter for a decompress blit.

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

3 years agofreedreno: Add debugging for blitter fallback recursion
Rob Clark [Sun, 13 Jun 2021 20:37:16 +0000 (13:37 -0700)]
freedreno: Add debugging for blitter fallback recursion

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

3 years agofreedreno: Don't try staging blit for non-renderable formats
Rob Clark [Sun, 13 Jun 2021 15:21:52 +0000 (08:21 -0700)]
freedreno: Don't try staging blit for non-renderable formats

If a format is not supported as a render target, there is no point in
trying a staging blit, as it will end up in a CPU copy fallback.

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

3 years agofreedreno: Drop obsolete comment
Rob Clark [Sun, 13 Jun 2021 20:36:19 +0000 (13:36 -0700)]
freedreno: Drop obsolete comment

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

3 years agovenus: be verbose about which physical devices are skipped
Chia-I Wu [Tue, 15 Jun 2021 00:27:23 +0000 (17:27 -0700)]
venus: be verbose about which physical devices are skipped

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11369>

3 years agovenus: fix compatibility with older host drivers
Chia-I Wu [Mon, 14 Jun 2021 23:39:54 +0000 (16:39 -0700)]
venus: fix compatibility with older host drivers

Unlike on Android, KHR_swapchain may be advertised even when the host
driver does not support EXT_image_drm_format_modifier and
EXT_queue_family_foreign.  Do not request those extensions when they are
not supported.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11369>

3 years agovenus: clean up vn_physical_device_get_native_extensions
Chia-I Wu [Tue, 15 Jun 2021 00:23:07 +0000 (17:23 -0700)]
venus: clean up vn_physical_device_get_native_extensions

Separate Android and non-Android paths.  No real change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11369>

3 years agonir/cse: resize the instruction set
Rhys Perry [Mon, 17 Aug 2020 19:22:23 +0000 (20:22 +0100)]
nir/cse: resize the instruction set

ministat (CSE only):
Difference at 95.0% confidence
-3357.54 +/- 32.5177
-25.267% +/- 0.24098%
(Student's t, pooled s = 33.909)

ministat (entire run):
Difference at 95.0% confidence
-3414.27 +/- 270.628
-2.76477% +/- 0.217647%
(Student's t, pooled s = 282.207)

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

3 years agonir: use a single set during CSE
Rhys Perry [Mon, 17 Aug 2020 18:56:16 +0000 (19:56 +0100)]
nir: use a single set during CSE

Use a single set and ensure dominance by checking after a equivalent
instruction is found.

Besides removing the need to copy a set, this also lets us resize the set
at the start of the pass in the next commit.

ministat (CSE only):
Difference at 95.0% confidence
-984.956 +/- 28.8559
-6.90075% +/- 0.190231%
(Student's t, pooled s = 26.9052)

ministat (entire run):
Difference at 95.0% confidence
-1246.1 +/- 257.253
-0.998972% +/- 0.205094%
(Student's t, pooled s = 239.863)

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

3 years agofreedreno/registers: define REG_DSI_CPHY_MODE_CTRL
Jonathan Marek [Tue, 15 Jun 2021 16:42:12 +0000 (12:42 -0400)]
freedreno/registers: define REG_DSI_CPHY_MODE_CTRL

For use by the kernel driver.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11381>

3 years agoiris: fix error message on I915_GEM_[GS]ET_TILING failure
Marcin Ślusarz [Mon, 14 Jun 2021 09:01:41 +0000 (11:01 +0200)]
iris: fix error message on I915_GEM_[GS]ET_TILING failure

The first problem was noticed by Coverity (CID 1485970).

Fixes: ab49063f449 ("iris: Only use SET/GET_TILING when exporting/importing BOs")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11357>

3 years agozink: use correct type for u_bit_scan
Erik Faye-Lund [Mon, 14 Jun 2021 09:59:04 +0000 (11:59 +0200)]
zink: use correct type for u_bit_scan

Since we're going to iterate over each bit of this variable using
u_bit_scan, we should make sure we use an unsigned int for the variable.

While this works on GCC, it's not guaranteed to work, and produces a
warning on MSVC.

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

3 years agoanv: Replace DC Flush with HDC Pipeline Flush
Felix DeGrood [Thu, 18 Mar 2021 16:44:33 +0000 (09:44 -0700)]
anv: Replace DC Flush with HDC Pipeline Flush

HDC Pipeline Flush is the correct method for flushing HDC
pipeline on Gfx12+ HW. Continue using DC Flush for earlier HW.

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

3 years agoanv: Add ANV_PIPE_HDC_PIPELINE_FLUSH_BIT
Felix DeGrood [Thu, 18 Mar 2021 02:46:41 +0000 (19:46 -0700)]
anv: Add ANV_PIPE_HDC_PIPELINE_FLUSH_BIT

Gfx12+ PIPE_CONTROL bit for flushing HDC cache and memory
transactions to L3 cache.

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

3 years agoanv: Only flush Tile Cache on VK_ACCESS_HOST_R/W
Felix DeGrood [Fri, 12 Mar 2021 23:36:49 +0000 (15:36 -0800)]
anv: Only flush Tile Cache on VK_ACCESS_HOST_R/W

Tile Cache flush flushes all Color/Depth values from L3 cache
to memory in Unified Cache mode. This is only required when
CPU access is required.

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

3 years agoanv: remove unnecessary Tile Cache flushes
Felix DeGrood [Wed, 17 Mar 2021 04:02:35 +0000 (21:02 -0700)]
anv: remove unnecessary Tile Cache flushes

On Gfx12+, flushing tile cache ensures color/depth values are
globally visible, but that's expensive.  Most operations only
need values to be GT-visible which can be achieved with depth
or rt flush.  Remove a bunch of unnecessary Tile Cache flushes.
Fast clears and slow depth clears still require Tile Cache flush.

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

3 years agoanv: Remove Tile Cache flush from SBA, Pipe Select
Felix DeGrood [Wed, 17 Mar 2021 04:00:59 +0000 (21:00 -0700)]
anv: Remove Tile Cache flush from SBA, Pipe Select

Tile Cache flushing not required for State Base Address or
Pipe Select instructions.

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

3 years agoanv: Clear all pending stall after pipe flush
Felix DeGrood [Fri, 29 Jan 2021 22:40:11 +0000 (14:40 -0800)]
anv: Clear all pending stall after pipe flush

Was only clearing CS stalls after emitting pending pipe
controls.  Need to clear all stalls.

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

3 years agoanv: Add debug messages for DEBUG_PIPE_CONTROL
Felix DeGrood [Thu, 11 Mar 2021 16:40:56 +0000 (08:40 -0800)]
anv: Add debug messages for DEBUG_PIPE_CONTROL

Enable with INTEL_DEBUG=pc.

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

3 years agoanv: Cache VB/IB in L3$ for Gfx12
Felix DeGrood [Wed, 24 Mar 2021 16:08:58 +0000 (09:08 -0700)]
anv: Cache VB/IB in L3$ for Gfx12

Gfx12 enables caching of Vertex and Index Buffers in L3.

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

3 years agozink: standardize zero-init code style
Hoe Hao Cheng [Tue, 15 Jun 2021 10:55:54 +0000 (18:55 +0800)]
zink: standardize zero-init code style

quick grepping shows that the amount of {0} (there were 8) is higher
than { 0 } (only 5), so {0} it is!

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

3 years agozink: zero-init structs with ISO C
Hoe Hao Cheng [Tue, 15 Jun 2021 10:51:44 +0000 (18:51 +0800)]
zink: zero-init structs with ISO C

zero-initing with empty braces is a GNU extension, MSVC does not like
it.

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

3 years agoci/lava: Generate YAML from Python, not Jinja
Daniel Stone [Fri, 11 Jun 2021 19:04:38 +0000 (20:04 +0100)]
ci/lava: Generate YAML from Python, not Jinja

This makes it much easier to use the common init scripts ... which we
also do here.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Make kernel image type a normal argument
Daniel Stone [Fri, 11 Jun 2021 17:34:13 +0000 (18:34 +0100)]
ci/lava: Make kernel image type a normal argument

Just pass the actual parameter, rather than bare YAML.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Drop bitrotten fastboot support
Daniel Stone [Fri, 11 Jun 2021 17:32:03 +0000 (18:32 +0100)]
ci/lava: Drop bitrotten fastboot support

We don't have any fastboot devices in LAVA, and even if we did, the old
overlay path no longer applies.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Use common stage-2 init
Daniel Stone [Fri, 11 Jun 2021 16:14:21 +0000 (17:14 +0100)]
ci/lava: Use common stage-2 init

Now that our job-execution scripts look very similar for LAVA and
bare-metal, we can just tell LAVA to use the same stage-2 init we use
for bare-metal and delete a bunch of duplication.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Pass MinIO path on the command line
Daniel Stone [Fri, 11 Jun 2021 16:41:41 +0000 (17:41 +0100)]
ci/lava: Pass MinIO path on the command line

This brings us much closer with what bare-metal does, and also allows us
to upload job data to a local instance rather than the primary fd.o one.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Set CPU and GPU governors to max, disable GPU runtime PM
Daniel Stone [Fri, 11 Jun 2021 16:09:17 +0000 (17:09 +0100)]
ci/bare-metal: Set CPU and GPU governors to max, disable GPU runtime PM

Give us a bit more predictable performance by making sure we always run
at full tilt.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci: Unify {BARE_METAL,LAVA}_TEST_SCRIPT environment
Daniel Stone [Fri, 11 Jun 2021 15:53:54 +0000 (16:53 +0100)]
ci: Unify {BARE_METAL,LAVA}_TEST_SCRIPT environment

Should also probably never have been different.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci: Unify {BM,LAVA}_START_XORG environment
Daniel Stone [Fri, 11 Jun 2021 15:46:57 +0000 (16:46 +0100)]
ci: Unify {BM,LAVA}_START_XORG environment

Why were they ever different ... ?

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci: Consistent pass/fail result output
Daniel Stone [Fri, 11 Jun 2021 15:44:55 +0000 (16:44 +0100)]
ci: Consistent pass/fail result output

One less point of differentiation.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Start using devcoredump captures
Daniel Stone [Fri, 11 Jun 2021 15:41:35 +0000 (16:41 +0100)]
ci/lava: Start using devcoredump captures

No reason not to.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Move devcoredump capture to CI common
Daniel Stone [Fri, 11 Jun 2021 15:18:15 +0000 (16:18 +0100)]
ci/bare-metal: Move devcoredump capture to CI common

Reusing this for LAVA sounds like a good idea!

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Split init script into two stages
Daniel Stone [Fri, 11 Jun 2021 15:13:01 +0000 (16:13 +0100)]
ci/bare-metal: Split init script into two stages

Whilst we want to reuse the same init and job environment for LAVA and
bare-metal, LAVA needs to additionally inject wget and tar jobs, so we
can actually get our per-job environment, as the rootfs we run in is
just the container-generated base rootfs.

Split the init script into two stages, with the first stage doing very
base bringup of devices and networking, and the second stage setting the
job environment and running the jobs.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Consistently set library paths
Daniel Stone [Fri, 11 Jun 2021 14:56:19 +0000 (15:56 +0100)]
ci/bare-metal: Consistently set library paths

Everything needs them, so might as well set it up front.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci: Be consistent about install path
Daniel Stone [Fri, 11 Jun 2021 14:54:34 +0000 (15:54 +0100)]
ci: Be consistent about install path

Make both LAVA and bare-metal untar into $CI_PROJECT_DIR/install/, and
symlink /install/ to it during init.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci: Move bare-metal init script to common directory
Daniel Stone [Fri, 11 Jun 2021 14:51:38 +0000 (15:51 +0100)]
ci: Move bare-metal init script to common directory

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Reorder init so network comes first
Daniel Stone [Fri, 11 Jun 2021 14:50:15 +0000 (15:50 +0100)]
ci/bare-metal: Reorder init so network comes first

Make sure that everything we need to ensure network access comes first,
so we can reuse this in LAVA which needs the network to pull the
per-pipeline build and the per-job environment overlays.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Try harder to do NTP
Daniel Stone [Fri, 11 Jun 2021 14:45:44 +0000 (15:45 +0100)]
ci/bare-metal: Try harder to do NTP

Same as LAVA does.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Rename environment variable script
Daniel Stone [Fri, 11 Jun 2021 14:43:17 +0000 (15:43 +0100)]
ci/lava: Rename environment variable script

Make it line up with bare-metal.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Use HWCI_KERNEL_MODULES to load modules
Daniel Stone [Fri, 11 Jun 2021 14:41:50 +0000 (15:41 +0100)]
ci/lava: Use HWCI_KERNEL_MODULES to load modules

One fewer difference to bare-metal.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Add parens around shell command
Tomeu Vizoso [Tue, 15 Jun 2021 09:23:23 +0000 (11:23 +0200)]
ci/bare-metal: Add parens around shell command

Play safe and make sure we don't get bit by priority rules between the
|| and | operators.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Suggested-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/bare-metal: Rename BM_KERNEL_MODULES to HWCI_KERNEL_MODULES
Daniel Stone [Fri, 11 Jun 2021 14:40:08 +0000 (15:40 +0100)]
ci/bare-metal: Rename BM_KERNEL_MODULES to HWCI_KERNEL_MODULES

To try to make init more common.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Explicitly start Xorg for Iris EGL tests
Daniel Stone [Sun, 13 Jun 2021 12:55:36 +0000 (13:55 +0100)]
ci/lava: Explicitly start Xorg for Iris EGL tests

These tests relies on Xorg being started, so let's explicitly declare
that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Set PIGLIT_NO_WINDOW
Daniel Stone [Sat, 12 Jun 2021 12:55:26 +0000 (13:55 +0100)]
ci/lava: Set PIGLIT_NO_WINDOW

This got lost in the move away from hardcoded environment variables, and
fixes the Iris EGL tests.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/lava: Always upload Piglit replay images to MinIO
Daniel Stone [Sat, 12 Jun 2021 12:25:45 +0000 (13:25 +0100)]
ci/lava: Always upload Piglit replay images to MinIO

This should probably be set in the trace-job environments, but the
inheritance is a bit of a mess between all the systems at the moment,
and this matches previous hardcoded behaviour at least.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoci/piglit: Fix path to uploaded images
Daniel Stone [Sat, 12 Jun 2021 09:19:36 +0000 (10:19 +0100)]
ci/piglit: Fix path to uploaded images

Missed this bit when I was reworking environment variables.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Emma Anholt <emma@anholt.net>
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11329#note_956187
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

3 years agoradeonsi: use si_nir_is_output_const_if_tex_is_const
Pierre-Eric Pelloux-Prayer [Thu, 6 May 2021 13:20:21 +0000 (15:20 +0200)]
radeonsi: use si_nir_is_output_const_if_tex_is_const

When a blending mode producing "color = src * dst" is used and we
can determine that dst is 1, then the draw call can dropped completely.

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

3 years agoradeonsi/nir: add si_nir_is_output_const_if_tex_is_const
Pierre-Eric Pelloux-Prayer [Wed, 5 May 2021 07:01:19 +0000 (09:01 +0200)]
radeonsi/nir: add si_nir_is_output_const_if_tex_is_const

Determine if a given shader write the same constant value to its output
if a specific input texture is replaced by constant load.

It's done by checking if the store_output intrinsics only depends on
constant and a texture. If it's true, the given texture is replaced by
a constant load in cloned shader and this clone is optimized.

Then the output is checked (= is it constant or not).

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

3 years agoradeonsi: use si_install_draw_wrapper for tmz handling
Pierre-Eric Pelloux-Prayer [Wed, 19 May 2021 16:38:29 +0000 (18:38 +0200)]
radeonsi: use si_install_draw_wrapper for tmz handling

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

3 years agoradeonsi: add si_install_draw_wrapper
Pierre-Eric Pelloux-Prayer [Wed, 19 May 2021 15:11:57 +0000 (17:11 +0200)]
radeonsi: add si_install_draw_wrapper

This allows to implement custom draw_vbo code-path without
touching si_draw_vbo.

As an example, skipped all draw calls with an odd new_draws
could be done like this:

   void mywrapper(...) {
       if (new_draws % 2)
          return;
       return sctx->real_draw_vbo(...);
   }

   if (some_condition_is_met)
      si_install_draw_wrapper(sctx, mywrapper);

Instead of having to add the "if ()" condition inside si_draw_vbo.

Note that a single wrapper may be installed so care must be taken
to not override an existing wrapper.

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

3 years agoradeonsi: add _once suffix to depth_cleared_level_mask
Pierre-Eric Pelloux-Prayer [Fri, 7 May 2021 09:48:34 +0000 (11:48 +0200)]
radeonsi: add _once suffix to depth_cleared_level_mask

And add a new variable to disambiguate between "has been cleared once" and
"is cleared".

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

3 years agogallium/u_threaded: merge draws faster by merging indexbuf unreferencing
Marek Olšák [Sun, 13 Jun 2021 16:13:50 +0000 (12:13 -0400)]
gallium/u_threaded: merge draws faster by merging indexbuf unreferencing

Instead of N times decrementing the index buffer refcount by 1, decrement
it by N once.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11349>

3 years agoturnip: Copy command buffers to deferred submit request
Hyunjun Ko [Tue, 8 Jun 2021 06:49:45 +0000 (06:49 +0000)]
turnip: Copy command buffers to deferred submit request

To make sure the index of global bo table in drm_msm_gem_submit_cmd is
valid at actual submit time.

v1. Move the entry_count calculation into the submit request creation
function.

Fixes: #4877
Fixes: 3f229e34 ("turnip: Implement VK_KHR_timeline_semaphore.")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11260>

3 years agocrocus: fix scanout tiling so glamor/modesetting can work.
Dave Airlie [Mon, 14 Jun 2021 07:29:45 +0000 (17:29 +1000)]
crocus: fix scanout tiling so glamor/modesetting can work.

This fixes the scanout tiling to be like iris, with this X/glamor
can run.

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

3 years agocrocus: enable GL_EXT_memory_object feature on gen7
Dave Airlie [Mon, 14 Jun 2021 02:37:41 +0000 (12:37 +1000)]
crocus: enable GL_EXT_memory_object feature on gen7

This is enabled by enabling gallium's memobj capability.

Ports 05cf1e7f36cb5337aea3467c730bac1b80494730 from iris

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

3 years agocrocus: plumb device/driver UUID generators
Dave Airlie [Mon, 14 Jun 2021 03:25:57 +0000 (13:25 +1000)]
crocus: plumb device/driver UUID generators

Ports 456fa9b8385b14d6f2d4bea16e89bf280c4d5b3f from iris.

    Use the same generators as used in anv driver so both Vulkan and OpenGL
    drivers can share the same external memory objects.

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

3 years agocrocus: hook up resource creation from memory object
Dave Airlie [Mon, 14 Jun 2021 02:34:45 +0000 (12:34 +1000)]
crocus: hook up resource creation from memory object

Port 772dc50d162f6ac99676ef5134607f0d0e6db21e from iris

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

3 years agocrocus: hook up memory object creation from handle
Dave Airlie [Mon, 14 Jun 2021 02:27:49 +0000 (12:27 +1000)]
crocus: hook up memory object creation from handle

Port cdb5a727644e9fd0195519f81ce34f79a99ae432 from iris

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

3 years agocrocus: Drop buffer support in resource_from_handle
Dave Airlie [Mon, 14 Jun 2021 02:03:43 +0000 (12:03 +1000)]
crocus: Drop buffer support in resource_from_handle

Port 9d503b36ca24e1747e99a034e05700ad80c0682c from iris

   The callers don't seem to pass targets of PIPE_BUFFER. Stop nesting an
   if-else block by dropping support for this target.

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

3 years agocrocus: introduce main resource configuration helper.
Dave Airlie [Sun, 13 Jun 2021 23:43:40 +0000 (09:43 +1000)]
crocus: introduce main resource configuration helper.

Along the lines of what iris does.

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

3 years agocrocus: Make iris_bo_import_dmabuf take a modifier
Dave Airlie [Mon, 14 Jun 2021 01:51:37 +0000 (11:51 +1000)]
crocus: Make iris_bo_import_dmabuf take a modifier

Port 493298528a82e2ab7cf3ce6aed187fe19730e3d0 from iris

    Replace the tiling parameter with a modifier parameter. I find it more
    straightforward to have this function figure out the tiling from the
    modifier than to have its caller do it.

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

3 years agocrocus: Don't call SET_TILING for dmabuf imports
Dave Airlie [Mon, 14 Jun 2021 01:41:37 +0000 (11:41 +1000)]
crocus: Don't call SET_TILING for dmabuf imports

This is a port of c111e9099ceada50a2437e6e2e2a0f7cc6597448 from iris to
crocus.

    Calling SET_TILING on a DMA buffer with the gen12 CCS modifier can fail
    unnecessarily. The main surface in the BO is Y-tiled, but the CCS portion is
    linear and can have a stride that's not a multiple of 128B. Because SET_TILING
    is called on the CCS plane with I915_TILING_Y, the ioctl will sometimes reject
    the stride.

    SET_TILING was originally used in b6d45e7f748e9ff7e198391f5ce5d1253101fedb to
    fix an assertion failure in iris_resource_from_handle. Assigning the BO's
    tiling_mode field is sufficient to avoid the failure.

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

3 years agoci: remove unzip from several containers that don't use it at all
Andres Gomez [Tue, 1 Jun 2021 10:37:54 +0000 (13:37 +0300)]
ci: remove unzip from several containers that don't use it at all

Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11110>

3 years agogallium/u_threaded: use tc_drop_resource_reference in call_draw_single_drawid
Marek Olšák [Sun, 6 Jun 2021 17:35:51 +0000 (13:35 -0400)]
gallium/u_threaded: use tc_drop_resource_reference in call_draw_single_drawid

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11335>

3 years agogallium/u_threaded: clear valid buffer range only if it's not bound for write
Marek Olšák [Thu, 20 May 2021 09:05:01 +0000 (05:05 -0400)]
gallium/u_threaded: clear valid buffer range only if it's not bound for write

We can't invalidate the range if a buffer is bound for write because we
would need to add the range that is bound, which we don't track.

This fixes buffer mappings incorrectly promoted to unsynchronized because
the valid range was cleared while the buffers were bound for write.

It also clears the valid range if the invalidation is allowed but skipped.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11335>

3 years agogallium/u_threaded: don't update valid_buffer_range for read-only shader buffers
Marek Olšák [Sat, 12 Jun 2021 00:18:28 +0000 (20:18 -0400)]
gallium/u_threaded: don't update valid_buffer_range for read-only shader buffers

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11335>

3 years agoutil/prim_restart: use more direct conversion for restart index
Mike Blumenkrantz [Mon, 14 Jun 2021 19:20:58 +0000 (15:20 -0400)]
util/prim_restart: use more direct conversion for restart index

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

3 years agoaux/tc: pass rebind count and rebind bitmask with replace_buffer_storage func
Mike Blumenkrantz [Wed, 2 Jun 2021 19:43:43 +0000 (15:43 -0400)]
aux/tc: pass rebind count and rebind bitmask with replace_buffer_storage func

tc already calculates all the rebinding that needs to be done on a given
context, so (some of) this info can be passed on to drivers to enable
optimizations

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

3 years agozink: Fix win32 build
Michel Zou [Mon, 14 Jun 2021 08:14:32 +0000 (10:14 +0200)]
zink: Fix win32 build

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11338>

3 years agozink: Drop useless zink_dispatch_table
Michel Zou [Sun, 13 Jun 2021 17:36:53 +0000 (19:36 +0200)]
zink: Drop useless zink_dispatch_table

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11338>