Re: [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature

2024-08-22 Thread Gurchetan Singh
On Thu, Aug 22, 2024 at 8:29 AM Sergio Lopez Pascual wrote: > Gurchetan Singh writes: > > > On Thu, Aug 8, 2024 at 3:38 AM Sergio Lopez Pascual > wrote: > > > >> Gurchetan Singh writes: > >> > >> > On Tue, Aug 6, 2024 at 1:15 PM Rob Clark w

Re: [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature

2024-08-09 Thread Gurchetan Singh
On Thu, Aug 8, 2024 at 3:38 AM Sergio Lopez Pascual wrote: > Gurchetan Singh writes: > > > On Tue, Aug 6, 2024 at 1:15 PM Rob Clark wrote: > > > >> On Tue, Aug 6, 2024 at 9:15 AM Gurchetan Singh > >> wrote: > >> > > >> > >

Re: [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature

2024-08-07 Thread Gurchetan Singh
On Tue, Aug 6, 2024 at 1:15 PM Rob Clark wrote: > On Tue, Aug 6, 2024 at 9:15 AM Gurchetan Singh > wrote: > > > > > > > > On Mon, Aug 5, 2024 at 2:14 AM Sergio Lopez Pascual > wrote: > >> > >> Dmitry Osipenko writes: > >> >

Re: [PATCH 0/2] drm/virtio: introduce the HOST_PAGE_SIZE feature

2024-08-06 Thread Gurchetan Singh
On Mon, Aug 5, 2024 at 2:14 AM Sergio Lopez Pascual wrote: > Dmitry Osipenko writes: > > > On 7/23/24 14:49, Sergio Lopez wrote: > >> There's an incresing number of machines supporting multiple page sizes > >> and on these machines the host and a guest can be running, each one, > >> with a diffe

Re: [RFC 0/7] drm/virtio: Import scanout buffers from other devices

2024-06-14 Thread Gurchetan Singh
On Thu, May 30, 2024 at 12:21 AM Kasireddy, Vivek wrote: > Hi Gurchetan, > > > > > On Fri, May 24, 2024 at 11:33 AM Kasireddy, Vivek > > mailto:vivek.kasire...@intel.com> > wrote: > > > > > > Hi, > > > > Sorry, my previous reply got messed up as a result of HTML > > formatting. This i

Re: [RFC 0/7] drm/virtio: Import scanout buffers from other devices

2024-05-29 Thread Gurchetan Singh
On Fri, May 24, 2024 at 11:33 AM Kasireddy, Vivek wrote: > Hi, > > Sorry, my previous reply got messed up as a result of HTML formatting. > This is > a plain text version of the same reply. > > > > > > > Having virtio-gpu import scanout buffers (via prime) from other > > devices means

Re: [RFC 0/7] drm/virtio: Import scanout buffers from other devices

2024-05-23 Thread Gurchetan Singh
On Thu, Mar 28, 2024 at 2:01 AM Vivek Kasireddy wrote: > Having virtio-gpu import scanout buffers (via prime) from other > devices means that we'd be adding a head to headless GPUs assigned > to a Guest VM or additional heads to regular GPU devices that are > passthrough'd to the Guest. In these

Re: [RFC] drm/msm: Add GPU memory traces

2024-03-05 Thread Gurchetan Singh
On Mon, Mar 4, 2024 at 6:04 PM Rob Clark wrote: > On Mon, Mar 4, 2024 at 5:38 PM Gurchetan Singh > wrote: > > > > > > > > > > On Fri, Mar 1, 2024 at 10:54 AM Rob Clark wrote: > >> > >> From: Rob Clark > >> > >>

Re: [RFC] drm/msm: Add GPU memory traces

2024-03-04 Thread Gurchetan Singh
On Fri, Mar 1, 2024 at 10:54 AM Rob Clark wrote: > From: Rob Clark > > Perfetto can use these traces to track global and per-process GPU memory > usage. > > Signed-off-by: Rob Clark > --- > I realized the tracepoint that perfetto uses to show GPU memory usage > globally and per-process was alre

Re: [PATCH v2 0/1] Implementation of resource_query_layout

2023-12-26 Thread Gurchetan Singh
On Thu, Dec 21, 2023 at 2:01 AM Julia Zhang wrote: > Hi all, > > Sorry to late reply. This is v2 of the implementation of > resource_query_layout. This adds a new ioctl to let guest query information > of host resource, which is originally from Daniel Stone. We add some > changes to support query

Re: [PATCH v3 2/2] drm/uapi: add explicit virtgpu context debug name

2023-11-13 Thread Gurchetan Singh
On Sat, Nov 11, 2023 at 2:37 PM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > On 10/18/23 21:17, Gurchetan Singh wrote: > > + case VIRTGPU_CONTEXT_PARAM_DEBUG_NAME: > > + if (vfpriv->explicit_debug_name) { > > +

Re: [PATCH v1] drm/virtio: Fix return value for VIRTGPU_CONTEXT_PARAM_DEBUG_NAME

2023-11-13 Thread Gurchetan Singh
of copied bytes. > > Fixes: 7add80126bce ("drm/uapi: add explicit virtgpu context debug name") > Signed-off-by: Dmitry Osipenko > Reviewed-by: Gurchetan Singh > --- > drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Re: [PATCH v3 2/2] drm/uapi: add explicit virtgpu context debug name

2023-11-10 Thread Gurchetan Singh
On Tue, Oct 31, 2023 at 8:55 AM Gurchetan Singh wrote: > > > On Sun, Oct 22, 2023 at 4:50 PM Dmitry Osipenko < > dmitry.osipe...@collabora.com> wrote: > >> On 10/18/23 21:17, Gurchetan Singh wrote: >> > There are two problems with the current method of determ

Re: [PATCH v18 25/26] drm/virtio: Support shmem shrinking

2023-11-03 Thread Gurchetan Singh
On Sun, Oct 29, 2023 at 4:03 PM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > Support generic drm-shmem memory shrinker and add new madvise IOCTL to > the VirtIO-GPU driver. BO cache manager of Mesa driver will mark BOs as > "don't need" using the new IOCTL to let shrinker purge the ma

Re: [PATCH v3 2/2] drm/uapi: add explicit virtgpu context debug name

2023-10-31 Thread Gurchetan Singh
On Sun, Oct 22, 2023 at 4:50 PM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > On 10/18/23 21:17, Gurchetan Singh wrote: > > There are two problems with the current method of determining the > > virtio-gpu debug name. > > > > 1) TASK_COMM_LEN is defined

Re: [PATCH v3] drm/virtio: add new virtio gpu capset definitions

2023-10-18 Thread Gurchetan Singh
On Tue, Oct 10, 2023 at 9:41 PM Huang Rui wrote: > On Tue, Oct 10, 2023 at 11:52:14PM +0800, Dmitry Osipenko wrote: > > On 10/10/23 18:40, Dmitry Osipenko wrote: > > > On 10/10/23 16:57, Huang Rui wrote: > > >> These definitions are used fro qemu, and qemu imports this marco in > the > > >> heade

[PATCH v3 2/2] drm/uapi: add explicit virtgpu context debug name

2023-10-18 Thread Gurchetan Singh
lesource.com/c/platform/hardware/google/gfxstream/+/2787176 Signed-off-by: Gurchetan Singh Reviewed-by: Josh Simonot --- Fixes suggested by Dmitry Osipenko v2: - Squash implementation and UAPI change into one commit - Avoid unnecessary casts - Use bool when necessary v3: - Use DEBU

[PATCH v3 1/2] drm/virtio: use uint64_t more in virtio_gpu_context_init_ioctl

2023-10-18 Thread Gurchetan Singh
drm_virtgpu_context_set_param defines both param and value to be u64s. Signed-off-by: Gurchetan Singh Reviewed-by: Josh Simonot Reviewed-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 2/2] drm/uapi: add explicit virtgpu context debug name

2023-10-18 Thread Gurchetan Singh
lesource.com/c/platform/hardware/google/gfxstream/+/2787176 Signed-off-by: Gurchetan Singh Reviewed-by: Josh Simonot --- v2: Fixes suggested by Dmitry Osipenko - Squash implementation and UAPI change into one commit - Avoid unnecessary casts - Use bool when necessary - Add case fo

[PATCH v2 1/2] drm/virtio: use uint64_t more in virtio_gpu_context_init_ioctl

2023-10-18 Thread Gurchetan Singh
drm_virtgpu_context_set_param defines both param and value to be u64s. Signed-off-by: Gurchetan Singh Reviewed-by: Josh Simonot Reviewed-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 3/3] drm/virtio: implement debug name via CONTEXT_INIT

2023-10-16 Thread Gurchetan Singh
This allows setting the debug name during CONTEXT_INIT. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 38 ++ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 2/3] drm/uapi: add explicit virtgpu context debug name

2023-10-16 Thread Gurchetan Singh
o set the debug name when creating a context. It takes a null-terminated C-string as the param value. Link to open-source userspace: https://android-review.googlesource.com/c/platform/hardware/google/gfxstream/+/2787176 Signed-off-by: Gurchetan Singh --- include/uapi/drm/virtgpu_drm.h | 2 +

[PATCH 1/3] drm/virtio: use uint64_t more in virtio_gpu_context_init_ioctl

2023-10-16 Thread Gurchetan Singh
drm_virtgpu_context_set_param defines both param and value to be u64s. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-07-28 Thread Gurchetan Singh
On Wed, Jul 19, 2023 at 11:58 AM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > 27.06.2023 20:16, Rob Clark пишет: > ... > >> Now these are just suggestions, and while I think they are good, you > can safely ignore them. > >> > >> But there's also the DRM requirements, which state "user

[PATCH v4] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-07 Thread Gurchetan Singh
s theoretically possible to create a DRM event on the global timeline (ring_idx == 0), if the context enabled DRM event polling. However, that wouldn't work and userspace (Sommelier). Explicitly disallow it for clarity. Signed-off-by: Gurchetan Singh --- v2: Fix indent (Dmitry) v3: Refa

Re: [PATCH v3] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-07 Thread Gurchetan Singh
On Fri, Jul 7, 2023 at 10:35 AM Dmitry Osipenko wrote: > > On 7/7/23 20:04, Dmitry Osipenko wrote: > > On 7/7/23 18:43, Gurchetan Singh wrote: > >> @@ -161,21 +157,27 @@ static int virtio_gpu_init_submit(struct > >> virtio_gpu_submit *submit, > >>

[PATCH v3] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-07 Thread Gurchetan Singh
hich just sends data to the Wayland server. This prevents the need to signal the automatically created virtio_gpu_fence. Signed-off-by: Gurchetan Singh --- v2: Fix indent (Dmitry) v3: Refactor drm fence event checks to avoid possible NULL deref (Dmitry) drivers/gpu/drm/virtio/virtgp

Re: [PATCH v2] drm/virtio: conditionally allocate virtio_gpu_fence

2023-07-05 Thread Gurchetan Singh
On Wed, Jun 28, 2023 at 8:58 AM Gurchetan Singh wrote: > > We don't want to create a fence for every command submission. It's > only necessary when userspace provides a waitable token for submission. > This could be: > > 1) bo_handles, to be used with VIRTGPU_WAIT &

Re: [PATCH] drm/virtio: conditionally allocate virtio_gpu_fence

2023-06-28 Thread Gurchetan Singh
On Mon, Jun 19, 2023 at 3:02 PM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > On 6/13/23 20:43, Gurchetan Singh wrote: > > We don't want to create a fence for every command submission. It's > > only necessary when userspace provides a waitable token fo

[PATCH v2] drm/virtio: conditionally allocate virtio_gpu_fence

2023-06-28 Thread Gurchetan Singh
hich just sends data to the Wayland server. This prevents the need to signal the automatically created virtio_gpu_fence. Signed-off-by: Gurchetan Singh Reviewed-by: --- v2: Fix indent (Dmitry) drivers/gpu/drm/virtio/virtgpu_submit.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-

[PATCH] drm/virtio: conditionally allocate virtio_gpu_fence

2023-06-13 Thread Gurchetan Singh
hich just sends data to the Wayland server. This prevents the need to signal the automatically created virtio_gpu_fence. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_submit.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/v

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-05-12 Thread Gurchetan Singh
On Thu, May 11, 2023 at 7:33 PM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > On 5/12/23 03:17, Gurchetan Singh wrote: > ... > > Can we get one of the Mesa MRs reviewed first? There's currently no > > virtio-intel MR AFAICT, and the amdgpu one is marked

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-05-11 Thread Gurchetan Singh
On Mon, May 8, 2023 at 6:59 AM Rob Clark wrote: > On Wed, May 3, 2023 at 10:07 AM Gurchetan Singh > wrote: > > > > > > > > On Mon, May 1, 2023 at 8:38 AM Dmitry Osipenko < > dmitry.osipe...@collabora.com> wrote: > >> > >> On 4/16/23 14:

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-05-03 Thread Gurchetan Singh
On Mon, May 1, 2023 at 8:38 AM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > On 4/16/23 14:52, Dmitry Osipenko wrote: > > We have multiple Vulkan context types that are awaiting for the addition > > of the sync object DRM UAPI support to the VirtIO-GPU kernel driver: > > > > 1. Venus

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-04-24 Thread Gurchetan Singh
On Wed, Apr 19, 2023 at 2:22 PM Dmitry Osipenko wrote: > > Hello Gurchetan, > > On 4/18/23 02:17, Gurchetan Singh wrote: > > On Sun, Apr 16, 2023 at 4:53 AM Dmitry Osipenko < > > dmitry.osipe...@collabora.com> wrote: > > > >> We have multiple V

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-04-17 Thread Gurchetan Singh
On Sun, Apr 16, 2023 at 4:53 AM Dmitry Osipenko < dmitry.osipe...@collabora.com> wrote: > We have multiple Vulkan context types that are awaiting for the addition > of the sync object DRM UAPI support to the VirtIO-GPU kernel driver: > > 1. Venus context > 2. Native contexts (virtio-freedreno, v

Re: [PATCH] drm/virtio: Fix capset-id query size

2022-02-15 Thread Gurchetan Singh
> Unfortunately this ioctl doesn't have a length field, so out of paranoia > I restricted the change to copy 64b to the single 64b param that can be > queried. > > Fixes: 78aa20fa4381 ("drm/virtio: implement context init: advertise > feature to userspace") >

Re: [PATCH] drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init

2022-01-07 Thread Gurchetan Singh
rtio: factor out the sg_table from > virtio_gpu_object") > Signed-off-by: Miaoqian Lin > Reviewed-by: Gurchetan Singh > --- > drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/v

[PATCH 2/2] drm/virtio: use drm_poll(..) instead of virtio_gpu_poll(..)

2021-11-22 Thread Gurchetan Singh
From: Gurchetan Singh With the use of dummy events, we can drop virtgpu specific behavior. Fixes: cd7f5ca33585 ("drm/virtio: implement context init: add virtio_gpu_fence_event") Reported-by: Daniel Vetter Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_

[PATCH 1/2] drm/virtgpu api: define a dummy fence signaled event

2021-11-22 Thread Gurchetan Singh
From: Gurchetan Singh The current virtgpu implementation of poll(..) drops events when VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK is enabled (otherwise it's like a normal DRM driver). This is because paravirtualized userspaces receives responses in a buffer of type BLOB_MEM_GUEST, not by

[PATCH 0/2] virtgpu dummy events

2021-11-22 Thread Gurchetan Singh
From: Gurchetan Singh There was a desire to not have a virtgpu-specific implementation of poll(..), but there wasn't any real event to return either. Solution: Dummy event with just event code Context: https://lists.freedesktop.org/archives/dri-devel/2021-November/330950.html User

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: > > > > > >

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 > >

Re: [PATCH] drm/virtio: add null check in virtio_gpu_poll

2021-11-15 Thread Gurchetan Singh
On Mon, Nov 15, 2021 at 9:58 AM Gurchetan Singh wrote: > From: Gurchetan Singh > > If vfpriv is null, we shouldn't check vfpriv->ring_idx_mask. > > Signed-off-by: Gurchetan Singh > --- > drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- > 1 file changed, 1 inse

[PATCH] drm/virtio: add null check in virtio_gpu_poll

2021-11-15 Thread Gurchetan Singh
From: Gurchetan Singh If vfpriv is null, we shouldn't check vfpriv->ring_idx_mask. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/dr

[RFC PATCH 8/8] drm: trace memory import per DRM device

2021-10-20 Thread Gurchetan Singh
import memory counter. * All drivers seem to use it? Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_prime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 1afcae0c4038..c2057b7a63b4 100644 --- a/drivers/gpu/drm

[RFC PATCH 2/8] drm: add new tracepoint fields to drm_device and drm_file

2021-10-20 Thread Gurchetan Singh
For struct drm_device, add: - mem_total - import_mem_total For struct drm_file, add: - mem_instance - import_mem_instance Signed-off-by: Gurchetan Singh --- include/drm/drm_device.h | 16 include/drm/drm_file.h | 16 2 files changed, 32

[RFC PATCH 4/8] drm: start using drm_gem_trace_gpu_mem_total

2021-10-20 Thread Gurchetan Singh
ff-by: Gurchetan Singh --- drivers/gpu/drm/drm_gem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 24a719b79400..528d7b29dccf 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -213,6 +213,7 @@

[RFC PATCH 7/8] drm: trace memory import per DRM file

2021-10-20 Thread Gurchetan Singh
- drm_gem_prime_fd_to_handle increases the per-instance imported memory counter - drm_gem_remove_prime_handles decreases the per-instance imported memory counter on non-fake imports. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_gem.c | 3 +++ drivers/gpu/drm/drm_prime.c | 2

[RFC PATCH 5/8] drm: start using drm_gem_trace_gpu_mem_instance

2021-10-20 Thread Gurchetan Singh
- drm_gem_handle_create_tail(..) increases the per instance memory counter. - drm_gem_object_release_handle(..) decreases the per instance memory counter. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm

[RFC PATCH 6/8] drm: track real and fake imports in drm_prime_member

2021-10-20 Thread Gurchetan Singh
Sometimes, an exported dma-buf is added to the import list. That messes up with trace point accounting, so track real vs. fake imports to correct this. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_gem.c | 5 - drivers/gpu/drm/drm_internal.h | 4 ++-- drivers/gpu/drm

[RFC PATCH 1/8] tracing/gpu: modify gpu_mem_total

2021-10-20 Thread Gurchetan Singh
ps://lore.kernel.org/r/20200302234840.57188-1-zzyi...@google.com/ [2] https://www.spinics.net/lists/kernel/msg4062769.html Signed-off-by: Gurchetan Singh --- include/trace/events/gpu_mem.h | 61 -- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/include

[RFC PATCH 3/8] drm: add helper functions for gpu_mem_total and gpu_mem_instance

2021-10-20 Thread Gurchetan Singh
- Add helper functions for above tracepoints in the drm_gem.{h,c} files - Given more tracepoints, a drm_trace.* file may be started Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_gem.c | 49 +++ include/drm

[RFC PATCH 0/8] GPU memory tracepoints

2021-10-20 Thread Gurchetan Singh
ts/cgroups/msg27867.html [4] https://www.spinics.net/lists/linux-doc/msg97788.html [5] https://source.android.com/devices/graphics/implement-dma-buf-gpu-mem Gurchetan Singh (8): tracing/gpu: modify gpu_mem_total drm: add new tracepoint fields to drm_device and drm_file drm: add helper functions

[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

[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

[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/

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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/

[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

[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

[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

[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

[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

[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

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, > >

[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

[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

[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

[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

[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

[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

[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

[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/

[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

[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

[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

[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

[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

[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

[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

  1   2   3   4   >