aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* anv: Unify GetDeviceQueue and GetDeviceQueue2Ricardo Garcia2019-11-111-4/+8
| | | | | | | | | Avoid duplicating some checks and code by making anv_GetDeviceQueue a subcase of anv_GetDeviceQueue2, like radv does. Signed-off-by: Ricardo Garcia <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: implement VK_KHR_separate_depth_stencil_layoutsLionel Landwerlin2019-11-066-27/+90
| | | | | | | | | | | | | | | | | | | v2: Use ternary to simplify code (Jason) v3: Reorder switch cases to follow existing section ordering (Nanley) Add missing comment in cmd_buffer_end_subpass() about new layout (Nanley) v4: Fix layout comparison for stencil case (Nanley) Update a few more comments (Nanley) Move VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR in color attachment case for future stencil-CCS support (Nanley) v5: Missed comments update (Nanley) Updated relnotes.txt (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* meson: move the generic symbols check arguments to a common variableEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* meson: add variable to control the symbols checksEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* anv: Properly handle host query reset of performance queriesLionel Landwerlin2019-11-041-32/+20
| | | | | | | | | | | | The host query reset entry point didn't use the availability offset for performance queries. To fix this, reorder the availability of performance queries to match other queries. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 2b5f30b1d9 ("anv: implement VK_INTEL_performance_query") Reviewed-by: Jason Ekstrand <[email protected]>
* anv: remove incorrect polygonMode=point early-outErik Faye-Lund2019-11-011-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is incorrect, because polygonMode only applies if the final primitive type is a polygon; polygonMode doesn't apply to line-primitives as the comment suggests. The Vulkan 1.1 spec, section 26.11, "Polygons" defines that polygons are separate from points and line segments: " A polygon results from the decomposition of a triangle strip, triangle fan or a series of independent triangles. Like points and line segments, polygon rasterization is controlled by several variables in the VkPipelineRasterizationStateCreateInfo structure. " Further, section 26.11.2, "Polygon Mode", only define polygonMode to apply to polygons: " Possible values of the VkPipelineRasterizationStateCreateInfo::polygonMode property of the currently active pipeline, specifying the method of rasterization for polygons, are: " This seems to clearly define that polygonMode doesn't apply to points and lines, so let's make sure that we don't early out with the wrong value. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Move the RT BTI flush workaround to begin_subpassJason Ekstrand2019-10-311-23/+18
| | | | | | | Now that we're no longer compacting binding table entries, the only time they can possibly change is when we actually switch subpasses. Reviewed-by: Rafael Antognolli <[email protected]>
* anv: Stop compacting render targets in the binding tableJason Ekstrand2019-10-311-88/+62
| | | | | | | | Instead, always emit one entry for every color attachment in the subpass or one NULL if there are no color attachments. This will let us adjust an Ice Lake workaround so we don't get a stall on every draw call. Reviewed-by: Rafael Antognolli <[email protected]>
* anv: Don't claim the null RT as a valid color targetJason Ekstrand2019-10-311-6/+6
| | | | | | | If it's NULL, we can let the compiler go ahead and delete it or flag it as NULL. Reviewed-by: Rafael Antognolli <[email protected]>
* anv: Don't delete fragment shaders that write sample maskJason Ekstrand2019-10-311-1/+3
| | | | | | | Also, use color_outputs_valid rather than nr_color_outputs since it should be a bit more accurate. Reviewed-by: Rafael Antognolli <[email protected]>
* anv: Use the new BO alloc API for AndroidJason Ekstrand2019-10-311-28/+15
| | | | | Fixes: a44f5ee0d8b "anv: Rework the internal BO allocation API" Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: add missing xmlconfig headers dependencyEric Engestrom2019-10-311-0/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* anv: Zero released anv_bo structsJason Ekstrand2019-10-311-1/+12
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use a bitset for tracking residencyJason Ekstrand2019-10-312-79/+87
| | | | | | | | | Now that we can conveniently map between GEM handles and struct anv_bo pointers, we can use a simple bitset for residency tracking instead of the complex hash set. This shaves about 3% off of a CPU-limited example running with the Dawn WebGPU implementation. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Set the batch allocator for compute pipelinesJason Ekstrand2019-10-311-2/+5
| | | | | | | Otherwise relocations just up and crash. Fixes: a3153162a9b "anv: Delay allocation of relocation lists" Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Add a device parameter to anv_execbuf_add_boJason Ekstrand2019-10-311-19/+32
| | | | | | | We're about to start needing to lookup BO pointers by GEM handle so we need access to the device. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Drop anv_bo_init and anv_bo_init_newJason Ekstrand2019-10-313-49/+35
| | | | | | | BOs are now only ever allocated through the BO cache so there's no need to have these exposed. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate misc BOs from the cacheJason Ekstrand2019-10-318-63/+52
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate scratch BOs from the cacheJason Ekstrand2019-10-312-41/+18
| | | | | | | | While we're here, we get rid of the locking and use a lock-free algorithm. The chances of spilling contention are low and this is actually a bit simpler in some ways. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate batch and fence buffers from the cacheJason Ekstrand2019-10-315-200/+125
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate descriptor buffers from the BO cacheJason Ekstrand2019-10-313-36/+14
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Set more flags on descriptor pool buffersJason Ekstrand2019-10-311-1/+8
| | | | | | | the ASYNC flag, in particular, has the potential to help performance because it means less sync tracking in the kernel. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate query pool BOs from the cacheJason Ekstrand2019-10-312-26/+16
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use the query_slot helper in vkResetQueryPoolEXTJason Ekstrand2019-10-311-1/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allocate block pool BOs from the cacheJason Ekstrand2019-10-312-48/+34
| | | | | | | This commit switches block pools over to being allocated from the BO cache rather than being allocated manually by the block pool. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/tests: Initialize the BO cache and device mutexJason Ekstrand2019-10-316-0/+8
| | | | | | | We're about to start depending on the BO cache in the state and block pools so we need them properly initialized for the tests to work. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/tests: Zero-initialize instancesJason Ekstrand2019-10-316-6/+14
| | | | | | | | Some of the tests were actually relying on some of those uninitialized bits to be non-zero. In particular, a couple want use_softpin = true. Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Choose BO flags internally in anv_block_poolJason Ekstrand2019-10-319-76/+70
| | | | | | | All block pools are allocated with the same flags. There's no good reason why it needs to be configurable. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Rework the internal BO allocation APIJason Ekstrand2019-10-316-102/+217
| | | | | | | | | | | | | | | | | | | | This makes a number of changes to the current API: 1. Everything is renamed to anv_device_* instead of anv_bo_cache_* because the BO cache is soon going to be the sole BO allocation path and not some special case to make import/export work. 2. Drop the cache parameter. It's totally redundant with the device and just annoying to keep typing. 3. Rework flags so that they go the convenient direction for usage in ANV rather than whichever awkward way the i915 specified it to maintain backwards compatibility. This also gives us the opportunity to set some defaults. 4. Add flags for mapping and coherency. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use anv_block_pool_foreach_bo in get_bo_from_poolJason Ekstrand2019-10-311-6/+5
| | | | | | While we're at it, use gen_48b_address(). Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Rework anv_block_pool_expand_rangeJason Ekstrand2019-10-312-103/+76
| | | | | | | | | | | | | | | | | | | The growing algorithms for the softpin case and the userptr version are almost entirely different. Having this weird join doesn't make the code more comprehensible. This rework does a few things: 1. Move the comment about 48-bit addresses to anv_device_init where we actually unset the EXEC_OBJECT_SUPPORTS_48B_ADDRESS flag. 2. Separate the paths in anv_block_pool_expand_range so it's easier to see what happens in the two different cases. 3. Use the anv_block_poo::bos array for storing all allocated BOs in both paths rather than using the cleanup list in both paths. This lets us make the cleanups array only used for mmaps of the memfd for the userptr case. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Fix a potential BO handle leakJason Ekstrand2019-10-311-1/+3
| | | | | Fixes: 731c4adcf9b "anv/allocator: Add support for non-userptr" Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Handle state pool relocations using "wrapper" BOsJason Ekstrand2019-10-313-14/+56
| | | | | | | | | | Instead of depending on a mutable BO in the state pool for handling growing state pools, add a concept of "wrapper" BOs which just wrap an actual BO. This way, the wrapper can exist once for all of time and we can put it in relocation lists even if the actual BO it references gets swapped out. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Replace ANV_BO_EXTERNAL with anv_bo::is_externalJason Ekstrand2019-10-316-20/+22
| | | | | | | | We're not THAT strapped for space that we can't burn one extra bit for a boolean. If we're really worried about it, we can always shrink the flags field to 16 bits because the kernel only uses 7 currently. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Inline anv_block_pool_get_boJason Ekstrand2019-10-311-27/+13
| | | | | | | It has exactly one caller and we're about to change some of the dynamics which would make this confusing as a separate function. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Declare the bo in the anv_block_pool_foreach_bo loopJason Ekstrand2019-10-313-3/+2
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Stop storing the GEM handle in anv_reloc_list_addJason Ekstrand2019-10-311-1/+1
| | | | | | | | We have to go through and rewrite them all anyway so it doesn't do us any good to put them in the list in anv_reloc_list_add. Also, for state pools the handles are likely wrong by the time vkQueueSubmit is called. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Fix a relocation race conditionJason Ekstrand2019-10-314-12/+25
| | | | | | | | | | | | | | Previously, we would read the offset from the BO in anv_reloc_list_add to generate the presumed offset and then again in the caller to compute the 64-bit address to write into the buffer. However, if the offset somehow changed between these two points, the presumed offset would no longer match the written offset. This is unlikely to actually ever be a problem in practice because the presumed offset gets recorded first and so if the written address is wrong then the presumed offset is almost certainly wrong and the relocation will trigger. However, it's much safer to simply have anv_reloc_list_add return the 64-bit address. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use a util_sparse_array for the GEM handle -> BO mapJason Ekstrand2019-10-312-90/+36
| | | | | | | | This lets us do less allocation because the anv_bo's are now embedded in the sparse array and it also allows lock-free translation from GEM handle to BO which will be useful in future commits. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Move refcount to anv_boJason Ekstrand2019-10-312-61/+50
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Remove _mesa_locale_init/fini calls.Bas Nieuwenhuizen2019-10-311-3/+0
| | | | | | | | | The resulting locale is not used for Vulkan, and it is not reference counted, giving issues when multiple instances are created. CC: 19.2 19.3 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* anv: Add Tile Cache Flush for Unified Cache.Rafael Antognolli2019-10-303-1/+45
|
* anv: Align fast clear color state buffer to a page.Rafael Antognolli2019-10-301-0/+9
| | | | | | | | | | | | | On gen11 and older, compressed images are tiled and aligned to 4K. On gen12 this 4K alignment restriction was removed. However, only aligning the fast clear color buffer to 64B (a cacheline, as it's on the documentation) is causing some bugs where the fast clear color is not converted during the fast clear operation. Aligning things to 4K seems to fix it. v2: Assert that image->planes[plane].offset is 4K aligned (Nanley) Reviewed-by: Nanley Chery <[email protected]>
* anv: Avoid emitting UBO surface states that won't be usedJason Ekstrand2019-10-301-1/+12
| | | | | | | | This shaves around 4-5% off of a CPU-limited example running with the Dawn WebGPU implementation. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Reduce the minimum number of relocationsJason Ekstrand2019-10-291-1/+1
| | | | | | | | | | The original value of 256 was under the assumption that you're a batch buffer which is likely going to have a large number of relocations. However, pipeline objects on Gen7 will have at most 6 relocations (one per shader stage and one for the workaround BO) so this is a lot of per-pipeline wasted space. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Delay allocation of relocation listsJason Ekstrand2019-10-291-67/+71
| | | | | | | | | | | | | The old relocation list code always allocated 256 relocations and a hash set up-front without knowing whether or not we really need them. In particular, in the softpin case, this is two fairly large allocations that we don't need to be making. Also, for pipeline objects on haswell where we don't have softpin, we don't need relocations unless scratch is used so this is extra data per-pipeline. Instead, we should do it on-demand. This shaves 3.5% off of a cpu-limited example running with the Dawn WebGPU implementation. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement new way for setting streamout buffers.Plamena Manolova2019-10-293-0/+19
| | | | | | | | | For gen12 we set the streamout buffers using 4 separate commands instead of 3DSTATE_SO_BUFFER. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Set depthBounds to true in anv_GetPhysicalDeviceFeatures.Plamena Manolova2019-10-291-1/+1
| | | | | | | | | Add depth bounds testing to the list of supported physical device features. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* anv: Fix output of INTEL_DEBUG=bat for chained batchesCaio Marcelo de Oliveira Filho2019-10-281-1/+1
| | | | | | | | | | The anv_batch_bo contents are linked one to another, and when printing we have to start with the first of those. Since in `u_vector` new elements are added to the head, to get the first element we need the vector's tail. Fixes: 32ffd90002b ("anv: add support for INTEL_DEBUG=bat") Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: add a couple printflike() annotationsEric Engestrom2019-10-281-2/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>