qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Fix resource freeing bugs in virtio-gpu-rutabaga
@ 2024-01-30 14:59 Manos Pitsidianakis
  2024-01-30 14:59 ` [PATCH v3 1/3] hw/display/virtio-gpu.c: use reset_bh class method Manos Pitsidianakis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Manos Pitsidianakis @ 2024-01-30 14:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Michael S. Tsirkin, Gurchetan Singh, Alyssa Ross,
	Alex Bennée

While testing the rutabaga gpu device, we noticed that if the device is
reset, it stops working and complains about missing resource ids. A
quick investigation discovered that the generic VirtIOGPU implementation
frees all resources, but for Rutabaga, they are tied with rutabaga
objects that need to be destroyed as well.

This series adds a resource_destroy class method that the Rutabaga
device can override and do its own bookkeeping.

v2 -> v3 differences:
- use error_setg_errno in virtio-gpu-rutabaga.c
  resource_destroy method. (Thanks Marc-André
  Lureau <marcandre.lureau@gmail.com> !)

v1 -> v2 differences:
- addressed review comments re: using the Error API for the
  resource_destroy method.

Manos Pitsidianakis (3):
  hw/display/virtio-gpu.c: use reset_bh class method
  virtio-gpu.c: add resource_destroy class method
  virtio-gpu-rutabaga.c: override resource_destroy method

 include/hw/virtio/virtio-gpu.h   |  3 ++
 hw/display/virtio-gpu-rutabaga.c | 47 ++++++++++++++++++++++++--------
 hw/display/virtio-gpu.c          | 27 +++++++++++++++---
 3 files changed, 61 insertions(+), 16 deletions(-)

Range-diff against v2:
1:  5893fb45d1 = 1:  87fb4fa72c hw/display/virtio-gpu.c: use reset_bh class method
2:  78b15e8f7e ! 2:  b0a86630c4 virtio-gpu.c: add resource_destroy class method
    @@ Commit message
         This commit adds a class method so that virtio-gpu-rutabaga can override
         it in the next commit.
     
    +    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
         Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
     
      ## include/hw/virtio/virtio-gpu.h ##
3:  926db899be ! 3:  e3778e44c9 virtio-gpu-rutabaga.c: override resource_destroy method
    @@ hw/display/virtio-gpu-rutabaga.c: rutabaga_cmd_create_resource_3d(VirtIOGPU *g,
     +                                   Error **errp)
     +{
     +    int32_t result;
    -+    const char *strerror = NULL;
     +    VirtIOGPURutabaga *vr = VIRTIO_GPU_RUTABAGA(g);
     +
     +    result = rutabaga_resource_unref(vr->rutabaga, res->resource_id);
     +    if (result) {
    -+        error_setg(errp, "%s: rutabaga_resource_unref returned %"PRIi32
    -+                   " for resource_id = %"PRIu32, __func__, result,
    -+                   res->resource_id);
    -+        strerror = strerrorname_np((int)result);
    -+        if (strerror != NULL) {
    -+            error_append_hint(errp, "%s: %s\n",
    -+                              strerror, strerrordesc_np((int)result) ? : "");
    -+        }
    ++        error_setg_errno(errp,
    ++                        (int)result,
    ++                        "%s: rutabaga_resource_unref returned %"PRIi32
    ++                        " for resource_id = %"PRIu32, __func__, result,
    ++                        res->resource_id);
     +    }
     +
     +    if (res->image) {

base-commit: 11be70677c70fdccd452a3233653949b79e97908
-- 
γαῖα πυρί μιχθήτω



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-31  3:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 14:59 [PATCH v3 0/3] Fix resource freeing bugs in virtio-gpu-rutabaga Manos Pitsidianakis
2024-01-30 14:59 ` [PATCH v3 1/3] hw/display/virtio-gpu.c: use reset_bh class method Manos Pitsidianakis
2024-01-30 14:59 ` [PATCH v3 2/3] virtio-gpu.c: add resource_destroy " Manos Pitsidianakis
2024-01-30 14:59 ` [PATCH v3 3/3] virtio-gpu-rutabaga.c: override resource_destroy method Manos Pitsidianakis
2024-01-31  3:09   ` Gurchetan Singh

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