aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* aubinator: Move the guts of decode_group() to decoder.c.Kenneth Graunke2017-03-203-31/+42
| | | | | | This lets us use it outside of the aubinator binary itself. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop spec parameter to decode_group().Kenneth Graunke2017-03-201-13/+12
| | | | | | No longer necessary - the iterator gets it from the group. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Make the iterator store a pointer to structure descriptions.Kenneth Graunke2017-03-203-27/+11
| | | | | | | | | | | When the iterator encounters a structure field, it now looks up the gen_group for that structure definition and saves a pointer to it. This lets us drop a lot of ridiculous code in the caller, which looked at item->value (<struct NAME dword>), strtok'd the structure name back out, and looked it up itself. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Track the current field's starting dword offset.Kenneth Graunke2017-03-203-26/+18
| | | | | | | | | | The iterator code already computed this value, then we stored it in the structure name, strtok'd it back out, and also manually computed it when printing dword headers. Just put the value in the struct and use it. Way simpler. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop decode_structure() helper.Kenneth Graunke2017-03-201-16/+9
| | | | | | | It made more sense when decode_group() took a bunch of extra options, but now that there's only one...we may as well pass 0 and call it a day. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop unused print_dword_headers flag.Kenneth Graunke2017-03-201-5/+4
| | | | | | | | | I added this flag in 65a9d5eabb05e4925c1c9a17836cad57304210d6 but it was completely unused. Both callers appear to have printed dword headers, so we can just drop the flag and continue doing it unconditionally. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Store a pointer from gen_group back to gen_spec.Kenneth Graunke2017-03-202-0/+2
| | | | | | | When decoding a structure field within a group, we may want to look up that structure type. Having a gen_spec pointer makes it easy to do so. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Store enum textual name in iter->value.Kenneth Graunke2017-03-203-19/+15
| | | | | | | | | | | | | | | gen_field_iterator_next() produces a string representing the value of the field. For enum values, it also produced a separate "description" string containing the textual name of the enum. The only caller of this function combines the two, printing enums as "<numeric value> (<texture enum name>)". We may as well just store that in item->value directly, eliminating the description field, and a layer of wrapping. v2: Use non-overlapping source and destination strings in snprintf. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: Correct the BDW surface state sizeNanley Chery2017-03-201-1/+1
| | | | | | | | | | | The PRMs state that this packet is 16 DWORDS long. Ensure that the last three DWORDS are zeroed as required by the hardware when allocating a null surface state. Cc: <[email protected]> Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* anv/genX: Solve the vkCreateGraphicsPipelines crashXu,Randy2017-03-201-2/+2
| | | | | | | | | | | | The crash is due to NULL pColorBlendState, which is legal if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use any color attachments. Test: Sample subpasses from LunarG can run without crash Signed-off-by: Xu,Randy <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0 13.0" <[email protected]>
* genxml: Make MI_STORE_DATA_IMM have a single 64-bit data fieldJason Ekstrand2017-03-176-12/+6
| | | | | | This is way more convenient than having two separate dword fields. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv: Turn on inherited queriesJason Ekstrand2017-03-171-1/+1
| | | | | | | It all just works since it's just a hardware register so we might as well turn it on. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement pipeline statistics queriesIlia Mirkin2017-03-174-12/+226
| | | | | | | | In the end, pipeline statistics queries look a lot like occlusion queries only with between 1 and 11 begin/end pairs being generated instead of just the one. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv: Disable VF statistics for blorp and SOL memcpyJason Ekstrand2017-03-174-3/+18
| | | | | | | | | | | | | | | | | | | In order to get accurate statistics, we need to disable statistics for blits, clears, and the surface state memcpy at the top of each secondary command buffer. There are two possible approaches to this: 1) Disable before the blit/memcpy and re-enable afterwards 2) Move emitting 3DSTATE_VF_STATISTICS from initialization and make it part of pipeline state and then just disabale statistics before blits and memcpy operations. Emitting 3DSTATE_VF_STATISTICS should be fairly cheap so it doesn't really matter which path we take. We choose the second option as it's more consistent with the way the rest of the statistics are enabled and disabled. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/pipeline: Enable clipper statisticsJason Ekstrand2017-03-171-0/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* genxml: s/Clipper Statistics Enable/Statistics Enable/Jason Ekstrand2017-03-175-5/+5
| | | | | | | It's in 3DSTATE_CLIP, so it doesn't really need the extra detail. This matches what we do for VS, FS, etc. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/query: Rework store_query_resultJason Ekstrand2017-03-171-15/+24
| | | | | | | | The new version is a nice GPU parallel to cpu_write_query_result and it nicely handles things like dealing with 32 vs. 64-bit offsets in the destination buffer. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Break GPU query calculation into a helperJason Ekstrand2017-03-171-12/+18
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* genxml: Add pipeline statistics registers on gen7+Jason Ekstrand2017-03-174-0/+176
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Add a helper for writing a query pool resultJason Ekstrand2017-03-171-16/+17
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Use a variable-length slot sizeJason Ekstrand2017-03-172-28/+33
| | | | | | | | Not all queries are the same. Even the two queries we support today require a different amount of data per slot. Once we introduce pipeline statistics queries, the size will vary wildly. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Move the available bits to the frontJason Ekstrand2017-03-172-28/+19
| | | | | | | | We're about to make slots variable-length and always having the available bits at the front makes certain operations substantially easier once we do that. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Let 32-bit values wrapJason Ekstrand2017-03-171-2/+0
| | | | | | | | | | | | | | | From the Vulkan 1.0.39 Specification: "If VK_QUERY_RESULT_64_BIT is not set and the result overflows a 32-bit value, the value may either wrap or saturate." So we can either clamp or wrap. Wrapping is both easier and what the user gets if they use vkCmdCopyQueryPoolResults and we should be consistent. We could make vkCmdCopyQueryPoolResults clamp but it's annoying and ends up burning extra batch for something the spec clearly doesn't require. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/device: init timestampPeriod from devinfoRobert Bragg2017-03-171-3/+1
| | | | | | | | | | Now that there's a timebase_scale in gen_device_info which is effectively the 'period' this switches anv_GetPhysicalDeviceProperties to using this common device info to initialize the timestampPeriod device limit. Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Allow a per gen timebase scale factorRobert Bragg2017-03-172-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to Skylake the Gen HW timestamps were driven by a 12.5MHz clock with the convenient property of being able to scale by an integer (80) to nanosecond units. For Skylake the frequency is 12MHz or a scale factor of 83.333333 This updates gen_device_info to track a floating point timebase_scale factor and makes corresponding _queryobj.c changes to no longer assume a scale factor of 80 works across all gens. Although the gen6_ code could have been been left alone, the changes keep the code more comparable, and it now shares a few utility functions for scaling raw timestamps and calculating deltas. The utility for calculating deltas takes into account 32 or 36bit overflow depending on the current kernel version. Note: this leaves the timestamp handling of ARB_query_buffer_object untouched, which continues to use an incorrect scale of 80 on Skylake for now. This is more awkward to solve since the scaling is currently done using a very limited uint64 ALU available to the command parser that doesn't support multiply or divide where it's already taking a large number of instructions just to effectively multiple by 80. This fixes piglit arb_timer_query-timestamp-get on Skylake v2: (Ken) Update timebase_scale for platforms past Skylake/Broxton too. Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/device: Remove a use of a compound literalJason Ekstrand2017-03-171-1/+1
| | | | | | | | Older versions of GCC don't like compound literals in static const variable declarations because they don't think it's an actual constant value. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/GetQueryPoolResults: Actually implement the specJason Ekstrand2017-03-161-16/+36
| | | | | | | | | | | | | | The Vulkan spec is fairly clear about when we should and should not write query pool results. We're also supposed to return VK_NOT_READY if VK_QUERY_RESULT_PARTIAL_BIT is not set and we come across any queries which are not yet finished. This fixes rendering corruptions on The Talos Principle where geometry flickers in and out due to bogus query results being returned by the driver. These issues are most noticable on Sky Lake GT4 2hen running on "ultra" settings. Reviewed-By: Lionel Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100182 Cc: "17.0 13.0" <[email protected]>
* anv/query: Invalidate the correct rangeJason Ekstrand2017-03-161-2/+6
| | | | | Reviewed-By: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/query: Fix the location of timestamp availabilityJason Ekstrand2017-03-161-1/+1
| | | | | Reviewed-By: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]>
* genxml: Add XML version tagsJason Ekstrand2017-03-168-0/+8
| | | | | | | There's not much point to having them or not having them but this reduces some pointless diff from the version we can auto-generate Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Use fprintf for output.Kenneth Graunke2017-03-161-69/+73
| | | | | | | This will make it easier to choose an output file. For now, it remains stdout. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Reuse decode_structure code for handling commandsKenneth Graunke2017-03-161-23/+16
| | | | | | | | | | | The code for decoding structures and commands was almost identical. The only differences are: we print dword headers for commands, and we skip the first one (with the command opcode and lengths). So, generalize decode_structure to add a starting DWord, and a flag for printing the DWord headers, and reuse it. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Delete redundant NULL check.Kenneth Graunke2017-03-161-10/+3
| | | | | | | | | handle_struct_decode() is just a wrapper around decode_structure() with a NULL check. But the only caller already does that NULL check. So, just use decode_structure() directly. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Fix indentation.Kenneth Graunke2017-03-161-7/+6
| | | | | | Three space, not four. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: improve error reporting when creating pipelinesIago Toral Quiroga2017-03-162-2/+4
| | | | | | | Specifically, report 'out of memory' errors that might have happened while emitting the pipeline's batch. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle errors in emit_binding_table() and emit_samplers()Iago Toral Quiroga2017-03-161-5/+17
| | | | | | | | | | | | | | These can fail to allocate device memory, however, the driver can recover from this error by allocating a new binding table block and trying again. v2: - Instead of tracking the errors in these functions and making callers reset the batch's status before attempting to allocate a new block for the binding table, simply make callers responsible for setting the error status if they fail to allocate memory during the second attempt (Jason). Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle errors while allocating new binding table blocksIago Toral Quiroga2017-03-162-6/+13
| | | | | | | | | | Also, we had a couple of instances in flush_descriptor_sets() were we were returning a VkResult directly upon error, but the return value of this function is not a VkResult but a uint32_t dirty mask, so simply return 0 in these cases which reduces the amount of work the driver will do after the error has been raised. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/blorp: make anv_cmd_buffer_alloc_blorp_binding_table() return a VkResultIago Toral Quiroga2017-03-163-26/+46
| | | | | | | | | | | | Instead of asserting inside the function, and then use use that information to return early from its callers upon failure. v2: - Make sure that clear_color_attachment() and clear_depth_stencil_attachment() get the VkResult as well so they avoid executing the batch if an error happened. (Topi) Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/device: assert that commands submitted to a queue are not bogusIago Toral Quiroga2017-03-161-0/+1
| | | | | | | | Any errors that may have happened during the command buffer recording are reported by vkEndCommandBuffer() and it is the application's reponsibility to not submit broken commands to a queue. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffersIago Toral Quiroga2017-03-161-0/+4
| | | | | | | v2: Assert on secondary commands, applications should've called vkEndCommandBuffer() and received an error for them before (Jason) Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: skip vkCmdDispatch() on broken command buffersIago Toral Quiroga2017-03-161-0/+3
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: skip vkCmdDraw*() on broken command buffersIago Toral Quiroga2017-03-161-0/+12
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle memory allocation errors during queue submissionsIago Toral Quiroga2017-03-161-3/+6
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: handle out of memory during vkCmdPushConstantsIago Toral Quiroga2017-03-161-3/+11
| | | | | | | Fixes: dEQP-VK.api.out_of_host_memory.cmd_push_constants Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: handle allocation errors during vkCmdBeginRenderPass()Iago Toral Quiroga2017-03-161-3/+11
| | | | | | | Fixes: dEQP-VK.api.out_of_host_memory.cmd_begin_render_pass Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: skip vkCmdEndRenderPass() for broken command buffersIago Toral Quiroga2017-03-161-0/+3
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: skip vkCmdNextSubpass() for broken command buffersIago Toral Quiroga2017-03-161-0/+3
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/cmd_buffer: report tracked errors in vkEndCommandBuffer()Iago Toral Quiroga2017-03-161-0/+3
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle failures when growing reloc listsIago Toral Quiroga2017-03-164-22/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | Growing the reloc list happens through calling anv_reloc_list_add() or anv_reloc_list_append(). Make sure that we call these through helpers that check the result and set the batch error status if needed. v2: - Handling the crashes is not good enough, we need to keep track of the error, for that, keep track of the errors in the batch instead (Jason). - Make reloc list growth go through helpers so we can have a central place where we can do error tracking (Jason). v3: - Callers that need the offset returned by anv_reloc_list_add() can compute it themselves since it is extracted from the inputs to the function, so change the function to return a VkResult, make anv_batch_emit_reloc() also return a VkResult and let their callers do the error management (Topi) v4: - Let anv_batch_emit_reloc() return an uint64_t as it originally did, there is no real benefit in having it return a VkResult. - Do not add an is_aux parameter to add_surface_state_reloc(), instead do error checking for aux in add_image_view_relocs() separately. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: avoid crashes when failing to allocate batchesIago Toral Quiroga2017-03-163-17/+36
| | | | | | | | | | | | | | | | | | | | | | Most of the time we use macros that handle this situation transparently, but there are some cases were we need to handle this explicitly. This patch makes sure we don't crash, notice that error handling takes place in the function that actually failed the allocation, anv_batch_emit_dwords(), which will set the status field of the batch so it can be used at a later moment to report the error to the user. v2: - Not crashing is not good enough, we need to keep track of the error (Topi, Jason). Iago: now that we track errors in the batch, this is being handled. - Added guards in a few more places that needed it (Iago) v3: - Check result of anv_batch_emitn() for NULL before calling memset() in emit_vertex_input() (Topi) Reviewed-by: Topi Pohjolainen <[email protected]>