[virtio-dev] Re: virtio-gpu dedicated heap

2022-03-04 Thread Gurchetan Singh
On Fri, Mar 4, 2022 at 4:53 AM Robin Murphy wrote: > On 2022-03-04 04:05, Gurchetan Singh wrote: > > Hi everyone, > > > > With the current virtio setup, all of guest memory is shared with host > > devices. There has been interest in changing this, to improve isolatio

[virtio-dev] virtio-gpu dedicated heap

2022-03-03 Thread Gurchetan Singh
Hi everyone, With the current virtio setup, all of guest memory is shared with host devices. There has been interest in changing this, to improve isolation of guest memory and increase confidentiality. The recently introduced restricted DMA mechanism makes excellent progress in this area: https

[virtio-dev] Re: [PATCH v3 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-11-19 Thread Gurchetan Singh
On Fri, Nov 19, 2021 at 9:38 AM Rob Clark wrote: > On Thu, Nov 18, 2021 at 12:53 AM Daniel Vetter wrote: > > > > On Tue, Nov 16, 2021 at 06:31:10PM -0800, Gurchetan Singh wrote: > > > On Tue, Nov 16, 2021 at 7:43 AM Daniel Vetter wrote: > > > > > >

[virtio-dev] Re: [PATCH v3 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-11-16 Thread Gurchetan Singh
#x27;s not rare for virtio to "special things" (see virtio_dma_buf_ops, virtio_dma_ops), since they are in fake devices. We're open to other ideas, but hopefully that answers some of your questions. > Thanks, Daniel > > > > > Thanks, > > Vivek > >

[virtio-dev] [PATCH v3 12/12] drm/virtio: implement context init: advertise feature to userspace

2021-09-21 Thread Gurchetan Singh
This advertises the context init feature to userspace, along with a mask of supported capabilities. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c

[virtio-dev] [PATCH v3 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-21 Thread Gurchetan Singh
We don't want fences from different 3D contexts (virgl, gfxstream, venus) to be on the same timeline. With explicit context creation, we can specify the number of ring each context wants. Execbuffer can specify which ring to use. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [PATCH v3 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-09-21 Thread Gurchetan Singh
common way to receive responses with virtgpu]. As such, there is no context specific read(..) implementation either -- just a poll(..) implementation. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.c | 43 +- drivers/gpu/drm

[virtio-dev] [PATCH v3 10/12] drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK

2021-09-21 Thread Gurchetan Singh
f KMS events. The parameter VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK specifies the pollable rings. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 22 +- 2 files changed, 22 inser

[virtio-dev] [PATCH v3 08/12] drm/virtio: implement context init: stop using drv->context when creating fence

2021-09-21 Thread Gurchetan Singh
260 to signal before 259. As such, process each fence_id individually. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_fence.c | 16 ++-- drivers/gpu/drm/virtio/virtgpu_vq.c| 15 +++ 2 files changed, 17 insertions(+), 14 deleti

[virtio-dev] [PATCH v3 07/12] drm/virtio: implement context init: plumb {base_fence_ctx, ring_idx} to virtio_gpu_fence_alloc

2021-09-21 Thread Gurchetan Singh
r GPU commands. As such, we'll need to specify these parameters when allocating a dma_fence. vgdev->fence_drv.context is the "default" fence context for 2D mode and old userspace. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [PATCH v3 06/12] drm/virtio: implement context init: track {ring_idx, emit_fence_info} in virtio_gpu_fence

2021-09-21 Thread Gurchetan Singh
e_ctx. The ring_idx will be emitted to host userspace, when emit_fence_info is true. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/

[virtio-dev] [PATCH v3 05/12] drm/virtio: implement context init: support init ioctl

2021-09-21 Thread Gurchetan Singh
From: Anthoine Bourgeois This implements the context initialization ioctl. A list of params is passed in by userspace, and kernel driver validates them. The only currently supported param is VIRTGPU_CONTEXT_PARAM_CAPSET_ID. If the context has already been initialized, -EEXIST is returned. This

[virtio-dev] [PATCH v3 02/12] drm/virtgpu api: create context init feature

2021-09-21 Thread Gurchetan Singh
11 1 23 The "Sommelier" guest Wayland proxy uses this to poll for events from the host compositor. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang Acked-by: Nicholas Verne --- include/uapi/drm/virtgpu_drm.h | 27

[virtio-dev] [PATCH v3 04/12] drm/virtio: implement context init: probe for feature

2021-09-21 Thread Gurchetan Singh
From: Anthoine Bourgeois Let's probe for VIRTIO_GPU_F_CONTEXT_INIT. Create a new DRM_INFO(..) line since the current one is getting too long. Signed-off-by: Anthoine Bourgeois Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c

[virtio-dev] [PATCH v3 03/12] drm/virtio: implement context init: track valid capabilities in a mask

2021-09-21 Thread Gurchetan Singh
The valid capability IDs are between 1 to 63, and defined in the virtio gpu spec. This is used for error checking the subsequent patches. We're currently only using 2 capability IDs, so this should be plenty for the immediate future. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [PATCH v3 01/12] virtio-gpu api: multiple context types with explicit initialization

2021-09-21 Thread Gurchetan Singh
l the host which per-context command ring (or "hardware queue", distinct from the virtio-queue) the fence should be associated with. The new capability sets (gfxstream, venus etc.) are only defined in the virtio-gpu spec and not defined in the header. Signed-off-by: Gurchetan

[virtio-dev] [PATCH v3 00/12] Context types, v3

2021-09-21 Thread Gurchetan Singh
eed implicit sync in patch 9. Changes since v2: * u8 ring_idx --> __u8 ring_idx to fix buildbot issues Anthoine Bourgeois (2): drm/virtio: implement context init: probe for feature drm/virtio: implement context init: support init ioctl Gurchetan Singh (10): virtio-gpu api: multiple c

[virtio-dev] [PATCH v2 12/12] drm/virtio: implement context init: advertise feature to userspace

2021-09-16 Thread Gurchetan Singh
This advertises the context init feature to userspace, along with a mask of supported capabilities. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c

[virtio-dev] [PATCH v2 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-09-16 Thread Gurchetan Singh
common way to receive responses with virtgpu]. As such, there is no context specific read(..) implementation either -- just a poll(..) implementation. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.c | 43 +- drivers/gpu/drm

[virtio-dev] [PATCH v2 08/12] drm/virtio: implement context init: stop using drv->context when creating fence

2021-09-16 Thread Gurchetan Singh
260 to signal before 259. As such, process each fence_id individually. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_fence.c | 16 ++-- drivers/gpu/drm/virtio/virtgpu_vq.c| 15 +++ 2 files changed, 17 insertions(+), 14 deleti

[virtio-dev] [PATCH v2 05/12] drm/virtio: implement context init: support init ioctl

2021-09-16 Thread Gurchetan Singh
From: Anthoine Bourgeois This implements the context initialization ioctl. A list of params is passed in by userspace, and kernel driver validates them. The only currently supported param is VIRTGPU_CONTEXT_PARAM_CAPSET_ID. If the context has already been initialized, -EEXIST is returned. This

[virtio-dev] [PATCH v2 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-16 Thread Gurchetan Singh
sync support in case a buffer object comes from a different context type. This can be added later when the revelant context types support multiple rings, by waiting on the reservation object associated with the foreign context's buffer object. Signed-off-by: Gurchetan Singh Acked-by: Lin

[virtio-dev] [PATCH v2 10/12] drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK

2021-09-16 Thread Gurchetan Singh
f KMS events. The parameter VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK specifies the pollable rings. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 22 +- 2 files changed, 22 inser

[virtio-dev] [PATCH v2 02/12] drm/virtgpu api: create context init feature

2021-09-16 Thread Gurchetan Singh
11 1 23 The "Sommelier" guest Wayland proxy uses this to poll for events from the host compositor. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang Acked-by: Nicholas Verne --- include/uapi/drm/virtgpu_drm.h | 27

[virtio-dev] [PATCH v2 07/12] drm/virtio: implement context init: plumb {base_fence_ctx, ring_idx} to virtio_gpu_fence_alloc

2021-09-16 Thread Gurchetan Singh
r GPU commands. As such, we'll need to specify these parameters when allocating a dma_fence. vgdev->fence_drv.context is the "default" fence context for 2D mode and old userspace. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [PATCH v2 06/12] drm/virtio: implement context init: track {ring_idx, emit_fence_info} in virtio_gpu_fence

2021-09-16 Thread Gurchetan Singh
e_ctx. The ring_idx will be emitted to host userspace, when emit_fence_info is true. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/

[virtio-dev] [PATCH v2 04/12] drm/virtio: implement context init: probe for feature

2021-09-16 Thread Gurchetan Singh
From: Anthoine Bourgeois Let's probe for VIRTIO_GPU_F_CONTEXT_INIT. Create a new DRM_INFO(..) line since the current one is getting too long. Signed-off-by: Anthoine Bourgeois Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c

[virtio-dev] [PATCH v2 03/12] drm/virtio: implement context init: track valid capabilities in a mask

2021-09-16 Thread Gurchetan Singh
The valid capability IDs are between 1 to 63, and defined in the virtio gpu spec. This is used for error checking the subsequent patches. We're currently only using 2 capability IDs, so this should be plenty for the immediate future. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [PATCH v2 00/12] Context types

2021-09-16 Thread Gurchetan Singh
eed implicit sync in patch 9 commit message. Anthoine Bourgeois (2): drm/virtio: implement context init: probe for feature drm/virtio: implement context init: support init ioctl Gurchetan Singh (10): virtio-gpu api: multiple context types with explicit initialization drm/virtgpu api: cre

[virtio-dev] [PATCH v2 01/12] virtio-gpu api: multiple context types with explicit initialization

2021-09-16 Thread Gurchetan Singh
l the host which per-context command ring (or "hardware queue", distinct from the virtio-queue) the fence should be associated with. The new capability sets (gfxstream, venus etc.) are only defined in the virtio-gpu spec and not defined in the header. Signed-off-by: Gurchetan

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-16 Thread Gurchetan Singh
On Wed, Sep 15, 2021 at 5:11 PM Chia-I Wu wrote: > i > > On Tue, Sep 14, 2021 at 6:26 PM Gurchetan Singh > wrote: > > > > > > > > On Tue, Sep 14, 2021 at 10:53 AM Chia-I Wu wrote: > >> > >> ,On Mon, Sep 13, 2021 at 6:57 PM Gurchetan Singh

Re: [virtio-dev] Re: [PATCH v1 08/12] drm/virtio: implement context init: stop using drv->context when creating fence

2021-09-15 Thread Gurchetan Singh
On Tue, Sep 14, 2021 at 10:53 PM Gerd Hoffmann wrote: > On Wed, Sep 08, 2021 at 06:37:13PM -0700, Gurchetan Singh wrote: > > The plumbing is all here to do this. Since we always use the > > default fence context when allocating a fence, this makes no > > functional differe

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-14 Thread Gurchetan Singh
On Tue, Sep 14, 2021 at 10:53 AM Chia-I Wu wrote: > ,On Mon, Sep 13, 2021 at 6:57 PM Gurchetan Singh > wrote: > > > > > > > > > > On Mon, Sep 13, 2021 at 11:52 AM Chia-I Wu wrote: > >> > >> . > >> > >> On Mon, Sep 13, 2021

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-13 Thread Gurchetan Singh
On Mon, Sep 13, 2021 at 11:52 AM Chia-I Wu wrote: > . > > On Mon, Sep 13, 2021 at 10:48 AM Gurchetan Singh > wrote: > > > > > > > > On Fri, Sep 10, 2021 at 12:33 PM Chia-I Wu wrote: > >> > >> On Wed, Sep 8, 2021 at 6:37 PM Gurchetan Sing

Re: [virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-13 Thread Gurchetan Singh
On Fri, Sep 10, 2021 at 12:33 PM Chia-I Wu wrote: > On Wed, Sep 8, 2021 at 6:37 PM Gurchetan Singh > wrote: > > > > We don't want fences from different 3D contexts (virgl, gfxstream, > > venus) to be on the same timeline. With explicit context creation, > >

[virtio-dev] [PATCH v1 10/12] drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK

2021-09-08 Thread Gurchetan Singh
f KMS events. The parameter VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK specifies the pollable rings. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 22 +- 2 files changed, 22 inser

[virtio-dev] [PATCH v1 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-09-08 Thread Gurchetan Singh
common way to receive responses with virtgpu]. As such, there is no context specific read(..) implementation either -- just a poll(..) implementation. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.c | 43 +- drivers/gpu/drm

[virtio-dev] [PATCH v1 12/12] drm/virtio: implement context init: advertise feature to userspace

2021-09-08 Thread Gurchetan Singh
This advertises the context init feature to userspace, along with a mask of supported capabilities. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c

[virtio-dev] [PATCH v1 07/12] drm/virtio: implement context init: plumb {base_fence_ctx, ring_idx} to virtio_gpu_fence_alloc

2021-09-08 Thread Gurchetan Singh
r GPU commands. As such, we'll need to specify these parameters when allocating a dma_fence. vgdev->fence_drv.context is the "default" fence context for 2D mode and old userspace. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [PATCH v1 04/12] drm/virtio: implement context init: probe for feature

2021-09-08 Thread Gurchetan Singh
From: Anthoine Bourgeois Let's probe for VIRTIO_GPU_F_CONTEXT_INIT. Create a new DRM_INFO(..) line since the current one is getting too long. Signed-off-by: Anthoine Bourgeois Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c

[virtio-dev] [PATCH v1 08/12] drm/virtio: implement context init: stop using drv->context when creating fence

2021-09-08 Thread Gurchetan Singh
260 to signal before 259. As such, process each fence_id individually. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_fence.c | 16 ++-- drivers/gpu/drm/virtio/virtgpu_vq.c| 15 +++ 2 files changed, 17 insertions(+), 14 deleti

[virtio-dev] [PATCH v1 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-09-08 Thread Gurchetan Singh
We don't want fences from different 3D contexts (virgl, gfxstream, venus) to be on the same timeline. With explicit context creation, we can specify the number of ring each context wants. Execbuffer can specify which ring to use. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [PATCH v1 06/12] drm/virtio: implement context init: track {ring_idx, emit_fence_info} in virtio_gpu_fence

2021-09-08 Thread Gurchetan Singh
e_ctx. The ring_idx will be emitted to host userspace, when emit_fence_info is true. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/

[virtio-dev] [PATCH v1 05/12] drm/virtio: implement context init: support init ioctl

2021-09-08 Thread Gurchetan Singh
From: Anthoine Bourgeois This implements the context initialization ioctl. A list of params is passed in by userspace, and kernel driver validates them. The only currently supported param is VIRTGPU_CONTEXT_PARAM_CAPSET_ID. If the context has already been initialized, -EEXIST is returned. This

[virtio-dev] [PATCH v1 03/12] drm/virtio: implement context init: track valid capabilities in a mask

2021-09-08 Thread Gurchetan Singh
The valid capability IDs are between 1 to 63, and defined in the virtio gpu spec. This is used for error checking the subsequent patches. We're currently only using 2 capability IDs, so this should be plenty for the immediate future. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [PATCH v1 02/12] drm/virtgpu api: create context init feature

2021-09-08 Thread Gurchetan Singh
11 1 23 The "Sommelier" guest Wayland proxy uses this to poll for events from the host compositor. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang Acked-by: Nicholas Verne --- include/uapi/drm/virtgpu_drm.h | 27

[virtio-dev] [PATCH v1 01/12] virtio-gpu api: multiple context types with explicit initialization

2021-09-08 Thread Gurchetan Singh
l the host which per-context command ring (or "hardware queue", distinct from the virtio-queue) the fence should be associated with. The new capability sets (gfxstream, venus etc.) are only defined in the virtio-gpu spec and not defined in the header. Signed-off-by: Gurchetan

[virtio-dev] [PATCH v1 00/12] Context types

2021-09-08 Thread Gurchetan Singh
tio: implement context init: support init ioctl Gurchetan Singh (10): virtio-gpu api: multiple context types with explicit initialization drm/virtgpu api: create context init feature drm/virtio: implement context init: track valid capabilities in a mask drm/virtio: implement context init: tr

[virtio-dev] [RFC PATCH 08/12] drm/virtio: implement context init: stop using drv->context when creating fence

2021-08-25 Thread Gurchetan Singh
260 to signal before 259. As such, process each fence_id individually. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_fence.c | 16 ++-- drivers/gpu/drm/virtio/virtgpu_vq.c| 15 +++ 2 files changed, 17 insertions(+), 14 deleti

[virtio-dev] [RFC PATCH 12/12] drm/virtio: implement context init: advertise feature to userspace

2021-08-25 Thread Gurchetan Singh
This advertises the context init feature to userspace, along with a mask of supported capabilities. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c

[virtio-dev] [RFC PATCH 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

2021-08-25 Thread Gurchetan Singh
common way to receive responses with virtgpu]. As such, there is no context specific read(..) implementation either -- just a poll(..) implementation. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.c | 43 +- drivers/gpu/drm

[virtio-dev] [RFC PATCH 10/12] drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK

2021-08-25 Thread Gurchetan Singh
f KMS events. The parameter VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK specifies the pollable rings. Signed-off-by: Gurchetan Singh Acked-by: Nicholas Verne --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_ioctl.c | 23 +-- 2 files changed, 22 inser

[virtio-dev] [RFC PATCH 09/12] drm/virtio: implement context init: allocate an array of fence contexts

2021-08-25 Thread Gurchetan Singh
We don't want fences from different 3D contexts (virgl, gfxstream, venus) to be on the same timeline. With explicit context creation, we can specify the number of ring each context wants. Execbuffer can specify which ring to use. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [RFC PATCH 07/12] drm/virtio: implement context init: plumb {base_fence_ctx, ring_idx} to virtio_gpu_fence_alloc

2021-08-25 Thread Gurchetan Singh
r GPU commands. As such, we'll need to specify these parameters when allocating a dma_fence. vgdev->fence_drv.context is the "default" fence context for 2D mode and old userspace. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [RFC PATCH 06/12] drm/virtio: implement context init: track {ring_idx, emit_fence_info} in virtio_gpu_fence

2021-08-25 Thread Gurchetan Singh
e_ctx. The ring_idx will be emitted to host userspace, when emit_fence_info is true. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/

[virtio-dev] [RFC PATCH 05/12] drm/virtio: implement context init: support init ioctl

2021-08-25 Thread Gurchetan Singh
From: Anthoine Bourgeois This implements the context initialization ioctl. A list of params is passed in by userspace, and kernel driver validates them. The only currently supported param is VIRTGPU_CONTEXT_PARAM_CAPSET_ID. If the context has already been initialized, -EEXIST is returned. This

[virtio-dev] [RFC PATCH 04/12] drm/virtio: implement context init: probe for feature

2021-08-25 Thread Gurchetan Singh
From: Anthoine Bourgeois Let's probe for VIRTIO_GPU_F_CONTEXT_INIT. Create a new DRM_INFO(..) line since the current one is getting too long. Signed-off-by: Anthoine Bourgeois Acked-by: Lingfeng Yang --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c

[virtio-dev] [RFC PATCH 03/12] drm/virtio: implement context init: track valid capabilities in a mask

2021-08-25 Thread Gurchetan Singh
The valid capability IDs are between 1 to 63, and defined in the virtio gpu spec. This is used for error checking the subsequent patches. We're currently only using 2 capability IDs, so this should be plenty for the immediate future. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng

[virtio-dev] [RFC PATCH 02/12] drm/virtgpu api: create context init feature

2021-08-25 Thread Gurchetan Singh
11 1 23 The "Sommelier" guest Wayland proxy uses this to poll for events from the host compositor. Signed-off-by: Gurchetan Singh Acked-by: Lingfeng Yang Acked-by: Nicholas Verne --- include/uapi/drm/virtgpu_drm.h | 27

[virtio-dev] [RFC PATCH 00/12] -- 2021: The year of the context type

2021-08-25 Thread Gurchetan Singh
obe for feature drm/virtio: implement context init: support init ioctl Gurchetan Singh (10): virtio-gpu api: multiple context types with explicit initialization drm/virtgpu api: create context init feature drm/virtio: implement context init: track valid capabilities in a mask drm/virtio

[virtio-dev] [RFC PATCH 01/12] virtio-gpu api: multiple context types with explicit initialization

2021-08-25 Thread Gurchetan Singh
l the host which per-context command ring (or "hardware queue", distinct from the virtio-queue) the fence should be associated with. The new capability sets (gfxstream, venus etc.) are only defined in the virtio-gpu spec and not defined in the header. Signed-off-by: Gurchetan

[virtio-dev] Re: [PATCH v2 09/23] virtio-gpu api: blob resources

2020-09-16 Thread Gurchetan Singh
On Tue, Sep 8, 2020 at 11:55 PM Gerd Hoffmann wrote: > Hi, > > > @@ -100,7 +102,7 @@ struct drm_virtgpu_resource_info { > > __u32 bo_handle; > > __u32 res_handle; > > __u32 size; > > - __u32 stride; > > + __u32 blob_mem; > > }; > > Huh? This is not in the virtio spec

[virtio-dev] Re: [PATCH v2 04/23] virtio: Add get_shm_region method

2020-09-14 Thread Gurchetan Singh
On Thu, Sep 10, 2020 at 2:56 AM Miklos Szeredi wrote: > On Thu, Sep 10, 2020 at 2:28 AM Gurchetan Singh > wrote: > > > That sounds like an excellent plan ! > > > > I will send out blob v3 (incorporating kraxel@'s feedback) once the > topic pull request (it

[virtio-dev] Re: [PATCH v2 04/23] virtio: Add get_shm_region method

2020-09-09 Thread Gurchetan Singh
; > > > On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > > > > > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal > wrote: > > > > > > > > > > > Hi Gurchetan, > > > > > > > > > > > >

[virtio-dev] Re: [PATCH v2 22/23] drm/virtio: implement blob resources: resource create blob ioctl

2020-09-03 Thread Gurchetan Singh
On Thu, Sep 3, 2020 at 2:11 PM Chia-I Wu wrote: > On Wed, Sep 2, 2020 at 2:09 PM Gurchetan Singh > wrote: > > > > From: Gerd Hoffmann > > > > Implement resource create blob as specified. > > > > Signed-off-by: Gerd Hoffmann > > Co-developed-b

[virtio-dev] Re: [PATCH v2 04/23] virtio: Add get_shm_region method

2020-09-02 Thread Gurchetan Singh
ek > > On Wed, Sep 02, 2020 at 02:08:28PM -0700, Gurchetan Singh wrote: > > From: Sebastien Boeuf > > > > Virtio defines 'shared memory regions' that provide a continuously > > shared region between the host and guest. > > > > Provide a method to

[virtio-dev] [PATCH v2 21/23] drm/virtio: implement blob resources: report blob mem to userspace

2020-09-02 Thread Gurchetan Singh
The stride field has never been used, so repurpose it to be "blob_mem". This way, userspace can know the memory properties of the blob if it's passed between userspace processes and no suitable userspace API exists to transmit that knowledge. Signed-off-by: Gurchetan Singh Acked-b

[virtio-dev] [PATCH v2 22/23] drm/virtio: implement blob resources: resource create blob ioctl

2020-09-02 Thread Gurchetan Singh
From: Gerd Hoffmann Implement resource create blob as specified. Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h| 4 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 136

[virtio-dev] [PATCH v2 18/23] drm/virtio: implement blob resources: blob display integration

2020-09-02 Thread Gurchetan Singh
SCANOUT_BLOB forwards the DRM framebuffer metadata to the host. The modifier is intentionally left out -- it may be possible to query the host for that. We also assume one blob resource per DRM framebuffer. That too is an intentional simplification. Signed-off-by: Gurchetan Singh Acked-by

[virtio-dev] [PATCH v2 23/23] drm/virtio: advertise features to userspace

2020-09-02 Thread Gurchetan Singh
New api changes are now available to userspace. Also, the comparison to true is redundant, so remove it. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu

[virtio-dev] [PATCH v2 19/23] drm/virtio: implement blob resources: refactor UUID code somewhat

2020-09-02 Thread Gurchetan Singh
For upcoming blob resources, userspace can specify that the resource will be used for cross-device sharing. This is mainly for exportable blobs that will only shared with the virtgpu display but not across devices. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm

[virtio-dev] [PATCH v2 07/23] drm/virtio: blob prep: refactor getting pages and attaching backing

2020-09-02 Thread Gurchetan Singh
Useful for upcoming blob resources. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_object.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio

[virtio-dev] [PATCH v2 16/23] drm/virtio: implement blob resources: implement vram object

2020-09-02 Thread Gurchetan Singh
From: Gerd Hoffmann A virtio-gpu vram object is based on range-based allocation. No guest shmemfs backing, so we call drm_gem_private_object_init. This is for host memory without any guest backing (atleast initially). Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off

[virtio-dev] [PATCH v2 08/23] drm/virtio: blob prep: make CPU responses more generic

2020-09-02 Thread Gurchetan Singh
RESOURCE_MAP_BLOB / RESOURCE_UNMAP_BLOB can use this. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 +++--- drivers/gpu/drm/virtio/virtgpu_prime.c | 6 +++--- drivers/gpu/drm/virtio/virtgpu_vq.c| 10 +- 3 files changed, 11

[virtio-dev] [PATCH v2 11/23] virtio-gpu api: cross-device feature

2020-09-02 Thread Gurchetan Singh
This feature was recently added to virtio-gpu, lets make it userspace queryable. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- include/uapi/drm/virtgpu_drm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h index

[virtio-dev] [PATCH v2 20/23] drm/virtio: implement blob resources: fix stride discrepancy

2020-09-02 Thread Gurchetan Singh
integration between guest/host looking increasingly attractive, it also makes sense to keep track of one value for stride. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 35

[virtio-dev] [PATCH v2 13/23] drm/virtio: implement blob resources: probe for host visible region

2020-09-02 Thread Gurchetan Singh
From: Gerd Hoffmann The availability of the host visible region means host 3D allocations can be directly mapped in the guest. Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_debugfs.c

[virtio-dev] [PATCH v2 05/23] virtio: Implement get_shm_region for PCI transport

2020-09-02 Thread Gurchetan Singh
From: Sebastien Boeuf On PCI the shm regions are found using capability entries; find a region by searching for the capability. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert Signed-off-by: kbuild test robot Acked-by: Michael S. Tsirkin Cc: k...@vger.kernel.org Cc: virt

[virtio-dev] [PATCH v2 14/23] drm/virtio: implement blob resources: expose virtio_gpu_resource_id_get

2020-09-02 Thread Gurchetan Singh
VRAM object will need it. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 ++ drivers/gpu/drm/virtio/virtgpu_object.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers

[virtio-dev] [PATCH v2 12/23] drm/virtio: implement blob resources: probe for the feature.

2020-09-02 Thread Gurchetan Singh
From: Gerd Hoffmann Let's proble for VIRTIO_GPU_F_RESOURCE_BLOB. Signed-off-by: Gerd Hoffmann Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_

[virtio-dev] [PATCH v2 09/23] virtio-gpu api: blob resources

2020-09-02 Thread Gurchetan Singh
Future work: - Emulated coherent `blob_mem` type for QEMU/vhost-user - A `blob_mem` type for guest-only resources imported in cache-coherent FOSS GPU/display drivers. - Display integration involving the blob model using seamless Wayland windows. Signed-off-by: Gerd Hoffmann Co-de

[virtio-dev] [PATCH v2 10/23] virtio-gpu api: host visible feature

2020-09-02 Thread Gurchetan Singh
;s caching type and possibly in the future performance hints about the buffer.. 2) VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB This hypercall tells the host to remove the host resource's mapping from the guest VM. Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off-by: Gurchetan

[virtio-dev] [PATCH v2 15/23] drm/virtio: implement blob resources: add new fields to internal structs

2020-09-02 Thread Gurchetan Singh
Useful for upcoming blob resources. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [PATCH v2 06/23] virtio: Implement get_shm_region for MMIO transport

2020-09-02 Thread Gurchetan Singh
From: Sebastien Boeuf On MMIO a new set of registers is defined for finding SHM regions. Add their definitions and use them to find the region. Signed-off-by: Sebastien Boeuf Cc: k...@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org Cc: "Michael S. Tsirkin" --- drivers/virtio/vi

[virtio-dev] [PATCH v2 17/23] drm/virtio: implement blob resources: hypercall interface

2020-09-02 Thread Gurchetan Singh
This implements the blob hypercall interface. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 15 +++ drivers/gpu/drm/virtio/virtgpu_vq.c | 65 2 files changed, 80 insertions(+) diff --git a/drivers/gpu/drm

[virtio-dev] [PATCH v2 04/23] virtio: Add get_shm_region method

2020-09-02 Thread Gurchetan Singh
From: Sebastien Boeuf Virtio defines 'shared memory regions' that provide a continuously shared region between the host and guest. Provide a method to find a particular region on a device. Signed-off-by: Sebastien Boeuf Signed-off-by: Dr. David Alan Gilbert Acked-by: Michael S. Tsirkin Cc: k

[virtio-dev] [PATCH v2 00/23] Blob prerequisites + blob resources

2020-09-02 Thread Gurchetan Singh
he feature. drm/virtio: implement blob resources: probe for host visible region drm/virtio: implement blob resources: implement vram object drm/virtio: implement blob resources: resource create blob ioctl Gurchetan Singh (13): drm/virtio: fix uninitialized variable drm/virtio: report uuid

[virtio-dev] [PATCH v2 02/23] drm/virtio: fix uninitialized variable

2020-09-02 Thread Gurchetan Singh
smatch reported this with the blob series: drivers/gpu/drm/virtio/virtgpu_kms.c:227 virtio_gpu_init() error: uninitialized symbol 'ret'. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[virtio-dev] [PATCH v2 01/23] Fix use after free in get_capset_info callback.

2020-09-02 Thread Gurchetan Singh
From: Doug Horn If a response to virtio_gpu_cmd_get_capset_info takes longer than five seconds to return, the callback will access freed kernel memory in vg->capsets. Signed-off-by: Doug Horn --- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_vq.c | 10 +++---

[virtio-dev] [PATCH v2 03/23] drm/virtio: report uuid in debugfs

2020-09-02 Thread Gurchetan Singh
In keeping with other features, report this in the debugfs. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c index 3221520f61f0c

[virtio-dev] [PATCH 17/24] drm/virtio: implement blob resources: implement vram object

2020-08-13 Thread Gurchetan Singh
From: Gerd Hoffmann A virtio-gpu vram object is based on range-based allocation. No guest shmemfs backing, so we call drm_gem_private_object_init. This is for host memory without any guest backing (atleast initially). Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off

[virtio-dev] [PATCH 19/24] drm/virtio: implement blob resources: blob display integration

2020-08-13 Thread Gurchetan Singh
SCANOUT_BLOB forwards the DRM framebuffer metadata to the host. The modifier is intentionally left out -- it may be possible to query the host for that. We also assume one blob resource per DRM framebuffer. That too is an intentional simplification. Signed-off-by: Gurchetan Singh Acked-by

[virtio-dev] [PATCH 15/24] drm/virtio: implement blob resources: expose virtio_gpu_resource_id_get

2020-08-13 Thread Gurchetan Singh
VRAM object will need it. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h| 2 ++ drivers/gpu/drm/virtio/virtgpu_object.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers

[virtio-dev] [PATCH 23/24] drm/virtio: implement blob resources: resource create blob ioctl

2020-08-13 Thread Gurchetan Singh
From: Gerd Hoffmann Implement resource create blob as specified. Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h| 4 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 136

[virtio-dev] [PATCH 14/24] drm/virtio: implement blob resources: probe for host visible region

2020-08-13 Thread Gurchetan Singh
From: Gerd Hoffmann The availability of the host visible region means host 3D allocations can be directly mapped in the guest. Signed-off-by: Gerd Hoffmann Co-developed-by: Gurchetan Singh Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_debugfs.c

[virtio-dev] [PATCH 21/24] drm/virtio: implement blob resources: fix stride discrepancy

2020-08-13 Thread Gurchetan Singh
integration between guest/host looking increasingly attractive, it also makes sense to keep track of one value for stride. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 35

[virtio-dev] [PATCH 24/24] drm/virtio: advertise features to userspace

2020-08-13 Thread Gurchetan Singh
New api changes are now available to userspace. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index

[virtio-dev] [PATCH 16/24] drm/virtio: implement blob resources: add new fields to internal structs

2020-08-13 Thread Gurchetan Singh
Useful for upcoming blob resources. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h

[virtio-dev] [PATCH 13/24] drm/virtio: implement blob resources: probe for the feature.

2020-08-13 Thread Gurchetan Singh
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_kms.c

[virtio-dev] [PATCH 18/24] drm/virtio: implement blob resources: hypercall interface

2020-08-13 Thread Gurchetan Singh
This implements the blob hypercall interface. Signed-off-by: Gurchetan Singh Acked-by: Tomeu Vizoso --- drivers/gpu/drm/virtio/virtgpu_drv.h | 15 +++ drivers/gpu/drm/virtio/virtgpu_vq.c | 65 2 files changed, 80 insertions(+) diff --git a/drivers/gpu/drm

  1   2   >