diff options
author | Térence Clastres | 2019-08-07 05:24:29 +0200 |
---|---|---|
committer | Térence Clastres | 2019-08-07 05:24:29 +0200 |
commit | 640bd253dc9fd3c1ba8bdd6d125cf94f63937b02 (patch) | |
tree | 72b6ebb202b9db49ab4298e598078179a71f4e84 | |
parent | c2060791d43149358912b70b24782ddcc4db1472 (diff) | |
download | aur-640bd253dc9fd3c1ba8bdd6d125cf94f63937b02.tar.gz |
Update patch and fetch it directly from source, misc cleanups
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | Makefile.diff | 37 | ||||
-rw-r--r-- | PKGBUILD | 35 | ||||
-rw-r--r-- | dkms.conf | 3 | ||||
-rw-r--r-- | hda_intel.diff | 101 | ||||
-rw-r--r-- | hdac_stream.diff | 15 |
7 files changed, 66 insertions, 147 deletions
@@ -1,7 +1,7 @@ pkgbase = snd_hda_intel-amd-hd-audio-fix-dkms pkgdesc = The snd_hda_intel kernel driver, patched to remove crackling on AMD HD-audio controller pkgver = 1 - pkgrel = 1 + pkgrel = 2 url = https://bugzilla.kernel.org/show_bug.cgi?id=195303 arch = x86_64 license = GPL2 @@ -10,16 +10,16 @@ pkgbase = snd_hda_intel-amd-hd-audio-fix-dkms replaces = snd_hda_intel-alc1220-dkms source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.2.tar.xz source = https://www.kernel.org/pub/linux/kernel/v5.x/patch-5.2.5.xz - source = hda_intel.diff - source = hdac_stream.diff + source = patch-7.diff::https://bugzilla.kernel.org/attachment.cgi?id=284221 source = dkms.conf source = Makefile + source = Makefile.diff md5sums = ddf994de00d7b18395886dd9b30b9262 md5sums = 0bfed20acab24d45232983b54339a3c9 - md5sums = 867d3d27fb1716290c76d90ffb739343 - md5sums = b5f5cf9b9a7e0c5852d290992eb73b68 - md5sums = 20495ab7a2c425ba786c44d53d458909 - md5sums = 4cf63656de83b4321d6261289735d1e1 + md5sums = e0d0c2c46caaff7039d74b6c54360af9 + md5sums = 8239975d93c5b07c11b092386ba9aa86 + md5sums = 7168339cf224bcd7927614fd608435a6 + md5sums = 77d3d06692c18e1504163a0a05521ac0 pkgname = snd_hda_intel-amd-hd-audio-fix-dkms @@ -7,12 +7,14 @@ endif KDIR := /usr/lib/modules/$(KRELEASE)/build PWD := $(shell pwd) SRCDIR := $(PWD)/hda-src -MODULENAME := snd-hda-intel.ko +MODULESNAME := snd-hda-intel.ko,snd-hda-codec.ko + default: $(Q)cd $(SRCDIR) $(MAKE) -j 1 -C $(KDIR) M=$(SRCDIR) modules - $(Q)cp $(SRCDIR)/$(MODULENAME) $(PWD) + $(Q)cp $(SRCDIR)/{$(MODULESNAME)} $(PWD) clean: $(MAKE) -C $(KDIR) M=$(SRCDIR) clean - $(Q)rm $(PWD)/$(MODULENAME) + $(Q)rm $(PWD)/{$(MODULESNAME)} + diff --git a/Makefile.diff b/Makefile.diff new file mode 100644 index 000000000000..f7155ed406bf --- /dev/null +++ b/Makefile.diff @@ -0,0 +1,37 @@ +3d2 +< snd-hda-tegra-objs := hda_tegra.o +5c4 +< snd-hda-codec-y := hda_bind.o hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o +--- +> snd-hda-codec-y := hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o +16,28d14 +< snd-hda-codec-generic-objs := hda_generic.o +< snd-hda-codec-realtek-objs := patch_realtek.o +< snd-hda-codec-cmedia-objs := patch_cmedia.o +< snd-hda-codec-analog-objs := patch_analog.o +< snd-hda-codec-idt-objs := patch_sigmatel.o +< snd-hda-codec-si3054-objs := patch_si3054.o +< snd-hda-codec-cirrus-objs := patch_cirrus.o +< snd-hda-codec-ca0110-objs := patch_ca0110.o +< snd-hda-codec-ca0132-objs := patch_ca0132.o +< snd-hda-codec-conexant-objs := patch_conexant.o +< snd-hda-codec-via-objs := patch_via.o +< snd-hda-codec-hdmi-objs := patch_hdmi.o hda_eld.o +< +32,45d17 +< # codec drivers +< obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o +< obj-$(CONFIG_SND_HDA_CODEC_REALTEK) += snd-hda-codec-realtek.o +< obj-$(CONFIG_SND_HDA_CODEC_CMEDIA) += snd-hda-codec-cmedia.o +< obj-$(CONFIG_SND_HDA_CODEC_ANALOG) += snd-hda-codec-analog.o +< obj-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += snd-hda-codec-idt.o +< obj-$(CONFIG_SND_HDA_CODEC_SI3054) += snd-hda-codec-si3054.o +< obj-$(CONFIG_SND_HDA_CODEC_CIRRUS) += snd-hda-codec-cirrus.o +< obj-$(CONFIG_SND_HDA_CODEC_CA0110) += snd-hda-codec-ca0110.o +< obj-$(CONFIG_SND_HDA_CODEC_CA0132) += snd-hda-codec-ca0132.o +< obj-$(CONFIG_SND_HDA_CODEC_CONEXANT) += snd-hda-codec-conexant.o +< obj-$(CONFIG_SND_HDA_CODEC_VIA) += snd-hda-codec-via.o +< obj-$(CONFIG_SND_HDA_CODEC_HDMI) += snd-hda-codec-hdmi.o +< +50d21 +< obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o @@ -6,7 +6,7 @@ _basekernel=5.2 _sub=5 _k_pkgver=${_basekernel}.${_sub} pkgver=1 -pkgrel=1 +pkgrel=2 pkgdesc="The snd_hda_intel kernel driver, patched to remove crackling on AMD HD-audio controller" arch=('x86_64') url="https://bugzilla.kernel.org/show_bug.cgi?id=195303" @@ -16,36 +16,31 @@ conflicts=(snd_hda_intel-alc1220-dkms) replaces=(snd_hda_intel-alc1220-dkms) source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${_basekernel}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v5.x/patch-${_k_pkgver}.xz" - "hda_intel.diff" - "hdac_stream.diff" + "patch-7.diff::https://bugzilla.kernel.org/attachment.cgi?id=284221" 'dkms.conf' - 'Makefile') + 'Makefile' + 'Makefile.diff') md5sums=('ddf994de00d7b18395886dd9b30b9262' '0bfed20acab24d45232983b54339a3c9' - '867d3d27fb1716290c76d90ffb739343' - 'b5f5cf9b9a7e0c5852d290992eb73b68' - '20495ab7a2c425ba786c44d53d458909' - '4cf63656de83b4321d6261289735d1e1') + 'e0d0c2c46caaff7039d74b6c54360af9' + '8239975d93c5b07c11b092386ba9aa86' + '7168339cf224bcd7927614fd608435a6' + '77d3d06692c18e1504163a0a05521ac0') prepare() { - mkdir -p "${srcdir}/${_pkgbase}" && cd "${srcdir}/${_pkgbase}" - - cp ../dkms.conf ../hda*.diff ../Makefile . + mkdir -p "${srcdir}/${_pkgbase}" cd "${srcdir}/linux-${_basekernel}" # add upstream patch patch -p1 -i ../patch-"${_k_pkgver}" - mkdir -p "${srcdir}"/hda-src/{hdacore,include/dkms/{sound,uapi/sound}} - cp -r sound/hda/* "${srcdir}/hda-src/hdacore" - cp sound/pci/hda/* "${srcdir}/hda-src" - cp -r include/{sound/hda*,sound/tlv.h} "${srcdir}/hda-src/include/dkms/sound" - cp include/uapi/sound/* "${srcdir}/hda-src/include/dkms/uapi/sound" || true + mkdir -p "${srcdir}"/hda-src + cp sound/pci/hda/hda_{auto_parser.{c,h},beep.h,codec.c,controller{.c,.h,_trace.h},hwdep.c,intel{.c,.h,_trace.h},jack.{c,h},local.h,proc.c,sysfs.c} "${srcdir}"/hda-src + cp sound/pci/hda/Makefile "${srcdir}"/hda-src cd "${srcdir}/hda-src" - patch -Np4 < ../hda_intel.diff - patch -Np1 < ../hdac_stream.diff - + patch -Np1 < ../Makefile.diff Makefile + patch -Np4 < ../patch-7.diff } package() { @@ -57,8 +52,6 @@ package() { -e "s/@PKGVER@/${pkgver}/" \ -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf" -# readlink -f . -# exit # Copy sources (including Makefile) cp -r "${srcdir}"/{hda*,Makefile} "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/" } diff --git a/dkms.conf b/dkms.conf index c2f61d9dc382..e92f08f2616c 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,6 +1,9 @@ PACKAGE_NAME="@_PKGBASE@" PACKAGE_VERSION="@PKGVER@" BUILT_MODULE_NAME[0]="snd-hda-intel" +BUILT_MODULE_NAME[1]="snd-hda-codec" MAKE[0]="make" +MAKE[1]="make" DEST_MODULE_LOCATION[0]="/kernel/sound/pci/hda/" +DEST_MODULE_LOCATION[1]="/kernel/sound/pci/hda/" AUTOINSTALL="yes" diff --git a/hda_intel.diff b/hda_intel.diff deleted file mode 100644 index 32d43708d934..000000000000 --- a/hda_intel.diff +++ /dev/null @@ -1,101 +0,0 @@ ---- a/sound/pci/hda/hda_intel.c -+++ a/sound/pci/hda/hda_intel.c -@@ -64,6 +64,7 @@ enum { - POS_FIX_VIACOMBO, - POS_FIX_COMBO, - POS_FIX_SKL, -+ POS_FIX_AMD, - }; - - /* Defines for ATI HD Audio support in SB450 south bridge */ -@@ -258,6 +259,7 @@ enum { - AZX_DRIVER_ATI, - AZX_DRIVER_ATIHDMI, - AZX_DRIVER_ATIHDMI_NS, -+ AZX_DRIVER_AMD, - AZX_DRIVER_VIA, - AZX_DRIVER_SIS, - AZX_DRIVER_ULI, -@@ -371,6 +373,7 @@ static char *driver_short_names[] = { - [AZX_DRIVER_ATI] = "HDA ATI SB", - [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", - [AZX_DRIVER_ATIHDMI_NS] = "HDA ATI HDMI", -+ [AZX_DRIVER_AMD] = "HD-Audio Generic", /* kept old name for compatibility */ - [AZX_DRIVER_VIA] = "HDA VIA VT82xx", - [AZX_DRIVER_SIS] = "HDA SIS966", - [AZX_DRIVER_ULI] = "HDA ULI M5461", -@@ -841,6 +844,37 @@ static unsigned int azx_via_get_position(struct azx *chip, - return bound_pos + mod_dma_pos; - } - -+/* get the current DMA position with correction on AMD chips */ -+static unsigned int azx_get_pos_amd(struct azx *chip, struct azx_dev *azx_dev) -+{ -+ unsigned int link_pos, fifo_size; -+ -+ link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); -+ -+#if 0 /* FIXME: do we need a correction for playback, too? */ -+ if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) -+ return link_pos; -+#endif -+ -+#if 1 /* FIXME: is this reliably readable on AMD platform (and correct?) */ -+ fifo_size = readw(azx_bus(chip)->remap_addr + -+ VIA_IN_STREAM0_FIFO_SIZE_OFFSET); -+#else /* FIXME: ... or better to use fifo_size per stream? */ -+ fifo_size = azx_dev->core.fifo_size; -+#endif -+ -+ if (azx_dev->insufficient) { -+ if (link_pos <= fifo_size) -+ return 0; -+ azx_dev->insufficient = 0; -+ } -+ -+ if (link_pos < fifo_size) -+ link_pos += azx_dev->core.bufsize; -+ link_pos -= fifo_size; -+ return link_pos; -+} -+ - static unsigned int azx_skl_get_dpib_pos(struct azx *chip, - struct azx_dev *azx_dev) - { -@@ -1417,6 +1451,7 @@ static int check_position_fix(struct azx *chip, int fix) - case POS_FIX_VIACOMBO: - case POS_FIX_COMBO: - case POS_FIX_SKL: -+ case POS_FIX_AMD: - return fix; - } - -@@ -1432,6 +1467,9 @@ static int check_position_fix(struct azx *chip, int fix) - if (chip->driver_type == AZX_DRIVER_VIA) { - dev_dbg(chip->card->dev, "Using VIACOMBO position fix\n"); - return POS_FIX_VIACOMBO; -+ } else if (chip->driver_type == AZX_DRIVER_AMD) { -+ dev_dbg(chip->card->dev, "Using AMD position fix\n"); -+ return POS_FIX_AMD; - } - if (chip->driver_caps & AZX_DCAPS_POSFIX_LPIB) { - dev_dbg(chip->card->dev, "Using LPIB position fix\n"); -@@ -1453,6 +1491,7 @@ static void assign_position_fix(struct azx *chip, int fix) - [POS_FIX_VIACOMBO] = azx_via_get_position, - [POS_FIX_COMBO] = azx_get_pos_lpib, - [POS_FIX_SKL] = azx_get_pos_skl, -+ [POS_FIX_AMD] = azx_get_pos_amd, - }; - - chip->get_position[0] = chip->get_position[1] = callbacks[fix]; -@@ -2447,6 +2486,10 @@ static const struct pci_device_id azx_ids[] = { - /* AMD Hudson */ - { PCI_DEVICE(0x1022, 0x780d), - .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, -+ /* AMD X370 */ -+ { PCI_DEVICE(0x1022, 0x1457), -+ .driver_data = AZX_DRIVER_AMD | AZX_DCAPS_PRESET_ATI_SB | -+ AZX_DCAPS_PM_RUNTIME }, - /* AMD Stoney */ - { PCI_DEVICE(0x1022, 0x157a), - .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB | diff --git a/hdac_stream.diff b/hdac_stream.diff deleted file mode 100644 index 45bd4c6ec141..000000000000 --- a/hdac_stream.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- a/hdacore/hdac_stream.c -+++ a/hdacore/hdac_stream.c -@@ -229,11 +229,7 @@ int snd_hdac_stream_setup(struct hdac_stream *azx_dev) - /* set the interrupt enable bits in the descriptor control register */ - snd_hdac_stream_updatel(azx_dev, SD_CTL, 0, SD_INT_MASK); - -- if (azx_dev->direction == SNDRV_PCM_STREAM_PLAYBACK) -- azx_dev->fifo_size = -- snd_hdac_stream_readw(azx_dev, SD_FIFOSIZE) + 1; -- else -- azx_dev->fifo_size = 0; -+ azx_dev->fifo_size = snd_hdac_stream_readw(azx_dev, SD_FIFOSIZE) + 1; - - /* when LPIB delay correction gives a small negative value, - * we ignore it; currently set the threshold statically to |