summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vk/allocator: Make block_pool_grow take and return a sizeJason Ekstrand2015-08-031-19/+19
| | | | | It takes the old size as an argument and returns the new size as the return value. On error, it returns a size of 0.
* vk/allocator: Fix a data race in the state poolJason Ekstrand2015-08-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The previous algorithm had a race because of the way we were using __sync_fetch_and_add for everything. In particular, the concept of "returning" over-allocated states in the "next > end" case was completely bogus. If too many threads were hitting the state pool at the same time, it was possible to have the following sequence: A: Get an offset (next == end) B: Get an offset (next > end) A: Resize the pool (now next < end by a lot) C: Get an offset (next < end) B: Return the over-allocated offset D: Get an offset in which case D will get the same offset as C. The solution to this race is to get rid of the concept of "returning" over-allocated states. Instead, the thread that gets a new block simply sets the next and end offsets directly and threads that over-allocate don't return anything and just futex-wait. Since you can only ever hit the over-allocate case if someone else hit the "next == end" case and hasn't resized yet, you're guaranteed that the end value will get updated and the futex won't block forever.
* vk/allocator: Make a few things more consistantJason Ekstrand2015-08-031-5/+5
|
* vk/allocator: Use memory pools rather than (MALLOC|FREE)LIKEJason Ekstrand2015-07-311-22/+21
| | | | | | We have pools, so we should be using them. Also, I think this will help keep valgrind from getting confused when we have to end up fighting with system allocations such as those from malloc/free and mmap/munmap.
* vk/allocator: Add an anv_state_pool_finish functionJason Ekstrand2015-07-313-0/+8
| | | | | Currently this is a no-op but it gives us a place to put finalization things in the future.
* vk/instance: valgrind-guard client-provided allocationsJason Ekstrand2015-07-311-1/+10
|
* vk/device: Add anv_instance_alloc/free helpersJason Ekstrand2015-07-311-12/+23
| | | | | This way we can more consistently alloc/free the device and it will provide us a better place to put valgrind hooks in the next patch
* vk/device: Mark newly allocated memory as undefined for valgrindJason Ekstrand2015-07-311-4/+4
| | | | | This way valgrind still works even if the client gives us memory that has been initialized or re-uses memory for some reason.
* vk/batch_chain: Decrement num_relocs instead of incrementing itJason Ekstrand2015-07-311-1/+9
|
* vk/batch_chain: Compute secondary exec mode after finishing the boJason Ekstrand2015-07-311-5/+7
| | | | | | Figuring out whether or not to do a copy requires knowing the length of the final batch_bo. This gets set by anv_batch_bo_finish so we have to do it afterwards. Not sure how this was even working before.
* vk: Re-name command buffer implementation filesJason Ekstrand2015-07-304-2087/+2087
| | | | | | | | Previously, the command buffer implementation was split between anv_cmd_buffer.c and anv_cmd_emit.c. However, this naming convention was confusing because none of the Vulkan entrypoints for anv_cmd_buffer were actually in anv_cmd_buffer.c. This changes it so that anv_cmd_buffer.c is what you think it is and the internals are in anv_batch_chain.c.
* vk/cmd_buffer: Add a simple command pool implementationJason Ekstrand2015-07-303-27/+61
|
* vk/cmd_buffer: Add support for zero-copy batch chainingJason Ekstrand2015-07-302-7/+78
|
* vk: Add initial support for secondary command buffersJason Ekstrand2015-07-304-17/+117
|
* vk/cmd_buffer: Split batch chaining into a helper functionJason Ekstrand2015-07-301-17/+27
|
* vk/device: Make BATCH_SIZE a global #defineJason Ekstrand2015-07-302-3/+3
|
* vk/cmd_buffer: Add functions for cloning a list of anv_batch_bo'sJason Ekstrand2015-07-301-0/+38
| | | | We'll need this to implement secondary command buffers.
* vk/reloc_list: Actually set the new length in reloc_list_growJason Ekstrand2015-07-301-0/+1
|
* util/list: Add list splicing functionsJason Ekstrand2015-07-301-0/+22
| | | | | This adds functions for splicing one list into another. These have more-or-less the same API as the kernel list splicing functions.
* CLONEJason Ekstrand2015-07-301-5/+61
|
* vk/cmd_buffer: Invalidate texture cache in emit_state_base_addressJason Ekstrand2015-07-301-40/+40
| | | | | | | Previously, the caller of emit_state_base_address was doing this. However, putting it directly in emit_state_base_address means that we'll never forget the flush at the cost of one PIPE_CONTROL at the top every batch (that should do nothing since the kernel just flushed for us).
* vk/cmd_buffer: Rename emit_batch_buffer_end to end_batch_bufferJason Ekstrand2015-07-303-7/+7
| | | | | | This is more generic and doesn't imply that it emits MI_BATCH_BUFFER_END. While we're at it, we'll move NOOP adding from bo_finish to end_batch_buffer.
* vk/cmd_buffer: Use an array to track all know anv_batch_bo objectsJason Ekstrand2015-07-292-17/+51
| | | | | | Instead of walking the list of batch and surface buffers, we simply keep track of all known batch and surface buffers as we build the command buffer. Then we use this new list to construct the validate list.
* vk/cmd_buffer: Rework validate list creationJason Ekstrand2015-07-291-63/+95
| | | | | | | | The algorighm we used previously required us to call add_bo in a particular order in order to guarantee that we get the initial batch buffer as the last element in the validate list. The new algorighm does a recursive walk over the buffers and then re-orders the list. This should be much more robust as we start to add circular dependancies in the relocations.
* vk/cmd_buffer: Move emit_batch_buffer_end higher in the fileJason Ekstrand2015-07-291-14/+14
|
* vk/cmd_buffer: Store the relocation list in the anv_batch_bo structJason Ekstrand2015-07-293-73/+49
| | | | | | | Before, we were doing this thing where we had one big relocation list for the whole command buffer and each subbuffer took a chunk out of it. Now, we store the actual relocation list in the anv_batch_bo. This comes at the cost of more small allocations but makes a lot of things simpler.
* vk/batch: Make relocs a pointer to a relocation listJason Ekstrand2015-07-293-17/+22
| | | | | | Previously anv_batch.relocs was an actual relocation list. However, this is limiting if the implementation of the batch wants to change the relocation list as the batch progresses.
* vk/headers: Update to new generated gen headersKristian Høgsberg Kristensen2015-07-294-139/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update fixes cases where a 48-bit address field was split into two parts: __gen_address_type MemoryAddress; uint32_t MemoryAddressHigh; which cases this pack code to be generated: dw[1] = __gen_combine_address(data, &dw[1], values->MemoryAddress, dw1); dw[2] = __gen_field(values->MemoryAddressHigh, 0, 15) | 0; which breaks for addresses above 4G. This update also fixes arrays of structs in commands and structs, for example, we now have: struct GEN8_BLEND_STATE_ENTRY Entry[8]; and the pack functions now write all dwords in the packet, making valgrind happy. Finally, we would try to pack 64 bits of blend state into a uint32_t - that's also fixed now.
* vk/cmd_buffer: Update a commentJason Ekstrand2015-07-291-2/+3
|
* vk/cmd_buffer: Use a doubly-linked list for batch and surface buffersJason Ekstrand2015-07-283-60/+98
| | | | This is probably better than hand-rolling the list of buffers.
* vk/aub: Use the data directly from the execbuf2Jason Ekstrand2015-07-281-36/+19
| | | | | | | | Previously, we were crawling through the anv_cmd_buffer datastructure to pull out batch buffers and things. This meant that every time something in anv_cmd_buffer changed, we broke aub dumping. However, aub dumping should just dump the stuff the kernel knows about so we really don't need to be crawling driver internals.
* vk/cmd_buffer: Pull the execbuf stuff into a substructJason Ekstrand2015-07-275-59/+68
|
* vk/cmd_buffer: Move the remaining entrypoints into cmd_emit.cJason Ekstrand2015-07-273-96/+82
|
* vk/cmd_buffer: Move the re-emission of STATE_BASE_ADDRESS to the flushing codeJason Ekstrand2015-07-272-45/+45
| | | | | | This used to happen magically in cmd_buffer_new_surface_state_bo. However, according to Ken, STATE_BASE_ADDRESS is very gen-specific so we really shouldn't have it in the generic data-structure code.
* vk/cmd_buffer: Factor the guts of CmdBufferEnd into two helpersJason Ekstrand2015-07-272-11/+27
|
* vk/cmd_buffer: Factor the guts of (Create|Reset|Destroy)CmdBuffer into helpersJason Ekstrand2015-07-272-59/+98
|
* vk/private.h: Re-arrange and better comment anv_cmd_bufferJason Ekstrand2015-07-271-5/+11
|
* vk: Actually advertise 0.138.1 at runtimeJason Ekstrand2015-07-231-1/+1
|
* vk/vulkan.h: Bump to the version 0.138.1 headerJason Ekstrand2015-07-231-18/+17
| | | | | This doesn't actually require any implementation changes but it does change an enum so it is ABI-incompatable with 0.138.0.
* vk: Add two more valgrind checksJason Ekstrand2015-07-232-0/+2
|
* vk/meta: Destroy shader modulesJason Ekstrand2015-07-221-0/+3
|
* vk/device: Finish the scratch block pool on device destructionJason Ekstrand2015-07-221-0/+1
|
* vk: Add a FreeDescriptorSets functionJason Ekstrand2015-07-222-0/+24
|
* vk/pipeline: Be more sloppy about shader entrypoint namesJason Ekstrand2015-07-221-3/+4
| | | | | | The CTS passes in NULL names right now. It's not too hard to support that as just "main". With this, and a patch to vulkancts, we now pass all 6 tests.
* vk: Prefix most filenames with anvChad Versace2015-07-1720-51/+51
| | | | | | Jason started the task by creating anv_cmd_buffer.c and anv_cmd_emit.c. This patch finishes the task by renaming all other files except gen*_pack.h and glsl_scraper.py.
* vk/image: Remove unneeded data from anv_buffer_viewChad Versace2015-07-173-17/+16
| | | | | | | | This completes the FINISHME to trim unneeded data from anv_buffer_view. A VkExtent3D doesn't make sense for a VkBufferView. So remove the member anv_surface_view::extent, and push it up to the two objects that actually need it, anv_image_view and anv_attachment_view.
* vk: Document members of anv_surface_viewChad Versace2015-07-171-6/+6
|
* vk: Remove more raw castsChad Versace2015-07-175-15/+31
| | | | | | | | | | This removes nearly all the remaining raw Anvil<->Vulkan casts from the C source files. (File compiler.cpp still contains many raw casts, and I plan on ignoring that). As far as I can tell, the only remaining raw casts are: anv_attachment_view -> anv_depth_stencil_view anv_attachment_view -> anv_color_attachment_view
* vk/image: Add braces around multi-line ifsChad Versace2015-07-171-4/+6
|
* nir/spirv: don't declare builtin blocksConnor Abbott2015-07-163-9/+22
| | | | | They aren't used, and the backend was barfing on them. Also, remove a hack in in compiler.cpp now that they're gone.