mesa/src/panfrost/vulkan/panvk_cmd_ts.h
Christoph Pillmayer 92c4dfe6ea panvk: Add timestamp write and reset
Timestamps are made up of multiple results from the different subqueues,
decided by the target stage for the timestamp. Afterwards, when the
timestamp query is copied, those individual results will be combined
into the final result.
For the computation of the final result, each timestamp query also has
a separate info field, containing the info required to perform the copy.

Timestamps inside a renderpass which cover the fragment subqueue need
to be deferred until after the RUN_FRAGMENT job. This happens via a linked
list of timestamps in the subqueue context.

Once in each primary command buffer, the syncobjs of the queries completed
so far are signalled. The list of those queries is part of the subqueue
context as well.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34932>
2025-07-01 08:27:29 +00:00

44 lines
927 B
C

/*
* Copyright (C) 2025 Arm Ltd.
* SPDX-License-Identifier: MIT
*/
#ifndef PANVK_CMD_TS_H
#define PANVK_CMD_TS_H
#ifndef PAN_ARCH
#error "PAN_ARCH must be defined"
#endif
#include <stdint.h>
#if PAN_ARCH >= 10
/* The timstamp info subqueue performs extra tasks like writing the info field
* and handling deferred timestamps. To minimize impact on drawing, choose the
* compute subqueue. */
#define PANVK_QUERY_TS_INFO_SUBQUEUE (PANVK_SUBQUEUE_COMPUTE)
enum panvk_query_ts_op {
PANVK_QUERY_TS_OP_MAX = 0,
PANVK_QUERY_TS_OP_MIN = 1,
};
static uint64_t
panvk_timestamp_info_encode(enum panvk_query_ts_op op, uint64_t sq_mask)
{
return (((uint64_t)sq_mask) << 32) | (op);
}
static enum panvk_query_ts_op
panvk_timestamp_info_get_op(uint64_t encoded)
{
return ((uint32_t)encoded);
}
static uint32_t
panvk_timestamp_info_get_sq_mask(uint64_t encoded)
{
return ((uint32_t)(encoded >> 32));
}
#endif
#endif