platform/upstream/mesa.git
3 years agou_format: Define tests for r3g3b2 formats and fix BE swizzles for them.
Eric Anholt [Tue, 27 Apr 2021 23:48:20 +0000 (16:48 -0700)]
u_format: Define tests for r3g3b2 formats and fix BE swizzles for them.

These tests passed for LE, and the BE channel ordering specified obviously
didn't fit the pattern of the other BE formats (channels are listed
right-to-left in the BE columns for historical reasons).

Note that we can't write pure-integer format tests in u_format_tests.c
currently.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agou_format: Assert that array formats don't include BE swizzles.
Eric Anholt [Tue, 27 Apr 2021 22:47:31 +0000 (15:47 -0700)]
u_format: Assert that array formats don't include BE swizzles.

Z32_FLOAT_S8X24_UINT and X32_S8X24_UINT are in fact the only non-bitmask
formats that have BE swizzles specified, but sorting out those two is
harder.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agou_format: Use the nice helper for reversing an array.
Emma Anholt [Tue, 1 Jun 2021 20:37:56 +0000 (13:37 -0700)]
u_format: Use the nice helper for reversing an array.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agou_format: Move the BE swizzle computation into Format init.
Eric Anholt [Tue, 27 Apr 2021 22:39:16 +0000 (15:39 -0700)]
u_format: Move the BE swizzle computation into Format init.

I wanted to do the next set BE changes here where I have Format's helper
functions available.

No changes in generated u_format_table.c.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agou_format: Drop redundant .name init.
Eric Anholt [Tue, 27 Apr 2021 22:56:23 +0000 (15:56 -0700)]
u_format: Drop redundant .name init.

It's the first member that's set.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agou_format: Fix some pep8 in u_format_parse.py.
Eric Anholt [Tue, 27 Apr 2021 22:40:21 +0000 (15:40 -0700)]
u_format: Fix some pep8 in u_format_parse.py.

My editor likes to enforce pep8, here's some low hanging fruit so I don't
have to do too much add -p.

Acked-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10505>

3 years agoturnip: fix register_index calculations of xfb outputs
Danylo Piliaiev [Tue, 1 Jun 2021 13:27:27 +0000 (16:27 +0300)]
turnip: fix register_index calculations of xfb outputs

nir_assign_io_var_locations() does not use outputs_written when
assigning driver locations. Use driver_location to avoid incorrectly
guessing what locations it assigned.

Copied from lavapipe 8731a1beb72da8f4165e5596519a56d16299c3f0

Will fix provoking vertex tf tests when VK_EXT_provoking_vertex
would be enabled:
 dEQP-VK.rasterization.provoking_vertex.transform_feedback.*

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

3 years agoturnip: emit vb stride dynamic state when it is dirty
Danylo Piliaiev [Wed, 2 Jun 2021 11:15:46 +0000 (14:15 +0300)]
turnip: emit vb stride dynamic state when it is dirty

Due to incorrect condition we never emitted vb stride
if state was dynamically set.

Fixes vertex explosion with Zink.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4738

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

3 years agoiris: Use bo->mmap_mode in transfer map read check
Kenneth Graunke [Thu, 27 May 2021 03:13:26 +0000 (20:13 -0700)]
iris: Use bo->mmap_mode in transfer map read check

The scenario we want to avoid is reading from WC or UC mappings,
so this is an easier to follow check.

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

3 years agoiris: Pick a single mmap mode (WB/WC) at BO allocation time
Kenneth Graunke [Thu, 20 May 2021 09:02:51 +0000 (02:02 -0700)]
iris: Pick a single mmap mode (WB/WC) at BO allocation time

Previously, iris_bufmgr had the ability to maintain multiple
simultaneous memory mappings for a BO, one in WB mode (with CPU caches),
and another in WC (streaming) mode.  Depending on the flags passed to
iris_bo_map(), we would select one mode or the other.

The rules for deciding which to use were:

- Systems with LLC always use WB mode because it's basically free
- Non-LLC systems used...
  - WB maps for all BOs where snooping is enabled (which translates to
    when BO_ALLOC_COHERENT is set at allocation time)
  - WB maps for reads unless persistent, coherent, async, or raw.
  - WC maps for everything else.

This patch simplifies the system by selecting a single mmap mode at
BO allocation time, and always using that.  Each BO now has at most one
map at a time, rather than up to two (or three before we deleted GTT
map support in recent patches).

In practical terms, this eliminates the capability to use WB maps for
reads of non-snooped BOs on non-LLC systems.  Such reads would now be
slow, uncached reads.  However, iris_transfer_map recently began using
staging blits for such reads - so the GPU copies the data to a snooped
buffer which will be mapped WB.  So, rather than incurring slow UC
reads, we really just take the hit of a blit, and retain fast reads.

The rest of the rules remain the same.

There are a few reasons for this:

1. TTM doesn't support mapping an object as both WB and WC.  The
   cacheability is treated as a property of the object, not the map.
   The kernel is moving to use TTM as part of adding discrete local
   memory support.  So it makes sense to centralize on that model.

2. Mapping the same BO as both WB and WC is impossible to support on
   some CPUs.  It works on x86/x86_64, which was fine for integrated
   GPUs, but it may become an issue for discrete graphics paired with
   other CPUs (should that ever be a thing we need to support).

3. It's overall much simpler.  We only have one bo->map field, and
   manage to drop a significant amount of boilerplate.

One issue that arises is the interaction with the BO cache: BOs with
WB maps and WC maps will be lumped together into the same cache.  This
means that a cached BO may have the wrong mmap mode.  We check that,
and if it doesn't match, we unmap it, waiting until iris_bo_map is
called to restore one with the desired mode.  This may underutilize
cache mappings slightly on non-LLC systems, but I don't expect it to
have a large impact.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4747
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10941>

3 years agoiris: Delete GTT mapping support
Kenneth Graunke [Thu, 20 May 2021 09:22:51 +0000 (02:22 -0700)]
iris: Delete GTT mapping support

In the bad old days, i965 used GTT mapping for detiling maps.  iris
never has, however.  The only reason it used GTT maps was in weird
fallback cases for dealing with BO imports from foreign memory.  We
now do staging blits for those, and never mmap them.

There are no more users of GTT mapping, so we can delete it.

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

3 years agoiris: Drop fallback GEM_MMAP_GTT if GEM_MMAP with I915_MMAP_WC fails
Kenneth Graunke [Thu, 20 May 2021 08:41:37 +0000 (01:41 -0700)]
iris: Drop fallback GEM_MMAP_GTT if GEM_MMAP with I915_MMAP_WC fails

XXX: This is actually wrong.  The dmabuf imported case can be mapped via
GEM_MMAP_GTT if the iommu is working, according to Joonas, but GEM_MMAP
would fall over and fail.  So we would need this fallback.
ALTERNATIVELY...we would need to flag such imported dmabufs as
unmappable, and then make iris_transfer_map/unmap always do blits
instead of direct mappings.  That seems like the saner approach

We never want to use GEM_MMAP_GTT, as it does detiling maps, and iris
always wants direct maps.  There were originally two cases that this
fallback path was attempting to handle:

1. The BO was allocated from stolen memory that we can't GEM_MMAP.

   At one point, kernel patches were being proposed to use stolen
   memory for userspace buffers, but these never landed.  The kernel
   has never given us stolen memory, so we cannot hit this case.

2. Imported objects may be from memory we can't GEM_MMAP.

   For example, a DMABUF from a discrete AMD/NVIDIA GPU in a PRIME
   setup would be backed by memory that we can't GEM_MMAP.  We could
   try and mmap these directly with GEM_MMAP_GTT, but that relies on
   the IOMMU working.  We could mmap the DMABUF fd directly (but have
   never tried to do so), but there are complex rules there.  Instead,
   we now flag those imports, however, and rely on the iris_transfer_map
   code to perform staging blits on the GPU, so we never even try to
   map them directly.  So this case won't reach us here any longer.

With both of those out of the way, there is no need for a fallback.

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

3 years agoiris: Assert on mapping a tiled buffer without MAP_RAW
Kenneth Graunke [Thu, 20 May 2021 07:46:30 +0000 (00:46 -0700)]
iris: Assert on mapping a tiled buffer without MAP_RAW

iris has never relied on detiled maps using hardware fences.
This code is a remnant of i965, where that was actually used.

We can just assert that callers don't do such a thing.

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

3 years agoiris: Use staging blits for transfers involving imported BOs
Kenneth Graunke [Thu, 20 May 2021 18:22:22 +0000 (11:22 -0700)]
iris: Use staging blits for transfers involving imported BOs

Direct mappings of imported DMABUFs can be tricky.  If they're allocated
from our own device, then we can probably mmap them and it'd be fine.
But they may come from a different device (such as a discrete GPU), in
which case I915_GEM_MMAP wouldn't work, I915_GEM_MMAP_GTT would require
a working IOMMU, and directly mmap'ing the DMABUF fd would come with a
bunch of rules and restrictions which are hard to get right.

CPU mapping an imported DMABUF image for writes seems very uncommon,
solidly in the "what are you even doing?" realm.  Mapping an imported
DMABUF for reading might be a thing, in case someone wanted to do
glReadPixels on it.  But in that case, the cost of doing a staging
blit is probably acceptable.

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

3 years agoiris: Use staging blits for reads from uncached buffers.
Kenneth Graunke [Thu, 20 May 2021 07:14:53 +0000 (00:14 -0700)]
iris: Use staging blits for reads from uncached buffers.

If we're doing CPU reads of a resource that doesn't have CPU caches
enabled for the mapping (say, in device local memory, or WC mapped),
then blit it to a temporary that does have those caches enabled.

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

3 years agoiris: Track imported vs. exported status separately
Kenneth Graunke [Thu, 20 May 2021 17:55:53 +0000 (10:55 -0700)]
iris: Track imported vs. exported status separately

Not all external objects are the same.  Imported buffers may be from
other devices (say a dmabuf from an AMD or NVIDIA discrete card) which
are backed by memory that we can't use with I915_GEM_MMAP.  However,
exported buffers are ones that we know we allocated ourselves from our
own device.  We may not know what other clients are doing with them,
but we can assume a bit more about where they came from.

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

3 years agoiris: Make an iris_bo_is_external() helper and use it in a few places
Kenneth Graunke [Thu, 20 May 2021 17:53:39 +0000 (10:53 -0700)]
iris: Make an iris_bo_is_external() helper and use it in a few places

I'd like to start tracking "imported" vs. "exported" for objects,
rather than a blanket "external" flag.  Instead of directly checking
bo->external, use a new helper that will eventually be "imported or
exported".

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

3 years agoiris: Delete a comment suggesting we use tiled staging buffers
Kenneth Graunke [Thu, 20 May 2021 18:25:35 +0000 (11:25 -0700)]
iris: Delete a comment suggesting we use tiled staging buffers

We basically tried this, and it performed worse, so delete the
suggestion in the comments that we may want to do it someday.

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

3 years agoiris: Promote to MAP_DIRECTLY when required before NULL return
Kenneth Graunke [Thu, 20 May 2021 18:15:30 +0000 (11:15 -0700)]
iris: Promote to MAP_DIRECTLY when required before NULL return

In some cases, we have to map directly (e.g. coherent/persistent maps).
In other cases (e.g. tiled), we /cannot/ map directly.  We should put
the code which adds the PIPE_MAP_DIRECTLY flag in mandatory cases before
the "bail and return NULL" check for cases where we can't do that.

We leave the "we would prefer to direct map this" cases after the error
check, since we -can- use blits for those, we'd just rather not.  ASTC
also stays because even though it's tiled, our tiled memcpy paths work.

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

3 years agoiris: Replace no_gpu flag with PIPE_MAP_DIRECTLY
Kenneth Graunke [Thu, 13 May 2021 05:19:42 +0000 (22:19 -0700)]
iris: Replace no_gpu flag with PIPE_MAP_DIRECTLY

Here, we're deciding when to map the buffer directly, rather than using
the GPU to blit to/from a temporary.  There is already a flag for that,
PIPE_MAP_DIRECTLY, which has the added benefit of not being a negative
(such as "no_gpu").

Currently, we intend to map directly if:

1. Direct mappings were requested explicitly
2. Persistent or coherent mappings were requested (and so we must)
3. ASTC textures (we currently can't blit those correctly)
4. There is no need for a temporary (there's no image compression that
   the CPU wouldn't understand, and we don't need to avoid stalls due
   to the buffer being busy on the GPU)

Expressing "please memory map this directly" is easier to follow than
"please don't use the GPU as part of mapping this".

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

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 2 Jun 2021 16:39:14 +0000 (12:39 -0400)]
zink: ci updates

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

3 years agozink: handle null bufferview/imageview descriptors when robustness2 is missing
Mike Blumenkrantz [Thu, 25 Mar 2021 19:55:47 +0000 (15:55 -0400)]
zink: handle null bufferview/imageview descriptors when robustness2 is missing

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

3 years agozink: create dummy surface/bufferview for null descriptor use
Mike Blumenkrantz [Thu, 25 Mar 2021 19:55:33 +0000 (15:55 -0400)]
zink: create dummy surface/bufferview for null descriptor use

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

3 years agozink: replace context-based null framebuffer surfaces with internal ones
Mike Blumenkrantz [Thu, 25 Mar 2021 19:44:18 +0000 (15:44 -0400)]
zink: replace context-based null framebuffer surfaces with internal ones

this is a bit cleaner and avoids accessing the context

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

3 years agozink: add a util function to create a null surface
Mike Blumenkrantz [Thu, 25 Mar 2021 19:42:53 +0000 (15:42 -0400)]
zink: add a util function to create a null surface

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

3 years agoci: build the hang-detection tool into x86_test-vk
Andres Gomez [Mon, 31 May 2021 11:41:21 +0000 (14:41 +0300)]
ci: build the hang-detection tool into x86_test-vk

hang-detection is a vulkan-based lightweight wrapper from
parallel-deqp-runner that periodically submits empty command buffers
and waits for their completions. If the completion never happens, the
GPU is considered hung, the wrapped script is killed, and the job
should get aborted.

This should have no negative impact on the runtime of dEQP/traces/...,
but will allow saving time when the GPU gets hung as we can abort the
job immediately rather than waiting for the timeout.

In the case of B2C, we are using this tool's error message as a way to
trigger the reboot of the test machine and start again.

v2:
  - Use hang-detection already with some jobs (Martin).

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11087>

3 years agoci: fix the vkd3d-proton runner
Andres Gomez [Mon, 31 May 2021 19:35:25 +0000 (22:35 +0300)]
ci: fix the vkd3d-proton runner

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11087>

3 years agoturnip: reset push descriptor set on command buffer reset
Danylo Piliaiev [Wed, 2 Jun 2021 13:07:13 +0000 (16:07 +0300)]
turnip: reset push descriptor set on command buffer reset

Otherwise it will store a pointer to already unmapped memory which
could lead to a crash in tu_CmdPushDescriptorSetWithTemplateKHR since
it tries to copy data from the old memory.

Fixes a crash with Zink's new lazy descriptor manager instroduced
in bfdd1d8d

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

3 years agoradv: explicitly load a desc set layout struct member during set allocate
Mike Blumenkrantz [Tue, 1 Jun 2021 15:11:00 +0000 (11:11 -0400)]
radv: explicitly load a desc set layout struct member during set allocate

accessing this variable repeatedly like this is a contended hotpath somehow,
so instead just create a const for reference

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11124>

3 years agoradv: declare index_va in a single call for indexed draw packet emit
Mike Blumenkrantz [Tue, 30 Mar 2021 20:22:27 +0000 (16:22 -0400)]
radv: declare index_va in a single call for indexed draw packet emit

this is an extreme hotpath, so having a single calculation in a const
variable is slightly better for compiler microoptimizing

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11124>

3 years agodocs: add the doc-comment for fse-vars
Erik Faye-Lund [Tue, 1 Jun 2021 10:22:00 +0000 (12:22 +0200)]
docs: add the doc-comment for fse-vars

This just copies the comment that's in the code where this state is
stored. It seems better than nothing.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11106>

3 years agodocs: use envvar role for envvars
Erik Faye-Lund [Tue, 1 Jun 2021 09:30:08 +0000 (11:30 +0200)]
docs: use envvar role for envvars

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11106>

3 years agodocs: use file-role for paths
Erik Faye-Lund [Tue, 1 Jun 2021 09:36:46 +0000 (11:36 +0200)]
docs: use file-role for paths

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11106>

3 years agodocs: fix header-levels in envvars.rst
Erik Faye-Lund [Tue, 1 Jun 2021 09:44:50 +0000 (11:44 +0200)]
docs: fix header-levels in envvars.rst

It seems something went wrong during conversion of this article (or
maybe even before in the HTML version), where every header after the
"Gallium environment variables" header was nested below it.

That's clearly not what's meant here, so let's fix that.

This makes the toctree make a bit more sense for this article.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11106>

3 years agodocs: quote a few defines
Erik Faye-Lund [Tue, 1 Jun 2021 09:31:15 +0000 (11:31 +0200)]
docs: quote a few defines

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11106>

3 years agoaux/draw: fix aalines and aapoints for shaders with explicit FragData outputs
Mike Blumenkrantz [Fri, 28 May 2021 13:53:00 +0000 (09:53 -0400)]
aux/draw: fix aalines and aapoints for shaders with explicit FragData outputs

all color outputs need to be rewritten with coverage, not just FragColor

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

3 years agov3dv: implement external semaphore/fence extensions
Iago Toral Quiroga [Tue, 1 Jun 2021 07:41:48 +0000 (09:41 +0200)]
v3dv: implement external semaphore/fence extensions

This provides most of the implementation, but there are some
things we cannot enable until we improve of kernel submit
interface, namely:

We don't expose capacity to export SYNC_FD, although we do
have the implementation in place. This requires that we
improve our kernel interface and event wait implementation
first so we can cover the corner case where the application
submits a command buffer that includes a VkCmdWaitForEvents
and tries to export a SYNC_FD from its signal semaphores or
fence before it the event is signaled and the command buffer
is sent to the kernel for execution in full.

Likewise, we can't currently import semaphores. This is because
our current kernel submit interface can only take one syncobj.
We have been working around this so far by waiting on the last
syncobj produced from the device whenever we had to wait on any
semaphores (which is obviously suboptimal already), but this
won't work as soon as we allow importing external semaphores,
as those could (and would typically) be produced from a
different device.

Once we address the kernel bits, we should come back and enable
SYNC_FD exports as well as semaphore imports.

Relevant CTS tests:
dEQP-VK.api.external.fence.*
dEQP-VK.api.external.semaphore.*
dEQP-VK.synchronization.cross_instance.*

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

3 years agov3dv: don't keep an open file descriptor for imported fences/semaphores
Iago Toral Quiroga [Tue, 1 Jun 2021 07:33:36 +0000 (09:33 +0200)]
v3dv: don't keep an open file descriptor for imported fences/semaphores

We can (and should) close the descriptor immediately after the import.

Gets the following CTS test to pass without requiring to increase limits
for open file descriptors:
dEQP-VK.synchronization.basic.binary_semaphore.chain

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

3 years agoandroid: i965: remove brw_ff_gs_emit.c from Makefile.sources
Mauro Rossi [Sat, 8 May 2021 08:30:52 +0000 (10:30 +0200)]
android: i965: remove brw_ff_gs_emit.c from Makefile.sources

Fixes the following building error:

clang: error: no such file or directory: 'external/mesa/src/mesa/drivers/dri/i965/brw_ff_gs_emit.c'
clang: error: no input files

Fixes: 897bcc1e6b42 ("i965: drop old brw ff gs code.")
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10718>

3 years agoandroid: intel/compiler: add brw_compile_ff_gs.c to Makefile.sources
Mauro Rossi [Sat, 8 May 2021 09:18:38 +0000 (11:18 +0200)]
android: intel/compiler: add brw_compile_ff_gs.c to Makefile.sources

Fixes the following building error:

FAILED: out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/i965_dri_intermediates/LINKED/i965_dri.so
...
ld.lld: error: undefined symbol: brw_compile_ff_gs_prog
>>> referenced by brw_ff_gs.c:56 (external/mesa/src/mesa/drivers/dri/i965/brw_ff_gs.c:56)

Fixes: 52e426fd8b57 ("intel/compiler: add support for compiling fixed function gs")
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10718>

3 years agoCI: Fix path confusion in OpenCL Piglit execution
Daniel Stone [Mon, 31 May 2021 20:01:42 +0000 (21:01 +0100)]
CI: Fix path confusion in OpenCL Piglit execution

When we remove the contents of the results directory, we `cd` into it.
The script expects that $PWD is /piglit, and $OLDPWD is the Mesa build
directory, however the cd into the results directory will make $OLDPWD
be $BUILDDIR/results.

This means that Piglit emits into results/results/ which looks weird,
but more importantly also fails OpenCL Piglit execution, because we
can't find our baseline result expectations.

Fix it by using an explicit variable rather than relying on history.

Fixes: 683ddf19dc85 ("ci: remove results directory content only with piglit runners")
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10856
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11126>

3 years agoRevert "CI: Disable rk3399-gru-kevin jobs for now"
Daniel Stone [Mon, 31 May 2021 08:50:40 +0000 (09:50 +0100)]
Revert "CI: Disable rk3399-gru-kevin jobs for now"

We've got 7/10 devices back now, that'll do.

This reverts commit 79a7f33710b84218a040a2bd540d7c39d1c0d2d4.

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

3 years agosparc: Avoid some redefinition warnings
Matt Turner [Tue, 1 Jun 2021 21:38:19 +0000 (14:38 -0700)]
sparc: Avoid some redefinition warnings

These definitions are provided by m_vector_asm.h now.

Fixes: 67ffb853f05 ("sparc: Reuse m_vector_asm.h.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11119>

3 years agoci/lava: Switch LAVA jobs to x86 runners
Tomeu Vizoso [Mon, 31 May 2021 07:03:04 +0000 (09:03 +0200)]
ci/lava: Switch LAVA jobs to x86 runners

So we don't need to provision aarch64 servers, which are these days
rarer than x8_64.

In the switch to the new runner tags, switch to one which contains the
device type, so we can dimension the runner jobs taking into account the
number of DUTs available.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.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/11108>

3 years agofreedreno/afuc: Print uintptr_t with PRIxPTR
Matt Turner [Tue, 1 Jun 2021 21:00:30 +0000 (14:00 -0700)]
freedreno/afuc: Print uintptr_t with PRIxPTR

Fixes a compilation error on 32-bit.

Fixes: bba61cef38b ("freedreno/afuc: Add emulator mode to afuc-disasm")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11118>

3 years agoci/android: Update to building for SDK 29 by default.
Eric Anholt [Wed, 21 Apr 2021 21:00:34 +0000 (14:00 -0700)]
ci/android: Update to building for SDK 29 by default.

This will get us build coverage of a bunch of Vulkan features, plus the
ELF TLS support.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>

3 years agoandroid: Fix ELF TLS support.
Eric Anholt [Wed, 21 Apr 2021 20:58:58 +0000 (13:58 -0700)]
android: Fix ELF TLS support.

Android 29 introduced general-dynamic TLS variable support ("quick
function call to look up the location of the dynamically allocated
storage"), while Mesa on normal Linux has used initial-exec ("use some of
the startup-time fixed slots, hope for the best!").  Both would be better
options than falling all the way back to pthread_getspecific(), which is
the alternative we have pre-29.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>

3 years agoutil: Add a helper macro for defining initial-exec variables.
Emma Anholt [Fri, 21 May 2021 20:23:07 +0000 (13:23 -0700)]
util: Add a helper macro for defining initial-exec variables.

I'm going to add another case for Android shortly, and then we can keep
the logic all in one spot.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>

3 years agoaux/draw: if pipe_draw_info::index_bias_varies is not set, ignore index_bias for N>1
Mike Blumenkrantz [Tue, 18 May 2021 15:10:02 +0000 (11:10 -0400)]
aux/draw: if pipe_draw_info::index_bias_varies is not set, ignore index_bias for N>1

this enables some optimizations in lavapipe

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10995>

3 years agoaux/trace: dump resource for samplerview and surface sandbox/jbko/21.2.0-devel
Mike Blumenkrantz [Tue, 25 May 2021 12:00:21 +0000 (08:00 -0400)]
aux/trace: dump resource for samplerview and surface

this is the most important member

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

3 years agodocs/gallium: Document the index buffer format convention
Alyssa Rosenzweig [Tue, 25 May 2021 21:59:46 +0000 (17:59 -0400)]
docs/gallium: Document the index buffer format convention

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agosi: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:37 +0000 (17:57 -0400)]
si: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agolima: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:31 +0000 (17:57 -0400)]
lima: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agofreedreno: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:26 +0000 (17:57 -0400)]
freedreno: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agoetnaviv: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:21 +0000 (17:57 -0400)]
etnaviv: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agov3d: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:41 +0000 (17:57 -0400)]
v3d: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agovc4: Use Rn_UINT instead of In_UINT for index buffers
Alyssa Rosenzweig [Tue, 25 May 2021 21:57:09 +0000 (17:57 -0400)]
vc4: Use Rn_UINT instead of In_UINT for index buffers

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10990>

3 years agozink: ci updates
Mike Blumenkrantz [Tue, 1 Jun 2021 23:07:16 +0000 (19:07 -0400)]
zink: ci updates

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

3 years agozink: optimize buffer rebinds
Mike Blumenkrantz [Wed, 10 Mar 2021 23:59:49 +0000 (18:59 -0500)]
zink: optimize buffer rebinds

by using the bind counts, the common cases of rebinds can be immediately
handled without unnecessary iteration, and following this each rebind can
be evaluated to ensure that every necessary descriptor was rebound in order
to catch any remaining corner cases that may not be handled in the optimized
rebind path

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

3 years agozink: unify more resource bind count tracking code
Mike Blumenkrantz [Mon, 1 Feb 2021 18:36:46 +0000 (13:36 -0500)]
zink: unify more resource bind count tracking code

we want to avoid updating these values when possible in order to reduce
overhead, which means that if a descriptor is being replaced, it should
be updated only if the replacement is not the same resource

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

3 years agozink: unify code for updating res->bind_count values
Mike Blumenkrantz [Mon, 1 Feb 2021 18:06:26 +0000 (13:06 -0500)]
zink: unify code for updating res->bind_count values

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

3 years agozink: add a second descriptor manager
Mike Blumenkrantz [Mon, 4 Jan 2021 18:34:13 +0000 (13:34 -0500)]
zink: add a second descriptor manager

this is the "lazy" descriptor manager, which aims to perform the least
amount of work calculating updates while ignoring the overhead that an
update may incur: effectively the inverse of the caching manager

in this initial implementation, divergence exists between the descriptor
layouts of the cached manager and the lazy manager in order to avoid
incurring regressions in the existing descriptor architecture; this will
be reconciled in a followup MR that refactors and unifies descriptor layouts

during this interim period and until such reconciliation occurs,
the default descriptor manager is now the lazy manager for testing purposes as
there are no changes here which can affect the existing infrastructure

the caching descriptor manager can be selected with the ZINK_CACHE_DESCRIPTORS
env var and will be automatically used for vulkan drivers which don't support
the features required for lazy mode (templates)

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

3 years agopanfrost/ci: Report flakes on IRC
Alyssa Rosenzweig [Wed, 26 May 2021 23:00:00 +0000 (19:00 -0400)]
panfrost/ci: Report flakes on IRC

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

3 years agoci: Move the flakes channels to OFTC
Emma Anholt [Wed, 26 May 2021 21:13:47 +0000 (14:13 -0700)]
ci: Move the flakes channels to OFTC

Following the rest of our channels, move CI reporting over.  Seems to
still work fine.  This affects freedreno and iris.

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

3 years agoci: Add known-flake handling for the IRC flake reports
Emma Anholt [Wed, 26 May 2021 17:45:33 +0000 (10:45 -0700)]
ci: Add known-flake handling for the IRC flake reports

Now, flakes that aren't in the *-flakes.txt get a "NEW" in their report so
I can watch for them.

The bash was unwieldy and made debugging hard, so I switched to python.

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

3 years agoanv: fix availability for copying timestamp query results
Mike Blumenkrantz [Tue, 1 Jun 2021 16:26:27 +0000 (12:26 -0400)]
anv: fix availability for copying timestamp query results

idx here is the index of the value being written, so if it isn't used/incremented
when the query result is written, the availability result will clobber it and
be written to the same buffer offset

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

3 years agopanfrost: Eliminate reserve_* functions
Alyssa Rosenzweig [Thu, 20 May 2021 21:09:14 +0000 (17:09 -0400)]
panfrost: Eliminate reserve_* functions

We always want to reserve _something_, so reserve what we need at batch
creation time and stop trying to re-reserve in a zillion places after.
This has a neglible (<128 bytes per batch) increase in memory usage for
compute-only workloads, but given the amount of simplication, that's a
fair tradeoff.

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

3 years agopanfrost: Elucidate thread group split field
Alyssa Rosenzweig [Thu, 20 May 2021 23:25:00 +0000 (19:25 -0400)]
panfrost: Elucidate thread group split field

Last unknown field in the XML :-)

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

3 years agopanfrost: Bubble up errors
Alyssa Rosenzweig [Thu, 20 May 2021 23:12:13 +0000 (19:12 -0400)]
panfrost: Bubble up errors

Instead of punting to PAN_MESA_DEBUG=msgs, which we can now remove.

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

3 years agopanfrost: Minor changes to draw_vbo
Alyssa Rosenzweig [Thu, 20 May 2021 22:29:14 +0000 (18:29 -0400)]
panfrost: Minor changes to draw_vbo

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

3 years agopanfrost: Write translate_index_size better
Alyssa Rosenzweig [Thu, 20 May 2021 20:43:51 +0000 (16:43 -0400)]
panfrost: Write translate_index_size better

Encodings line up with Gallium except for uint32.

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

3 years agopanfrost: Dirty track stack sizes
Alyssa Rosenzweig [Thu, 20 May 2021 18:13:07 +0000 (14:13 -0400)]
panfrost: Dirty track stack sizes

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

3 years agopanfrost: Don't allocate empty varying buffer
Alyssa Rosenzweig [Thu, 20 May 2021 18:10:25 +0000 (14:10 -0400)]
panfrost: Don't allocate empty varying buffer

If the FS doesn't actually read any varyings, there's no point.

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

3 years agopanfrost: Dirty track constant buffers
Alyssa Rosenzweig [Thu, 20 May 2021 17:38:57 +0000 (13:38 -0400)]
panfrost: Dirty track constant buffers

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

3 years agopanfrost: Analyze sysval dirty flags
Alyssa Rosenzweig [Thu, 20 May 2021 17:22:39 +0000 (13:22 -0400)]
panfrost: Analyze sysval dirty flags

We want dirty tracking for constant buffer uploads, but which dirty
flags are needed depend on what the sysvals are. So for each sysval,
record a corresponding dirty flag at compile time, so at draw-time the
check is easy.

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

3 years agopanfrost: Add draw parameters dirty flags
Alyssa Rosenzweig [Thu, 20 May 2021 17:22:01 +0000 (13:22 -0400)]
panfrost: Add draw parameters dirty flags

Needed to track some new sysvals.

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

3 years agopanfrost: Shrink pan_draw_mode return type
Alyssa Rosenzweig [Thu, 20 May 2021 17:11:02 +0000 (13:11 -0400)]
panfrost: Shrink pan_draw_mode return type

Let gcc emit ldrb instead of ldr for the table. Found by perf, but total
waste of time >_>

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

3 years agopanfrost: Update comment
Alyssa Rosenzweig [Wed, 19 May 2021 21:48:25 +0000 (17:48 -0400)]
panfrost: Update comment

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

3 years agoci/v3dv: update expected results
Juan A. Suarez Romero [Mon, 31 May 2021 15:47:02 +0000 (17:47 +0200)]
ci/v3dv: update expected results

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

3 years agopanfrost: Fix pan_pool_ref construction
Antonio Caggiano [Fri, 28 May 2021 12:45:03 +0000 (14:45 +0200)]
panfrost: Fix pan_pool_ref construction

Fix designator order for `pan_pool_ref` fields by matching declaration
order and avoid an error by the C++ compiler.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11064>

3 years agodocs: add basic documentation for venus
Chia-I Wu [Tue, 25 May 2021 20:11:25 +0000 (13:11 -0700)]
docs: add basic documentation for venus

It probably lacks some details but is a start at least.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10988>

3 years agogitlab-ci: enable building of Vulkan tests in Piglit
Tapani Pälli [Mon, 31 May 2021 07:09:55 +0000 (10:09 +0300)]
gitlab-ci: enable building of Vulkan tests in Piglit

This is part of tackling a Piglit issue:
https://gitlab.freedesktop.org/mesa/piglit/-/issues/53

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10971>

3 years agopanfrost: Use first_tiler to check if tiling is needed
Icecream95 [Mon, 31 May 2021 11:20:33 +0000 (23:20 +1200)]
panfrost: Use first_tiler to check if tiling is needed

If there is a preload job needing tiling, but no other jobs, then
first_tiler will be set but not tiler_dep.

Fixes faults when two depth-only (stencil is reloaded) clears are done
in a row.

panfrost ffa30000.gpu: Unhandled Page fault in AS1 at VA 0x0000000044870000
               Reason: TODO
               raw fault status: 0x49002C1
               decoded fault status: SLAVE FAULT
               exception type 0xC1: TRANSLATION_FAULT_LEVEL1
               access type 0x2: READ
               source id 0x490
panfrost ffa30000.gpu: gpu sched timeout, js=0, config=0x3301, status=0x8, head=0x608a300, tail=0x608a300, sched_job=f5b0862d

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11104>

3 years agopanfrost: Call abort() when aborting on fault
Icecream95 [Mon, 31 May 2021 11:18:07 +0000 (23:18 +1200)]
panfrost: Call abort() when aborting on fault

The existing exit(EIO) wasn't getting trapped by debuggers.

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

3 years agopan/decode: Flush the dump stream after decoding
Icecream95 [Mon, 31 May 2021 11:18:48 +0000 (23:18 +1200)]
pan/decode: Flush the dump stream after decoding

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

3 years agogitlab-ci: add python script to submit lava jobs
Gustavo Padovan [Sat, 29 May 2021 00:38:54 +0000 (21:38 -0300)]
gitlab-ci: add python script to submit lava jobs

Covert the job submission process to a python script for more
robustness and control. allowing easier manipulation of job data.

As a result, it adds retry logic to deal with Infrastructure Errors in LAVA.

_call_proxy() is equipped with a robust retry logic, which I have been
using already in the past few weeks in stress testing to run hundreds
of jobs.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11079>

3 years agov3d/simulator: use BFC/RFC registers to wait for bin/render to complete
Alejandro Piñeiro [Thu, 27 May 2021 08:59:07 +0000 (10:59 +0200)]
v3d/simulator: use BFC/RFC registers to wait for bin/render to complete

We were using the CT0CA (Control List Executor Current Address) and
CT0EA (Control List Executor End Address) registers, but that would
only wait for the CLE to reach the end of the list, but there could
still be things in the rest of the pipeline.

Even if that seems to work with the current simulator, the correct way
to do that is using the BFC (Binning Mode Flush Count) and RFC
(Rendering Mode Frame Count) registers instead.

In fact, this would be needed with a newer simulator snapshot, in
order to get the followint CTS tests working:
  dEQP-VK.api.copy_and_blit.core.resolve_image.whole_array_image.4_bit
  dEQP-VK.api.copy_and_blit.core.resolve_image.whole_array_image_one_region.4_bit
  dEQP-VK.api.copy_and_blit.core.resolve_image.whole_copy_before_resolving.4_bit
  dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
  dEQP-VK.api.image_clearing.core.clear_color_image.1d.optimal.multiple_layers.r32g32_uint
  dEQP-VK.api.image_clearing.core.clear_color_image.1d.optimal.remaining_array_layers_twostep.r16_sint

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

3 years agov3d/simulator: use the proper register when waiting on a CSD submit
Alejandro Piñeiro [Wed, 26 May 2021 21:21:31 +0000 (23:21 +0200)]
v3d/simulator: use the proper register when waiting on a CSD submit

Until now we were waiting until having a dispatch current and/or
queued. But that would only wait for all shaders to have started, it
won't wait for them to have finished.

With this commit we wait until the NUM_COMPLETED_JOBS (that in spite
of that name, it is about dispatches) field got increased.

This is in general safest, and it is needed after the latest simulator
update to get CTS tests like the following ones working:

  dEQP-VK.compute.basic.copy_ssbo_multiple_invocations
  dEQP-VK.compute.basic.copy_ssbo_single_invocation
  dEQP-VK.compute.basic.ssbo_rw_single_invocation
  dEQP-VK.compute.basic.ssbo_unsized_arr_single_invocation
  dEQP-VK.compute.basic.ubo_to_ssbo_multiple_invocations
  dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation

v2 (from Juan feedback):
   * Clarify JOBS vs DISPATCHES

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

3 years agov3d/simulator: wait for cache flushes
Alejandro Piñeiro [Tue, 25 May 2021 21:52:48 +0000 (23:52 +0200)]
v3d/simulator: wait for cache flushes

Current code just assumes that flushes are instant, as simulator
doesn't really model the caches. So right now we have just an assert
that the flush has been done.

But that can change on the future, so let's change the assert for a
wait.

Note that for the l1t case we are writing on the field TMUWCF. So I
understand that then we need to wait for TMUWCF_SET, even if the
previous code was using L2TFLS_SET.

This also happpens on the kernel side. We need to check if this was a
typo on the kernel side.

v2 (from Juan feedback)
   * Add comment about the TMUWCF vs L2TFLS difference between this
     commit and the kernel.

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

3 years agov3d/simulator: add a cache flush mode enum
Alejandro Piñeiro [Sun, 23 May 2021 21:09:58 +0000 (23:09 +0200)]
v3d/simulator: add a cache flush mode enum

Makes the write to the l2t cache control more readable (without magic
numbers).

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

3 years agov3d/simulator: capture hub interrupts
Alejandro Piñeiro [Fri, 7 May 2021 23:11:42 +0000 (01:11 +0200)]
v3d/simulator: capture hub interrupts

So far we were not capturing any HUB interrupt, just core. This could
be a problem if any is fired, as we could enter on an infinite
loop. With this commit we start to capture them. So we split v3d_isr
into core and hub interrupt handling.

As reference we capture the same HUB interrupts that we capture on the
v3d kernel support.

It is worth to note that all those are mostly untested. Now with both
opengl/vulkan driver being stable we were not able to raise those
interrupts.

v2 (Juan feedback):
   * Just one V3D_VERSION >= 41 block, more readable
   * Assert that the core is 0 at v3d_isr_core (we don't handle
     multi-core right now).

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

3 years agobroadcom/compiler: use proper type field for atomic operations
Alejandro Piñeiro [Wed, 28 Apr 2021 22:57:25 +0000 (00:57 +0200)]
broadcom/compiler: use proper type field for atomic operations

We were using the num_components to infer it, but in the end it is
VEC2 for CMPXCHG and 32BIT for anything else.

This doesn't affect any test with the real hw, but fixes an assert
with the last version of the simulator.

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

3 years agoci/lava: Disable CPU frequency scaling
Tomeu Vizoso [Fri, 28 May 2021 09:41:20 +0000 (11:41 +0200)]
ci/lava: Disable CPU frequency scaling

Lock CPU frequency scaling to max to speed up test execution and lower
the variation of frame times from performance replay jobs.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11101>

3 years agoRevert "ci/freedreno: Skip Portal 2 trace on a630, due to flakiness"
Tomeu Vizoso [Fri, 28 May 2021 09:20:50 +0000 (11:20 +0200)]
Revert "ci/freedreno: Skip Portal 2 trace on a630, due to flakiness"

This reverts commit e381bc0e6711de83d393ef3cc0b6b795772c1813.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11058>

3 years agoac/rgp: bump the SQTT file minor version to 5
Samuel Pitoiset [Fri, 28 May 2021 12:56:04 +0000 (14:56 +0200)]
ac/rgp: bump the SQTT file minor version to 5

To match latest RGP spec. Captures generated by RADV still work
with latest RGP (v1.10).

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

3 years agoac/rgp: mark SQTT_FILE_CHUNK_TYPE_ISA_DATABASE as deprecated
Samuel Pitoiset [Fri, 28 May 2021 12:55:40 +0000 (14:55 +0200)]
ac/rgp: mark SQTT_FILE_CHUNK_TYPE_ISA_DATABASE as deprecated

This is now deprecated and reserved for future uses.

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

3 years agoasahi: Allocate slices for mipmapping
Alyssa Rosenzweig [Tue, 1 Jun 2021 00:08:50 +0000 (20:08 -0400)]
asahi: Allocate slices for mipmapping

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

3 years agoasahi: Set levels in texture descriptor
Alyssa Rosenzweig [Tue, 1 Jun 2021 00:08:57 +0000 (20:08 -0400)]
asahi: Set levels in texture descriptor

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

3 years agoasahi: Add mipmapping state to the XML
Alyssa Rosenzweig [Tue, 1 Jun 2021 00:08:37 +0000 (20:08 -0400)]
asahi: Add mipmapping state to the XML

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

3 years agoasahi: Abort on blit()
Alyssa Rosenzweig [Mon, 31 May 2021 23:21:49 +0000 (19:21 -0400)]
asahi: Abort on blit()

Unimplemented.

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