1 #include <stdbool.h>
2 #include <errno.h>
3
4 #include "igt_core.h"
5 #include "intel_bufmgr.h"
6
7 #ifdef __GNUC__
8 #pragma GCC push_options
9 #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
10 #endif
11
12 static const char missing_support_str[] = "Not compiled with libdrm_intel support\n";
13
drm_intel_bufmgr_gem_init(int fd,int batch_size)14 drm_intel_bufmgr *drm_intel_bufmgr_gem_init(int fd, int batch_size)
15 {
16 igt_require_f(false, missing_support_str);
17 return NULL;
18 }
19
drm_intel_bo_unreference(drm_intel_bo * bo)20 void drm_intel_bo_unreference(drm_intel_bo *bo)
21 {
22 igt_require_f(false, missing_support_str);
23 }
24
drm_intel_bo_alloc(drm_intel_bufmgr * bufmgr,const char * name,unsigned long size,unsigned int alignment)25 drm_intel_bo *drm_intel_bo_alloc(drm_intel_bufmgr *bufmgr, const char *name,
26 unsigned long size, unsigned int alignment)
27 {
28 igt_require_f(false, missing_support_str);
29 return NULL;
30 }
31
drm_intel_bo_subdata(drm_intel_bo * bo,unsigned long offset,unsigned long size,const void * data)32 int drm_intel_bo_subdata(drm_intel_bo *bo, unsigned long offset,
33 unsigned long size, const void *data)
34 {
35 igt_require_f(false, missing_support_str);
36 return -ENODEV;
37 }
38
drm_intel_gem_bo_context_exec(drm_intel_bo * bo,drm_intel_context * ctx,int used,unsigned int flags)39 int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
40 int used, unsigned int flags)
41 {
42 igt_require_f(false, missing_support_str);
43 return -ENODEV;
44 }
45
drm_intel_bo_emit_reloc(drm_intel_bo * bo,uint32_t offset,drm_intel_bo * target_bo,uint32_t target_offset,uint32_t read_domains,uint32_t write_domain)46 int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
47 drm_intel_bo *target_bo, uint32_t target_offset,
48 uint32_t read_domains, uint32_t write_domain)
49 {
50 igt_require_f(false, missing_support_str);
51 return -ENODEV;
52 }
53
drm_intel_bo_emit_reloc_fence(drm_intel_bo * bo,uint32_t offset,drm_intel_bo * target_bo,uint32_t target_offset,uint32_t read_domains,uint32_t write_domain)54 int drm_intel_bo_emit_reloc_fence(drm_intel_bo *bo, uint32_t offset,
55 drm_intel_bo *target_bo,
56 uint32_t target_offset,
57 uint32_t read_domains, uint32_t write_domain)
58 {
59 igt_require_f(false, missing_support_str);
60 return -ENODEV;
61 }
62
drm_intel_bo_get_tiling(drm_intel_bo * bo,uint32_t * tiling_mode,uint32_t * swizzle_mode)63 int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
64 uint32_t * swizzle_mode)
65 {
66 igt_require_f(false, missing_support_str);
67 return -ENODEV;
68 }
69
drm_intel_bo_mrb_exec(drm_intel_bo * bo,int used,struct drm_clip_rect * cliprects,int num_cliprects,int DR4,unsigned int flags)70 int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used,
71 struct drm_clip_rect *cliprects, int num_cliprects,
72 int DR4, unsigned int flags)
73 {
74 igt_require_f(false, missing_support_str);
75 return -ENODEV;
76 }
77
drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo * bo,drm_intel_aub_annotation * annotations,unsigned count)78 void drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo,
79 drm_intel_aub_annotation *annotations,
80 unsigned count)
81 {
82 igt_require_f(false, missing_support_str);
83 }
84
drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr * bufmgr)85 void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr)
86 {
87 igt_require_f(false, missing_support_str);
88 }
89
drm_intel_bo_exec(drm_intel_bo * bo,int used,struct drm_clip_rect * cliprects,int num_cliprects,int DR4)90 int drm_intel_bo_exec(drm_intel_bo *bo, int used,
91 struct drm_clip_rect *cliprects, int num_cliprects, int DR4)
92 {
93 igt_require_f(false, missing_support_str);
94 return -ENODEV;
95 }
96
drm_intel_bufmgr_destroy(drm_intel_bufmgr * bufmgr)97 void drm_intel_bufmgr_destroy(drm_intel_bufmgr *bufmgr)
98 {
99 igt_require_f(false, missing_support_str);
100 }
101
drm_intel_bo_wait_rendering(drm_intel_bo * bo)102 void drm_intel_bo_wait_rendering(drm_intel_bo *bo)
103 {
104 igt_require_f(false, missing_support_str);
105 }
106
drm_intel_bo_get_subdata(drm_intel_bo * bo,unsigned long offset,unsigned long size,void * data)107 int drm_intel_bo_get_subdata(drm_intel_bo *bo, unsigned long offset,
108 unsigned long size, void *data)
109 {
110 igt_require_f(false, missing_support_str);
111 return -ENODEV;
112 }
113
drm_intel_bo_map(drm_intel_bo * bo,int write_enable)114 int drm_intel_bo_map(drm_intel_bo *bo, int write_enable)
115 {
116 igt_require_f(false, missing_support_str);
117 return -ENODEV;
118 }
119
drm_intel_gem_bo_map_gtt(drm_intel_bo * bo)120 int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo)
121 {
122 igt_require_f(false, missing_support_str);
123 return -ENODEV;
124 }
125
drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr * bufmgr)126 void drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr *bufmgr)
127 {
128 igt_require_f(false, missing_support_str);
129 }
130
drm_intel_bo_unmap(drm_intel_bo * bo)131 int drm_intel_bo_unmap(drm_intel_bo *bo)
132 {
133 igt_require_f(false, missing_support_str);
134 return -ENODEV;
135 }
136
drm_intel_bo_flink(drm_intel_bo * bo,uint32_t * name)137 int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name)
138 {
139 igt_require_f(false, missing_support_str);
140 return -ENODEV;
141 }
142
drm_intel_bo_gem_create_from_name(drm_intel_bufmgr * bufmgr,const char * name,unsigned int handle)143 drm_intel_bo *drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
144 const char *name,
145 unsigned int handle)
146 {
147 igt_require_f(false, missing_support_str);
148 return NULL;
149 }
150
drm_intel_bo_gem_export_to_prime(drm_intel_bo * bo,int * prime_fd)151 int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd)
152 {
153 igt_require_f(false, missing_support_str);
154 return -ENODEV;
155 }
156
drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr * bufmgr,int prime_fd,int size)157 drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr,
158 int prime_fd, int size)
159 {
160 igt_require_f(false, missing_support_str);
161 return NULL;
162 }
163
drm_intel_bufmgr_gem_set_vma_cache_size(drm_intel_bufmgr * bufmgr,int limit)164 void drm_intel_bufmgr_gem_set_vma_cache_size(drm_intel_bufmgr *bufmgr,
165 int limit)
166 {
167 igt_require_f(false, missing_support_str);
168 }
169
drm_intel_gem_bo_unmap_gtt(drm_intel_bo * bo)170 int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
171 {
172 igt_require_f(false, missing_support_str);
173 return -ENODEV;
174 }
175
drm_intel_gem_context_create(drm_intel_bufmgr * bufmgr)176 drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
177 {
178 igt_require_f(false, missing_support_str);
179 return NULL;
180 }
181
drm_intel_gem_context_get_id(drm_intel_context * ctx,uint32_t * ctx_id)182 int drm_intel_gem_context_get_id(drm_intel_context *ctx,
183 uint32_t *ctx_id)
184 {
185 igt_require_f(false, missing_support_str);
186 return -ENODEV;
187 }
188
drm_intel_gem_context_destroy(drm_intel_context * ctx)189 void drm_intel_gem_context_destroy(drm_intel_context *ctx)
190 {
191 igt_require_f(false, missing_support_str);
192 }
193
drm_intel_bo_alloc_tiled(drm_intel_bufmgr * bufmgr,const char * name,int x,int y,int cpp,uint32_t * tiling_mode,unsigned long * pitch,unsigned long flags)194 drm_intel_bo *drm_intel_bo_alloc_tiled(drm_intel_bufmgr *bufmgr,
195 const char *name,
196 int x, int y, int cpp,
197 uint32_t *tiling_mode,
198 unsigned long *pitch,
199 unsigned long flags)
200 {
201 igt_require_f(false, missing_support_str);
202 return NULL;
203 }
204
drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr * bufmgr,const char * filename)205 void drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr,
206 const char *filename)
207 {
208 igt_require_f(false, missing_support_str);
209 }
210
drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr * bufmgr,int enable)211 void drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr *bufmgr, int enable)
212 {
213 igt_require_f(false, missing_support_str);
214 }
215
drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo * bo,int x1,int y1,int width,int height,enum aub_dump_bmp_format format,int pitch,int offset)216 void drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo *bo,
217 int x1, int y1, int width, int height,
218 enum aub_dump_bmp_format format,
219 int pitch, int offset)
220 {
221 igt_require_f(false, missing_support_str);
222 }
223
drm_intel_gem_bo_start_gtt_access(drm_intel_bo * bo,int write_enable)224 void drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable)
225 {
226 igt_require_f(false, missing_support_str);
227 }
228
drm_intel_bo_set_tiling(drm_intel_bo * bo,uint32_t * tiling_mode,uint32_t stride)229 int drm_intel_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
230 uint32_t stride)
231 {
232 igt_require_f(false, missing_support_str);
233 return -ENODEV;
234 }
235
drm_intel_bo_disable_reuse(drm_intel_bo * bo)236 int drm_intel_bo_disable_reuse(drm_intel_bo *bo)
237 {
238 igt_require_f(false, missing_support_str);
239 return -ENODEV;
240 }
241
drm_intel_bo_reference(drm_intel_bo * bo)242 void drm_intel_bo_reference(drm_intel_bo *bo)
243 {
244 igt_require_f(false, missing_support_str);
245 }
246
drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr * bufmgr)247 int drm_intel_bufmgr_gem_get_devid(drm_intel_bufmgr *bufmgr)
248 {
249 igt_require_f(false, missing_support_str);
250 return -ENODEV;
251 }
252
drm_intel_bo_alloc_for_render(drm_intel_bufmgr * bufmgr,const char * name,unsigned long size,unsigned int alignment)253 drm_intel_bo *drm_intel_bo_alloc_for_render(drm_intel_bufmgr *bufmgr,
254 const char *name,
255 unsigned long size,
256 unsigned int alignment)
257 {
258 igt_require_f(false, missing_support_str);
259 return NULL;
260 }
261
drm_intel_bo_references(drm_intel_bo * bo,drm_intel_bo * target_bo)262 int drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo)
263 {
264 igt_require_f(false, missing_support_str);
265 return -ENODEV;
266 }
267
drm_intel_gem_bo_wait(drm_intel_bo * bo,int64_t timeout_ns)268 int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns)
269 {
270 igt_require_f(false, missing_support_str);
271 return -ENODEV;
272 }
273
drm_intel_bo_alloc_userptr(drm_intel_bufmgr * bufmgr,const char * name,void * addr,uint32_t tiling_mode,uint32_t stride,unsigned long size,unsigned long flags)274 drm_intel_bo *drm_intel_bo_alloc_userptr(drm_intel_bufmgr *bufmgr,
275 const char *name,
276 void *addr, uint32_t tiling_mode,
277 uint32_t stride, unsigned long size,
278 unsigned long flags)
279 {
280 igt_require_f(false, missing_support_str);
281 return NULL;
282 }
283
284 #ifdef __GNUC__
285 #pragma GCC pop_options
286 #endif
287