Debian Codegraph @

src/panfrost/vulkan/panvk_cmd_ts.h

raw
1 /*
2 * Copyright (C) 2025 Arm Ltd.
3 * SPDX-License-Identifier: MIT
4 */
5
6 #ifndef PANVK_CMD_TS_H
7 #define PANVK_CMD_TS_H
8
9 #ifndef PAN_ARCH
10 #error "PAN_ARCH must be defined"
11 #endif
12
13 #include <stdint.h>
14
15 #if PAN_ARCH >= 10
16 /* The timstamp info subqueue performs extra tasks like writing the info field
17 * and handling deferred timestamps. To minimize impact on drawing, choose the
18 * compute subqueue. */
19 #define PANVK_QUERY_TS_INFO_SUBQUEUE (PANVK_SUBQUEUE_COMPUTE)
20
21 enum panvk_query_ts_op {
22 PANVK_QUERY_TS_OP_MAX = 0,
23 PANVK_QUERY_TS_OP_MIN = 1,
24 };
25
26 static uint64_t
27 panvk_timestamp_info_encode(enum panvk_query_ts_op op, uint64_t sq_mask)
28 {
29 return (((uint64_t)sq_mask) << 32) | (op);
30 }
31
32 static enum panvk_query_ts_op
33 panvk_timestamp_info_get_op(uint64_t encoded)
34 {
35 return ((uint32_t)encoded);
36 }
37
38 static uint32_t
39 panvk_timestamp_info_get_sq_mask(uint64_t encoded)
40 {
41 return ((uint32_t)(encoded >> 32));
42 }
43 #endif
44 #endif