[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 undefine
From: |
Huang Rui |
Subject: |
[RFC QEMU PATCH 16/18] virtio-gpu: fix hw-display-virtio-gpu.so undefined symbol virtio_gpu_virgl_resource_unmap |
Date: |
Sun, 12 Mar 2023 17:22:42 +0800 |
From: Honglei Huang <honglei1.huang@amd.com>
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@kernel.org>
Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
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
- [RFC QEMU PATCH 06/18] virtio-gpu: Resource UUID, (continued)
- [RFC QEMU PATCH 06/18] virtio-gpu: Resource UUID, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 07/18] virtio-gpu: Support Venus capset, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 08/18] virtio-gpu: Initialize Venus, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 09/18] meson: Enable virglrenderer unstable APIs, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 10/18] virtio-gpu: Handle set scanout blob command, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 11/18] virtio-gpu: make blob scanout use dmabuf fd, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 12/18] softmmu: Fix the size to map cache with xen for host virtual address, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 13/18] hw/i386/xen/xen-hvm: Introduce xen_ram_block_check function, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 14/18] softmmu: Add ram block check to map the xen ram memory, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 16/18] virtio-gpu: fix hw-display-virtio-gpu.so undefined symbol virtio_gpu_virgl_resource_unmap,
Huang Rui <=
- [RFC QEMU PATCH 17/18] virtio-gpu: Add video hardware accelerate support for virgl, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 18/18] xen: translate irq of host pci device to gsi, Huang Rui, 2023/03/12
- [RFC QEMU PATCH 15/18] softmmu: Enable qemu ram allocation with fd for Xen, Huang Rui, 2023/03/12