Commit Graph

1571 Commits

Author SHA1 Message Date
Rob Clark ee7949b064 freedreno/registers: SC_WAIT_WC is not a6xx
I think this is probably only a2xx, but it was masking
WRITE_PRIMITIVE_COUNTS on a6xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6376>
2020-08-19 14:03:42 +00:00
Roman Stratiienko 8626d4cbef android: freedreno: Another build fix
During build on Android 10, build error occurred:

'''
[ 26% 456/1718] Gen Header: libfreedreno_registers_32 <= a3xx.xml.h
FAILED: out/target/product/pinephone/gen/STATIC_LIBRARIES/libfreedreno_registers_intermediates/registers/adreno/a3xx.xml.h
/bin/bash -c "PATH=/usr/bin:\$PATH python3 external/mesa3d/src/freedreno/registers/gen_header.py external/mesa3d/src/freedreno/registers/adreno/a3xx.xml > out/target/product/pinephone/gen/STATIC_LIBRARIES/libfreedreno_registers_intermediates/registers/adreno/a3xx.xml.h"
Traceback (most recent call last):
  File "external/mesa3d/src/freedreno/registers/gen_header.py", line 470, in <module>
    main()
  File "external/mesa3d/src/freedreno/registers/gen_header.py", line 446, in main
    xml_file = sys.argv[2]
IndexError: list index out of range
'''

Align build rules with meson fixes it.

Fixes: 62ebd342 ("freedreno/registers: split header build into subdirs")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6170>
2020-08-19 11:57:17 +00:00
Hyunjun Ko e0e9712a4d freedreno: support GL_EXT_semaphore
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
2020-08-18 20:40:40 +00:00
Eduardo Lima Mitev f6187aa1c3 freedreno: Enable GL_EXT_memory_object and GL_EXT_memory_object_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
2020-08-18 20:40:40 +00:00
Eduardo Lima Mitev 03fdf418a5 freedreno/layout: Move hard-coded minimum width for UBWC to a macro
This will also allow reuse of the value later in this series.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
2020-08-18 20:40:40 +00:00
Connor Abbott 7c98066e80 freedreno: Add afuc regression test
a5xx is still TODO, but at least this is a start.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott d145fcc1c1 freedreno/afuc: Install asm/disasm
Make the name a bit longer, since when installed it's not tucked away
under afuc/ anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott f0b87186df freedreno/afuc: Make 0 a valid number
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott 66dd248593 freedreno/afuc: Handle xmov modifiers
Although it's kind-of similar to "(rptN)" in the shader ISA, I called it
"xmov" to make it clear that it's completely orthogonal to "(rep)",
although you certainly can use both modifiers on the same instruction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott b2b19234d8 freedreno/afuc: Add iret
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott a2c14ac070 freedreno/afuc: Handle setsecure opcode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Connor Abbott 0acc394486 freedreno/afuc: Fix printing preemptleave on a5xx
This opcode is actually used on a5xx, but I'm not sure what it's for.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18 16:17:31 +00:00
Dave Airlie 8004fa9c95 vulkan/wsi: add sw support. (v2)
This adds an option to the WSI support for a software path to be
used with the vulkan sw drivers. There is probably some changes
that could be made to improve this and use present, for now
just use put image.

v2: roll out flag across all drivers (Eric)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082>
2020-08-17 14:30:50 +10:00
Jonathan Marek 92f65e28fe turnip: add missing tu_bo_list_add in CmdWriteTimestamp
Fixes an issue observed in renderdoc.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6320>
2020-08-14 14:28:11 +00:00
Jonathan Marek ddac5933f8 turnip: call packing functions directly for pack_gmem_clear_value
This involves rolling our own int packing functions, because the u_format
versions do clamping which differs from VK spec requirement.

This reduces the size of libvulkan_freedreno.so significantly.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek 201331edbf turnip: rework format_to_ifmt
Make it somewhat generic instead of listing formats individually.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek aa5ebf0a6d turnip: fix CmdBlitImage with D32_SFLOAT_S8_UINT
Fixes these dEQP tests:

dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.depth_stencil.2d_d32_sfloat_s8_uint_d32_sfloat_s8_uint.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek f83e89507d turnip: delete a blit_image TODO that has already been resolved
All the blit_image tests now pass when forcing the 3D path, so this TODO
is no longer relevant.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +00:00
Jonathan Marek 2ca1ccc18d turnip: remove dead tu_minify/typed_memcpy functions
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6304>
2020-08-14 13:42:02 +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
Rob Clark 3d6e4a201a freedreno/decode: try harder to not crash in disasm
Move the handling for catching asserts when we start decoding garbage
into disasm-a3xx.  This way it can also cover other cases where cffdec
tries to disassemble memory, such as SP_xS_OBJ_START.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark cbfce486f2 freedreno/crashdec: handle section name typos
The fixes tag isn't so much because it was incorrect before, but because
I'm going to send a kernel patch to fix the typo, and that will break
old crashdec.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark 8d437b2194 freedreno/ir3: add more disasm stats
Add tracking for # of instructions per category, similar to the last
patch.  Also add a few other shader-db stats that were missing on the
disasm side, to make it easier to compare to shaders from cmdstream
traces.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6243>
2020-08-11 01:12:18 +00:00
Rob Clark 7aa74ab792 freedreno/ir3: add tracking for # of instructions per category
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6243>
2020-08-11 01:12:18 +00:00
Rob Clark 3b6e8670f8 freedreno/registers: add some missing regs to build
Needed for installed version of crashdec/cffdump.

Fixes: 9c33c53898 ("freedreno/registers: install gzip'd register database")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6234>
2020-08-07 23:20:38 +00:00
Dylan Baker 1e28745bc0 meson/freedreno: Fix lua requirement
Freedreno needs at least Lua 5.2, but the current code will report found
for 5.1, which doesn't actually work.

Fixes: caa107cb8d
       ("freedreno/decode: move dependencies up a level")

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6229>
2020-08-07 17:27:00 +00:00
Eric Anholt f07e25bc6d freedreno/ir3: Clean up instrlen setup.
We were calculating it with the gpu_id check in two places, do it once and
use ir3_compiler for the gpu_id dependency.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5990>
2020-08-05 23:06:55 +00:00
Eric Anholt 51acfe2230 freedreno/ir3: Simpify the immediates from an array of vec4 to array of dwords.
We usually had to split the idx/swiz out of the dword index anyway.  Note
that incidentally, immediates_size now increments in vec4s instad of
4*vec4s.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5990>
2020-08-05 23:06:55 +00:00
Eric Anholt e873c4da08 freedreno/ir3: Merge the redundant immediate_idx/immediates_count fields
I got tripped up again with the index vs count vs size fields and I'd
rather we didn't store the redundant info.  Settle on immediates_count as
"how many dwords of immediates we have"

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5990>
2020-08-05 23:06:55 +00:00
Rob Clark 4f060549be freedreno/ir3: lower local_index using local_id
Somehow this works ok with the full compiler stack, but not in
ir3_cmdline.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>
2020-08-05 21:00:44 +00:00
Kristian H. Kristensen e05e60b230 turnip: Make tu_android.c compile again
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>
2020-08-05 18:08:07 +00:00
Eric Anholt 1938e2596f freedreno/computerator: Set SP_MODE_CONTROL to the same value as vulkan/GL
This gets us consistent hcN access with our drivers, for experimenting.
We don't know what the other bit does yet, but let's not have to debug
that later.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>
2020-08-05 04:35:05 +00:00
Eric Anholt c92ae9d3ef freedreno/a6xx: Document the bit for the magic 32bit-uniforms-as-16b mode.
Trying to figure out how uniforms were working, I found that computerator
had different behavior from our GL fragment shaders.  Given that 3xx had
an SP_ bit for this (thanks flto@ for the note), it was a matter of
pasting bits of SP_* setup into computerator until I got the GL behavior.
I named it the same as the a3xx register.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>
2020-08-05 04:35:05 +00:00
Eric Anholt db25c18f33 freedreno/ir3: Fix the type of half-float indirect uniform loads.
We would be making a MOV from a u32, when we should be loading from a
16-bit value.  This likely didn't bite us because we only do mediump in FS
and CS so far, and indirect uniforms are usually in a VS (and usually
highp).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6179>
2020-08-05 04:35:05 +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 7dfeae1a45 turnip: Collapse some tu_drm wrappers
These are all internal to tu_drm.c, we can skip a couple of
abstraction layers now.

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
Connor Abbott f226b198f5 tu: Reset has_tess after renderpass
Don't force sysmem for render passes after the one that uses
tessellation.

Also, move this into tu_cmd_state as that's where it belongs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6009>
2020-08-04 15:37:51 +02:00
Connor Abbott 06332ef60e freedreno: Document draw predication packets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6009>
2020-08-04 15:37:51 +02:00
Connor Abbott 9e48e31fa5 tu: Fix DST_INCOHERENT_FLUSH copy/paste error
This was meant to handle incoherent accesses by always flushing them,
but it accidentally checked for the coherent variant instead. As a
result e.g. a vkCmdClearImage() followed by a renderpass using the image
didn't get any flushes, resulting in the same sort of corruption seen
with sysmem renderpass clears. This happened to be exposed via some
tests that used multiview.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6009>
2020-08-04 15:37:51 +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 35f8f355f3 turnip: rework extended formats to allow more extended 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 67b1163f9f turnip: add support for D32_SFLOAT_S8_UINT
Add support for D32_SFLOAT_S8_UINT, which requires special handling because
it is actually two images.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5537>
2020-08-04 11:40:18 +00:00
Eric Anholt 66d8bbd822 freedreno: Fix "Offset of packed bitfield changed" warnings:
Example:

../src/freedreno/ir2/instr-a2xx.h:384:1: note: offset of packed bit-field
‘const_index’ has changed in GCC 4.4
  384 | } instr_fetch_vtx_t;

It's apparently due to bitfields that would cross the width of their type.
Just expand the types of the affected fields so that the compiler quiets
down.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6165>
2020-08-03 23:28:49 +00:00
Jonathan Marek ba6cdb275c turnip: delete tu_clear_sysmem_attachments_2d
2D path is using the same hardware as the 3D path, with the advantage of
separate register state, but here it requires WFI and extra cache flushing
and invalidating, so it should be better to just use the 3D path. There are
also some cases where the 3D path would be much faster, since it can clear
multiple attachments at once.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5775>
2020-08-03 22:38:22 +00:00
Jonathan Marek 9b6486bd3d turnip: fix sysmem CmdClearAttachments 3D fallback breaking GMEM path flush
It was clearing the flush bits, which are used by both GMEM/SYSMEM paths,
but emitting the flushes inside the cond_exec, where they would only run
for the sysmem path.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5775>
2020-08-03 22:38:22 +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