Skip to contentSkip to conversation

virtio-gpu-rutabaga: make sure ctx_ids match

PATCH In review Gurchetan Singh 3 participants 4 messages Oct 5 – Oct 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-gpu-rutabaga: make sure ctx_ids match

The ctx_ids need to match as well as the ring ids for proper signaling.

Fixes 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
---
 hw/display/virtio-gpu-rutabaga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/display/virtio-gpu-rutabaga.c +2 -1
index 3aafa4dc66..edf7b62703 100644
@@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
         }
 
         if (signaled_ctx_specific &&
-           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
+           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
+           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
             continue;
         }
 
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 15 lines · Gurchetan Singh

The ctx_ids need to match as well as the ring ids for proper signaling.

Fixes 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
---
 hw/display/virtio-gpu-rutabaga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/display/virtio-gpu-rutabaga.c +0 -0
index 3aafa4dc66..edf7b62703 100644

hw/display/virtio-gpu-rutabaga.c virtio_gpu_rutabaga_aio_cb(void *opaque) · line 908

Quoted 8 lines
hw/display/virtio-gpu-rutabaga.c +2 -1
@@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
         }
 
         if (signaled_ctx_specific &&
-           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
+           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
+           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
             continue;
         }

lgtm

btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an oversight? I can send a patch if it's the case

thanks

Quoted 5 lines
hw/display/virtio-gpu-rutabaga.c +0 -1
--

2.55.0

Reviewed-by
#2 lore raw
Quoted 30 lines · Marc-André Lureau

Hi

Quoted 15 lines · Gurchetan Singh

The ctx_ids need to match as well as the ring ids for proper signaling.

Fixes 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for gfxstream")
---
  hw/display/virtio-gpu-rutabaga.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/display/virtio-gpu-rutabaga.c +0 -0
index 3aafa4dc66..edf7b62703 100644

hw/display/virtio-gpu-rutabaga.c virtio_gpu_rutabaga_aio_cb(void *opaque) · line 908

Quoted 8 lines
hw/display/virtio-gpu-rutabaga.c +2 -1
@@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
          }
 
          if (signaled_ctx_specific &&
-           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
+           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
+           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
              continue;
          }

lgtm

Quoted 1 line
Quoted 5 lines

btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an oversight? I can send a patch if it's the case

It looks like an oversight to me as well.

Earlier revisions of the patch used VirtioPCIDeviceTypeInfo [1]. In v12, the code was converted to use DEFINE_TYPES() [2], and VirtioPCIDeviceTypeInfo was replaced with TypeInfo at the same time.

[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/[email protected]/

Regards,
Akihiko Odaki

#3 lore raw
Quoted 33 lines · Akihiko Odaki
Quoted 9 lines · Marc-André Lureau

Hi

Quoted 5 lines · Gurchetan Singh

The ctx_ids need to match as well as the ring ids for proper signaling.

Fixes 1dcc6adbc168 ("gfxstream + rutabaga: add initial support for

gfxstream")

Quoted 6 lines

Review

Quoted 6 lines
---
  hw/display/virtio-gpu-rutabaga.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/hw/display/virtio-gpu-rutabaga.c

Quoted 15 lines

hw/display/virtio-gpu-rutabaga.c virtio_gpu_rutabaga_aio_cb(void *opaque) · line 908

Quoted 12 lines

index 3aafa4dc66..edf7b62703 100644

hw/display/virtio-gpu-rutabaga.c +2 -1
@@ -902,7 +902,8 @@ virtio_gpu_rutabaga_aio_cb(void *opaque)
          }
 
          if (signaled_ctx_specific &&
-           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx)) {
+           ((cmd->cmd_hdr.ctx_id != fence_data.ctx_id) ||
+           (cmd->cmd_hdr.ring_idx != fence_data.ring_idx))) {
              continue;
          }

lgtm

Quoted 9 lines
Quoted 1 line
Quoted 5 lines

btw Gurchetan, do you remember why virtio-gpu-pci-rutabaga.c is using raw TypeInfo, and not VirtioPCIDeviceTypeInfo? Is it just an oversight? I can send a patch if it's the case

I don't remember, but probably a random oversight yes. Feel free to send the patch and I will test.

Quoted 6 lines

It looks like an oversight to me as well.

Earlier revisions of the patch used VirtioPCIDeviceTypeInfo [1]. In v12, the code was converted to use DEFINE_TYPES() [2], and VirtioPCIDeviceTypeInfo was replaced with TypeInfo at the same time.

[1]

Quoted 9 lines

https://lore.kernel.org/qemu-devel/[email protected]/
[2]

https://lore.kernel.org/qemu-devel/[email protected]/

Regards,
Akihiko Odaki