Commit Graph

141 Commits

Author SHA1 Message Date
Eric Anholt 9a5f3594ee turnip: Emit clears of gmem using linear.
This is what we do in freedreno.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-15 07:56:20 -04:00
Eric Anholt 776a9ce36b turnip: Set up the correct tiling mode for small attachments.
Noticed while debugging a tiling-looking issue by comparing our gmem
blit setup to freedreno's.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-15 07:56:19 -04:00
Jonathan Marek 057c0f5caa turnip: update setup_slices
Deal with tiled r8g8 having different alignment and other updates taken
from fd6_resource. Additionally track image samples/cpp.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-15 07:56:19 -04:00
Jonathan Marek 2f939ef889 turnip: add black border color
Avoids hangs and some texture tests are happy with just this.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-15 07:56:19 -04:00
Jonathan Marek 8727253329 turnip: emit texture and uniform state
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
2019-09-26 17:18:13 -04:00
Jonathan Marek e353fd096d turnip: use image tile_mode for gmem configuration
Fixes at least this deqp test:
dEQP-VK.api.smoke.triangle

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-09-24 22:32:09 -04: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
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
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 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 b8a5e10d0d turnip: mark IBs for dumping
Includes IBs in kernel cmdbuf dumps.
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
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 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 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 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 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 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 ba6bcb387c turnip: preliminary support for tu_CmdBeginRenderPass 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 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 45120127ea turnip: run sed and clang-format on tu_cs 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
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 abf0792bbe turnip: Make bo_list functions not static 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
Chia-I Wu d30baaaba6 turnip: add .clang-format
Add and apply .clang-format.
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 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 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