anv: Use helpers in util/os_time.h in the query code

These are about to be the only use of anv_gettime_ns() so lets switch
them over so the next patch can delete the helper outright.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
This commit is contained in:
Jason Ekstrand 2021-10-20 16:44:53 -05:00
parent 213edd1841
commit 87cf858946

View file

@ -29,6 +29,8 @@
#include "anv_private.h"
#include "util/os_time.h"
#include "genxml/gen_macros.h"
#include "genxml/genX_pack.h"
@ -415,9 +417,9 @@ static VkResult
wait_for_available(struct anv_device *device,
struct anv_query_pool *pool, uint32_t query)
{
uint64_t abs_timeout = anv_get_absolute_timeout(2 * NSEC_PER_SEC);
uint64_t abs_timeout_ns = os_time_get_absolute_timeout(2 * NSEC_PER_SEC);
while (anv_gettime_ns() < abs_timeout) {
while (os_time_get_nano() < abs_timeout_ns) {
if (query_is_available(pool, query))
return VK_SUCCESS;
VkResult status = vk_device_check_status(&device->vk);