Skip to contentSkip to conversation

Revert "drm/virtio: Allow importing prime buffers when 3D is enabled"

PATCH Applied Dmitry Osipenko 4 participants 5 messages Sep 11 – Sep 20

Subsystems (4)
lore
Share & tools
lore

Dmitry Osipenko

author maintainer
#0 lore raw

PATCH 1/1 Revert "drm/virtio: Allow importing prime buffers when 3D is enabled"

Guest userspace may import udmabuf to vrend. Vrend doesn't support guest blobs, and thus, further 3d operations with the imported blob are failing. Typical scenario of the problem shown with mouse cursor RGBA image imported into virtio-gpu, which previously was rejected by virtio-gpu driver. Revert enabling guest blobs importing into vrend to fix the regression.

Fixes df4dc947c46b ("drm/virtio: Allow importing prime buffers when 3D is enabled")
---
 drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_prime.c +1 -1
index 149e6bcb5878..ebf471044d06 100644
@@ -349,7 +349,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
 		}
 	}
 
-	if (!vgdev->has_resource_blob)
+	if (!vgdev->has_resource_blob || vgdev->has_virgl_3d)
 		return drm_gem_prime_import(dev, buf);
 
 	bo = kzalloc_obj(*bo);
Signature · 1 line
2.55.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

Guest userspace may import udmabuf to vrend. Vrend doesn't support guest blobs, and thus, further 3d operations with the imported blob are failing. Typical scenario of the problem shown with mouse cursor RGBA image imported into virtio-gpu, which previously was rejected by virtio-gpu driver. Revert enabling guest blobs importing into vrend to fix the regression.

Fixes df4dc947c46b ("drm/virtio: Allow importing prime buffers when 3D is enabled")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Dmitry Osipenko
Quoted 28 lines · Dmitry Osipenko

Guest userspace may import udmabuf to vrend. Vrend doesn't support guest blobs, and thus, further 3d operations with the imported blob are failing. Typical scenario of the problem shown with mouse cursor RGBA image imported into virtio-gpu, which previously was rejected by virtio-gpu driver. Revert enabling guest blobs importing into vrend to fix the regression.

Fixes df4dc947c46b ("drm/virtio: Allow importing prime buffers when 3D is enabled")
---
 drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_prime.c +1 -2
index 149e6bcb5878..ebf471044d06 100644
@@ -349,7 +349,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
                }
        }
 
-       if (!vgdev->has_resource_blob)
+       if (!vgdev->has_resource_blob || vgdev->has_virgl_3d)
                return drm_gem_prime_import(dev, buf);
 
        bo = kzalloc_obj(*bo);
--
Quoted 2 lines

2.55.0

r-b. Thanks for the prompt revert!

Reviewed-by on v1 1/1
#3 lore raw
In reply to Dmitry Osipenko
Quoted 18 lines · Dmitry Osipenko

Guest userspace may import udmabuf to vrend. Vrend doesn't support guest blobs, and thus, further 3d operations with the imported blob are failing. Typical scenario of the problem shown with mouse cursor RGBA image imported into virtio-gpu, which previously was rejected by virtio-gpu driver. Revert enabling guest blobs importing into vrend to fix the regression.

Fixes df4dc947c46b ("drm/virtio: Allow importing prime buffers when 3D is enabled")
---
  drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_prime.c +0 -0
index 149e6bcb5878..ebf471044d06 100644

drivers/gpu/drm/virtio/virtgpu_prime.c struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, · line 355

Quoted 8 lines
drivers/gpu/drm/virtio/virtgpu_prime.c +1 -1
@@ -349,7 +349,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
  		}
  	}
 
-	if (!vgdev->has_resource_blob)
+	if (!vgdev->has_resource_blob || vgdev->has_virgl_3d)
  		return drm_gem_prime_import(dev, buf);
 
  	bo = kzalloc_obj(*bo);

Oops, right, didn't think the back-compat issues all the way through on that one..

BTW, to clarify wrt the original use case this was intended for— I got it all working, but it adds new feature flags:

https://lore.kernel.org/virtio-comment/[email protected]/

So I'll "unlock" this again in new patches but not unconditionally of course. Rather, gated on the new F_CREATE_GUEST_HANDLE flag which would indicate that the device backend *does* support creating guest blobs with host handles (dmabufs).

Thanks,
~val

author maintainer Applied
#4 lore raw
In reply to Dmitry Osipenko
Quoted 18 lines · Dmitry Osipenko

Guest userspace may import udmabuf to vrend. Vrend doesn't support guest blobs, and thus, further 3d operations with the imported blob are failing. Typical scenario of the problem shown with mouse cursor RGBA image imported into virtio-gpu, which previously was rejected by virtio-gpu driver. Revert enabling guest blobs importing into vrend to fix the regression.

Fixes df4dc947c46b ("drm/virtio: Allow importing prime buffers when 3D is enabled")
---
 drivers/gpu/drm/virtio/virtgpu_prime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_prime.c +0 -0
index 149e6bcb5878..ebf471044d06 100644

drivers/gpu/drm/virtio/virtgpu_prime.c struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev, · line 355

Quoted 8 lines
drivers/gpu/drm/virtio/virtgpu_prime.c +1 -1
@@ -349,7 +349,7 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,
 		}
 	}
 
-	if (!vgdev->has_resource_blob)
+	if (!vgdev->has_resource_blob || vgdev->has_virgl_3d)
 		return drm_gem_prime_import(dev, buf);
 
 	bo = kzalloc_obj(*bo);

Applied to misc-fixes

Signature · 2 lines
Best regards,
Dmitry