Commit Graph

138856 Commits

Author SHA1 Message Date
Juan A. Suarez Romero 14b66e27dc v3d: rename VC5 enums and definitions
As the driver was renamed in the past from VC5 to V3D, let's rename also
the definitions and enumerations to keep it consistent across the code.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Juan A. Suarez Romero 3c318e6335 v3d: rename header include guards
Long time ago VC5 was renamed to V3D, but the include guards `VC5_FOO_H`
were not.

In order to keep consistency, let's rename these guards from `VC5_FOO_H`
to `V3D_FOO_H`.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10402>
2021-04-29 11:22:12 +02:00
Caio Marcelo de Oliveira Filho e763db4a47 spirv: Don't replicate patch bool in vtn_variable
When we originally added patch variable handling to spirv_to_nir, we
were splitting I/O block variables in spirv_to_nir, so we weren't
guaranteed to have a nir_variable early enough in processing.

Since b0c643d8f5 ("spirv: Use NIR per-member splitting"), we've been
using NIR per-member splitting where we have a nir_variable which has
a separate nir_variable_data per member.  With this, we can drop
vtn_variable::patch and use the patch boolean on the nir_variable
instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10469>
2021-04-29 06:55:29 +00:00
Vinson Lee 3cd5e1b40f clover: Add constructor for constant_argument.
Fix defects reported by Coverity Scan.

member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize buf.
member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize st.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10399>
2021-04-28 22:30:07 -07:00
Jason Ekstrand 656c30ac59 intel/isl: There are seven aux states
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10515>
2021-04-28 23:16:03 -05:00
Mike Blumenkrantz 8243115836 zink: use first-created shader variant as the default
it's not really expected that most apps are going to be switching variants
all the time, so having the "default" one be more dynamic allows skipping
shader lookups more frequently

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10513>
2021-04-29 03:43:08 +00:00
Mike Blumenkrantz 6dab5898db zink: add fastpath for getting default shader variants
no need for hashing or lookups if this is the default variant

also have an alt variant for vertex stages to account for streamout and
halfz lowering

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10513>
2021-04-29 03:43:08 +00:00
Mike Blumenkrantz 1ff40cedf0 zink: create entrypoints for descriptor variables with spirv 1.5
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
2021-04-29 03:33:22 +00:00
Mike Blumenkrantz 3bf52471cc zink: generate spirv 1.5 from ntv when using vk >= 1.2
this has an ntv option so further tuning here should be easy enough

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10512>
2021-04-29 03:33:22 +00:00
Mike Blumenkrantz 6398605f28 zink: export PIPE_CAP_TGSI_CLOCK
ARB_shader_clock

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:20 -04:00
Mike Blumenkrantz ff5e0cb1bb zink: support nir_intrinsic_shader_clock
simple const unop

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:14 -04:00
Mike Blumenkrantz 0fba3bc236 zink: add spirv builder for unops with a const operand
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:11 -04:00
Mike Blumenkrantz 73210e3a99 zink: add conversion util for nir_scope -> SpvScope
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:08 -04:00
Mike Blumenkrantz 3c06eede9c zink: hook up VK_KHR_shader_clock
more extensions wooo

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10510>
2021-04-28 20:04:06 -04:00
Ian Romanick 3572e24e74 ci: Uprev piglit to b3a9fa345 ("framework/replay: Quote resource names before signing")
The PIGLIT_BUILD_CL_TESTS related changes were shamelessly stolen from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6441/diffs?commit_id=5742be00e6b493b5289ed8120eb06f10d341ea3a.

v2: Remove glslang-tools from arm_build.sh.  Suggested by Michel.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10492>
2021-04-28 21:11:34 +00:00
Chia-I Wu 1e3981f69c venus: enable external memory support
This enables VK_KHR_external_memory_fd and
VK_EXT_external_memory_dma_buf support.

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/10437>
2021-04-28 12:59:19 -07:00
Chia-I Wu efa185ed5c venus: rework external memory capability queries
The idea is to allow the renderer to use a completely different external
memory handle type (e.g., OPAQUE_WIN32!?) than the driver (always
OPAQUE_FD and DMA_BUF).  It hides the mismatch by doing translations in
vkGetPhysicalDevice*.

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/10437>
2021-04-28 12:59:19 -07:00
Chia-I Wu fbaa6dbf4e venus: update venus-protocol for external memory
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/10437>
2021-04-28 12:59:18 -07:00
Chia-I Wu 88f481dd74 venus: make sure gem_handle and vn_renderer_bo are 1:1
When two vn_renderer_bo's share the same gem_handle, destroying one of
them would invalidate the other.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu f41a79f948 venus: use sparse array to manage vn_renderer_bo
It should be faster.  More importantly, we want to use it to keep track
of all BOs for correct dmabuf import.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu c62026165c venus: move some common members to vn_renderer_bo
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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu b39ea79c95 venus: merge bo create and init ops
There is no good reason to seprate them.  I also plan to adopt
util_sparse_array, which requires the kernel BO to be created first (to
use its gem_handle/res_id as the key).

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu 2db720330b venus: move vn_renderer_bo_ops to vn_renderer
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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu 0d703b9d64 venus: pass vn_renderer in vn_renderer_bo functions
We will move vn_renderer_bo_ops to vn_renderer in the following commit.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu 6db21119b7 venus: add dev->renderer pointer
dev->instance->renderer is slower to type and to follow.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu b54a262421 venus: use vn_renderer_shmem
vn_renderer_bo_create_cpu becomes unused and is removed.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu 452a49fe19 venus: add vn_renderer_shmem
CPU BOs and GPU BOs are used different enough that it makes sense to
treat them as different objects.  This commit adds vn_renderer_shmem to
represent CPU BOs.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu 2c2fb015cc venus: rename VN_CS_ENCODER_INITIALIZER
Rename it to VN_CS_ENCODER_INITIALIZER_LOCAL to make it clear that it is
only for local variables.

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/10437>
2021-04-28 12:58:58 -07:00
Chia-I Wu b1f25da0b4 venus: update venus-protocol headers to use accessors
Switch to the newly added vn_instance_submit_command accessors.

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/10437>
2021-04-28 12:58:54 -07:00
Chia-I Wu 3c8255f602 venus: provide accessors for vn_instance_submit_command
This will allow us to change vn_instance_submit_command without
regenerating the headers.

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/10437>
2021-04-28 12:53:28 -07:00
Dylan Baker ce2706fc92 docs: update calendar for 21.1.0-rc3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
2021-04-28 09:34:33 -07:00
Dylan Baker c7dd23ff61 docs: update calendar for 21.1.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
2021-04-28 09:34:32 -07:00
Dylan Baker 82484b9787 docs: update calendar for 21.1.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10503>
2021-04-28 09:34:30 -07:00
Rob Clark cbd6e5f2e5 freedreno/ci: Skip texsubmimage cube_map_array
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 1d19325483 freedreno/ci: Disable counterstrike trace on a306 for now
The combination of removing bottlenecks in userspace (userspace fences,
etc) and slow GPU results in hitting full ringbuffer on a306.  Haven't
figured out a reasonable way to work around that in userspace until a
kernel fix is in place, so disable this one for now.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark f92f31455a freedreno/drm: Assume explicit fences if in_fence_fd
If we ever see explicit fencing used, then we can disable implicit
fencing, even for internal or unfenced batches.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark e9a9ac6f77 freedreno/drm: Async submit support
Move the submit ioctl to it's own thread to unblock the driver thread
and let it move on to the next frame.

Note that I did experiment with doing the append_bo() parts
synchronously on the theory that we should be more likely to hit the
fast path if we did that part of submit merging before the bo was
potentially re-used in the next batch/submit.  It helped some things
by a couple percent, but hurt more things.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 2c9e8db28d freedreno/drm: pipe should hold reference to device
A more direct solution would be for bo's to have a reference to the
device.  But bo's are ref/unrefd more frequently.

This avoids async submits unrefing a bo after the device handle-
table is freed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark ad9654a4c1 freedreno/drm: fd_submit should hold ref to fd_pipe
Also, move this into the base class, no reason for it to be in backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 55eb75d3e6 freedreno: Avoid flushing deferred submits for u_trace
This is a bit ugly, but with userspace fences and deferred submits it is
better to poll until the timestamp buffer is ready.  Otherwise we could
be triggering deferred submits to flush sooner than they normally would,
changing the behavior of what we are trying to measure.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark cccdc513e3 freedreno/drm/sp: Implement deferred submit merging
For submits flushed with (a) no required fence, and (b) no externally
visible effects (ie. imported/exported bo), we can defer flushing the
submit and merge it into a later submit.

This is a bit more work in userspace, but it cuts down the number of
submit ioctls.  And a common case is that later submits overlap in the
bo's used (for example, blit upload to a buffer, which is then used in
the following draw pass), so it reduces the net amount of work needed
to be done in the kernel to handle the submit ioctl.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/19
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark c7dc5cf3cb freedreno/drm/sp: Split submit prep and finish
For deferred submits, we still need to do the prep steps immediately,
but the ioctl construction can be deferred.. prepare for that by
splitting the prep out.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 62a6773d80 freedreno/drm: Add pipe tracking for deferred submits
Now that we have some bo state tracking for userspace fences, we can
build on this to add a way for the pipe implementation to defer a submit
flush in order to merge submits into a single ioctl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark aafcd8aacb freedreno: Re-work fd_submit fence interface
Move everything into a struct assocated with the pipe_fence_handle, so
that the drm layer can fill in the seqn/fd fences directly.

This will give us a comvenient place to insert a util_queue_fence in the
next commit.

While we're at it, extract the uint32_t fence (previously called
'timestamp' in place, a kgsl legacy) into a struct that encapsulates
both the kernel fence and the userspace fence.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark d531c8d22a freedreno/drm: Reference count submits
To merge submits, we'll need drm to internally hold an extra reference
to the submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 9cb264f966 freedreno: Drop unused create_fence() arg
It was always zero.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 7f4b85c7cf freedreno: Move fence struct to header
Just a bit of code-motion to prep for later patches.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark c3f4835b99 freedreno: last_fence optimization for TC async flushes
Without deferred flushes, we would track the last_fence any time when
there had be no rendering/etc since the last flush, to avoid creating
empty batches simply for the purpose of getting a fence.  We can do the
same thing with deferred flushes, where the fence is created from the
frontend thread before we know what will be flushed, by repopulating
the pre-created fence.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 807bfa6be8 freedreno/batch: Don't create fences for every batch
We only need fences for batches flushed via pctx->flush().  This will
serve as a useful signal about submits that can be merged.

v2. disable this optimization pre-a6xx until I can debug issues that
    submit merging exposes

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 49852ace2a freedreno/drm: Inline the fence-table
In the common case, a bo will have no more than a single fence attached.
We can inline the storage to avoid a separate allocation in this case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00