MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / virtgpu_init_capset

Function virtgpu_init_capset

external/ggml/src/ggml-virtgpu/virtgpu.cpp:301–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301static virt_gpu_result_t virtgpu_init_capset(virtgpu * gpu) {
302 if (gpu->use_apir_capset) {
303 GGML_LOG_INFO(GGML_VIRTGPU "Using the APIR capset\n");
304 gpu->capset.id = VIRTGPU_DRM_CAPSET_APIR;
305 } else {
306 GGML_LOG_INFO(GGML_VIRTGPU "Using the Venus capset\n");
307 gpu->capset.id = VIRTGPU_DRM_CAPSET_VENUS;
308 }
309 gpu->capset.version = 0;
310
311 int ret =
312 virtgpu_ioctl_get_caps(gpu, gpu->capset.id, gpu->capset.version, &gpu->capset.data, sizeof(gpu->capset.data));
313
314 if (ret) {
315 GGML_LOG_ERROR(GGML_VIRTGPU "%s: failed to get APIR v%d capset: %s\n", __func__, gpu->capset.version,
316 strerror(errno));
317 return APIR_ERROR_INITIALIZATION_FAILED;
318 }
319
320 assert(gpu->capset.data.supports_blob_resources);
321
322 return APIR_SUCCESS;
323}
324
325static int virtgpu_ioctl_context_init(virtgpu * gpu, virgl_renderer_capset capset_id) {
326 drm_virtgpu_context_set_param ctx_set_params[3] = {

Callers 1

create_virtgpuFunction · 0.85

Calls 1

virtgpu_ioctl_get_capsFunction · 0.85

Tested by

no test coverage detected