<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/virtio/virtgpu_fence.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-09-29T07:22:31+00:00</updated>
<entry>
<title>drm/virtio: implement context init: add virtio_gpu_fence_event</title>
<updated>2021-09-29T07:22:31+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2021-09-21T23:20:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cd7f5ca33585918febe5e2f6dc090a21cfa775b0'/>
<id>urn:sha1:cd7f5ca33585918febe5e2f6dc090a21cfa775b0</id>
<content type='text'>
Similar to DRM_VMW_EVENT_FENCE_SIGNALED.  Sends a pollable event
to the DRM file descriptor when a fence on a specific ring is
signaled.

One difference is the event is not exposed via the UAPI -- this is
because host responses are on a shared memory buffer of type
BLOB_MEM_GUEST [this is the 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 &lt;gurchetansingh@chromium.org&gt;
Acked-by: Nicholas Verne &lt;nverne@chromium.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-12-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: implement context init: stop using drv-&gt;context when creating fence</title>
<updated>2021-09-29T07:22:31+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2021-09-21T23:20:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bbf588d7d4ed5912481b12a31ffadec359fb8cae'/>
<id>urn:sha1:bbf588d7d4ed5912481b12a31ffadec359fb8cae</id>
<content type='text'>
The plumbing is all here to do this.  Since we always use the
default fence context when allocating a fence, this makes no
functional difference.

We can't process just the largest fence id anymore, since it's
it's associated with different timelines.  It's fine for fence_id
260 to signal before 259.  As such, process each fence_id
individually.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Acked-by: Lingfeng Yang &lt;lfy@google.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-9-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: implement context init: plumb {base_fence_ctx, ring_idx} to virtio_gpu_fence_alloc</title>
<updated>2021-09-29T07:22:30+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2021-09-21T23:20:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8b6e76f69a4336076a2e639d211c4cf3447ce87'/>
<id>urn:sha1:e8b6e76f69a4336076a2e639d211c4cf3447ce87</id>
<content type='text'>
These were defined in the previous commit. We'll need these
parameters when allocating a dma_fence.  The use case for this
is multiple synchronizations timelines.

The maximum number of timelines per 3D instance will be 32. Usually,
only 2 are needed -- one for CPU commands, and another for GPU
commands.

As such, we'll need to specify these parameters when allocating a
dma_fence.

vgdev-&gt;fence_drv.context is the "default" fence context for 2D mode
and old userspace.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Acked-by: Lingfeng Yang &lt;lfy@google.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20210921232024.817-8-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: consider dma-fence context when signaling</title>
<updated>2020-12-02T10:48:14+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2020-12-01T02:16:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=36549848ed27c22bb2ffd5d1468efc6505b05f97'/>
<id>urn:sha1:36549848ed27c22bb2ffd5d1468efc6505b05f97</id>
<content type='text'>
This an incremental refactor towards multiple dma-fence contexts
in virtio-gpu.  Since all fences are still allocated using
&amp;virtio_gpu_fence_driver.context, nothing should break and every
processed fence will be signaled.

The overall idea is every 3D context can allocate a number of
dma-fence contexts.  Each dma-fence context refers to it's own
timeline.

For example, consider the following case where virgl submits
commands to the GPU (fence ids 1, 3) and does a metadata query with
the CPU (fence id 5).  In a different process, gfxstream submits
commands to the GPU (fence ids 2, 4).

fence_id (&amp;dma_fence.seqno)       | 1 2 3 4 5
----------------------------------|-----------
fence_ctx 0 (virgl gpu)           | 1   3
fence_ctx 1 (virgl metadata query)|         5
fence_ctx 2 (gfxstream gpu)       |   2   4

With multiple fence contexts, we can wait for the metadata query
to finish without waiting for the virgl gpu to finish.  virgl gpu
does not have to wait for gfxstream gpu.  The fence id still is the
monotonically increasing sequence number, but it's only revelant to
the specific dma-fence context.

To fully enable this feature, we'll need to:
  - have each 3d context allocate a number of fence contexts. Not
    too hard with explicit context initialization on the horizon.
  - have guest userspace specify fence context when performing
    ioctls.
  - tag each fence emitted to the host with the fence context
    information.  virtio_gpu_ctrl_hdr has padding + flags available,
    so that should be easy.

This change goes in the direction specified above, by:
  - looking up the virtgpu_fence given a fence_id
  - signalling all prior fences in a given context
  - signalling current fence

v2: fix grammar in comment
v3: add r-b tags

Reviewed-by: Anthoine Bourgeois &lt;anthoine.bourgeois@gmail.com&gt;
Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-3-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: rework virtio_fence_signaled</title>
<updated>2020-12-02T10:48:14+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2020-12-01T02:16:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b9662c3a54eba1a06e2c14744dd78b065df120c5'/>
<id>urn:sha1:b9662c3a54eba1a06e2c14744dd78b065df120c5</id>
<content type='text'>
virtio_gpu_fence_event_process sets the last_fence_id and
subsequently calls dma_fence_signal_locked(..).

dma_fence_signal_locked(..) sets DMA_FENCE_FLAG_SIGNALED_BIT,
which is actually checked before &amp;dma_fence_ops.(*signaled) is
called.

The check for last_fence_id is therefore a bit redundant, and
it will not be sufficient to check the last_fence_id for multiple
synchronization timelines.  Remove it.

v3: add r-b tags

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Anthoine Bourgeois &lt;anthoine.bourgeois@gmail.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-2-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: virtio_{blah} --&gt; virtio_gpu_{blah}</title>
<updated>2020-12-02T10:48:14+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2020-12-01T02:16:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41a90202cd150a2f1318582a985e27b4a3bd9a8d'/>
<id>urn:sha1:41a90202cd150a2f1318582a985e27b4a3bd9a8d</id>
<content type='text'>
virtio_gpu typically uses the prefix virtio_gpu, but there are
a few places where the virtio prefix is used.  Modify this for
consistency.

v3: add r-b tags

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Anthoine Bourgeois &lt;anthoine.bourgeois@gmail.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20201201021623.619-1-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: rename sync_seq and last_seq</title>
<updated>2020-11-20T09:44:41+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2020-11-19T01:08:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=65f8453dc69159fd499e0c5b7fafbba771a1dfe2'/>
<id>urn:sha1:65f8453dc69159fd499e0c5b7fafbba771a1dfe2</id>
<content type='text'>
To be clearer about our intentions to associate sequence numbers
and fence IDs, let's rename these variables.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Anthoine Bourgeois &lt;anthoine.bourgeois@gmail.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20201119010809.528-5-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: use fence_id when processing fences</title>
<updated>2020-11-20T09:44:41+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2020-11-19T01:08:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bb53a604a74b38e6d71ae12174c8c1d229c2e2b1'/>
<id>urn:sha1:bb53a604a74b38e6d71ae12174c8c1d229c2e2b1</id>
<content type='text'>
Currently, the fence ID, which can be used to identify a
virtgpu fence, is the same as the fence sequence number.

Let's use the fence_id name to clearly signal this.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Reviewed-by: Anthoine Bourgeois &lt;anthoine.bourgeois@gmail.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20201119010809.528-4-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: move to_virtio_fence inside virtgpu_fence</title>
<updated>2019-12-19T06:13:46+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2019-12-19T00:57:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c91a1e2b5a6a72260dd2a116a6157cb9e740c35d'/>
<id>urn:sha1:c91a1e2b5a6a72260dd2a116a6157cb9e740c35d</id>
<content type='text'>
That's the only file that uses it.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20191219005733.18960-5-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/virtio: static-ify virtio_fence_signaled</title>
<updated>2019-12-19T06:13:45+00:00</updated>
<author>
<name>Gurchetan Singh</name>
<email>gurchetansingh@chromium.org</email>
</author>
<published>2019-12-19T00:57:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=974e65e384b441062004576c625ade3d54bb5d79'/>
<id>urn:sha1:974e65e384b441062004576c625ade3d54bb5d79</id>
<content type='text'>
Not used anywhere else.

Signed-off-by: Gurchetan Singh &lt;gurchetansingh@chromium.org&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20191219005733.18960-1-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
</feed>
