Skip to content

Commit f62b3ba

Browse files
Upgrade QEMU to 9.1.0
- Upgrade QEMU to 9.1.0 - Resolve build errors Tracked-On: OAM-129500 Signed-off-by: Suresh, Prashanth <prashanth.suresh@intel.com>
1 parent d810f6b commit f62b3ba

File tree

4 files changed

+238
-0
lines changed

4 files changed

+238
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 3bb76be9e87cd94c653d129595db87eed1ee4682 Mon Sep 17 00:00:00 2001
2+
From: "Suresh, Prashanth" <prashanth.suresh@intel.com>
3+
Date: Wed, 15 Jan 2025 17:25:59 +0000
4+
Subject: [PATCH] Upgrade QEMU to 9.1.0
5+
6+
1. Upgrade QEMU to 9.1.0
7+
2. Resolve build errors for QEMU
8+
9+
Signed-off-by: Suresh, Prashanth <prashanth.suresh@intel.com>
10+
---
11+
scripts/setup_host.sh | 5 ++++-
12+
1 file changed, 4 insertions(+), 1 deletion(-)
13+
14+
diff --git a/scripts/setup_host.sh b/scripts/setup_host.sh
15+
index 4e5b74f..5d57014 100755
16+
--- a/scripts/setup_host.sh
17+
+++ b/scripts/setup_host.sh
18+
@@ -9,7 +9,7 @@ set -eE
19+
20+
#--------- Global variable -------------------
21+
reboot_required=0
22+
-QEMU_REL="qemu-8.2.1"
23+
+QEMU_REL="qemu-9.1.0"
24+
skip_install_qemu=false
25+
26+
#Directory to keep versions of qemu which can be reused instead of downloading again
27+
@@ -64,6 +64,9 @@ function ubu_install_qemu_gvt(){
28+
29+
cd $CIV_WORK_DIR/$QEMU_REL/
30+
31+
+ mv $CIV_VERTICAl_DIR/qemu/0031-Set-the-fourcc-if-it-is-0.patch $CIV_WORK_DIR/patches/qemu/
32+
+ mv $CIV_VERTICAl_DIR/qemu/0033-CiV-SRIOV-virtio-gpu-power-management-qemu.patch $CIV_WORK_DIR/patches/qemu/
33+
+
34+
qemu_patch_num=$(ls $CIV_WORK_DIR/patches/qemu/*.patch 2> /dev/null | wc -l)
35+
if [ "$qemu_patch_num" != "0" ]; then
36+
for i in $CIV_WORK_DIR/patches/qemu/*.patch; do
37+
--
38+
2.34.1
39+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
From 7764aa273054bf351c834f5670b51407331b009f Mon Sep 17 00:00:00 2001
2+
From: "Suresh, Prashanth" <prashanth.suresh@intel.com>
3+
Date: Wed, 15 Jan 2025 22:29:08 +0530
4+
Subject: [PATCH] Fix compilation failure for QEMU 9.1
5+
6+
---
7+
include/ui/dmabuf.h | 20 +++++++++++++++++++-
8+
ui/dmabuf.c | 19 -------------------
9+
2 files changed, 19 insertions(+), 20 deletions(-)
10+
11+
diff --git a/include/ui/dmabuf.h b/include/ui/dmabuf.h
12+
index 07e8178d7..3e217e53b 100644
13+
--- a/include/ui/dmabuf.h
14+
+++ b/include/ui/dmabuf.h
15+
@@ -10,7 +10,25 @@
16+
#ifndef DMABUF_H
17+
#define DMABUF_H
18+
19+
-typedef struct QemuDmaBuf QemuDmaBuf;
20+
+typedef struct QemuDmaBuf {
21+
+ int fd;
22+
+ uint32_t width;
23+
+ uint32_t height;
24+
+ uint32_t stride;
25+
+ uint32_t fourcc;
26+
+ uint64_t modifier;
27+
+ uint32_t texture;
28+
+ uint32_t x;
29+
+ uint32_t y;
30+
+ uint32_t backing_width;
31+
+ uint32_t backing_height;
32+
+ bool y0_top;
33+
+ int fence_fd;
34+
+ bool allow_fences;
35+
+ bool render_sync;
36+
+ bool draw_submitted;
37+
+} QemuDmaBuf;
38+
+
39+
40+
QemuDmaBuf *qemu_dmabuf_new(uint32_t width, uint32_t height,
41+
uint32_t stride, uint32_t x,
42+
diff --git a/ui/dmabuf.c b/ui/dmabuf.c
43+
index 0adaea008..d8ed6731d 100644
44+
--- a/ui/dmabuf.c
45+
+++ b/ui/dmabuf.c
46+
@@ -10,25 +10,6 @@
47+
#include "qemu/osdep.h"
48+
#include "ui/dmabuf.h"
49+
50+
-struct QemuDmaBuf {
51+
- int fd;
52+
- uint32_t width;
53+
- uint32_t height;
54+
- uint32_t stride;
55+
- uint32_t fourcc;
56+
- uint64_t modifier;
57+
- uint32_t texture;
58+
- uint32_t x;
59+
- uint32_t y;
60+
- uint32_t backing_width;
61+
- uint32_t backing_height;
62+
- bool y0_top;
63+
- int fence_fd;
64+
- bool allow_fences;
65+
- bool render_sync;
66+
- bool draw_submitted;
67+
-};
68+
-
69+
QemuDmaBuf *qemu_dmabuf_new(uint32_t width, uint32_t height,
70+
uint32_t stride, uint32_t x,
71+
uint32_t y, uint32_t backing_width,
72+
--
73+
2.43.0
74+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 86a0465b5065f69dd965efd94437b9858ba435ce Mon Sep 17 00:00:00 2001
2+
From: yhe39 <yue.he@intel.com>
3+
Date: Mon, 29 Nov 2021 11:11:27 +0800
4+
Subject: [PATCH] Set the fourcc if it is 0
5+
6+
Signed-off-by: yhe39 <yue.he@intel.com>
7+
---
8+
ui/egl-helpers.c | 6 +++++-
9+
1 file changed, 5 insertions(+), 1 deletion(-)
10+
11+
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
12+
index 42f0b45d4..e7d84febc 100644
13+
--- a/ui/egl-helpers.c
14+
+++ b/ui/egl-helpers.c
15+
@@ -284,7 +284,11 @@ void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf)
16+
attrs[i++] = EGL_HEIGHT;
17+
attrs[i++] = qemu_dmabuf_get_backing_height(dmabuf);
18+
attrs[i++] = EGL_LINUX_DRM_FOURCC_EXT;
19+
- attrs[i++] = qemu_dmabuf_get_fourcc(dmabuf);
20+
+ if (dmabuf->fourcc == 0) {
21+
+ attrs[i++] = 0x34324241;
22+
+ }
23+
+ else
24+
+ attrs[i++] = dmabuf->fourcc;
25+
26+
attrs[i++] = EGL_DMA_BUF_PLANE0_FD_EXT;
27+
attrs[i++] = qemu_dmabuf_get_fd(dmabuf);
28+
--
29+
2.25.1
30+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
From 832cbe9d489149133fc1ebe779aa67b987bbb629 Mon Sep 17 00:00:00 2001
2+
From: "Yuan, Hang" <hang.yuan@intel.com>
3+
Date: Thu, 30 Jun 2022 08:29:39 +0800
4+
Subject: [PATCH] CiV SRIOV virtio-gpu power management qemu
5+
6+
Tracked-On: OAM-102664
7+
Signed-off-by: Yuan, Hang <hang.yuan@intel.com>
8+
---
9+
hw/display/virtio-gpu.c | 19 +++++++++++++++++++
10+
include/hw/virtio/virtio-gpu.h | 2 ++
11+
.../standard-headers/linux/virtio_config.h | 4 ++++
12+
3 files changed, 25 insertions(+)
13+
14+
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
15+
index 25a091465..a8c46f6d8 100644
16+
--- a/hw/display/virtio-gpu.c
17+
+++ b/hw/display/virtio-gpu.c
18+
@@ -1336,6 +1336,7 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
19+
g->cursor_bh = qemu_bh_new_guarded(virtio_gpu_cursor_bh, g,
20+
&qdev->mem_reentrancy_guard);
21+
g->reset_bh = qemu_bh_new(virtio_gpu_reset_bh, g);
22+
+ g->suspended = false;
23+
qemu_cond_init(&g->reset_cond);
24+
QTAILQ_INIT(&g->reslist);
25+
QTAILQ_INIT(&g->cmdq);
26+
@@ -1347,6 +1348,10 @@ void virtio_gpu_reset(VirtIODevice *vdev)
27+
struct virtio_gpu_simple_resource *res, *tmp;
28+
struct virtio_gpu_ctrl_command *cmd;
29+
30+
+ if (g->suspended) {
31+
+ return;
32+
+ }
33+
+
34+
QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) {
35+
virtio_gpu_resource_destroy(g, res);
36+
}
37+
@@ -1387,6 +1392,19 @@ virtio_gpu_set_config(VirtIODevice *vdev, const uint8_t *config)
38+
}
39+
}
40+
41+
+static void
42+
+virtio_gpu_set_status(VirtIODevice *vdev, uint8_t status)
43+
+{
44+
+ VirtIOGPU *g = VIRTIO_GPU(vdev);
45+
+
46+
+ if (status == VIRTIO_CONFIG_S_SUSPEND) {
47+
+ g->suspended = true;
48+
+ }
49+
+ if ((status == VIRTIO_CONFIG_S_RESUME) || (status & VIRTIO_CONFIG_S_DRIVER)) {
50+
+ g->suspended = false;
51+
+ }
52+
+}
53+
+
54+
/*
55+
* For historical reasons virtio_gpu does not adhere to virtio migration
56+
* scheme as described in doc/virtio-migration.txt, in a sense that no
57+
@@ -1439,6 +1457,7 @@ static void virtio_gpu_class_init(ObjectClass *klass, void *data)
58+
vdc->reset = virtio_gpu_reset;
59+
vdc->get_config = virtio_gpu_get_config;
60+
vdc->set_config = virtio_gpu_set_config;
61+
+ vdc->set_status = virtio_gpu_set_status;
62+
63+
dc->vmsd = &vmstate_virtio_gpu;
64+
device_class_set_props(dc, virtio_gpu_properties);
65+
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
66+
index 6372f4bbb..dd9f481bc 100644
67+
--- a/include/hw/virtio/virtio-gpu.h
68+
+++ b/include/hw/virtio/virtio-gpu.h
69+
@@ -159,6 +159,8 @@ typedef struct VGPUDMABuf {
70+
struct VirtIOGPU {
71+
VirtIOGPUBase parent_obj;
72+
73+
+ bool suspended;
74+
+
75+
uint8_t scanout_vmstate_version;
76+
uint64_t conf_max_hostmem;
77+
78+
diff --git a/include/standard-headers/linux/virtio_config.h b/include/standard-headers/linux/virtio_config.h
79+
index 22e3a85f6..30c4ed2cb 100644
80+
--- a/include/standard-headers/linux/virtio_config.h
81+
+++ b/include/standard-headers/linux/virtio_config.h
82+
@@ -40,6 +40,10 @@
83+
#define VIRTIO_CONFIG_S_DRIVER_OK 4
84+
/* Driver has finished configuring features */
85+
#define VIRTIO_CONFIG_S_FEATURES_OK 8
86+
+/* Device will enter suspend state */
87+
+#define VIRTIO_CONFIG_S_SUSPEND 0x10
88+
+/* Device resumed */
89+
+#define VIRTIO_CONFIG_S_RESUME 0x11
90+
/* Device entered invalid state, driver must reset it */
91+
#define VIRTIO_CONFIG_S_NEEDS_RESET 0x40
92+
/* We've given up on this device. */
93+
--
94+
2.25.1
95+

0 commit comments

Comments
 (0)