On Mon, May 19, 2025 at 7:29 PM Dmitry Osipenko
<dmitry.osipe...@collabora.com> wrote:
>
> On 5/18/25 18:26, Yiwei Zhang wrote:
> > +#if VIRGL_VERSION_MAJOR >= 1
> > +static void virgl_write_context_fence(void *opaque, uint32_t ctx_id,
> > +                                      uint32_t ring_idx, uint64_t 
> > fence_id) {
> > +    VirtIOGPU *g = opaque;
> > +    struct virtio_gpu_ctrl_command *cmd, *tmp;
> > +
> > +    QTAILQ_FOREACH_SAFE(cmd, &g->fenceq, next, tmp) {
> > +        if (cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_INFO_RING_IDX &&
>
> What if guest kernel version is very old and doesn't support ring_idx?
> Wouldn't this write_context_fence() cb be used by vrend for signalling
> fences without ring_idx info?

Old kernels without CONTEXT_INIT don't have the uapi to create context
fences. So only ctx0 fences can be created, which are retired only
with the ctx0 specific write_fence() callback. The newer
write_context_fence() callback is dedicated to retire context fences.

>
> --
> Best regards,
> Dmitry

Reply via email to