| 299 | } |
| 300 | |
| 301 | static 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 | |
| 325 | static int virtgpu_ioctl_context_init(virtgpu * gpu, virgl_renderer_capset capset_id) { |
| 326 | drm_virtgpu_context_set_param ctx_set_params[3] = { |
no test coverage detected