-
Notifications
You must be signed in to change notification settings - Fork 48
enable spice in qemu #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
enable spice in qemu #647
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0219b16
enable spice in qemu
8488c00
enable spice in qemu
5319104
enable spice in qemu
d460f2a
update spec
6b982ab
update spec
bde75c5
Update gstreamer1-plugins-base.spec for changelog
cheeyanglee 06ad7b3
update qemu spec
bf6735a
update qemu spec
6942827
update qemu spec
ba79302
update qemu spec
e9f38ef
add qemu patch
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...S/gstreamer1-plugins-base/0001-glimagesink-set-last-sample-disabled-if-input-is-ext.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| From 20de7236a6fa022a7c52b1c1ccf6ce33a3142f7a Mon Sep 17 00:00:00 2001 | ||
| From: He Junyan <[email protected]> | ||
| Date: Thu, 16 May 2024 14:22:42 +0800 | ||
| Subject: [PATCH] glimagesink: set last sample disabled if input is | ||
| "external-oes" | ||
|
|
||
| The last sample causes error log of: | ||
| gstglmemory.c:926:_gl_tex_copy: Cannot copy External OES textures | ||
|
|
||
| So we should disable last sample if the input is "external-oes". | ||
|
|
||
| Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6863#note_2415780> | ||
|
|
||
| This is a temporary fix for error message that occcured after a successful | ||
| playback. Need to be removed after upstream have produced their fix. | ||
| --- | ||
| ext/gl/gstglimagesink.c | 10 ++++++++++ | ||
| 1 file changed, 10 insertions(+) | ||
|
|
||
| diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c | ||
| index dd32d5f1..019df309 100644 | ||
| --- a/ext/gl/gstglimagesink.c | ||
| +++ b/ext/gl/gstglimagesink.c | ||
| @@ -1647,6 +1647,7 @@ gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) | ||
| GstGLImageSink *glimage_sink; | ||
| gboolean ok; | ||
| GstVideoInfo vinfo; | ||
| + GstStructure *structure; | ||
|
|
||
| GST_DEBUG_OBJECT (bsink, "set caps with %" GST_PTR_FORMAT, caps); | ||
|
|
||
| @@ -1668,6 +1669,15 @@ gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) | ||
|
|
||
| GST_GLIMAGE_SINK_UNLOCK (glimage_sink); | ||
|
|
||
| + structure = gst_caps_get_structure (caps, 0); | ||
| + if (gst_structure_has_field_typed | ||
| + (structure, "texture-target", G_TYPE_STRING)) { | ||
| + const gchar *str = gst_structure_get_string (structure, "texture-target"); | ||
| + | ||
| + if (g_strcmp0 (str, GST_GL_TEXTURE_TARGET_EXTERNAL_OES_STR) == 0) | ||
| + gst_base_sink_set_last_sample_enabled (bsink, FALSE); | ||
| + } | ||
| + | ||
| return ok; | ||
| } | ||
|
|
||
| -- | ||
| 2.34.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,32 @@ | ||
| %global debug_package %{nil} | ||
| %bcond cdparanoia %{undefined rhel} | ||
| %bcond libvisual %{undefined rhel} | ||
| %global majorminor 1.0 | ||
| Summary: GStreamer streaming media framework base plugins | ||
| Name: gstreamer1-plugins-base | ||
| Version: 1.26.5 | ||
| Release: 1%{?dist} | ||
| Release: 2%{?dist} | ||
| License: LGPLv2+ | ||
| Vendor: Microsoft Corporation | ||
| Distribution: Azure Linux | ||
| Vendor: Intel Corporation | ||
| Distribution: Edge Microvisor Toolkit | ||
| URL: https://gstreamer.freedesktop.org/ | ||
| Source0: https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-%{version}.tar.xz | ||
| Patch0: 0001-missing-plugins-Remove-the-mpegaudioversion-field.patch | ||
|
|
||
| # Platform patches | ||
| Patch10: 0001-glimagesink-set-last-sample-disabled-if-input-is-ext.patch | ||
|
|
||
| BuildRequires: meson >= 0.48.0 | ||
| BuildRequires: gcc | ||
| BuildRequires: gcc-c++ | ||
| BuildRequires: gstreamer1-devel >= %{version} | ||
| BuildRequires: gobject-introspection-devel >= 1.31.1 | ||
| BuildRequires: iso-codes-devel | ||
| BuildRequires: alsa-lib-devel | ||
| %if %{with cdparanoia} | ||
| BuildRequires: cdparanoia-devel | ||
| %endif | ||
| BuildRequires: libogg-devel >= 1.0 | ||
| BuildRequires: libtheora-devel >= 1.1 | ||
| %if %{with libvisual} | ||
| BuildRequires: libvisual-devel | ||
| %endif | ||
| BuildRequires: libvorbis-devel >= 1.0 | ||
| BuildRequires: libXv-devel | ||
| BuildRequires: opus-devel | ||
| BuildRequires: orc-devel >= 0.4.18 | ||
| BuildRequires: pango-devel | ||
| BuildRequires: pkgconfig | ||
|
|
@@ -44,6 +41,7 @@ BuildRequires: mesa-libEGL-devel | |
| BuildRequires: mesa-libgbm-devel | ||
| BuildRequires: libgudev-devel | ||
| BuildRequires: wayland-devel | ||
| BuildRequires: egl-wayland-devel | ||
| BuildRequires: graphene-devel | ||
| # pkgconfig-style deps specifically searched-for by autotools/configure | ||
| BuildRequires: pkgconfig(wayland-client) >= 1.0 | ||
|
|
@@ -94,16 +92,12 @@ for developing applications that use %{name}. | |
|
|
||
| %build | ||
| %meson \ | ||
| -D package-name='Fedora GStreamer-plugins-base package' \ | ||
| -D package-origin='http://download.fedoraproject.org' \ | ||
| -D gl_winsys=wayland,x11,gbm \ | ||
| %{!?with_cdparanoia:-D cdparanoia=disabled} \ | ||
| %{!?with_libvisual:-D libvisual=disabled} \ | ||
| -D doc=disabled \ | ||
| -D orc=enabled \ | ||
| -D tremor=disabled \ | ||
| -D tests=disabled \ | ||
| -D examples=disabled \ | ||
| -D opus=disabled | ||
| %meson_build | ||
|
|
||
| %install | ||
|
|
@@ -172,7 +166,7 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
|
|
||
| %files -f gst-plugins-base-%{majorminor}.lang | ||
| %license COPYING | ||
| %doc AUTHORS NEWS README.static-linking RELEASE REQUIREMENTS | ||
| %doc AUTHORS NEWS README.md README.static-linking RELEASE REQUIREMENTS | ||
| %{_datadir}/appdata/*.appdata.xml | ||
| %{_libdir}/libgstallocators-%{majorminor}.so.* | ||
| %{_libdir}/libgstaudio-%{majorminor}.so.* | ||
|
|
@@ -210,12 +204,12 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
| %{_libdir}/gstreamer-%{majorminor}/libgstaudiorate.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstaudioresample.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstaudiotestsrc.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstbasedebug.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstcompositor.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstdsd.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstencoding.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstgio.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstbasedebug.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstoverlaycomposition.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstdsd.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstplayback.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstpbtypes.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstrawparse.so | ||
|
|
@@ -229,15 +223,10 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
|
|
||
| # base plugins with dependencies | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstalsa.so | ||
| %if %{with cdparanoia} | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstcdparanoia.so | ||
| %endif | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstopengl.so | ||
| %if %{with libvisual} | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstlibvisual.so | ||
| %endif | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstogg.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstopus.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstpango.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgsttheora.so | ||
| %{_libdir}/gstreamer-%{majorminor}/libgstvorbis.so | ||
|
|
@@ -257,9 +246,9 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/allocators.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/allocators-prelude.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstdmabuf.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstdrmdumb.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstfdmemory.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstphysmemory.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstdrmdumb.h | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/allocators/gstshmallocator.h | ||
| %dir %{_includedir}/gstreamer-%{majorminor}/gst/app | ||
| %{_includedir}/gstreamer-%{majorminor}/gst/app/app.h | ||
|
|
@@ -437,8 +426,12 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
| %{_libdir}/pkgconfig/*.pc | ||
|
|
||
| %changelog | ||
| * Mon Oct 13 2025 Swee Yee Fonn <[email protected]> - 1.26.5-2 | ||
| - Upgrading to 1.26.5 based on Fedora 44 (license: MIT) for guidance. | ||
|
|
||
| * Thu Oct 29 2025 kintalix jayanth <[email protected]> - 1.26.5-1 | ||
| - update to 1.26.5 | ||
| - Initial Edge Microvisor Toolkit import from Azure Linux (license: MIT) | ||
|
|
||
| * Wed Jan 22 2025 Andrew Phelps <[email protected]> - 1.20.4-3 | ||
| - Remove dependency on opus | ||
|
|
@@ -857,4 +850,4 @@ rm %{_libexecdir}/gstreamer-%{majorminor}/gst-plugin-scanner | |
| - Remove rpath. | ||
|
|
||
| * Tue Jul 17 2012 Brian Pepple <[email protected]> - 0.11.92-1 | ||
| - Initial Fedora spec file. | ||
| - Initial Fedora spec file. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "Signatures": { | ||
| "libvisual-0.4.0.tar.gz": "0b4dfdb87125e129567752089e3c8b54cefed601eef169d2533d8659da8dc1d7" | ||
| "libvisual-0.4.0.tar.bz2": "78f38d3ce857edde5482aa4415b504bbcd4d4a688fd4de09ec2131ad08174279" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| Vendor: Microsoft Corporation | ||
| Distribution: Azure Linux | ||
| Vendor: Intel Corporation | ||
| Distribution: Edge Microvisor Toolkit | ||
| %global smallversion 0.4 | ||
|
|
||
| Name: libvisual | ||
| Version: 0.4.0 | ||
| Release: 30%{?dist} | ||
| Release: 31%{?dist} | ||
| Summary: Abstraction library for audio visualisation plugins | ||
| License: LGPLv2+ | ||
| URL: http://libvisual.sf.net | ||
| Source0: http://dl.sf.net/libvisual/libvisual-%{version}.tar.gz | ||
| URL: https://github.com/Libvisual/libvisual | ||
| Source0: https://github.com/Libvisual/libvisual/releases/download/libvisual-%{version}/libvisual-%{version}.tar.bz2 | ||
| BuildRequires: gcc-c++ | ||
| BuildRequires: xorg-x11-proto-devel | ||
| # https://bugzilla.redhat.com/show_bug.cgi?id=435771 | ||
|
|
@@ -73,6 +73,11 @@ find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' | |
|
|
||
|
|
||
| %changelog | ||
| * Mon Oct 13 2025 Swee Yee Fonn <[email protected]> - 0.4.0-31 | ||
| - Initial Edge Microvisor Toolkit import from Azure Linux (license: MIT) | ||
| - License verified. | ||
| - Update Source0 url to be downloadable. | ||
|
|
||
| * Mon Nov 01 2021 Muhammad Falak <[email protected]> - 0.4.0-30 | ||
| - Remove epoch | ||
|
|
||
|
|
||
131 changes: 131 additions & 0 deletions
131
SPECS/qemu/0001-spice-Introduce-hw-bypass-to-bypass-encoding.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| From 99447393cb7dc00df0689324d0979aa1225e6718 Mon Sep 17 00:00:00 2001 | ||
| From: "Mazlan, Hazwan Arif" <[email protected]> | ||
| Date: Mon, 16 Jun 2025 08:31:04 +0800 | ||
| Subject: [PATCH] spice: Introduce hw-bypass to bypass encoding | ||
|
|
||
| Signed-off-by: Mazlan, Hazwan Arif <[email protected]> | ||
| --- | ||
| include/ui/spice-display.h | 1 + | ||
| qemu-options.hx | 3 +++ | ||
| ui/spice-core.c | 5 +++++ | ||
| ui/spice-display.c | 14 ++++++++------ | ||
| 4 files changed, 17 insertions(+), 6 deletions(-) | ||
|
|
||
| diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h | ||
| index d087d7198a9e..8cdd510c1914 100644 | ||
| --- a/include/ui/spice-display.h | ||
| +++ b/include/ui/spice-display.h | ||
| @@ -155,6 +155,7 @@ struct SimpleSpiceCursor { | ||
|
|
||
| extern bool spice_opengl; | ||
| extern bool remote_client; | ||
| +extern bool hw_bypass; | ||
|
|
||
| int qemu_spice_rect_is_empty(const QXLRect* r); | ||
| void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r); | ||
| diff --git a/qemu-options.hx b/qemu-options.hx | ||
| index dd972180cd7b..aa8e2338265e 100644 | ||
| --- a/qemu-options.hx | ||
| +++ b/qemu-options.hx | ||
| @@ -2393,6 +2393,9 @@ SRST | ||
| ``gl=[on|off]`` | ||
| Enable/disable OpenGL context. Default is off. | ||
|
|
||
| + ``hw-bypass=[on|off]`` | ||
| + Enable/disable hw encoding checking bypass. Default is off. | ||
| + | ||
| ``rendernode=<file>`` | ||
| DRM render node for OpenGL rendering. If not specified, it will | ||
| pick the first available. (Since 2.9) | ||
| diff --git a/ui/spice-core.c b/ui/spice-core.c | ||
| index 39991c1686f3..0c0463f329c1 100644 | ||
| --- a/ui/spice-core.c | ||
| +++ b/ui/spice-core.c | ||
| @@ -503,6 +503,9 @@ static QemuOptsList qemu_spice_opts = { | ||
| },{ | ||
| .name = "display", | ||
| .type = QEMU_OPT_STRING, | ||
| + },{ | ||
| + .name = "hw-bypass", | ||
| + .type = QEMU_OPT_BOOL, | ||
| },{ | ||
| .name = "head", | ||
| .type = QEMU_OPT_NUMBER, | ||
| @@ -845,6 +848,8 @@ static void qemu_spice_init(void) | ||
| g_free(x509_cacert_file); | ||
| g_free(password); | ||
|
|
||
| + hw_bypass = qemu_opt_get_bool(opts, "hw-bypass", 0); | ||
| + | ||
| #ifdef HAVE_SPICE_GL | ||
| if (qemu_opt_get_bool(opts, "gl", 0)) { | ||
| if ((port != 0) || (tls_port != 0)) { | ||
| diff --git a/ui/spice-display.c b/ui/spice-display.c | ||
| index 0d75bb57fede..75ad029a3cc1 100644 | ||
| --- a/ui/spice-display.c | ||
| +++ b/ui/spice-display.c | ||
| @@ -31,6 +31,8 @@ | ||
|
|
||
| bool spice_opengl; | ||
| bool remote_client; | ||
| +bool hw_bypass; | ||
| + | ||
|
|
||
| int qemu_spice_rect_is_empty(const QXLRect* r) | ||
| { | ||
| @@ -994,7 +996,7 @@ static void spice_gl_switch(DisplayChangeListener *dcl, | ||
| spice_qxl_gl_scanout(&ssd->qxl, fd, | ||
| surface_width(ssd->ds), | ||
| surface_height(ssd->ds), | ||
| - stride, fourcc, false); | ||
| + stride, fourcc, false, hw_bypass); | ||
| ssd->have_surface = true; | ||
| ssd->have_scanout = false; | ||
|
|
||
| @@ -1017,7 +1019,7 @@ static void qemu_spice_gl_scanout_disable(DisplayChangeListener *dcl) | ||
| SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); | ||
|
|
||
| trace_qemu_spice_gl_scanout_disable(ssd->qxl.id); | ||
| - spice_qxl_gl_scanout(&ssd->qxl, -1, 0, 0, 0, 0, false); | ||
| + spice_qxl_gl_scanout(&ssd->qxl, -1, 0, 0, 0, 0, false, false); | ||
| qemu_spice_gl_monitor_config(ssd, 0, 0, 0, 0); | ||
| ssd->have_surface = false; | ||
| ssd->have_scanout = false; | ||
| @@ -1058,7 +1060,7 @@ static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl, | ||
| } else { | ||
| /* note: spice server will close the fd */ | ||
| spice_qxl_gl_scanout(&ssd->qxl, fd, backing_width, backing_height, | ||
| - stride, fourcc, y_0_top); | ||
| + stride, fourcc, y_0_top, hw_bypass); | ||
| qemu_spice_gl_monitor_config(ssd, x, y, w, h); | ||
| } | ||
|
|
||
| @@ -1154,7 +1156,7 @@ static bool spice_gl_blit_scanout_texture(SimpleSpiceDisplay *ssd) | ||
| spice_qxl_gl_scanout(&ssd->qxl, fd, | ||
| surface_width(ssd->ds), | ||
| surface_height(ssd->ds), | ||
| - stride, fourcc, ssd->backing_y_0_top); | ||
| + stride, fourcc, ssd->backing_y_0_top, hw_bypass); | ||
| qemu_spice_gl_monitor_config(ssd, 0, 0, | ||
| surface_width(ssd->ds), | ||
| surface_height(ssd->ds)); | ||
| @@ -1213,7 +1215,7 @@ static void qemu_spice_gl_update(DisplayChangeListener *dcl, | ||
| fd = egl_get_fd_for_texture(ssd->blit_fb.texture, | ||
| &stride, &fourcc, NULL); | ||
| spice_qxl_gl_scanout(&ssd->qxl, fd, width, height, | ||
| - stride, fourcc, false); | ||
| + stride, fourcc, false, hw_bypass); | ||
| } | ||
| } else { | ||
| stride = qemu_dmabuf_get_stride(dmabuf); | ||
| @@ -1224,7 +1226,7 @@ static void qemu_spice_gl_update(DisplayChangeListener *dcl, | ||
| trace_qemu_spice_gl_forward_dmabuf(ssd->qxl.id, width, height); | ||
| /* note: spice server will close the fd, so hand over a dup */ | ||
| spice_qxl_gl_scanout(&ssd->qxl, fd, width, height, | ||
| - stride, fourcc, y_0_top); | ||
| + stride, fourcc, y_0_top, hw_bypass); | ||
| } | ||
| qemu_spice_gl_monitor_config(ssd, 0, 0, width, height); | ||
| ssd->guest_dmabuf_refresh = false; | ||
| -- | ||
| 2.43.0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.