dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/virtio: Remove restriction of non-zero blob_flags
@ 2022-02-19 17:03 Rob Clark
  2022-02-22 20:35 ` Chia-I Wu
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Clark @ 2022-02-19 17:03 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Clark, David Airlie, open list, Gurchetan Singh,
	Gerd Hoffmann, open list:VIRTIO GPU DRIVER

From: Rob Clark <robdclark@chromium.org>

With native userspace drivers in guest, a lot of GEM objects need to be
neither shared nor mappable.  And in fact making everything mappable
and/or sharable results in unreasonably high fd usage in host VMM.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
This is for a thing I'm working on, a new virtgpu context type that
allows for running native userspace driver in the guest, with a
thin shim in the host VMM.  In this case, the guest has a lot of
GEM buffer objects which need to be neither shared nor mappable.

This supersedes https://patchwork.freedesktop.org/patch/475127/

 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 69f1952f3144..3a8078f2ee27 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -617,8 +617,7 @@ static int verify_blob(struct virtio_gpu_device *vgdev,
 	if (!vgdev->has_resource_blob)
 		return -EINVAL;
 
-	if ((rc_blob->blob_flags & ~VIRTGPU_BLOB_FLAG_USE_MASK) ||
-	    !rc_blob->blob_flags)
+	if (rc_blob->blob_flags & ~VIRTGPU_BLOB_FLAG_USE_MASK)
 		return -EINVAL;
 
 	if (rc_blob->blob_flags & VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/virtio: Remove restriction of non-zero blob_flags
  2022-02-19 17:03 [PATCH] drm/virtio: Remove restriction of non-zero blob_flags Rob Clark
@ 2022-02-22 20:35 ` Chia-I Wu
  0 siblings, 0 replies; 2+ messages in thread
From: Chia-I Wu @ 2022-02-22 20:35 UTC (permalink / raw)
  To: Rob Clark
  Cc: Rob Clark, David Airlie, open list, ML dri-devel,
	Gurchetan Singh, Gerd Hoffmann, open list:VIRTIO GPU DRIVER

On Sat, Feb 19, 2022 at 9:02 AM Rob Clark <robdclark@gmail.com> wrote:
>
> From: Rob Clark <robdclark@chromium.org>
>
> With native userspace drivers in guest, a lot of GEM objects need to be
> neither shared nor mappable.  And in fact making everything mappable
> and/or sharable results in unreasonably high fd usage in host VMM.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-22 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-19 17:03 [PATCH] drm/virtio: Remove restriction of non-zero blob_flags Rob Clark
2022-02-22 20:35 ` Chia-I Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).