gfxstream: address-space graphics requires kParamResourceBlob and kParamHostVisible
Make init failure more clear if this is not the case. Reviewed-by: Gurchetan Singh <gurchetansingh@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37285>
This commit is contained in:
@@ -84,6 +84,15 @@ AddressSpaceStream* createVirtioGpuAddressSpaceStream(enum VirtGpuCapset capset)
|
||||
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
||||
auto caps = instance->getCaps();
|
||||
|
||||
if (!caps.params[kParamResourceBlob]) {
|
||||
mesa_loge("VirtGpuDevice does not support blob-resources!");
|
||||
return nullptr;
|
||||
}
|
||||
if (!caps.params[kParamHostVisible] && !caps.params[kParamCreateGuestHandle]) {
|
||||
mesa_loge("VirtGpuDevice must support at least one of: 1) host-visible memory (kParamHostVisible) or 2) host handles created from guest memory (kParamCreateGuestHandle).");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!GetRingParamsFromCapset(capset, caps, ringSize, bufferSize, blobAlignment)) {
|
||||
mesa_loge("Failed to get ring parameters");
|
||||
return nullptr;
|
||||
|
||||
@@ -194,7 +194,7 @@ int32_t DrmVirtGpuDevice::init(int32_t descriptor) {
|
||||
|
||||
ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_GETPARAM, &get_param);
|
||||
if (ret) {
|
||||
mesa_logd("virtgpu backend not enabling %s", params[i].name);
|
||||
mesa_logd("Could not query virtgpu param from device: %s", params[i].name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user