xref: /aosp_15_r20/external/mesa3d/src/virtio/virtio-gpu/venus_hw.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Copyright 2020 Chromium
3*61046927SAndroid Build Coastguard Worker  *
4*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
5*61046927SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
6*61046927SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
7*61046927SAndroid Build Coastguard Worker  * on the rights to use, copy, modify, merge, publish, distribute, sub
8*61046927SAndroid Build Coastguard Worker  * license, and/or sell copies of the Software, and to permit persons to whom
9*61046927SAndroid Build Coastguard Worker  * the Software is furnished to do so, subject to the following conditions:
10*61046927SAndroid Build Coastguard Worker  *
11*61046927SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*61046927SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*61046927SAndroid Build Coastguard Worker  * Software.
14*61046927SAndroid Build Coastguard Worker  *
15*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*61046927SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*61046927SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18*61046927SAndroid Build Coastguard Worker  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19*61046927SAndroid Build Coastguard Worker  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20*61046927SAndroid Build Coastguard Worker  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21*61046927SAndroid Build Coastguard Worker  * USE OR OTHER DEALINGS IN THE SOFTWARE.
22*61046927SAndroid Build Coastguard Worker  */
23*61046927SAndroid Build Coastguard Worker 
24*61046927SAndroid Build Coastguard Worker #ifndef VENUS_HW_H
25*61046927SAndroid Build Coastguard Worker #define VENUS_HW_H
26*61046927SAndroid Build Coastguard Worker 
27*61046927SAndroid Build Coastguard Worker #include <stdint.h>
28*61046927SAndroid Build Coastguard Worker 
29*61046927SAndroid Build Coastguard Worker #ifdef VIRGL_RENDERER_UNSTABLE_APIS
30*61046927SAndroid Build Coastguard Worker struct virgl_renderer_capset_venus {
31*61046927SAndroid Build Coastguard Worker    uint32_t wire_format_version;
32*61046927SAndroid Build Coastguard Worker    uint32_t vk_xml_version;
33*61046927SAndroid Build Coastguard Worker    uint32_t vk_ext_command_serialization_spec_version;
34*61046927SAndroid Build Coastguard Worker    uint32_t vk_mesa_venus_protocol_spec_version;
35*61046927SAndroid Build Coastguard Worker 
36*61046927SAndroid Build Coastguard Worker    /* This flag indicates render server config, and will be needed until drm
37*61046927SAndroid Build Coastguard Worker     * virtio-gpu blob mem gets fixed to attach_resource before resource_map.
38*61046927SAndroid Build Coastguard Worker     */
39*61046927SAndroid Build Coastguard Worker    uint32_t supports_blob_id_0;
40*61046927SAndroid Build Coastguard Worker 
41*61046927SAndroid Build Coastguard Worker    /* Extension number N, where N is defined by the Vulkan spec, corresponds
42*61046927SAndroid Build Coastguard Worker     * to bit [N / 32] & (1 << N % 32). The below mask1 covers the first 1023
43*61046927SAndroid Build Coastguard Worker     * Vulkan extensions (numbered from 1 to 1023).
44*61046927SAndroid Build Coastguard Worker     *
45*61046927SAndroid Build Coastguard Worker     * Bit (mask1[0] & 0x1) is used for backward compatibility purpose. When
46*61046927SAndroid Build Coastguard Worker     * that bit is set, the extension mask(s) are valid. Otherwise, all the
47*61046927SAndroid Build Coastguard Worker     * extensions are assumed to be supported by the renderer side protocol.
48*61046927SAndroid Build Coastguard Worker     */
49*61046927SAndroid Build Coastguard Worker    uint32_t vk_extension_mask1[32];
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker    /* The single-threaded renderer cannot afford potential blocking calls. It
52*61046927SAndroid Build Coastguard Worker     * also leads to GPU lost if the wait depends on a following command. This
53*61046927SAndroid Build Coastguard Worker     * capset allows such blocking calls to passthrough from the clients, and
54*61046927SAndroid Build Coastguard Worker     * shifts the responsibilities to the client drivers.
55*61046927SAndroid Build Coastguard Worker     */
56*61046927SAndroid Build Coastguard Worker    uint32_t allow_vk_wait_syncs;
57*61046927SAndroid Build Coastguard Worker 
58*61046927SAndroid Build Coastguard Worker    /* This flag indicates that the renderer supports multiple fencing
59*61046927SAndroid Build Coastguard Worker     * timelines. The client driver is expected to associate each VkQueue with
60*61046927SAndroid Build Coastguard Worker     * one of these timelines at queue creation by binding it with an unused
61*61046927SAndroid Build Coastguard Worker     * ring_idx. Queues created without a ring_idx binding are associated to a
62*61046927SAndroid Build Coastguard Worker     * shared legacy timeline. The special ring_idx==0 is reserved for CPU
63*61046927SAndroid Build Coastguard Worker     * fences that are signaled by the renderer immediately upon consumption of
64*61046927SAndroid Build Coastguard Worker     * the associated renderer submission.
65*61046927SAndroid Build Coastguard Worker     */
66*61046927SAndroid Build Coastguard Worker    uint32_t supports_multiple_timelines;
67*61046927SAndroid Build Coastguard Worker 
68*61046927SAndroid Build Coastguard Worker    /* This flag indicates to the guest that hypervisor does not support memory
69*61046927SAndroid Build Coastguard Worker     * pages injections and blob allocations must be done by guest from the
70*61046927SAndroid Build Coastguard Worker     * dedicated heap (Host visible memory).
71*61046927SAndroid Build Coastguard Worker     */
72*61046927SAndroid Build Coastguard Worker    uint32_t use_guest_vram;
73*61046927SAndroid Build Coastguard Worker };
74*61046927SAndroid Build Coastguard Worker #endif
75*61046927SAndroid Build Coastguard Worker 
76*61046927SAndroid Build Coastguard Worker #endif /* VENUS_HW_H */
77