aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
Commit message (Collapse)AuthorAgeFilesLines
* turnip: Implement vkCmdCopyQueryPoolResults for occlusion queriesBrian Ho2020-01-241-0/+111
| | | | | | | | | Use CP_COND_EXEC and CP_COND_WRITE to conditionally copy the results of a query to a buffer based off the query's availability. Fixes: #2238 Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Implement vkCmdResetQueryPoolBrian Ho2020-01-241-0/+38
| | | | | | Clears the available bit for each requested query on the GPU. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Implement vkGetQueryPoolResults for occlusion queriesBrian Ho2020-01-241-0/+125
| | | | | | | | Implements fetching the results of a query pool with the VK_QUERY_RESULT_WAIT_BIT, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT, and VK_QUERY_RESULT_PARTIAL_BIT flags. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Update query availability on render pass endBrian Ho2020-01-244-9/+44
| | | | | | | | | | | | | | Unlike on an immidiate-mode renderer, Turnip only renders tiles on vkCmdEndRenderPass. As such, we need to track all queries that were active in a given render pass and defer setting the available bit on those queries until after all tiles have rendered. This commit adds a draw_epilogue_cs to tu_cmd_buffer that is executed as an IB at the end of tu_CmdEndRenderPass. We then emit packets to this command stream that update the availability bit of a given query in tu_CmdEndQuery. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Implement vkCmdEndQuery for occlusion queriesBrian Ho2020-01-241-0/+82
| | | | | | | | | Mostly a translation of freedreno's implementation of glEndQuery for GL_SAMPLES_PASSED query objects with a slight modification to set the availability bit of the query bo (slot->available) if the query was not ended inside a render pass. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Implement vkCmdBeginQuery for occlusion queriesBrian Ho2020-01-241-0/+68
| | | | | | | | Mostly a translation of freedreno's implementation of glBeginQuery for GL_SAMPLES_PASSED query objects with special logic for handling tiled render passes. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Implement vkCreateQueryPool for occlusion queriesBrian Ho2020-01-241-0/+52
| | | | | | | | | General structure is inspired by anv's implementation in genX_query.c. We define a packed struct that tracks sample count at the beginning of the query and at the end; the result of the occlusion query is then slot->end - slot->begin. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* turnip: Update tu_query_pool with turnip-specific fieldsBrian Ho2020-01-241-4/+3
| | | | | | | tu_query_pool was forked from radv_query_pool, but we will need a different set of fields to implement queries in turnip. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3279>
* freedreno: Document CP_INDIRECT_BUFFER_CHAINConnor Abbott2020-01-241-0/+6
| | | | | | | | | This will let us use batch chaining instead of growing batches on a5xx and a6xx. Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3537> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3537>
* freedreno: Document CP_UNK_A6XX_55Connor Abbott2020-01-242-23/+62
| | | | | Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3537>
* freedreno: Document CP_COND_REG_EXEC moreConnor Abbott2020-01-242-5/+32
| | | | | | | | | The vulkan blob uses the RENDER_MODE mode to condition a blit on the render mode in traces of a dEQP triangle test. Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3182> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3182>
* turnip: Convert the rest of tu_cmd_buffer.c over to the new pack macros.Eric Anholt2020-01-231-112/+96
| | | | | | | | There are only a couple of hard cases left using pkt4, where the register number to write is computed. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>
* turnip: Convert renderpass setup to the new register packing macros.Eric Anholt2020-01-232-182/+188
| | | | | | | | | This gets a lot of the hard code converted over to the new macros, resulting in (I feel) much more readable code with LESS_SHOUTING_ABOUT_THE_REG(). I decided to consistently put the reg on its own line, so that all the register names line up. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>
* turnip: Port krh's packing macros from freedreno to tu.Eric Anholt2020-01-234-17/+107
| | | | | | | | | | | | This introduces some minor unpacking of the temporary fd_reg_pair structs to code that previously was packing a whole register field. In the pack wrapper in tu_cs.h, I added some explanatory docs, dropped the relocs handling since we don't need it, and removed the extra regs[] in the __ONE_REG() macro (which was causing gcc's optimizer to fall on its face in my release build). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>
* freedreno: Fix OUT_REG() on address regs without a .bo supplied.Eric Anholt2020-01-231-0/+1
| | | | | | | | | Sometimes you want to zero out an address by supplying a NULL BO, but without this we would end up only emitting one dword. Increases size of fd6_gmem.o by .8%, though it's not clear to me why (no obvious terrible codegen happening) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>
* freedreno: Add some missing a6xx address declarations.Eric Anholt2020-01-231-0/+5
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3455>
* turnip: Fix execution of secondary cmd bufs with nothing in primary.Eric Anholt2020-01-231-6/+2
| | | | | | | | | | | | | We want to finish off cmd emission in the primary CS and add its entry to the IB, but regardless of whether there had been anything in the primary CS to emit, we still need a reserved CS entry for the loop below. Fixes crashes in dEQP-VK.binding_model.shader_access.secondary_cmd_buf.* and many more in dEQP-VK.renderpass* Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3524> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3524>
* turnip: simplify tu_physical_device_get_format_propertiesJonathan Marek2020-01-231-24/+12
| | | | | | | | | | | Fixes the "bad VkImageTiling" error when tiling is VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT. Signed-off-by: Jonathan Marek <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>
* vulkan/wsi: remove unused image_get_modifierJonathan Marek2020-01-231-16/+0
| | | | | | | Signed-off-by: Jonathan Marek <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>
* turnip: set linear tiling for scanout imagesJonathan Marek2020-01-231-0/+5
| | | | | | | | Fixes: 210e6887 "vulkan/wsi: Use the interface from the real modifiers extension" Signed-off-by: Jonathan Marek <[email protected]> Acked-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>
* turnip: hook up GetImageDrmFormatModifierPropertiesEXTJonathan Marek2020-01-232-0/+24
| | | | | | | | Fixes: 210e6887 "vulkan/wsi: Use the interface from the real modifiers extension" Signed-off-by: Jonathan Marek <[email protected]> Acked-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>
* freedreno/drm: Don't miscalculate timeoutGuido Günther2020-01-231-3/+2
| | | | | | | | | The current code overflows (s * 1000000000) for s >= 5 but that is e.g. used in msm_bo_cpu_prep. Signed-off-by: Guido Günther <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3514> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3514>
* turnip: Add support for fine derivatives.Eric Anholt2020-01-235-1/+25
| | | | | | | | | | | | This does appear to be the required instruction sequence (dsxpp_1 dst src; dsxpp_1.p dst src) as dropping either instruction fails the testsuite. Fixes dEQP-VK.glsl.derivate.* Reviewed-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3494> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3494>
* freedreno/ir3: Plumb the ir3_shader_variant into legalize.Eric Anholt2020-01-233-9/+7
| | | | | | | | | | legalize is computing a lot of state that goes in the variant, let's just store it directly instead of passing pointers around. This leaves max_bary in place, which is doing some surprising work (overwriting the original total_in in some cases). Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3494>
* util/hash_table: update users to use new optimal integer hash functionsAnthony Pesch2020-01-231-15/+2
| | | | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
* turnip: Add support for uniform texel buffers.Eric Anholt2020-01-234-12/+55
| | | | | | | | | | | | | | | | | | | Pretty straightforward: Port texture descriptor code from freedreno, fill in alignment limits from closed vk, and tu_cmd_buffer.c was already uploading the texture descriptor. This doesn't implement storage texel buffers (required in the compute pipeline) yet, since those will need an IBO descriptor for the store path. Still, making the load path be connected to the texture descriptor won't hurt. Part of #2237 Fixes dEQP-VK.binding_model.shader_access.primary_cmd_buf.uniform_texel_buffer.* Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3522> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3522>
* turnip: Add support for non-zero (still constant) UBO buffer indices.Eric Anholt2020-01-221-2/+3
| | | | | | | | | | | This was actually all ready to go at this point, and just needed to increment by the value. Fixes dEQP-VK.binding_model.shader_access.primary_cmd_buf.uniform_buffer.* Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3504> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3504>
* turnip: fix array/matrix varyingsJonathan Marek2020-01-211-2/+2
| | | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109>
* turnip: remove tu_sort_variables_by_locationJonathan Marek2020-01-211-48/+0
| | | | | | | | nir_assign_io_var_locations already does sorting. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109>
* freedreno/ir3: allow inputs with the same locationJonathan Marek2020-01-211-9/+17
| | | | | | | | | turnip can have multiple inputs with the same location, and different location_frac. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3109>
* turnip: Disable UBWC on images used as storage images.Eric Anholt2020-01-211-0/+12
| | | | | | | | | | | | | | The closed GL driver doesn't use UBWC on any storage images. It does tile mostly (skipping tiling on writeonly images, it seems), but for freedreno we've been enabling tiling in all cases and it's fine. We do need to disable UBWC, as tests fail otherwise and just plugging in the equivalent UBWC regs like we were setting up a texture isn't enough. Fixes dEQP-VK.image.atomic_operations.* Reviewed-by: Jonathan Marek <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>
* turnip: Add limited support for storage images.Eric Anholt2020-01-216-19/+116
| | | | | | | | | | | So far this doesn't handle the texture state-based storage image access loads, and doesn't support descriptor arrays (same as SSBOs). The texture side is more tricky, since we have another remapping table to work around. This is enough to get some of dEQP-VK.image.atomic_operations.* working. Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>
* turnip: Refactor the intrinsic lowering.Eric Anholt2020-01-211-35/+48
| | | | | | | Too many things in one function, split them out based on the intrinsic. Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>
* turnip: Fix some whitespace around binary operators.Eric Anholt2020-01-211-3/+3
| | | | | | | Conforms to mesa style and the rest of turnip. Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3433>
* freedreno: Stop scattered remapping of SSBOs/images to IBOs.Eric Anholt2020-01-218-51/+63
| | | | | | | | | | | | | | | | | | | | | | | Just make it be all SSBOs then all storage images. The remapping table was there to make it so that the big gap present from gallium's atomic lowering would get cleaned up, but that's no longer case. The table has made it very hard to support Vulkan storage images, so it's time for it to go. This does mean that an SSBO/IBO that is only loaded (or size-queried) will now occupy a slot in the table where it wouldn't before. This seems like a minor cost compared to being able to drop this much logic. With the remapping table gone, SSBO array handling for turnip just falls out. Fixes many array cases of dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_buffer.* Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> (turnip) Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3240> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3240>
* turnip: Refactor linkage state setup.Eric Anholt2020-01-211-20/+20
| | | | | | | | As I touch this for descriptor set reworks, I don't want to have to update it twice. Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3240>
* turnip: fix invalid VK_ERROR_OUT_OF_POOL_MEMORYHyunjun Ko2020-01-211-0/+3
| | | | | | | | | | | | | | | | When VK_DESCRIPTOR_TYPE_SAMPLER is provided, it doesn't need to be counted as a buffer count. Otherwise it leads to mismatch of allocated buffer size, hitting VK_ERROR_OUT_OF_POOL_MEMORY finally. Fixes: c39afe68f0390d45130c1317b3b7e65f55542c36 Also fixes amber tests: ./tests/cases/address_modes_float.amber ./tests/cases/address_modes_int.amber ./tests/cases/magfilter_linear.amber ./tests/cases/magfilter_nearest.amber Reviewed-by: Jonathan Marek <[email protected]>
* vulkan/wsi: Use the interface from the real modifiers extensionJason Ekstrand2020-01-172-12/+14
| | | | | | | | | | | The anv implementation still isn't quite complete, but we can at least start using the structs from the real extension. v2: Fix circular pNext list (Lionel) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3434>
* turnip: Pretend to support Vulkan 1.2Jason Ekstrand2020-01-153-13/+13
| | | | | | It doesn't really support any Vulkan properly yet so why not claim 1.2? This was an easier way of fixing the build than trying to roll it forward to a later version of ANV's entrypoint generator scripts.
* freedreno/ir3: rename instructionsRob Clark2020-01-157-14/+25
| | | | | | | | | | | | | Turns out this range of opcodes are more general purpose if/else/endif instructions. We should re-work tess to create a basic block and use normal flow control. And possibly (for a6xx+) optimize cases to use if/else/endif when appropriate. Signed-off-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3398> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3398>
* nir/lower_atomics_to_ssbo: Also lower barriersJason Ekstrand2020-01-131-2/+0
| | | | | | | | | | | This is more correct for a pass which is supposed to completely lower away atomic counters. It also lets us stop supporting atomic counter barriers in most of the drivers. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* nir: Rename nir_intrinsic_barrier to control_barrierJason Ekstrand2020-01-132-3/+3
| | | | | | | | This is a more explicit name now that we don't want it to be doing any memory barrier stuff for us. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* nir: Add a new memory_barrier_tcs_patch intrinsicJason Ekstrand2020-01-131-0/+1
| | | | | | | | | | | Right now, it's implemented as a no-op for everyone. For most drivers, it's a switch case in the NIR -> whatever which just breaks. For ir3, they already have code to delete tessellation barriers so we just add a case to also delete memory_barrier_tcs_patch. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
* freedreno/drm: Fix memory leak in softpin implementationLasse Lopperi2020-01-101-0/+2
| | | | | | | | | | | | | | | | Free the memory allocated for cmds/reloc_bos array when destoying the associated ringbuffer. For similar fix for the non-softpin implementation see: https://gitlab.freedesktop.org/mesa/mesa/commit/d014af98b7afc69f4f733c8b8b6f2e3438e68407 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2324 Fixes: f3cc0d2 ("freedreno: import libdrm_freedreno + redesign submit") Signed-off-by: Lasse Lopperi <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3342> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3342>
* ir3: Set up full/half register conflicts correctlyKristian H. Kristensen2020-01-091-2/+1
| | | | | | | | | | | | | | Setting up transitive conflicts between a full register and its two half registers (eg r0.x and hr0.x and hr0.y) will make the half registers conflict. They don't actually conflict and this prevents us from using both at the same time. Add and use a new ra helper that sets up transitive conflicts between a register and its subregisters, except it carefully avoids the subregister conflict. Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* turnip: Use VK_NULL_HANDLE instead of NULL.Bas Nieuwenhuizen2020-01-021-1/+1
| | | | | | | | | Only occurrence of implicitly converting pointer->int. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2570>
* freedreno/ir3: fix flat shading againRob Clark2019-12-241-1/+1
| | | | | | | | | These days `ctx->inputs` is the split scalar input components and `ir->inputs` is the full vecN. This got fixed in the load_input case, but the load_interpolated_input case was missed. Fixes: bdf6b7018ce ("freedreno/ir3: re-work shader inputs/outputs") Signed-off-by: Rob Clark <[email protected]>
* turnip: disable B8G8R8 vertex formatsJonathan Marek2019-12-191-6/+6
| | | | | | | | | Looks like swap doesn't work as expected on these, disable them. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3170> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3170>
* turnip: minor warning fixesJonathan Marek2019-12-192-2/+2
| | | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3177> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3177>
* turnip: implement secondary command buffersJonathan Marek2019-12-193-2/+62
| | | | | | | | | | Uses a new "tu_cs_add_entries" function because tu_cs_emit_call doesn't work inside draw_cs (which is already called by tu_cs_emit_call). Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3075> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3075>