diff options
author | Thomas Sachau <tommy@gentoo.org> | 2010-04-03 13:51:55 +0000 |
---|---|---|
committer | Thomas Sachau <tommy@gentoo.org> | 2010-04-03 13:51:55 +0000 |
commit | 8cd0b0777f5d62ca1a9eb57de2d0400d8cde48d3 (patch) | |
tree | bef58fa2b941773d1109986d7629c71eaa3f08a8 /app-emulation/qemu-kvm/files | |
parent | x86 stable wrt security bug #293647 (diff) | |
download | gentoo-2-8cd0b0777f5d62ca1a9eb57de2d0400d8cde48d3.tar.gz gentoo-2-8cd0b0777f5d62ca1a9eb57de2d0400d8cde48d3.tar.bz2 gentoo-2-8cd0b0777f5d62ca1a9eb57de2d0400d8cde48d3.zip |
Include madvise defines, fixes bug 305785, include virtio-large-iovecs patch, fixes bug 308451, include upstream fix for crash with sdl as default sound option, fixes sound issues of bug 294269
(Portage version: 2.2_rc67-r3/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/qemu-kvm/files')
-rw-r--r-- | app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-fix-crash-with-sdl.patch | 145 | ||||
-rw-r--r-- | app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-include-madvise-defines.patch | 12 |
2 files changed, 157 insertions, 0 deletions
diff --git a/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-fix-crash-with-sdl.patch b/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-fix-crash-with-sdl.patch new file mode 100644 index 000000000000..909deadf42e3 --- /dev/null +++ b/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-fix-crash-with-sdl.patch @@ -0,0 +1,145 @@ +From ff5414990645653bf43bf64adfc1ca77ffb9edcb Mon Sep 17 00:00:00 2001 +From: malc <av1474@comtv.ru> +Date: Sun, 17 Jan 2010 00:25:29 +0300 +Subject: [PATCH] Revert "sdlaudio: make it suck less" + +This reverts commit 4839abe78fd466a3cf06faa7c362154afd5404f1. + +The commit was badly broken, Gentoo has sdl as the default driver, +consequently 5 gentoo users have hit the breakage and were kind enough +to report, so thank you: + +Claes Gyllenswrd +vekin +Chris + +But above all thanks to Toralf Foerster who actually provied enough +information to pinpoint the breakage to sdlaudio. + +http://bugs.gentoo.org/show_bug.cgi?id=294269 +--- + audio/sdlaudio.c | 80 +++++++++++++++++++++++++++++++++-------------------- + 1 files changed, 50 insertions(+), 30 deletions(-) + +diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c +index aa39c33..8e7e5cb 100644 +--- a/audio/sdlaudio.c ++++ b/audio/sdlaudio.c +@@ -41,8 +41,8 @@ + typedef struct SDLVoiceOut { + HWVoiceOut hw; + int live; ++ int rpos; + int decr; +- int pending; + } SDLVoiceOut; + + static struct { +@@ -225,10 +225,6 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len) + HWVoiceOut *hw = &sdl->hw; + int samples = len >> hw->info.shift; + +- if (sdl_lock (s, "sdl_callback")) { +- return; +- } +- + if (s->exit) { + return; + } +@@ -236,34 +232,49 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len) + while (samples) { + int to_mix, decr; + +- while (!sdl->pending) { +- if (sdl_unlock (s, "sdl_callback")) { +- return; +- } +- +- sdl_wait (s, "sdl_callback"); +- if (s->exit) { +- return; +- } +- +- if (sdl_lock (s, "sdl_callback")) { +- return; +- } +- sdl->pending += sdl->live; +- sdl->live = 0; ++ /* dolog ("in callback samples=%d\n", samples); */ ++ sdl_wait (s, "sdl_callback"); ++ if (s->exit) { ++ return; ++ } ++ ++ if (sdl_lock (s, "sdl_callback")) { ++ return; ++ } ++ ++ if (audio_bug (AUDIO_FUNC, sdl->live < 0 || sdl->live > hw->samples)) { ++ dolog ("sdl->live=%d hw->samples=%d\n", ++ sdl->live, hw->samples); ++ return; ++ } ++ ++ if (!sdl->live) { ++ goto again; + } + +- to_mix = audio_MIN (samples, sdl->pending); +- decr = audio_pcm_hw_clip_out (hw, buf, to_mix, 0); +- buf += decr << hw->info.shift; ++ /* dolog ("in callback live=%d\n", live); */ ++ to_mix = audio_MIN (samples, sdl->live); ++ decr = to_mix; ++ while (to_mix) { ++ int chunk = audio_MIN (to_mix, hw->samples - hw->rpos); ++ struct st_sample *src = hw->mix_buf + hw->rpos; ++ ++ /* dolog ("in callback to_mix %d, chunk %d\n", to_mix, chunk); */ ++ hw->clip (buf, src, chunk); ++ sdl->rpos = (sdl->rpos + chunk) % hw->samples; ++ to_mix -= chunk; ++ buf += chunk << hw->info.shift; ++ } + samples -= decr; ++ sdl->live -= decr; + sdl->decr += decr; +- sdl->pending -= decr; +- } + +- if (sdl_unlock (s, "sdl_callback")) { +- return; ++ again: ++ if (sdl_unlock (s, "sdl_callback")) { ++ return; ++ } + } ++ /* dolog ("done len=%d\n", len); */ + } + + static int sdl_write_out (SWVoiceOut *sw, void *buf, int len) +@@ -281,9 +292,18 @@ static int sdl_run_out (HWVoiceOut *hw, int live) + return 0; + } + +- sdl->live = live; +- decr = sdl->decr; +- sdl->decr = 0; ++ if (sdl->decr > live) { ++ ldebug ("sdl->decr %d live %d sdl->live %d\n", ++ sdl->decr, ++ live, ++ sdl->live); ++ } ++ ++ decr = audio_MIN (sdl->decr, live); ++ sdl->decr -= decr; ++ ++ sdl->live = live - decr; ++ hw->rpos = sdl->rpos; + + if (sdl->live > 0) { + sdl_unlock_and_post (s, "sdl_run_out"); +-- +1.7.0.4 + diff --git a/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-include-madvise-defines.patch b/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-include-madvise-defines.patch new file mode 100644 index 000000000000..c50c7172f3c6 --- /dev/null +++ b/app-emulation/qemu-kvm/files/qemu-kvm-0.12.3-include-madvise-defines.patch @@ -0,0 +1,12 @@ +--- exec.c 2010-02-26 03:34:00.000000000 +0100 ++++ exec.c.new 2010-04-03 15:31:53.000000000 +0200 +@@ -22,6 +22,9 @@ + #else + #include <sys/types.h> + #include <sys/mman.h> ++#ifndef MADV_MERGEABLE ++#include <asm/mman.h> ++#endif + #endif + #include <stdlib.h> + #include <stdio.h> |