Commit Graph

39 Commits

Author SHA1 Message Date
Hyunjun Ko 937dd76426 turnip: Implement VK_KHR_performance_query
There are still some commands unimplemented yet.

- vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR:
  The following patch supports this.

- vkAcquireProfilingLockKHR / vkReleaseProfilingLock
  This patch supports only monitoring perf counters for each submit.
  To reserve/configure counters across submits we would need a kernel
  interface to be able to do that.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>
2020-12-22 04:57:22 +00:00
Eric Anholt 4df98c3c0c turnip: Only link libdrm in the DRM case, not KGSL.
libvulkan's not a fan of opening my libdrm.so.2 from /vendor/lib64 or
/vendor/lib64/hw, but then we shouldn't need it, anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6821>
2020-10-19 18:41:50 +00:00
Eric Anholt f63ce9bbe0 turnip: Don't link the WSI code if we don't have a WSI extension.
I don't like the TU_HAS_SURFACE duplication, but this is a step to having
a non-libdrm-dependent turnip on Android with KGSL (which doesn't have
drm for rendering).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6821>
2020-10-19 18:41:50 +00:00
Jonathan Marek 8dc8922af2 turnip: implement legacy API functions separately
Move legacy API functions to a separate file, and implement them by calling
the new API functions, like tu_CreateRenderPass was already doing.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6920>
2020-09-30 17:02:55 +00:00
Jonathan Marek cec0bc73e5 turnip: rework fences to use syncobjs
Fences are now just a syncobj, which makes our life easier.

The next step will be to fill out ImportFenceFdKHR()/GetFenceFdKHR().

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6683>
2020-09-24 14:37:13 +00:00
Kristian H. Kristensen e80758405c turnip: Add kgsl backend
Lacking a bit around fences and wsi integration, but there's enough
here to actually drive the GPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4479>
2020-09-21 22:51:05 +00:00
Eric Anholt 221aa00eeb turnip: Make sure we include the build id.
The ir3 disk cache is initialized when we use the ir3 compiler, even if we
don't use it ourselves, and it requires a build id.  With lld, it seems we
don't end up getting one included by default.

Fixes: f97acb4bb4 ("freedreno/ir3: disk-cache support")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6324>
2020-08-31 17:50:30 +00:00
Connor Abbott c884afc6f7 tu: Add multiview lowering pass
For now this only handles an a630 quirk where PC_MULTIVIEW_MASK doesn't
exist. However in the future it will also handle multi-position output.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5720>
2020-08-20 19:21:18 +00:00
Eric Engestrom f95637f01a meson: fix android vulkan build
Android doesn't have `pthread_cancel()` and is unlikely to ever
implement it [1], but `wsi_common_display.c` needs it (or an
alternative).

Let's just disable the platform on Android (as it used to be
before 448eb19158).

[1] https://android-review.googlesource.com/c/platform/bionic/+/1215779/1/docs/status.md

Fixes: 448eb19158 ("vulkan: automatically compile the `display` platform when available")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Nataraj Deshpande <nataraj.deshpande@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5860>
2020-07-14 09:34:54 +00:00
Eric Engestrom 448eb19158 vulkan: automatically compile the `display` platform when available
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>
2020-07-10 13:48:24 +00:00
Rob Clark b5c810d68b turnip: drop linking libfreedreno_drm
Now that it is no longer required.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5476>
2020-06-15 15:46:37 +00:00
Dylan Baker a8e2d79e02 meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden. This is nice
because we don't need to track which languages are used, if C++ is
suddenly added meson just does the right thing.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Eduardo Lima Mitev 9623debf48 freedreno: Centralize UUID generation into new files freedreno_uuid.c/h
The new files are created under a 'common' folder under 'src/freedreno',
where shared functionality between GL and Vulkan drivers (that is not
registers, layout or compiler) will be placed.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4847>
2020-05-14 19:05:02 +00:00
Jonathan Marek 2e084c2cb3 turnip: new clear/blit implementation with shader path fallback
The shader path is used to implement the following cases:
* stencil aspect mask on D24S8 (for image_to_buffer,buffer_to_image)
* clear/copy msaa destination (2D engine can't have msaa dest)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3783>
2020-04-09 14:43:02 +00:00
Kristian H. Kristensen 4399cacaf0 turnip: Drop dep_llvm from dependencies
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4478>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4478>
2020-04-07 18:44:21 +00:00
Kristian H. Kristensen 5789505ab3 turnip: Make Android platform build
We still don't have a way to keep this from breaking, but I don't
think this ever built.  Let's call it progress.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4478>
2020-04-07 18:44:21 +00:00
Eric Engestrom 79af30768d meson: inline `inc_common`
Let's make it clear what includes are being added everywhere, so that
they can be cleaned up.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
2020-03-28 21:36:54 +01:00
Eric Anholt d9cf3e76bd freedreno: Move a6xx's setup_slices() to a shareable helper function.
We pass in all the parameters for setting up the layout, though freedreno
still sets a few of them up early (since it uses layout helpers in making
some decisions about the layout setup parameters that will be cleaned up
once krh's blitter work lands).
2019-12-11 04:24:18 +00:00
Eric Anholt bdf03b738d turnip: Drop the copy of the formats table.
Now that we can (mostly) generate a pipe format for a VkFormat, use that
to answer queries about formats.  This will let us refactor the freedreno
format table surface layout code to be shared between gallium and vulkan.

This causes us to expose fewer formats for now (on a 1/100 CTS run I'm
doing, skips go from 3671 to 3835 out of 5145 tests).  Fails stay about
the same (478 -> 434, but the run is pretty flaky and we're doing fewer
tests now).

v2: Rebase on master, throw a finishme on missing vk-to-pipe formats that
    tu used to support.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> (v1)
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
2019-11-19 15:35:52 -08:00
Jonathan Marek 3cd44839fa turnip: add x11 wsi
Copied from radv

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-11-18 22:18:05 +00:00
Jonathan Marek df9f2adfa3 turnip: add display wsi
Copied from radv (minus the fence change)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-11-18 22:18:05 +00:00
Eric Engestrom 2f652e0b36 meson: move the generic symbols check arguments to a common variable
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviwed-by: Dylan Baker <dylan@pnwbakers>
2019-11-05 20:30:47 +00:00
Eric Engestrom 2c4395e61c meson: add variable to control the symbols checks
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviwed-by: Dylan Baker <dylan@pnwbakers>
2019-11-05 20:12:32 +00:00
Jonathan Marek d3c9914152 turnip: improve CmdCopyImage and implement CmdBlitImage
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-15 07:56:20 -04:00
Eric Engestrom d2d85b950d meson: replace libmesa_util with idep_mesautil
This automates the include_directories and dependencies tracking so that
all users of libmesa_util don't need to add them manually.

Next commit will remove the ones that were only added for that reason.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2019-08-03 00:08:37 +00:00
Eric Engestrom d2de5b6ba2 anv+tu+radv: delete unusable dev_icd.json
As per previous commit, Meson doesn't support using uninstalled libs,
they're simply not ready until `ninja install` is ran, so delete them.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> # for anv
Reviewed-by: Eric Anholt <eric@anholt.net> # for tu
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> # for radv
2019-07-26 14:47:53 +00:00
Kristian H. Kristensen e03259974e freedreno: Generate headers from xml files
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Rob Clark <robdclark@gmail.com>
2019-07-10 22:05:02 +00:00
Eric Engestrom 1abae9e54a tu: add exported symbols check
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-07-10 11:27:51 +00:00
Lionel Landwerlin cb7c9b2a93 vulkan: fix build dependency issue with generated files
On machines with many cores, you can run into that issue :

../mesa-9999/src/vulkan/overlay-layer/overlay.cpp:42:10: fatal error: vk_enum_to_str.h: No such file or directory

v2: Move declare_dependency around (Eric)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Jan Ziak
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-05-22 14:07:14 +00:00
Bas Nieuwenhuizen 42ed6d9789 turnip: Deconflict vk_format_table regeneration
Avoids

src/freedreno/vulkan/meson.build:42:0: ERROR:  Tried to create target "vk_format_table.c", but a target of that name already exists.

when building both radv and turnip.

Fixes: 26380b3a9f "turnip: Add driver skeleton (v2)"
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2019-03-16 14:38:51 +00:00
Chia-I Wu 24af64baa5 turnip: preliminary support for Wayland WSI 2019-03-11 10:02:13 -07:00
Chia-I Wu 970a8fec96 turnip: preliminary support for shader modules
Save SPIR-V in tu_shader_module.  Tranlation to NIR happens in
tu_shader_create, and compilation to binary code happens in
tu_shader_compile.  Both will be called during pipeline creation.
2019-03-11 10:02:13 -07:00
Chia-I Wu 68c27ea92b turnip: preliminary support for fences
This should be quite complete feature-wise.  External fences are
still missing.  We probably also want to add a simpler path to
tu_WaitForFences for when fenceCount == 1.
2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 23d6f0f970 turnip: Move stream functions to tu_cs.c 2019-03-11 10:01:41 -07:00
Chia-I Wu a25a803127 turnip: remove unnecessary libfreedreno_drm dep
Remove libfreedreno_drm dep and unused fd_device.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen b0562e272f turnip: move tu_gem.c to tu_drm.c 2019-03-11 10:01:41 -07:00
Chad Versace 359e9016c5 turnip: Replace fd_bo with tu_bo
(olv, after rebase) remove inc_drm_uapi
2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen 13ff7ffbcb turnip: Gather some device info. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen 26380b3a9f turnip: Add driver skeleton (v2)
meson files have been updated, autotools and android still need
updating.

Only build tested.

v2 (chadv):
  - Rebase onto master.
  - Fix build breakage in Python scripts.
  - Drop the WSI code. The internal WSI apis have changed recently, and
    will likely change again before the driver goes upstream. To avoid
    unnecessary rebase work, let's drop the WSI code and re-add it when
    we're ready to really use WSI.

(olv, after rebase) do not enable freedreno by default on ARM
2019-03-11 10:01:15 -07:00