qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Kasireddy <vivek.kasireddy@intel.com>
To: qemu-devel@nongnu.org
Cc: "Vivek Kasireddy" <vivek.kasireddy@intel.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Dmitry Osipenko" <dmitry.osipenko@collabora.com>
Subject: [PATCH v1 1/7] virtio-gpu: Recreate the resource's dmabuf if new backing is attached
Date: Fri,  3 Oct 2025 16:35:54 -0700	[thread overview]
Message-ID: <20251003234138.85820-2-vivek.kasireddy@intel.com> (raw)
In-Reply-To: <20251003234138.85820-1-vivek.kasireddy@intel.com>

There are cases when a blob resource's backing might get detached
and re-attached again such as when the underlying object is getting
migrated in the Guest. In these situations, we need to obtain a new
dmabuf fd, which can be done by calling virtio_gpu_init_udmabuf().

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 hw/display/virtio-gpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index de35902213..70e8757128 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -937,6 +937,10 @@ virtio_gpu_resource_attach_backing(VirtIOGPU *g,
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         return;
     }
+
+    if (res->blob_size && res->dmabuf_fd < 0) {
+        virtio_gpu_init_udmabuf(res);
+    }
 }
 
 static void
-- 
2.50.1



  reply	other threads:[~2025-10-03 23:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-03 23:35 [PATCH v1 0/7] vfio: Implement VFIO_DEVICE_FEATURE_DMA_BUF and use it in virtio-gpu Vivek Kasireddy
2025-10-03 23:35 ` Vivek Kasireddy [this message]
2025-10-03 23:35 ` [PATCH v1 2/7] virtio-gpu: Don't rely on res->blob to identify blob resources Vivek Kasireddy
2025-10-10  4:19   ` Akihiko Odaki
2025-10-13  6:54     ` Kasireddy, Vivek
2025-10-03 23:35 ` [PATCH v1 3/7] virtio-gpu: Find hva for Guest's DMA addr associated with a ram device Vivek Kasireddy
2025-10-03 23:35 ` [PATCH v1 4/7] vfio/region: Add a helper to get region index from memory region Vivek Kasireddy
2025-10-06  8:26   ` Cédric Le Goater
2025-10-07  4:50     ` Kasireddy, Vivek
2025-10-07  9:05       ` Cédric Le Goater
2025-10-03 23:35 ` [PATCH v1 5/7] linux-headers: Update vfio.h to include VFIO_DEVICE_FEATURE_DMA_BUF Vivek Kasireddy
2025-10-03 23:35 ` [PATCH v1 6/7] vfio/device: Add support for VFIO_DEVICE_FEATURE_DMA_BUF Vivek Kasireddy
2025-10-06  8:24   ` Cédric Le Goater
2025-10-07  4:48     ` Kasireddy, Vivek
2025-10-03 23:36 ` [PATCH v1 7/7] virtio-gpu-udmabuf: Create dmabuf for blobs associated with VFIO devices Vivek Kasireddy
2025-10-06 15:59   ` Cédric Le Goater
2025-10-07  4:53     ` Kasireddy, Vivek
2025-10-07  6:51     ` Cédric Le Goater
2025-10-10  4:53   ` Akihiko Odaki
2025-10-13  7:00     ` Kasireddy, Vivek
2025-10-06 15:28 ` [PATCH v1 0/7] vfio: Implement VFIO_DEVICE_FEATURE_DMA_BUF and use it in virtio-gpu Cédric Le Goater
2025-10-07  4:51   ` Kasireddy, Vivek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251003234138.85820-2-vivek.kasireddy@intel.com \
    --to=vivek.kasireddy@intel.com \
    --cc=alex.bennee@linaro.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).