Commit Graph

168 Commits

Author SHA1 Message Date
Connor Abbott 8d2757789a tu: Enable multi-position output
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6515>
2020-09-29 16:16:05 +00:00
Eric Anholt a55dc276a3 turnip: Replace tu_log*() with mesa_log*()
This gets us logging on Android.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6806>
2020-09-28 09:14:44 -07:00
Jonathan Marek dcba32bac0 turnip: implement VK_EXT_extended_dynamic_state
Passes dEQP-VK.pipeline.extended_dynamic_state.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5641>
2020-09-25 12:59:02 +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
Jonathan Marek 89ffe859a8 turnip: add a fd field to tu_device
Avoid the extra indirect for this commonly used field.

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
Connor Abbott e781cc7025 tu: Expose shaderStorageImage*WithoutFormat
We don't use the format anymore in the backend, except determining the
number of components, and we fallback to 4 there if it's not specified.
So we should be safe to enable this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6800>
2020-09-22 14:54:40 +00:00
Connor Abbott 6ebc20fd88 tu: Expose shaderImageGatherExtended
This just allows textureGather() to have offsets, which we already
supported in ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6800>
2020-09-22 14:54:40 +00:00
Connor Abbott 205f4e9a57 tu: Expose shaderStorageImageExtendedFormats
We already supported all the formats on the list, so it's trivial to
enable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6800>
2020-09-22 14:54:40 +00:00
Eric Anholt 207219d435 turnip: Add support for a615.
Verified RB_CCU_CNTL, 9805, and A0F8 values from blob traces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6741>
2020-09-16 23:53:00 +00:00
Jonathan Marek efff734220 turnip: multiViewport and VK_EXT_shader_viewport_index_layer
Passes at least:
dEQP-VK.dynamic_state.vp_state.viewport_array
dEQP-VK.draw.shader_viewport_index.*
dEQP-VK.draw.shader_layer.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5832>
2020-09-15 16:18:45 +00:00
Jonathan Marek bea6290ca0 turnip: device global bo list
Avoid having to deal with BO tracking. However, the kernel still requires a
bo list, so keep a global one which can be re-used for every submit.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6686>
2020-09-13 04:04:58 +00:00
Hyunjun Ko 075e40ea98 turnip: Implement VK_EXT_host_query_reset
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6299>
2020-09-02 10:49:03 +00:00
Hyunjun Ko b92be738d5 turnip: Support pipeline statistics query
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6299>
2020-09-02 10:49:03 +00:00
Connor Abbott b708a1acb8 tu: Enable VK_KHR_multiview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5720>
2020-08-20 19:21:18 +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
Jonathan Marek 0c97e601a4 turnip: implement VK_EXT_custom_border_color
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093>
2020-08-13 16:54:06 +00:00
Kristian H. Kristensen add2b44ab6 turnip: Only include msm_drm in tu_drm.c
We copy the definition for struct drm_msm_gem_submit_bo and flags to
keep the bo list code working for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5999>
2020-08-05 01:19:22 +00:00
Kristian H. Kristensen 4b9c0cd821 turnip: Move remaining drm code to tu_drm.c
This moves the semaphore implementation and tu_QueueSubmit to
tu_drm.c, such that that's the only file including xf86drm.h and
msm_drm.h.  This way, the entire kernel interface is contained in
tu_drm.c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5999>
2020-08-05 01:19:22 +00:00
Kristian H. Kristensen 59e5f95bdc turnip: Move tu_bo functions to tu_drm.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5999>
2020-08-05 01:19:22 +00:00
Kristian H. Kristensen 270599cc1e turnip: Move device enumeration and feature discovery to tu_drm.c
These steps are all drm specific.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5999>
2020-08-05 01:19:22 +00:00
Connor Abbott ee2c58dde4 tu: Implement VK_EXT_conditional_rendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6009>
2020-08-04 15:38:17 +02:00
Jonathan Marek 95db96d75b turnip: implement VK_EXT_4444_formats
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6164>
2020-08-04 13:15:23 +00:00
Jonathan Marek 5afaec3741 turnip: workaround for a630 d24_unorm_s8_uint fails
A630 doesn't have the HW format we use to sample stencil, so it needs a
workaround. It also has a bug around the AS_R8G8B8A8 format, which doesn't
work when UBWC is disabled, so use 8_8_8_8_UNORM instead when UBWC is
disabled (using AS_R8G8B8A8 or 8_8_8_8_UNORM should only matter with UBWC)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5438>
2020-08-03 21:07:30 +00:00
Connor Abbott 8e8baecd6a tu: Enable resource dynamic indexing
This has actually worked since bindless support was merged.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6086>
2020-07-27 16:38:17 +00:00
Connor Abbott 9e596cc2c2 tu: Enable vertex & fragment stores & atomics
Note that there are some extra tess fails, but they're probably
unrelated to the actual feature. There were also some xfails that were
created as part of an earlier attempt to enable the feature which were
fixed in the meantime, so remove them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5738>
2020-07-24 18:43:40 +00:00
Connor Abbott 6cbdffd79c tu: Implement VK_KHR_draw_indirect_count
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6007>
2020-07-24 19:21:07 +02:00
Jonathan Marek 1747f9fdd0 turnip: remove extra gmem alignment
Now that we clear the PITCHALIGN" field when filling GMEM input attachment
descriptors, we can get rid of the extra tile width alignment on a630/a640.

With the "block_align_shift" value change, this brings down the default
gmem_align from 16k to 4k on a630/a640 and down from 24k to 12k on a650,
to match the gallium driver.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5528>
2020-07-24 13:44:42 +00:00
Connor Abbott 1610c69f34 tu: Enable VK_EXT_depth_clip_enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6047>
2020-07-23 18:55:56 +00:00
Hyunjun Ko d941c6b74f turnip: implement VK_EXT_private_data
Which is using base class's implementation.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5539>
2020-07-14 02:48:30 +00:00
Hyunjun Ko 5d3fdbc52b turnip: Use the common base object type and struct.
v2. Define new helper function to avoid duplicated a pair of function calls.
v3. Move new helper functions to vk_object.h and call them.
v4. Merge 2 commits to use commomn base object type and struct into one.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5539>
2020-07-14 02:48:30 +00:00
Jonathan Marek 14c554a391 turnip: use global bo for clear blit shaders
Fill the global bo will all possible shaders for 3D clear/blit. Note the
global bo size is still <4k (so this doesn't cost any extra memory), this
saves having to allocate shaders in sub_cs everytime the 3D path is used.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5776>
2020-07-07 16:40:45 +00:00
Connor Abbott 7682c887b3 tu: Enable KHR_variable_pointers
Passes dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.*
and dEQP-VK.spirv_assembly.instruction.compute.variable_pointers.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5684>
2020-07-06 22:48:57 +00:00
Jonathan Marek 7af2a0b9bc turnip: support multi-image layouts
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4600>
2020-07-05 15:25:17 +00:00
Jonathan Marek 0e7b7c3087 turnip: vsc improvements
* Remove scratch_bo from cmdbuffer, use a device-global bo instead, which
  also includes border color (and eventually shaders for 3D blit path)
* Use CP_SET_BIN_DATA5_OFFSET to allow setting VSC buffer addresses only
  once at the start of the cmdstream
* Use scratch bo mechanism for a resizable VSC buffer
* Use feedback from "vsc_draw_overflow" and "vsc_prim_overflow" values to
  increase the size of VSC buffer when beginning to record a new cmdbuffer

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5570>
2020-07-03 14:49:10 +00:00
Jonathan Marek 8898ebce1a turnip: make tiling config part of framebuffer state
Compute the tiling config at framebuffer creation time. A framebuffer will b
be re-used multiple times, so this will avoid having to re-calculate the
tiling config every time a command buffer is recorded.

The tiling config already couldn't use the render area's x1/y1 because of
hw binning, this move makes it so the render area isn't used at all for the
tiling config.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5570>
2020-07-03 14:49:10 +00:00
Jonathan Marek 622c548967 turnip: enable depthBiasClamp
Passes at least dEQP-VK.dynamic_state.rs_state.depth_bias_clamp

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5678>
2020-06-29 13:08:51 +00:00
Jonathan Marek 0ed100ea49 turnip: enable largePoints
Passes dEQP-VK.rasterization.primitive_size.points.point_size_*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5678>
2020-06-29 13:08:51 +00:00
Kristian H. Kristensen 4fccbd0ea6 turnip: Put VK_KHR_external_fence_fd stubs back
tu_ImportFenceFdKHR is used by tu_AcquireImageANDROID, which may or
may not work, but let's at least keep things compiling until somebody
has time to tie up the loose ends on the Android side.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5670>
2020-06-26 16:29:15 -07:00
Eric Anholt 34630fe081 turnip: Properly return VK_DEVICE_LOST on queuesubmit failures.
The device lost support closely matches the anv code for the same.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
2020-06-26 19:34:17 +00:00
Eric Anholt e67c2e1c96 turnip: Do better TU_DEBUG=startup logging of drmGetDevices2() failure.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
2020-06-26 19:34:17 +00:00
Bas Nieuwenhuizen aba8c579a9 turnip: semaphore support.
There is only one queue for now, so for non-shared semaphores, the
implementation is basically a no-op. For shared semaphores, this
always uses syncobjs. This depends on syncobj support in the msm
kernel driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2769>
2020-06-26 19:34:17 +00:00
Rob Clark c0f22c3d94 freedreno/ir3: add ir3_compiler_destroy()
Use ir3_compiler_destroy() rather than open-coding ralloc_free().  This
will give us a place to add more compiler related cleanup code in the
following patches.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5372>
2020-06-26 08:43:23 -07:00
Jonathan Marek 1854eeefde turnip: fix VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES
My attempt to be clever here backfired, it overwrites the pNext and stops
the loop (causing deqp to fail to query extension features after that).

Fixes: 62de79ac44 ("turnip: implement VK_KHR_shader_draw_parameters")

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5654>
2020-06-26 11:11:29 +00:00
Eric Anholt 72c0522db2 turnip: Add support for polygon fill modes.
Passes the new tests in dEQP-VK.rasterization.culling.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5650>
2020-06-25 13:46:30 -07:00
Jonathan Marek 62de79ac44 turnip: implement VK_KHR_shader_draw_parameters
Note: going by the blob, VFD_INDEX_OFFSET/FD_INSTANCE_START_OFFSET seem
completely unused by indirect draws, so this changes them to only be set
for non-indirect draws (and moves them to the vs_params draw state).

Passes dEQP-VK.draw.shader_draw_parameters.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5635>
2020-06-25 15:57:45 +00:00
Jonathan Marek 1fd2bc10dc turnip: implement VK_EXT_vertex_attribute_divisor
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5640>
2020-06-25 00:10:11 +00:00
Jonathan Marek 01e2893cba turnip: implement depthBounds
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5628>
2020-06-24 20:55:15 +00:00
Jonathan Marek 6cf87d777a turnip: enable VK_EXT_index_type_uint8
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5579>
2020-06-23 10:44:19 +00:00
Brian Ho 64ccb74028 turnip: Enable tessellationShader physical device feature
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5059>
2020-06-22 14:35:46 +00:00
Brian Ho cca9aa4dfd turnip: Fill out VkPhysicalDeviceSubgroupProperties
This commit fills out VkPhysicalDeviceSubgroupProperties if present
in a VkPhysicalDeviceProperties2. The values here are simply pulled
from the blob.

Fixes some flakes in dEQP-VK.subgroups.* since dEQP was reading
uninitialized values of VkPhysicalDeviceSubgroupProperties.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5564>
2020-06-19 17:49:09 +00:00