refactoring
- overlays/{linux,wine-osu}.nix -> packages/{linux-lava,wine-osu}/
- overlays/misc/ -> overlays/patches/
- overlays/misc/0001...patch -> packages/linux-lava/si...patch
- overlays/misc/wine/ -> packages/wine-osu/patches/
- flake.nix:
- overlays are dynamically read from overlays/
- define custom packages separately
- packages/*
- now imported using callPackage
This commit is contained in:
parent
268a85c2ef
commit
d9b73bfd43
15 changed files with 210 additions and 200 deletions
129
packages/linux-lava/default.nix
Normal file
129
packages/linux-lava/default.nix
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
buildLinux,
|
||||
kernelPatches,
|
||||
lib,
|
||||
...
|
||||
} @ args:
|
||||
let
|
||||
major = "5";
|
||||
minor = "12";
|
||||
patch = "13";
|
||||
tkg = "2da317c20ed6f70085b195639b9aad2cacf31ab5";
|
||||
|
||||
mm = "${major}.${minor}";
|
||||
mmp = "${major}.${minor}.${patch}";
|
||||
|
||||
kernelUrl = name: sha256: builtins.fetchurl {
|
||||
inherit sha256;
|
||||
url = "https://cdn.kernel.org/pub/linux/kernel/v${major}.x/${name}.xz";
|
||||
};
|
||||
|
||||
tkgPatch = name: sha256: {
|
||||
inherit name;
|
||||
patch = builtins.fetchurl {
|
||||
inherit sha256;
|
||||
url = "https://raw.githubusercontent.com/Frogging-Family/linux-tkg/${tkg}/linux-tkg-patches/${mm}/${name}.patch";
|
||||
};
|
||||
};
|
||||
in buildLinux (args // {
|
||||
version = "${mmp}-tkg-Lava";
|
||||
isZen = true;
|
||||
# TODO:
|
||||
# some stuff is set in pkgs/os-specific/linux/kernel/common-config.nix
|
||||
# but i have no idea how to change it
|
||||
structuredExtraConfig = with lib.kernel; builtins.mapAttrs (_: value: lib.mkForce value) {
|
||||
LOCALVERSION = freeform "-tkg-Lava";
|
||||
ZENIFY = yes;
|
||||
FUTEX2 = yes;
|
||||
MHASWELL = yes;
|
||||
WINESYNC = module;
|
||||
|
||||
# timers
|
||||
HZ_PERIODIC = no;
|
||||
NO_HZ = yes;
|
||||
NO_HZ_COMMON = yes;
|
||||
NO_HZ_FULL = yes;
|
||||
NO_HZ_IDLE = no;
|
||||
CONTEXT_TRACKING = yes;
|
||||
CONTEXT_TRACKING_FORCE = yes;
|
||||
# HZ_100 = yes;
|
||||
HZ_1000 = yes;
|
||||
HZ_1000_NODEF = yes;
|
||||
|
||||
# preempt
|
||||
PREEMPT = yes;
|
||||
PREEMPT_COUNT = yes;
|
||||
PREEMPT_VOLUNTARY = no;
|
||||
PREEMPTION = yes;
|
||||
PREEMPT_DYNAMIC = yes;
|
||||
|
||||
# scheduler
|
||||
# SCHED_ALT = yes;
|
||||
# SCHED_PDS = yes;
|
||||
CACULE_SCHED = yes;
|
||||
|
||||
# cacule stuff
|
||||
SCHED_AUTOGROUP = yes;
|
||||
BSD_PROCESS_ACCT = no;
|
||||
TASK_XACCT = no;
|
||||
CGROUP_CPUACCT = no;
|
||||
CGROUP_DEBUG = no;
|
||||
|
||||
# disable numa
|
||||
NUMA = no;
|
||||
AMD_NUMA = no;
|
||||
X86_64_ACPI_NUMA = no;
|
||||
NODES_SPAN_OTHER_NODES = no;
|
||||
NUMA_EMU = no;
|
||||
NEED_MULTIPLE_NODES = no;
|
||||
USE_PERCPU_NUMA_NODE_ID = no;
|
||||
ACPI_NUMA = no;
|
||||
|
||||
# disable misc debugging
|
||||
SLUB_DEBUG = no;
|
||||
PM_DEBUG = no;
|
||||
PM_ADVANCED_DEBUG = no;
|
||||
PM_SLEEP_DEBUG = no;
|
||||
ACPI_DEBUG = no;
|
||||
SCHED_DEBUG = no;
|
||||
LATENCYTOP = no;
|
||||
DEBUG_PREEMPT = no;
|
||||
};
|
||||
ignoreConfigErrors = true;
|
||||
|
||||
src = kernelUrl "linux-${mm}.tar" "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx";
|
||||
kernelPatches = [
|
||||
# Kernel version patch
|
||||
{
|
||||
name = "patch-${patch}";
|
||||
patch = kernelUrl "patch-${mmp}" "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4";
|
||||
}
|
||||
|
||||
# AMD SI manual clocking
|
||||
{
|
||||
name = "si-clock";
|
||||
patch = ./si-manual-clocking.patch;
|
||||
}
|
||||
|
||||
# Graysky gcc patches
|
||||
{
|
||||
name = "graysky-gcc";
|
||||
patch = builtins.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/d2e7942c19ee568638d3795cf52db5274a90ce0a/more-uarches-for-kernel-5.8+.patch";
|
||||
sha256 = "16jbknjlg12jxbj8cjkk01djvr01n9zz7qlzxppcqizmz55vk0wh";
|
||||
};
|
||||
}
|
||||
|
||||
# TK-Glitch patches
|
||||
( tkgPatch "0002-clear-patches" "1h1gx6rq2c961d36z1szqv9xpq1xgz2bhqjsyb03jjdrdzlcv9rm" )
|
||||
( tkgPatch "0003-cacule-${mm}" "1rgdk1x514xsjwcjjcdmggbaj6biql5p41skn98ysqbjaw7k22ib" )
|
||||
( tkgPatch "0003-glitched-base" "1dg177i3y54z5nadc5678hm67angram2vlr314mpxv3jgsh7vj8s" )
|
||||
( tkgPatch "0003-glitched-cfs" "1cm4s72pymxnh37da84qrzvrwbbwagk46m1xsk99ir7cjb1l1zay" )
|
||||
# ( tkgPatch "0005-glitched-pds" "0833awp8n9ngyl5spx8znwyw1lj3nacp8vg7ffysw0j5r8akv9pw" )
|
||||
( tkgPatch "0007-v${mm}-fsync" "0mplwdglw58bmkkxix4ccwgax3r02gahax9042dx33mybdnbl0mk" )
|
||||
( tkgPatch "0007-v${mm}-futex2_interface" "1j29zyx2s85scfhbprgb9cs11rp50glbzczl4plphli8wds342pw" )
|
||||
( tkgPatch "0007-v${mm}-winesync" "1av2k86ns0zc3lmgbfdch1z2a808brp2jvsfl4cwwlwwb51qzipp" )
|
||||
# ( tkgPatch "0009-prjc_v${mm}-r1" "1z731jiwyc7z4d5hzd6szrxnvw0iygbqx82y2anzm32n22731dqv" )
|
||||
( tkgPatch "0012-misc-additions" "092ws9v1snk61i6x3gbqm5m803zd81wykkdxizn7knvy2r611cbz")
|
||||
];
|
||||
} // (args.argsOverride or {}))
|
||||
216
packages/linux-lava/si-manual-clocking.patch
Normal file
216
packages/linux-lava/si-manual-clocking.patch
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
From 5d133651479c4be74cd7eb8006fc43366c9b15b9 Mon Sep 17 00:00:00 2001
|
||||
From: LavaDesu <me@lava.moe>
|
||||
Date: Wed, 3 Mar 2021 17:37:38 +0700
|
||||
Subject: [PATCH] Lava's amdgpu patches
|
||||
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +-
|
||||
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 111 +++++++++++++++++++-
|
||||
drivers/gpu/drm/amd/pm/powerplay/si_dpm.c | 17 +++
|
||||
4 files changed, 130 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
index 29885febc0b0..2ed893e8983c 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
|
||||
@@ -191,6 +191,12 @@ extern int amdgpu_discovery;
|
||||
extern int amdgpu_mes;
|
||||
extern int amdgpu_noretry;
|
||||
extern int amdgpu_force_asic_type;
|
||||
+
|
||||
+extern __u32 amdgpu_force_mclk;
|
||||
+extern __u32 amdgpu_force_sclk;
|
||||
+extern __u32 amdgpu_force_vddc;
|
||||
+extern __u32 amdgpu_force_vddci;
|
||||
+
|
||||
#ifdef CONFIG_HSA_AMD
|
||||
extern int sched_policy;
|
||||
extern bool debug_evictions;
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
index 47e0b48dc26f..f1e4485a60b2 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
|
||||
@@ -146,7 +146,7 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
|
||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
|
||||
int r;
|
||||
|
||||
- if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, true) < 0)
|
||||
+ if (pci_p2pdma_distance_many(adev->pdev, &attach->dev, 1, amdgpu_dpm == 1) < 0)
|
||||
attach->peer2peer = false;
|
||||
|
||||
if (attach->dev->driver == adev->dev->driver)
|
||||
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
index 5fa65f191a37..8a90331da0e5 100644
|
||||
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
|
||||
@@ -39,6 +39,11 @@
|
||||
#include <asm/processor.h>
|
||||
#include "hwmgr.h"
|
||||
|
||||
+__u32 amdgpu_force_mclk = 0;
|
||||
+__u32 amdgpu_force_sclk = 0;
|
||||
+__u32 amdgpu_force_vddc = 0;
|
||||
+__u32 amdgpu_force_vddci = 0;
|
||||
+
|
||||
static const struct cg_flag_name clocks[] = {
|
||||
{AMD_CG_SUPPORT_GFX_FGCG, "Graphics Fine Grain Clock Gating"},
|
||||
{AMD_CG_SUPPORT_GFX_MGCG, "Graphics Medium Grain Clock Gating"},
|
||||
@@ -2167,6 +2172,94 @@ static ssize_t amdgpu_get_gpu_metrics(struct device *dev,
|
||||
return size;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * DOC: pp_override_mclk
|
||||
+ *
|
||||
+ * It's like pp_od_clk_voltage but worse and can potentially destroy your gpu idk
|
||||
+ */
|
||||
+static ssize_t amdgpu_get_pp_override_mclk(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ DRM_INFO("[Lava] Read pp_override_mclk\n");
|
||||
+ return sprintf(buf, "%u", amdgpu_force_mclk);
|
||||
+}
|
||||
+static ssize_t amdgpu_set_pp_override_mclk(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t count)
|
||||
+{
|
||||
+ sscanf(buf, "%u", &amdgpu_force_mclk);
|
||||
+ DRM_INFO("[Lava] Write pp_override_mclk, %u\n", amdgpu_force_mclk);
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * DOC: pp_override_sclk
|
||||
+ *
|
||||
+ * pp_override_mclk but sclk
|
||||
+ */
|
||||
+static ssize_t amdgpu_get_pp_override_sclk(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ DRM_INFO("[Lava] Read pp_override_sclk\n");
|
||||
+ return sprintf(buf, "%u", amdgpu_force_sclk);
|
||||
+}
|
||||
+static ssize_t amdgpu_set_pp_override_sclk(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t count)
|
||||
+{
|
||||
+ sscanf(buf, "%u", &amdgpu_force_sclk);
|
||||
+ DRM_INFO("[Lava] Write pp_override_sclk, %u\n", amdgpu_force_sclk);
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * DOC: pp_override_vddc
|
||||
+ *
|
||||
+ * pp_override_mclk but vddc
|
||||
+ */
|
||||
+static ssize_t amdgpu_get_pp_override_vddc(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ DRM_INFO("[Lava] Read pp_override_vddc\n");
|
||||
+ return sprintf(buf, "%u", amdgpu_force_vddc);
|
||||
+}
|
||||
+static ssize_t amdgpu_set_pp_override_vddc(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t count)
|
||||
+{
|
||||
+ sscanf(buf, "%u", &amdgpu_force_vddc);
|
||||
+ DRM_INFO("[Lava] Write pp_override_vddc, %u\n", amdgpu_force_vddc);
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * DOC: pp_override_vddci
|
||||
+ *
|
||||
+ * pp_override_mclk but vddci
|
||||
+ */
|
||||
+static ssize_t amdgpu_get_pp_override_vddci(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ DRM_INFO("[Lava] Read pp_override_vddci\n");
|
||||
+ return sprintf(buf, "%u", amdgpu_force_vddci);
|
||||
+}
|
||||
+static ssize_t amdgpu_set_pp_override_vddci(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ const char *buf,
|
||||
+ size_t count)
|
||||
+{
|
||||
+ sscanf(buf, "%u", &amdgpu_force_vddci);
|
||||
+ DRM_INFO("[Lava] Write pp_override_vddci, %u\n", amdgpu_force_vddci);
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
static struct amdgpu_device_attr amdgpu_device_attrs[] = {
|
||||
AMDGPU_DEVICE_ATTR_RW(power_dpm_state, ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
|
||||
AMDGPU_DEVICE_ATTR_RW(power_dpm_force_performance_level, ATTR_FLAG_BASIC),
|
||||
@@ -2193,6 +2286,10 @@ static struct amdgpu_device_attr amdgpu_device_attrs[] = {
|
||||
AMDGPU_DEVICE_ATTR_RO(unique_id, ATTR_FLAG_BASIC),
|
||||
AMDGPU_DEVICE_ATTR_RW(thermal_throttling_logging, ATTR_FLAG_BASIC),
|
||||
AMDGPU_DEVICE_ATTR_RO(gpu_metrics, ATTR_FLAG_BASIC),
|
||||
+ AMDGPU_DEVICE_ATTR_RW(pp_override_mclk, ATTR_FLAG_BASIC),
|
||||
+ AMDGPU_DEVICE_ATTR_RW(pp_override_sclk, ATTR_FLAG_BASIC),
|
||||
+ AMDGPU_DEVICE_ATTR_RW(pp_override_vddc, ATTR_FLAG_BASIC),
|
||||
+ AMDGPU_DEVICE_ATTR_RW(pp_override_vddci, ATTR_FLAG_BASIC),
|
||||
};
|
||||
|
||||
static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_attr *attr,
|
||||
@@ -2220,11 +2317,15 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
|
||||
if (asic_type < CHIP_VEGA20)
|
||||
*states = ATTR_STATE_UNSUPPORTED;
|
||||
} else if (DEVICE_ATTR_IS(pp_od_clk_voltage)) {
|
||||
- *states = ATTR_STATE_UNSUPPORTED;
|
||||
- if ((is_support_sw_smu(adev) && adev->smu.od_enabled) ||
|
||||
- (is_support_sw_smu(adev) && adev->smu.is_apu) ||
|
||||
- (!is_support_sw_smu(adev) && hwmgr->od_enabled))
|
||||
- *states = ATTR_STATE_SUPPORTED;
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_mclk)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_sclk)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_vddc)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
+ } else if (DEVICE_ATTR_IS(pp_override_vddci)) {
|
||||
+ *states = ATTR_STATE_SUPPORTED;
|
||||
} else if (DEVICE_ATTR_IS(mem_busy_percent)) {
|
||||
if (adev->flags & AMD_IS_APU || asic_type == CHIP_VEGA10)
|
||||
*states = ATTR_STATE_UNSUPPORTED;
|
||||
diff --git a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
index afa1711c9620..74b847bf83e0 100644
|
||||
--- a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
+++ b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c
|
||||
@@ -3492,6 +3492,23 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
|
||||
&max_mclk_vddc);
|
||||
|
||||
for (i = 0; i < ps->performance_level_count; i++) {
|
||||
+ if (amdgpu_force_mclk) {
|
||||
+ if (ps->performance_levels[i].mclk > amdgpu_force_mclk)
|
||||
+ ps->performance_levels[i].mclk = amdgpu_force_mclk;
|
||||
+ }
|
||||
+ if (amdgpu_force_sclk) {
|
||||
+ if (ps->performance_levels[i].sclk > amdgpu_force_sclk)
|
||||
+ ps->performance_levels[i].sclk = amdgpu_force_sclk;
|
||||
+ }
|
||||
+ if (amdgpu_force_vddc) {
|
||||
+ if (ps->performance_levels[i].vddc > amdgpu_force_vddc)
|
||||
+ ps->performance_levels[i].vddc = amdgpu_force_vddc;
|
||||
+ }
|
||||
+ if (amdgpu_force_vddci) {
|
||||
+ if (ps->performance_levels[i].vddci > amdgpu_force_vddci)
|
||||
+ ps->performance_levels[i].vddci = amdgpu_force_vddci;
|
||||
+ }
|
||||
+
|
||||
if (max_sclk_vddc) {
|
||||
if (ps->performance_levels[i].sclk > max_sclk_vddc)
|
||||
ps->performance_levels[i].sclk = max_sclk_vddc;
|
||||
--
|
||||
2.31.1
|
||||
|
||||
51
packages/wine-osu/default.nix
Normal file
51
packages/wine-osu/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
getPaths,
|
||||
winePackages,
|
||||
wineUnstable,
|
||||
wineStaging,
|
||||
...
|
||||
}:
|
||||
# TODO: Use winePackages.callPackage
|
||||
(wineStaging.overrideDerivation(o: {
|
||||
patches = (o.patches or []) ++ getPaths ./patches;
|
||||
})).override {
|
||||
wineRelease = "staging";
|
||||
wineBuild = "wineWow";
|
||||
|
||||
pngSupport = true;
|
||||
jpegSupport = true;
|
||||
tiffSupport = true;
|
||||
gettextSupport = true;
|
||||
fontconfigSupport = true;
|
||||
alsaSupport = true;
|
||||
gtkSupport = true;
|
||||
openglSupport = true;
|
||||
tlsSupport = true;
|
||||
gstreamerSupport = true;
|
||||
#cupsSupport = true;
|
||||
colorManagementSupport = true;
|
||||
dbusSupport = true;
|
||||
mpg123Support = true;
|
||||
#openalSupport = true;
|
||||
#openclSupport = true;
|
||||
#cairoSupport = true;
|
||||
#odbcSupport = true;
|
||||
netapiSupport = true;
|
||||
cursesSupport = true;
|
||||
vaSupport = true;
|
||||
pcapSupport = true;
|
||||
#v4lSupport = true;
|
||||
#saneSupport = true;
|
||||
gsmSupport = true;
|
||||
#gphoto2Support = true;
|
||||
#ldapSupport = true;
|
||||
pulseaudioSupport = true;
|
||||
udevSupport = true;
|
||||
xineramaSupport = true;
|
||||
xmlSupport = true;
|
||||
vulkanSupport = true;
|
||||
sdlSupport = true;
|
||||
faudioSupport = true;
|
||||
vkd3dSupport = true;
|
||||
mingwSupport = true;
|
||||
}
|
||||
11241
packages/wine-osu/patches/0001-Revert-to-5.14-winepulse.drv.patch
Normal file
11241
packages/wine-osu/patches/0001-Revert-to-5.14-winepulse.drv.patch
Normal file
File diff suppressed because it is too large
Load diff
59
packages/wine-osu/patches/0002-5.14-Latency-Fix.patch
Normal file
59
packages/wine-osu/patches/0002-5.14-Latency-Fix.patch
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
From 4a2c23db4eddd827ac81513af43bc92475ad7d3a Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian 'gonX' Jensen <gonx@gonx.dk>
|
||||
Date: Sun, 20 Jun 2021 17:02:15 +0200
|
||||
Subject: [PATCH 2/4] 5.14 Latency Fix
|
||||
|
||||
---
|
||||
dlls/winepulse.drv/mmdevdrv.c | 22 ++++++++++++++--------
|
||||
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c
|
||||
index 07407089ac5af65eb13d6e00b6d0969a61ec5589..3ed47e38c830987e4bcc2e9f5c59c7773fe686f1 100644
|
||||
--- a/dlls/winepulse.drv/mmdevdrv.c
|
||||
+++ b/dlls/winepulse.drv/mmdevdrv.c
|
||||
@@ -68,9 +68,6 @@ enum DriverPriority {
|
||||
Priority_Preferred
|
||||
};
|
||||
|
||||
-static const REFERENCE_TIME MinimumPeriod = 30000;
|
||||
-static const REFERENCE_TIME DefaultPeriod = 100000;
|
||||
-
|
||||
static pa_context *pulse_ctx;
|
||||
static pa_mainloop *pulse_ml;
|
||||
|
||||
@@ -510,11 +507,12 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) {
|
||||
if (length)
|
||||
pulse_def_period[!render] = pulse_min_period[!render] = pa_bytes_to_usec(10 * length, &ss);
|
||||
|
||||
- if (pulse_min_period[!render] < MinimumPeriod)
|
||||
- pulse_min_period[!render] = MinimumPeriod;
|
||||
-
|
||||
- if (pulse_def_period[!render] < DefaultPeriod)
|
||||
- pulse_def_period[!render] = DefaultPeriod;
|
||||
+ const char* penv = getenv("STAGING_AUDIO_PERIOD");
|
||||
+ if (penv) {
|
||||
+ int val = atoi(penv);
|
||||
+ pulse_def_period[!render] = pulse_min_period[!render] = val;
|
||||
+ printf("Staging audio period set to %d.\n", val);
|
||||
+ }
|
||||
|
||||
wfx->wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx->cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
@@ -1640,6 +1638,14 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient2 *iface,
|
||||
if (duration <= 2 * period)
|
||||
period /= 2;
|
||||
}
|
||||
+
|
||||
+ const char* denv = getenv("STAGING_AUDIO_DURATION");
|
||||
+ if (denv) {
|
||||
+ int val = atoi(denv);
|
||||
+ duration = val;
|
||||
+ printf("Staging audio duration set to %d.\n", val);
|
||||
+ }
|
||||
+
|
||||
period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000);
|
||||
|
||||
if (duration < 20000000)
|
||||
--
|
||||
2.32.0
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
From e17fb0bda3c042beec05b918e2d171211742e01c Mon Sep 17 00:00:00 2001
|
||||
From: Torge Matthies <openglfreak@googlemail.com>
|
||||
Date: Fri, 12 Feb 2021 13:58:35 +0100
|
||||
Subject: [PATCH 3/4] secur32: Fix crash from invalid context in
|
||||
InitializeSecurityContextW.
|
||||
|
||||
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
|
||||
---
|
||||
dlls/secur32/schannel.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
|
||||
index 9c7e98b32a4c55588a78ac6c3811b89db9e09db7..b2baefbc8caaf370c9c0ec31b7daf4cc9bb7fbb8 100644
|
||||
--- a/dlls/secur32/schannel.c
|
||||
+++ b/dlls/secur32/schannel.c
|
||||
@@ -983,6 +983,7 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
|
||||
unsigned char *ptr;
|
||||
|
||||
ctx = schan_get_object(phContext->dwLower, SCHAN_HANDLE_CTX);
|
||||
+ if (!ctx) return SEC_E_INVALID_HANDLE;
|
||||
if (pInput)
|
||||
{
|
||||
idx = schan_find_sec_buffer_idx(pInput, 0, SECBUFFER_TOKEN);
|
||||
--
|
||||
2.32.0
|
||||
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
From b1ac42097f6f6e038a2e1fac773bc31e829fb891 Mon Sep 17 00:00:00 2001
|
||||
From: Torge Matthies <openglfreak@googlemail.com>
|
||||
Date: Mon, 5 Apr 2021 05:48:28 +0200
|
||||
Subject: [PATCH 4/4] kernelbase: Cache last used locale->sortguid mapping.
|
||||
|
||||
get_language_sort reads from the registry, which is not particularly fast.
|
||||
Staging's implementation of CompareStringEx calls this function, and if
|
||||
CompareStringEx is used in a loop over many elements, it will slow down the
|
||||
application by a lot (> 30 seconds vs a few hundred ms in osu!, depends
|
||||
on the CPU and the number of installed beatmaps).
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50923
|
||||
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
|
||||
---
|
||||
dlls/kernelbase/locale.c | 42 +++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 41 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
|
||||
index 89b3577505348a001577ba3549b8af2d1e6cb456..db97383f2858455f8c329f326d4b3f9f3ec606cb 100644
|
||||
--- a/dlls/kernelbase/locale.c
|
||||
+++ b/dlls/kernelbase/locale.c
|
||||
@@ -619,6 +619,21 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
|
||||
};
|
||||
static CRITICAL_SECTION locale_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
|
||||
+static struct
|
||||
+{
|
||||
+ WCHAR locale[LOCALE_NAME_MAX_LENGTH]; /* The locale name */
|
||||
+ const struct sortguid *guid; /* The cached associated GUID */
|
||||
+} sortguid_cache;
|
||||
+
|
||||
+static CRITICAL_SECTION sortguid_cache_section;
|
||||
+static CRITICAL_SECTION_DEBUG sortguid_cache_section_debug =
|
||||
+{
|
||||
+ 0, 0, &sortguid_cache_section,
|
||||
+ { &sortguid_cache_section_debug.ProcessLocksList, &sortguid_cache_section_debug.ProcessLocksList },
|
||||
+ 0, 0, { (DWORD_PTR)(__FILE__ ": sortguid_cache_section") }
|
||||
+};
|
||||
+static CRITICAL_SECTION sortguid_cache_section = { &sortguid_cache_section_debug, -1, 0, 0, 0, 0 };
|
||||
+
|
||||
|
||||
static void init_sortkeys( DWORD *ptr )
|
||||
{
|
||||
@@ -656,7 +671,7 @@ static const struct sortguid *find_sortguid( const GUID *guid )
|
||||
}
|
||||
|
||||
|
||||
-static const struct sortguid *get_language_sort( const WCHAR *locale )
|
||||
+static const struct sortguid *get_language_sort_uncached( const WCHAR *locale )
|
||||
{
|
||||
WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39];
|
||||
const struct sortguid *ret;
|
||||
@@ -699,6 +714,31 @@ done:
|
||||
}
|
||||
|
||||
|
||||
+static const struct sortguid *get_language_sort( const WCHAR *locale )
|
||||
+{
|
||||
+ const struct sortguid *ret = NULL;
|
||||
+
|
||||
+ if (!locale) return get_language_sort_uncached( locale );
|
||||
+
|
||||
+ RtlEnterCriticalSection( &sortguid_cache_section );
|
||||
+
|
||||
+ if (sortguid_cache.guid && !wcsncmp( sortguid_cache.locale, locale, LOCALE_NAME_MAX_LENGTH ))
|
||||
+ {
|
||||
+ ret = sortguid_cache.guid;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = get_language_sort_uncached( locale );
|
||||
+
|
||||
+ lstrcpynW( sortguid_cache.locale, locale, LOCALE_NAME_MAX_LENGTH );
|
||||
+ sortguid_cache.guid = ret;
|
||||
+
|
||||
+done:
|
||||
+ RtlLeaveCriticalSection( &sortguid_cache_section );
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static LCID locale_to_lcid( WCHAR *win_name )
|
||||
{
|
||||
WCHAR *p;
|
||||
--
|
||||
2.32.0
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue