aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_query.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: wire up vk_errorf macro to do debug reportingTapani Pälli2017-09-121-1/+2
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Remove 'inline' keywordsMatt Turner2017-08-291-1/+1
| | | | | | | | | | Unless you have data, the compiler knows better than you whether a function should be inlined. No difference in the resulting binary with gcc-6.3.0 or clang-4.0. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* anv: Stop setting BO flags in bo_init_newJason Ekstrand2017-05-231-0/+7
| | | | | | | | | | | | | | | | | | The idea behind doing this was to make it easier to set various flags. However, we have enough custom flag settings floating around the driver that this is more of a nuisance than a help. This commit has the following functional changes: 1) The workaround_bo created in anv_CreateDevice loses both flags. This shouldn't matter because it's very small and entirely internal to the driver. 2) The bo created in anv_CreateDmaBufImageINTEL loses the EXEC_OBJECT_ASYNC flag. In retrospect, it never should have gotten EXEC_OBJECT_ASYNC in the first place. Reviewed-by: Nanley Chery <[email protected]> Cc: "17.1" <[email protected]>
* anv/query: handle more cases of 'out of host memory'Iago Toral Quiroga2017-05-051-0/+10
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* anv/query: Use genxml for MI_MATHJason Ekstrand2017-04-201-43/+28
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed by: Iago Toral Quiroga <[email protected]>
* anv/query: Use snooping on !LLC platformsJason Ekstrand2017-04-071-13/+11
| | | | | | | | | | | | | | Commit b2c97bc789198427043cd902bc76e194e7e81c7d which made us start using a busy-wait for individual query results also messed up cache flushing on !LLC platforms. For one thing, I forgot the mfence after the clflush so memory access wasn't properly getting fenced. More importantly, however, was that we were clflushing the whole query range and then waiting for individual queries and then trying to read the results without clflushing again. Getting the clflushing both correct and efficient is very subtle and painful. Instead, let's side-step the problem by just snooping. Reviewed-by: Chris Wilson <[email protected]>
* anv/query: Busy-wait for available query entriesJason Ekstrand2017-04-051-6/+56
| | | | | | | | | | | | | | | | | | | Before, we were just looking at whether or not the user wanted us to wait and waiting on the BO. Some clients, such as the Serious engine, use a single query pool for hundreds of individual query results where the writes for those queries may be split across several command buffers. In this scenario, the individual query we're looking for may become available long before the BO is idle so waiting on the query pool BO to be finished is wasteful. This commit makes us instead busy-loop on each query until it's available. This significantly reduces pipeline bubbles and improves performance of The Talos Principle on medium settings (where the GPU isn't overloaded with drawing) by around 20% on my SkyLake gt4. Reviewed-by: Chris Wilson <[email protected]> Tested-by: Eero Tamminen <[email protected]> Tested-by: Grazvydas Ignotas <[email protected]>
* anv: Query the kernel for reset statusJason Ekstrand2017-04-041-8/+3
| | | | | | | | | | | | When a client causes a GPU hang (or experiences issues due to a hang in another client) we want to let it know as soon as possible. In particular, if it submits work with a fence and calls vkWaitForFences or vkQueueQaitIdle and it returns VK_SUCCESS, then the client should be able to trust the results of that rendering. In order to provide this guarantee, we have to ask the kernel for context status in a few key locations. Reviewed-by: Kenneth Graunke <[email protected]>
* anv/query: handle out of host memory without crashing in compute_query_result()Iago Toral Quiroga2017-03-241-0/+5
| | | | | | | | | | | | We don't need to make the caller (CmdCopyQueryPoolResults) aware of the problem since compute_query_result() only emits state. The caller is also expected to hit OOM in this scenario right after calling this function, but it is already handling it safely. Fixes: dEQP-VK.api.out_of_host_memory.cmd_copy_query_pool_results Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: return VK_ERROR_DEVICE_LOST immeditely when device is known to be lostIago Toral Quiroga2017-03-241-0/+3
| | | | | | | | If we know the device has been lost we should return this error code for any command that can report it before we attempt to do anything with the device. Reviewed-by: Jason Ekstrand <[email protected]>
* genxml: Make MI_STORE_DATA_IMM have a single 64-bit data fieldJason Ekstrand2017-03-171-2/+1
| | | | | | This is way more convenient than having two separate dword fields. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv: Implement pipeline statistics queriesIlia Mirkin2017-03-171-10/+222
| | | | | | | | 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/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]>
* 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-171-22/+30
| | | | | | | | 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-171-27/+18
| | | | | | | | 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/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]>
* anv: Put everything about queries in genX_query.cJason Ekstrand2017-02-211-0/+480
Reviewed-by: Lionel Landwerlin <[email protected]>