1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// Copyright 2022 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//! Stub impplementation of the native interface of gfxstream_backend.so.
//!
//! This implementation is used to enable the gfxstream feature of crosvm to be compiled without
//! gfxstream_backend.so available. It is only used for testing purposes and not functional
//! at runtime.

#![cfg(feature = "gfxstream_stub")]

use std::os::raw::c_char;
use std::os::raw::c_int;
use std::os::raw::c_uint;
use std::os::raw::c_void;

use crate::generated::virgl_renderer_bindings::iovec;
use crate::gfxstream::stream_renderer_box;
use crate::gfxstream::stream_renderer_command;
use crate::gfxstream::stream_renderer_create_blob;
use crate::gfxstream::stream_renderer_fence;
use crate::gfxstream::stream_renderer_handle;
use crate::gfxstream::stream_renderer_param;
use crate::gfxstream::stream_renderer_resource_create_args;
use crate::gfxstream::stream_renderer_vulkan_info;

#[no_mangle]
extern "C" fn stream_renderer_init(
    _stream_renderer_params: *mut stream_renderer_param,
    _num_params: u64,
) -> c_int {
    unimplemented!();
}

#[no_mangle]
extern "C" fn stream_renderer_teardown() {
    unimplemented!();
}

#[no_mangle]
extern "C" fn stream_renderer_resource_create(
    _args: *mut stream_renderer_resource_create_args,
    _iov: *mut iovec,
    _num_iovs: u32,
) -> c_int {
    unimplemented!();
}

#[no_mangle]
extern "C" fn stream_renderer_resource_unref(_res_handle: u32) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_context_destroy(_handle: u32) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_transfer_read_iov(
    _handle: u32,
    _ctx_id: u32,
    _level: u32,
    _stride: u32,
    _layer_stride: u32,
    _box_: *mut stream_renderer_box,
    _offset: u64,
    _iov: *mut iovec,
    _iovec_cnt: c_int,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_transfer_write_iov(
    _handle: u32,
    _ctx_id: u32,
    _level: c_int,
    _stride: u32,
    _layer_stride: u32,
    _box_: *mut stream_renderer_box,
    _offset: u64,
    _iovec: *mut iovec,
    _iovec_cnt: c_uint,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_submit_cmd(_cmd: *const stream_renderer_command) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_resource_attach_iov(
    _res_handle: c_int,
    _iov: *mut iovec,
    _num_iovs: c_int,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_resource_detach_iov(
    _res_handle: c_int,
    _iov: *mut *mut iovec,
    _num_iovs: *mut c_int,
) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_ctx_attach_resource(_ctx_id: c_int, _res_handle: c_int) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_ctx_detach_resource(_ctx_id: c_int, _res_handle: c_int) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_get_cap_set(_set: u32, _max_ver: *mut u32, _max_size: *mut u32) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_fill_caps(_set: u32, _version: u32, _caps: *mut c_void) {
    unimplemented!();
}

#[no_mangle]
extern "C" fn stream_renderer_flush(_res_handle: u32) {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_create_blob(
    _ctx_id: u32,
    _res_handle: u32,
    _create_blob: *const stream_renderer_create_blob,
    _iovecs: *const iovec,
    _num_iovs: u32,
    _handle: *const stream_renderer_handle,
) -> c_int {
    unimplemented!();
}

#[no_mangle]
extern "C" fn stream_renderer_export_blob(
    _res_handle: u32,
    _handle: *mut stream_renderer_handle,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_resource_map(
    _res_handle: u32,
    _map: *mut *mut c_void,
    _out_size: *mut u64,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_resource_unmap(_res_handle: u32) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_resource_map_info(_res_handle: u32, _map_info: *mut u32) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_vulkan_info(
    _res_handle: u32,
    _vulkan_info: *mut stream_renderer_vulkan_info,
) -> c_int {
    unimplemented!();
}
#[no_mangle]
extern "C" fn stream_renderer_context_create(
    _handle: u32,
    _nlen: u32,
    _name: *const c_char,
    _context_init: u32,
) -> c_int {
    unimplemented!();
}
#[no_mangle]

extern "C" fn stream_renderer_create_fence(_fence: *const stream_renderer_fence) -> c_int {
    unimplemented!();
}

#[cfg(gfxstream_unstable)]
#[no_mangle]
extern "C" fn stream_renderer_suspend() -> c_int {
    unimplemented!();
}

#[cfg(gfxstream_unstable)]
#[no_mangle]
extern "C" fn stream_renderer_snapshot(dir: *const c_char) -> c_int {
    unimplemented!();
}

#[cfg(gfxstream_unstable)]
#[no_mangle]
extern "C" fn stream_renderer_restore(dir: *const c_char) -> c_int {
    unimplemented!();
}

#[cfg(gfxstream_unstable)]
#[no_mangle]
extern "C" fn stream_renderer_resume() -> c_int {
    unimplemented!();
}