Commit Graph

1341 Commits

Author SHA1 Message Date
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
Vinson Lee d4e70be739 freedreno: Fix GCC build error.
../src/freedreno/vulkan/tu_device.c:900:4: error: initializer element is not constant
    .minImageTransferGranularity = (VkExtent3D) { 1, 1, 1 },
    ^

Suggested-by: Kristian Høgsberg <krh@bitplanet.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110698
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2019-06-03 16:46:54 -07:00
Caio Marcelo de Oliveira Filho e45bf01940 spirv: Change spirv_to_nir() to return a nir_shader
spirv_to_nir() returned the nir_function corresponding to the
entrypoint, as a way to identify it.  There's now a bool is_entrypoint
in nir_function and also a helper function to get the entry_point from
a nir_shader.

The return type reflects better what the function name suggests.  It
also helps drivers avoid the mistake of reusing internal shader
references after running NIR_PASS on it.  When using NIR_TEST_CLONE or
NIR_TEST_SERIALIZE, those would be invalidated right in the first pass
executed.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-05-29 10:34:35 -07:00
Caio Marcelo de Oliveira Filho c92d002982 turnip: Don't re-use entry_point pointer from spirv_to_nir
Replace its uses with nir_shader_get_entrypoint(), and change the
helper function to return nir_shader *.

This is a preparation to change spirv_to_nir() return type.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-05-29 10:26:22 -07: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
Eric Anholt 18d11cb4dc freedreno: Move msm_drm.h to the same spot as other DRM uapi.
The new location matches other drivers, and has a README about the rules
for updating it.

Reviewed-by: Rob Clark <robdclark@gmail.com>
2019-05-14 11:51:55 -07:00
Jason Ekstrand 072227da0a tu/entrypoints: Import copy
It's used without being imported
2019-05-13 17:20:33 -05:00
Rob Clark b15c46e6bf freedreno/ir3: move const_state to ir3_shader
For a6xx, we construct/emit a single VS const state used for both
binning pass and draw pass.  So far we were mostly getting lucky that
there were not (obvious) mismatches between the const_state (like
different lowered immediates) between the binning and draw pass
VS ir3_shader_variant.

And I guess this situation will come up more as GS and tess is added
into the equation.

Since really everything about the const state is not specific to the
variant, move this.  The main exception is lowered immediates, but these
are the last to appear in the layout, and it doesn't hurt for each new
shader variant to just append any immed's it lowers to the end of the
immediate state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-05-07 07:26:00 -07:00
Rob Clark 9403184ddd freedreno/ir3: move immediates to const_state
They are really part of the constant state, and it will moving things
from ir3_shader_variant to ir3_shader if we combine them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-05-07 07:26:00 -07:00
Eric Engestrom 0cff98c8a0 turnip: update to use the new features struct names
These were updated in version 1.1.106 of vulkan.h to make more sense
with the extension names.  We may as well keep with the times.

See also: 90108deb27 "anv: Update to use the new features struct names"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2019-04-30 16:55:38 +01:00
Emil Velikov 1a9367c134 turnip: drop dead close(master_fd)
The fd is -1, thus the block of if (fd != -1) close(fd) is dead code.

Cc: Chad Versace <chadversary@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2019-04-26 11:26:33 +01:00
Rob Clark 4e3ce224a7 freedreno: update generated headers
Pull in updates for sample shading.

Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-04-25 14:13:31 -07:00
Rob Clark 4d08c1b595 compiler: rename SYSTEM_VALUE_VARYING_COORD
And add corresponding enums for different sorts of varying
interpolation.

Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-04-25 14:13:31 -07:00
Bas Nieuwenhuizen f2e0f5c3c4 vulkan/wsi: Add X11 adaptive sync support based on dri options.
The dri options are optional. When the dri options are not provided
the WSI will not  use adaptive sync.

FWIW I think for xf86-video-amdgpu this still requires an X11 config
option, so only people who opt in can get possible regressions from this.

So then the remaining question is: why do this in the WSI?

It has been suggested in another MR that the application sets this.
However, I disagree with that as I don't think we'll ever get a
reasonable set of applications setting it.

The next questions is whether this can be a layer. It definitely
can be as implemented now. However, I think this generally fits
well with the function of the WSI. Furthemore, for e.g. the DISPLAY
WSI this is much harder to do in a layer.

Of course, most of the WSI could almost be a layer, but I think
this still fits best in the WSI.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2019-04-23 23:49:39 +00:00
Samuel Pitoiset 23d30f4099 spirv,nir: lower frexp_exp/frexp_sig inside a new NIR pass
This lowering isn't needed for RADV because AMDGCN has two
instructions. It will be disabled for RADV in an upcoming series.

While we are at it, factorize a little bit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-03-22 19:41:46 +01:00
Rob Clark dbac1a80d1 freedreno/ir3: rename has_kill to no_earlyz
There are other cases where we need to disable early-z, like image
writes.  So rename to something more generic.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2019-03-22 08:53:28 -04: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
Bas Nieuwenhuizen e1161d2ea7 turnip: Fix GCC compiles.
Apparently GCC does not consider static const variables to be
integer constants, and hence the array size and the static assert
result in compile failures.

Fixes: 4b9f967cd1 "turnip: add a more complete format table"
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 ae82b5df88 turnip: preliminary support for tu_GetImageSubresourceLayout 2019-03-11 10:02:13 -07:00
Chad Versace 6cb5fd0d71 turnip: Use Vulkan 1.1 names instead of KHR
That is, drop KHR from all tokens that were promoted to Vulkan 1.1.
The consistency makes ctags more useful (it now jumps directly to the
real definitions in vulkan_core.h instead of the typedefs); and it makes
the code slightly less verbose.
2019-03-11 10:02:13 -07:00
Chia-I Wu 949ce2745d turnip: preliminary support for tu_CmdDraw 2019-03-11 10:02:13 -07:00
Chia-I Wu f9b34622cd turnip: preliminary support for draw state binding
This adds support for tu_CmdBindPipeline, tu_CmdBindVertexBuffers,
etc.
2019-03-11 10:02:13 -07:00
Chia-I Wu 54b7a57c22 turnip: add draw_cs to tu_cmd_buffer
It will hold draw commands.
2019-03-11 10:02:13 -07:00
Chia-I Wu 1cdbab016e turnip: parse VkPipelineVertexInputStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu d17096b9b1 turnip: parse VkPipelineShaderStageCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu a7d842c97c turnip: compile VkPipelineShaderStageCreateInfo
Compile all shaders and upload the binaries to a BO.
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 9e0d878787 turnip: parse VkPipeline{Multisample,ColorBlend}StateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu bec0abf294 turnip: parse VkPipelineDepthStencilStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu 9496b377ff turnip: parse VkPipelineRasterizationStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu b4884761e8 turnip: parse VkPipelineViewportStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu 1bea6a91cb turnip: parse VkPipelineInputAssemblyStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu c584c2e86c turnip: parse VkPipelineDynamicStateCreateInfo 2019-03-11 10:02:13 -07:00
Chia-I Wu df48cb7b3e turnip: create a less dummy pipeline
Still dummy, but at least it is created from tu_pipeline_builder.
2019-03-11 10:02:13 -07:00
Chia-I Wu 57327626dc turnip: simplify tu_cs sub-streams usage
Let tu_cs_begin_sub_stream imply tu_cs_reserve_space, and
tu_cs_end_sub_stream imply tu_cs_sanity_check.  Callers are no
longer required to call them (but can still do if they choose to).
2019-03-11 10:02:13 -07:00
Chia-I Wu 59419bb691 turnip: fix tu_cs sub-streams
Update cs->start in tu_cs_end_sub_stream.  Otherwise, the entry
would include commands from all prior sub-streams.
2019-03-11 10:02:13 -07:00
Chia-I Wu c0567e84db turnip: tu_cs_emit_array
Array version of tu_cs_emit.  Useful for updating multiple
consecutive array-like registers, or loading a shader binary with
SS6_DIRECT.
2019-03-11 10:02:13 -07:00
Chia-I Wu fffaa9b4b3 turnip: add tu_cs_discard_entries
We will start a draw IB at the beginning of a subpass and consume it
at the end of the subpass.  With tu_cs_discard_entries, we can reuse
the same tu_cs for all subpasses.
2019-03-11 10:02:13 -07:00
Chia-I Wu 10c5013442 turnip: more/better asserts for tu_cs
Asserting (cur < end) in tu_cs_emit catches much less programming
errors comparing to asserting (cur < reserved_end).  We should never
write more commands than what we have reserved.

Assert IB is non-empty and sane in tu_cs_emit_ib.
2019-03-11 10:02:13 -07:00
Chia-I Wu aa7dd6cb7f turnip: use 32-bit offset in tu_cs_entry
We don't support nor expect BOs to be that big in tu_cs.
2019-03-11 10:02:13 -07:00
Chia-I Wu b8a5e10d0d turnip: mark IBs for dumping
Includes IBs in kernel cmdbuf dumps.
2019-03-11 10:02:13 -07:00
Eric Engestrom 4a48dd9fb8 turnip: use the platform defines in vk.xml instead of hard-coding them
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 0d12bcbfa7 turnip: Add todo for copies. 2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 51115e7201 turnip: Add buffer->image DMA copies.
Passes dEQP-VK.api.copy_and_blit.core.buffer_to_image.*
2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 6616563472 turnip: Add image->buffer DMA copies.
Passes dEQP-VK.api.copy_and_blit.core.image_to_buffer.*
2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen d76a1e2aa1 turnip: Implement buffer->buffer DMA copies.
Passes dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.*
2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen bafbf3bafe turnip: Add tu6_rb_fmt_to_ifmt. 2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 148876d424 turnip: Make tu6_emit_event_write shared. 2019-03-11 10:02:13 -07:00
Bas Nieuwenhuizen 7238471587 turnip: Add buffer memory binding. 2019-03-11 10:02:13 -07:00
Chia-I Wu 08b1c3fc7f turnip: respect color attachment formats
Make tu6_get_native_format available to tu_cmd_buffer and start
using of it.
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
Chia-I Wu 15319963fa turnip: fix VkClearValue packing
Add tu_pack_clear_value to correctly pack VkClearValue according to
VkFormat.  It ignores the component order defined by VkFormat, and
always packs to WZYX order.
2019-03-11 10:02:13 -07:00
Chia-I Wu 6545461041 turnip: add support for VK_KHR_external_memory_{fd,dma_buf} 2019-03-11 10:02:13 -07:00
Chia-I Wu 6d1c4049de turnip: advertise VK_KHR_external_memory
AFAICT, it is supported.  We don't need to handle any of the new
structs because our BOs can always be exported.
2019-03-11 10:02:13 -07:00
Chia-I Wu 0253845272 turnip: advertise VK_KHR_external_memory_capabilities
AFAICT, it is supported.
2019-03-11 10:02:13 -07:00
Chia-I Wu de89436216 turnip: add functions to import/export prime fd
Add tu_bo_init_dmabuf, tu_bo_export_dmabuf, tu_gem_import_dmabuf,
and tu_gem_export_dmabuf.
2019-03-11 10:02:13 -07:00
Chad Versace d5239bc59c turnip: Fix error behavior for VkPhysicalDeviceExternalImageFormatInfo
If the handle type is unsupported, then the spec requires us to return
VK_ERROR_FORMAT_NOT_SUPPORTED.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Closes: https://gitlab.freedesktop.org/bnieuwenhuizen/mesa/merge_requests/17
2019-03-11 10:02:13 -07:00
Chia-I Wu 4b9f967cd1 turnip: add a more complete format table
A format table is an array of tu_native_format.  Table lookup is
done through array indexing.

This commit defines a single format table for core VkFormat.  It is
derived from the table in the gallium driver.  There might be errors
introduced in the process of the conversion.

When an extension that defines new VkFormat is supported, we need to
add a new table for the extension.
2019-03-11 10:02:13 -07:00
Chia-I Wu f3bf779184 turnip: preliminary support for loadOp and storeOp
- create tile_load_ib and tile_store_ib at the beginning of each
   subpass
 - execute the IBs at the end of each subpass
 - no DONT_CARE support
 - no subpass dependency analysis and subpass merging
 - no zs support
 - no true VkImageView support
   - assume VK_FORMAT_B8G8R8A8_UNORM
   - no tiling
   - no MSAA

This also removes cur_cs from tu_cmd_buffer.
2019-03-11 10:02:13 -07:00
Chia-I Wu 0aeef7c8bd turnip: add TU_CS_MODE_SUB_STREAM
When in TU_CS_MODE_SUB_STREAM, tu_cs_begin_sub_stream (or
tu_cs_end_sub_stream) should be called instead of tu_cs_begin (or
tu_cs_end).  It gives the caller a TU_CS_MODE_EXTERNAL cs to emit
commands to.
2019-03-11 10:02:13 -07:00
Chia-I Wu f59c381423 turnip: add tu_cs_mode
Add tu_cs_mode and TU_CS_MODE_EXTERNAL.  When in
TU_CS_MODE_EXTERNAL, tu_cs wraps an external buffer and can not
grow.

This also moves tu_cs* up in tu_private.h, such that other structs
can embed tu_cs_entry.
2019-03-11 10:02:13 -07:00
Chia-I Wu 5c63fc626f turnip: provide both emit_ib and emit_call
tu_cs_emit_ib emits a CP_INDIRECT_BUFFER for a BO.  tu_cs_emit_call
emits a CP_INDIRECT_BUFFER for each entry of a target cs.
2019-03-11 10:02:13 -07:00
Chia-I Wu 741a4325df turnip: add tu_cs_sanity_check
It replaces tu_cs_reserve_space_assert and can be called at any
time to sanity check tu_cs.
2019-03-11 10:02:13 -07:00
Chia-I Wu 29f1110003 turnip: never fail tu_cs_begin/tu_cs_end
Error checking tu_cs_begin/tu_cs_end is too tedious for the callers.
Move tu_cs_add_bo and tu_cs_reserve_entry to tu_cs_reserve_space
such that tu_cs_begin/tu_cs_end never fails.
2019-03-11 10:02:13 -07:00
Chia-I Wu 0d81be3959 turnip: specify initial size in tu_cs_init
We will drop size parameter from tu_cs_begin shortly, such that
tu_cs_begin never fails.
2019-03-11 10:02:13 -07:00
Chia-I Wu 2774a1b97d turnip: add tu_cs_{reserve,add}_entry
We will stop calling tu_cs_reserve_entry in tu_cs_end shortly, such
that tu_cs_end never fails.
2019-03-11 10:02:13 -07:00
Chia-I Wu c11580373f turnip: add internal helpers for tu_cs
Add tu_cs_get_offset, tu_cs_get_size, tu_cs_get_space, and
tu_cs_is_empty.
2019-03-11 10:02:13 -07:00
Chia-I Wu 429e2d5755 turnip: add tu_tiling_config
We need the current color/depth/stencil attachments and the current
render area to compute the tiling config.

We compute the tiling config at the beginning of each subpass for
the moment.  We should change that when the driver can reorder/merge
subpasses.

It is very common that the render area is the entire framebuffer.
We might want to optimize for the case and compute the tiling config
in tu_framebuffer ctor.
2019-03-11 10:02:13 -07:00
Chia-I Wu 7c4483de0e turnip: preliminary support for tu_GetRenderAreaGranularity
Set it to tile alignments, 32x32 on 6xx.
2019-03-11 10:02:13 -07:00
Chia-I Wu 9c83a7572b turnip: emit HW init in tu_BeginCommandBuffer
Being the first commit that emits meaningful command packets, there
are many things included in this commit

 - tu6_emit_xxx are low-level helpers that emit command packets
   without boundary checks
 - tu6_xxx are high-level helpers that emit command packets with
   boundary checks
 - cmdbuf->cs is a pointer to the current CS, so that we can use the
   helpers above to emit to other CS
 - use cmd as the variable name of tu_cmd_buffer
 - there is a per-cmdbuf scratch bo for CP_EVENT_WRITE writeback
 - there is a per-cmdbuf debug marker, using scratch reg 7 or 6
   depending on whether the cmdbuf is primary or secondary

(olv, after rebase) REG_A6XX_SP_UNKNOWN_AB20 is renamed
2019-03-11 10:01:49 -07:00
Chia-I Wu 3b3af6321b turnip: add tu_cs_reserve_space(_assert)
They are used like

 tu_cs_reserve_space(...);
 tu_cs_emit(...);
 ...;
 tu_cs_reserve_space_assert();

to make sure we reserved enough space at the beginning.
2019-03-11 10:01:41 -07:00
Chad Versace aaa59ef70c turnip: Annotate vkGetImageSubresourceLayout with tu_stub
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-03-11 10:01:41 -07:00
Chia-I Wu ba6bcb387c turnip: preliminary support for tu_CmdBeginRenderPass 2019-03-11 10:01:41 -07:00
Chia-I Wu 1085df8176 turnip: preliminary support for tu_image_view_init 2019-03-11 10:01:41 -07:00
Chia-I Wu 992ecdd40e turnip: preliminary support for tu_BindImageMemory2 2019-03-11 10:01:41 -07:00
Chia-I Wu ef49b07b83 turnip: add cmdbuf->bo_list to bo_list in queue submit 2019-03-11 10:01:41 -07:00
Chia-I Wu 6c4df43db5 turnip: add tu_bo_list_merge
tu_bo_list_merge adds an entire list to the current list.
2019-03-11 10:01:41 -07:00
Chia-I Wu 7ad01913bd turnip: build drm_msm_gem_submit_bo array directly
Build drm_msm_gem_submit_bo array directly in tu_bo_list.  We might
change this again, but this is good enough for now.

There are other issues as well, such as not using
VkAllocationCallbacks and sloppy error checking.  We should revisit
this in the near future.  Same to tu_cs.
2019-03-11 10:01:41 -07:00
Chia-I Wu c969d8b975 turnip: add more tu_cs helpers 2019-03-11 10:01:41 -07:00
Chia-I Wu 39ba2b20d1 turnip: inline tu_cs_check_space
This allows the fast path (size check) to be inlined.
2019-03-11 10:01:41 -07:00
Chia-I Wu 2bcaa78236 turnip: update cs->start in tu_cs_end
This allows us to assert that there is no dangling command in
tu_cs_begin, rather than discarding them silently.
2019-03-11 10:01:41 -07:00
Chia-I Wu b01d1618a4 turnip: minor cleanup to tu_cs_end
Add comments and error checking.
2019-03-11 10:01:41 -07:00
Chia-I Wu af4eb20891 turnip: add tu_cs_add_bo
Refactor BO allocation code out of tu_cs_begin.  Add error checking.
2019-03-11 10:01:41 -07:00
Chia-I Wu ae9a72b48b turnip: document tu_cs 2019-03-11 10:01:41 -07:00
Chia-I Wu 45120127ea turnip: run sed and clang-format on tu_cs 2019-03-11 10:01:41 -07:00
Kristian H. Kristensen 0801019d33 turnip: Only get bo offset when we need to mmap
The offset we get from MSM_INFO_GET_OFFSET is an offset into the drm fd
for the purpose of mmaping the buffer.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 23d6f0f970 turnip: Move stream functions to tu_cs.c 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen ac2a845abf turnip: Add emit functions in a header.
This adds a radv-style check_space functions + emit functions.

Also puts them in a header as a bunch of inlines, so

(1) we can use them from meta code.
(2) they are inline for performance as these are common and small.

Did not put them in tu_private.h as a bunch of inlines only
clutters up that huge headerfile.

Precise error propagation for memory allocation failures is still
todo.
2019-03-11 10:01:41 -07:00
Chia-I Wu 2e684cb800 turnip: preliminary support for tu_QueueWaitIdle
This creates a new fd on each queue submit.  I do not go with
DRM_IOCTL_MSM_WAIT_FENCE solely because the path is marked legacy.
Otherwise, we can use the  fence id rather than requesting a fence
fd until external fences are supported and enabled.
2019-03-11 10:01:41 -07:00
Chia-I Wu b7a6a80e6c turnip: constify tu_device in tu_gem_* 2019-03-11 10:01:41 -07:00
Chia-I Wu 3809e6cf63 turnip: add wrappers around DRM_MSM_SUBMITQUEUE_*
Add tu_drm_submitqueue_new and tu_drm_submitqueue_close.
2019-03-11 10:01:41 -07:00
Chia-I Wu fcf24f47aa turnip: add wrappers around DRM_MSM_GET_PARAM
Add tu_drm_get_gpu_id and tu_drm_get_gmem_size.
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
Chia-I Wu 91232c52fe turnip: use msm_drm.h from inc_freedreno
The recent change to msm_drm.h changed the APIs in an incompatible
way.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 4f32869e3d turnip: Shorten primary_cmd_stream name.
It really is too long.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 26261847cf turnip: Fill command buffer 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen abe352525d turnip: Implement submission. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen abf0792bbe turnip: Make bo_list functions not static 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 65e0e79054 turnip: Add msm queue support. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 8713499657 turnip: Add a command stream. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen e3a9b07923 turnip: Implement a slow bo list 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 48b65201a6 turnip: Implement some UUIDs. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 7ae005f037 turnip: clean up TODO.
./deqp-vk -n dEQP-VK.info.*
Writing test log into TestResults.qpa
dEQP Core unknown (0xcafebabe) starting..
  target implementation = 'Surfaceless'
WARNING: tu is not a conformant vulkan implementation, testing use only.
WARNING: tu is not a conformant vulkan implementation, testing use only.

Test case 'dEQP-VK.info.build'..
  Pass (Not validated)

Test case 'dEQP-VK.info.device'..
  Pass (Not validated)

Test case 'dEQP-VK.info.platform'..
  Pass (Not validated)

Test case 'dEQP-VK.info.memory_limits'..
  Pass (Pass)

DONE!

Test run totals:
  Passed:        4/4 (100.0%)
  Failed:        0/4 (0.0%)
  Not supported: 0/4 (0.0%)
  Warnings:      0/4 (0.0%)
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 06602bf77f turnip: Remove some radv leftovers. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen c72e6085e7 turnip: Implement some format properties for RGBA8.
Just to get some tests to not skip. This is neither complete
nor completely correct.
2019-03-11 10:01:41 -07:00
Chia-I Wu d30baaaba6 turnip: add .clang-format
Add and apply .clang-format.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 6401ad389e turnip: Implement pipe-less param query. 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
Bas Nieuwenhuizen 3d99dd55a0 turnip: Stop hardcoding the msm version check. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen d9c3dc8ec8 turnip: Add image layout calculations. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 603354cffa turnip: Fix memory mapping. 2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen 426f6e46a8 turnip: Fix bo allocation after we stopped using libdrm_freedreno ...
Al this figuring out new errors is why I don't like reinventing the
wheel.
2019-03-11 10:01:41 -07:00
Bas Nieuwenhuizen f0a24e123f turnip: Add 630 to the list. 2019-03-11 10:01:41 -07:00
Chad Versace c3b5eea2cc turnip: Don't return from tu_stub funcs
Since the macros are lowercase and look like normal functions, that they
change control flow with a hidden return is surprising.
2019-03-11 10:01:41 -07:00
Chad Versace bf709dfe3f turnip: Fix 'unused' warnings
Now turnip builds without warnings on my machine.
2019-03-11 10:01:41 -07:00
Chad Versace 471f2d8409 turnip: Add TODO file 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
Chad Versace eb16ec715f turnip: Use vk_errorf() for initialization error messages
This small cleanup better prepares turnip for VK_EXT_debug_report.
2019-03-11 10:01:33 -07:00
Chad Versace 1372c95ad2 turnip: Add TODO for Android logging 2019-03-11 10:01:33 -07:00
Chad Versace cca208a033 turnip: Require DRM device version >= 1.3
Because the driver will require support for iova.
2019-03-11 10:01:33 -07:00
Chad Versace 5486943ed9 turnip: Fix indentation 2019-03-11 10:01:33 -07:00
Chad Versace 99a5de14cb turnip: Fix a real -Wmaybe-uninitialized 2019-03-11 10:01:33 -07:00
Chad Versace 75f2c8458b turnip: Use vk_outarray in all relevant public functions 2019-03-11 10:01:33 -07:00
Chad Versace 3ec87d56bd turnip: Fix result of vkEnumerate*ExtensionProperties
Given an unsupported layer name, the functions must return
VK_ERROR_LAYER_NOT_PRESENT.
2019-03-11 10:01:33 -07:00
Chad Versace ee835c7790 turnip: Fix result of vkEnumerate*LayerProperties
The functions must not return VK_ERROR_LAYER_NOT_PRESENT. The spec
reserves that error for vkEnumerate*ExtensionProperties.
2019-03-11 10:01:33 -07:00
Chad Versace daffb01704 turnip: Fix indentation in function signatures
Due to s/anv/tu/, in many function signatures the indentation of
parameters was off-by-one.
2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen b4f3e0d549 turnip: Disable more features. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen a01edd9c86 turnip: Initialize memory type in requirements. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen 7be2e1fc37 turnip: Cargo cult the Intel heap size functionality. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen 462b693d94 turnip: Report a memory type and heap. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen 8e52e8183c turnip: Add buffer allocation & mapping support. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen a0d62e4337 turnip: Fix newly introduced warning. 2019-03-11 10:01:33 -07:00
Bas Nieuwenhuizen bcd15ab34e turnip: Remove abort. 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 7922d50bd4 turnip: Fix up detection of device. 2019-03-11 10:01:33 -07:00
Chad Versace c63cb15745 turnip: Drop Makefile.am and Android.mk
The Makefile.am doesn't work. I tried fixing it but gave up because
I don't understand Autotools. I strongly suspect the Android.mk also
doesn't work.

Rather than maintain the broken build files, let's delete them and
re-add working build files if-and-when we need them. (Maybe we'll be
lucky and turnip will never need to support Autotools!).
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