virgl: remove check of VIRGL_CAP_V2_UNTYPED_RESOURCE
authorJulia Zhang <julia.zhang@amd.com>
Thu, 15 Jun 2023 12:04:12 +0000 (20:04 +0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 10 Jul 2023 06:52:39 +0000 (06:52 +0000)
Remove check of VIRGL_CAP_V2_UNTYPED_RESOURCE flag in
virgl_resource_from_handle() so that guest can still call
into virglrenderer to import external vulkan resource via
OpenGL APIs even if egl is not initialized.

Signed-off-by: Julia Zhang <julia.zhang@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23680>

src/gallium/drivers/virgl/virgl_resource.c

index 64a0dfa30518bf1f63af114101cf1c83cbc4ba7f..66610127848513ed442ac70a0b3ebcbb9c14a9ae 100644 (file)
@@ -762,7 +762,8 @@ static struct pipe_resource *virgl_resource_from_handle(struct pipe_screen *scre
 
    /* assign blob resource a type in case it was created untyped */
    if (res->blob_mem && plane == 0 &&
-       (vs->caps.caps.v2.capability_bits_v2 & VIRGL_CAP_V2_UNTYPED_RESOURCE)) {
+       (vs->caps.caps.v2.host_feature_check_version >= 18 ||
+       (vs->caps.caps.v2.capability_bits_v2 & VIRGL_CAP_V2_UNTYPED_RESOURCE))) {
       uint32_t plane_strides[VIRGL_MAX_PLANE_COUNT];
       uint32_t plane_offsets[VIRGL_MAX_PLANE_COUNT];
       uint32_t plane_count = 0;