[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC QEMU PATCH 16/18] virtio-gpu: fix hw-display-virtio-gpu.so undefined symbol virtio_gpu_virgl_resource_unmap


  • To: Gerd Hoffmann <kraxel@xxxxxxxxxx>, "Michael S . Tsirkin" <mst@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Antonio Caggiano <antonio.caggiano@xxxxxxxxxxxxx>, "Dr . David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Robert Beckett <bob.beckett@xxxxxxxxxxxxx>, <qemu-devel@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Huang Rui <ray.huang@xxxxxxx>
  • Date: Sun, 12 Mar 2023 17:22:42 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DFVzCS9EKJ3JtWs5IAcFXDUrjN+wb62RYxssFqs2lUk=; b=WlR8KlVlCdsWoIdZQCF+7oVbsWwJjNyPPY25xpD8xMQlNuHfvBDaadj4bniYj0Cztdwyw7uDfzZoViaawSZTQrAemBKZK3VXrHveIIjQgilIWDKnchWb+MsUMQCn1WsVX2gKiHa7LPL3q9jV8LoZU6IYnBfP2yTM9un+5GAY1ZqFeQkvkoTBm8sYrU88BV75GQzhCgr6Ajw1xRe5sMl5lbzLueok6H8LDvGUaQPrAHEfY+SnwmdF3vdpbfO0BG+k6U254HeVZDov6u7R5+MCVRp0N2G09IRglDlJl88M3wS/L4jbXqwr9FcW37S6U4fBr8JS4lYN0x5qBlY5ixuQHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bsgOPke2+iIN2vc68QxbIUzbY5YCmWkFXURFVjG+fkiCDUJs4pDCDcpbz6fxSUvRREXI5Rg+QjmBPHtQd962mNKY2JhC6bmxs0W/isHMYGea0KnC2vPKfXNmfA03DrWVwNwT9sbitkPfWg6DWoCiIV7914cq4zA65kWEDz6O5lCoKGHiHLqYEFUQGQPSP42rYbjLovFsdY9WjE98KwEKKj9oXDNPXVQfUv6YOxpXk2wJjmExNE6O2U8/oX8/axy+qqZ+MxXK5tgtRA+af5jZsGyw6Yr09N4ZG94aiO3a2MpfAPirTeZgl06Gd4/LA/mcNka+fPpPOF7TeJhmRSIYiA==
  • Cc: Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, "Stewart Hildebrand" <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, Honglei Huang <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, Chen Jiqian <Jiqian.Chen@xxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
  • Delivery-date: Sun, 12 Mar 2023 09:29:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Honglei Huang <honglei1.huang@xxxxxxx>

Move virtio_gpu_virgl_resource_unmap to virtio-gpu.c cause virtio-gpu.so
call this function but this function in virtio-gpu-gl.so before.

Add virgl dependency  into virtio-gpu-gl.so.

Suggested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Signed-off-by: Honglei Huang <honglei1.huang@xxxxxxx>
Reviewed-by: Huang Rui <ray.huang@xxxxxxx>
Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
 hw/display/meson.build        |  2 +-
 hw/display/virtio-gpu-virgl.c | 17 -----------------
 hw/display/virtio-gpu.c       | 19 +++++++++++++++++++
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/hw/display/meson.build b/hw/display/meson.build
index 7a725ed80e..21999dfbe0 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -67,7 +67,7 @@ softmmu_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_true: 
files('ati.c', 'ati_2d
 if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
   virtio_gpu_ss = ss.source_set()
   virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU',
-                    if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), 
pixman])
+                    if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), 
pixman, virgl])
   virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: 
files('virtio-gpu-udmabuf.c'),
                                           if_false: 
files('virtio-gpu-udmabuf-stubs.c'))
   virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: 
files('vhost-user-gpu.c'))
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 69083d15a9..d5214e0f43 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -636,23 +636,6 @@ static void virgl_cmd_resource_map_blob(VirtIOGPU *g,
     virtio_gpu_ctrl_response(g, cmd, &resp.hdr, sizeof(resp));
 }
 
-int virtio_gpu_virgl_resource_unmap(VirtIOGPU *g,
-                                    struct virtio_gpu_simple_resource *res)
-{
-    if (!res->mapped) {
-        qemu_log_mask(LOG_GUEST_ERROR, "%s: resource already unmapped %d\n",
-                      __func__, res->resource_id);
-        return VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID;
-    }
-
-    memory_region_set_enabled(&res->region, false);
-    memory_region_del_subregion(&g->parent_obj.hostmem, &res->region);
-    object_unparent(OBJECT(&res->region));
-
-    res->mapped = NULL;
-    return virgl_renderer_resource_unmap(res->resource_id);
-}
-
 static void virgl_cmd_resource_unmap_blob(VirtIOGPU *g,
                                         struct virtio_gpu_ctrl_command *cmd)
 {
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 95e421a525..95eaed61b3 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -31,6 +31,8 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 
+#include <virglrenderer.h>
+
 #define VIRTIO_GPU_VM_VERSION 1
 
 static struct virtio_gpu_simple_resource *
@@ -873,6 +875,23 @@ void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g,
     g_free(iov);
 }
 
+int virtio_gpu_virgl_resource_unmap(VirtIOGPU *g,
+                                    struct virtio_gpu_simple_resource *res)
+{
+    if (!res->mapped) {
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: resource already unmapped %d\n",
+                      __func__, res->resource_id);
+        return VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID;
+    }
+
+    memory_region_set_enabled(&res->region, false);
+    memory_region_del_subregion(&g->parent_obj.hostmem, &res->region);
+    object_unparent(OBJECT(&res->region));
+
+    res->mapped = NULL;
+    return virgl_renderer_resource_unmap(res->resource_id);
+}
+
 static void virtio_gpu_cleanup_mapping(VirtIOGPU *g,
                                        struct virtio_gpu_simple_resource *res)
 {
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.