summaryrefslogtreecommitdiff
path: root/hosts/iroha/gentoo/patches/games-util
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-11-13 11:16:51 -0500
committerAndrew Opalach <andrew@akon.city> 2024-11-13 11:16:51 -0500
commit69657cffd889bc353cbf8e83f12b46bc48f7321b (patch)
tree654050797a489bfd4064a72d7c63a0ebd09e731d /hosts/iroha/gentoo/patches/games-util
parent66ef19bafce2013f8878942e199541c8c994403c (diff)
downloaddotfiles-69657cffd889bc353cbf8e83f12b46bc48f7321b.tar.gz
dotfiles-69657cffd889bc353cbf8e83f12b46bc48f7321b.tar.bz2
dotfiles-69657cffd889bc353cbf8e83f12b46bc48f7321b.zip
Update gentoo hosts
Diffstat (limited to 'hosts/iroha/gentoo/patches/games-util')
-rw-r--r--hosts/iroha/gentoo/patches/games-util/xone/48.diff16
-rw-r--r--hosts/iroha/gentoo/patches/games-util/xone/53.diff75
2 files changed, 75 insertions, 16 deletions
diff --git a/hosts/iroha/gentoo/patches/games-util/xone/48.diff b/hosts/iroha/gentoo/patches/games-util/xone/48.diff
deleted file mode 100644
index db6f63d..0000000
--- a/hosts/iroha/gentoo/patches/games-util/xone/48.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/bus/bus.c b/bus/bus.c
-index 4a6c64f..8dc9bbb 100644
---- a/bus/bus.c
-+++ b/bus/bus.c
-@@ -56,7 +56,11 @@ static struct device_type gip_client_type = {
- .release = gip_client_release,
- };
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
- static int gip_bus_match(struct device *dev, struct device_driver *driver)
-+#else
-+static int gip_bus_match(struct device *dev, const struct device_driver *driver)
-+#endif
- {
- struct gip_client *client;
- struct gip_driver *drv;
diff --git a/hosts/iroha/gentoo/patches/games-util/xone/53.diff b/hosts/iroha/gentoo/patches/games-util/xone/53.diff
new file mode 100644
index 0000000..455452a
--- /dev/null
+++ b/hosts/iroha/gentoo/patches/games-util/xone/53.diff
@@ -0,0 +1,75 @@
+diff --git a/bus/bus.c b/bus/bus.c
+index 4a6c64f..8dc9bbb 100644
+--- a/bus/bus.c
++++ b/bus/bus.c
+@@ -56,7 +56,11 @@ static struct device_type gip_client_type = {
+ .release = gip_client_release,
+ };
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
+ static int gip_bus_match(struct device *dev, struct device_driver *driver)
++#else
++static int gip_bus_match(struct device *dev, const struct device_driver *driver)
++#endif
+ {
+ struct gip_client *client;
+ struct gip_driver *drv;
+diff --git a/driver/headset.c b/driver/headset.c
+index ebee92d..c736351 100644
+--- a/driver/headset.c
++++ b/driver/headset.c
+@@ -5,6 +5,7 @@
+
+ #include <linux/module.h>
+ #include <linux/hrtimer.h>
++#include <linux/vmalloc.h>
+ #include <sound/core.h>
+ #include <sound/initval.h>
+ #include <sound/pcm.h>
+@@ -90,13 +91,34 @@ static int gip_headset_pcm_close(struct snd_pcm_substream *sub)
+ static int gip_headset_pcm_hw_params(struct snd_pcm_substream *sub,
+ struct snd_pcm_hw_params *params)
+ {
+- return snd_pcm_lib_alloc_vmalloc_buffer(sub,
+- params_buffer_bytes(params));
++ struct snd_pcm_runtime *runtime = sub->runtime;
++ size_t size = params_buffer_bytes(params);
++
++ if (runtime->dma_area) {
++ if (runtime->dma_bytes >= size)
++ return 0; /* Already large enough */
++ vfree(runtime->dma_area);
++ }
++ runtime->dma_area = vzalloc(size);
++ if (!runtime->dma_area)
++ return -ENOMEM;
++ runtime->dma_bytes = size;
++ return 1;
+ }
+
+ static int gip_headset_pcm_hw_free(struct snd_pcm_substream *sub)
+ {
+- return snd_pcm_lib_free_vmalloc_buffer(sub);
++ struct snd_pcm_runtime *runtime = sub->runtime;
++
++ vfree(runtime->dma_area);
++ runtime->dma_area = NULL;
++ return 0;
++}
++
++static struct page *gip_headset_pcm_get_page(struct snd_pcm_substream *sub,
++ unsigned long offset)
++{
++ return vmalloc_to_page(sub->runtime->dma_area + offset);
+ }
+
+ static int gip_headset_pcm_prepare(struct snd_pcm_substream *sub)
+@@ -157,7 +179,7 @@ static const struct snd_pcm_ops gip_headset_pcm_ops = {
+ .prepare = gip_headset_pcm_prepare,
+ .trigger = gip_headset_pcm_trigger,
+ .pointer = gip_headset_pcm_pointer,
+- .page = snd_pcm_lib_get_vmalloc_page,
++ .page = gip_headset_pcm_get_page,
+ };
+
+ static bool gip_headset_advance_pointer(struct gip_headset_stream *stream,