diff options
-rw-r--r-- | 0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch | 182 | ||||
-rw-r--r-- | 0004-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch (renamed from 0003-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch) | 0 | ||||
-rw-r--r-- | PKGBUILD | 13 | ||||
-rw-r--r-- | config | 2 |
4 files changed, 191 insertions, 6 deletions
diff --git a/0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch b/0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch new file mode 100644 index 0000000..1e74d55 --- /dev/null +++ b/0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch @@ -0,0 +1,182 @@ +From 6b43b6519a752c51657b9afa4eb844cad29d2b8c Mon Sep 17 00:00:00 2001 +From: Nikhil Mahale <nmahale@nvidia.com> +Date: Mon, 3 Feb 2020 15:36:17 +0530 +Subject: ALSA: hda - Fix DP-MST support for NVIDIA codecs + +If dyn_pcm_assign is set, different jack objects are being created +for pcm and pins. + +If dyn_pcm_assign is set, generic_hdmi_build_jack() calls into +add_hdmi_jack_kctl() to create and track separate jack object for +pcm. Like sync_eld_via_acomp(), hdmi_present_sense_via_verbs() also +need to report status change of the pcm jack. + +Rename pin_idx_to_jack() to pin_idx_to_pcm_jack(). The code to +report status change of pcm jack, move it to update_eld() which is +common for acomp and !acomp code paths. + +Fixes: 5398e94fb753 ALSA: hda - Add DP-MST support for NVIDIA codecs +Signed-off-by: Nikhil Mahale <nmahale@nvidia.com> +--- + sound/pci/hda/patch_hdmi.c | 94 +++++++++++++++++++++++----------------------- + 1 file changed, 47 insertions(+), 47 deletions(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index 630b1f5c276d..469b25065643 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -1477,6 +1477,35 @@ static void hdmi_pcm_reset_pin(struct hdmi_spec *spec, + per_pin->channels = 0; + } + ++static struct snd_jack *pin_idx_to_pcm_jack(struct hda_codec *codec, ++ struct hdmi_spec_per_pin *per_pin) ++{ ++ struct hdmi_spec *spec = codec->spec; ++ struct snd_jack *jack = NULL; ++ struct hda_jack_tbl *jack_tbl; ++ ++ /* if !dyn_pcm_assign, get jack from hda_jack_tbl ++ * in !dyn_pcm_assign case, spec->pcm_rec[].jack is not ++ * NULL even after snd_hda_jack_tbl_clear() is called to ++ * free snd_jack. This may cause access invalid memory ++ * when calling snd_jack_report ++ */ ++ if (per_pin->pcm_idx >= 0 && spec->dyn_pcm_assign) { ++ jack = spec->pcm_rec[per_pin->pcm_idx].jack; ++ } else if (!spec->dyn_pcm_assign) { ++ /* ++ * jack tbl doesn't support DP MST ++ * DP MST will use dyn_pcm_assign, ++ * so DP MST will never come here ++ */ ++ jack_tbl = snd_hda_jack_tbl_get_mst(codec, per_pin->pin_nid, ++ per_pin->dev_id); ++ if (jack_tbl) ++ jack = jack_tbl->jack; ++ } ++ return jack; ++} ++ + /* update per_pin ELD from the given new ELD; + * setup info frame and notification accordingly + */ +@@ -1487,9 +1516,15 @@ static bool update_eld(struct hda_codec *codec, + struct hdmi_eld *pin_eld = &per_pin->sink_eld; + struct hdmi_spec *spec = codec->spec; + bool old_eld_valid = pin_eld->eld_valid; ++ struct snd_jack *pcm_jack; + bool eld_changed; + int pcm_idx; + ++ /* pcm_idx >=0 before update_eld() means it is in monitor ++ * disconnected event. Jack must be fetched before update_eld() ++ */ ++ pcm_jack = pin_idx_to_pcm_jack(codec, per_pin); ++ + /* for monitor disconnection, save pcm_idx firstly */ + pcm_idx = per_pin->pcm_idx; + if (spec->dyn_pcm_assign) { +@@ -1544,6 +1579,14 @@ static bool update_eld(struct hda_codec *codec, + SNDRV_CTL_EVENT_MASK_VALUE | + SNDRV_CTL_EVENT_MASK_INFO, + &get_hdmi_pcm(spec, pcm_idx)->eld_ctl->id); ++ ++ if (!pcm_jack) ++ pcm_jack = pin_idx_to_pcm_jack(codec, per_pin); ++ if (eld_changed && pcm_jack) ++ snd_jack_report(pcm_jack, ++ (eld->monitor_present && eld->eld_valid) ? ++ SND_JACK_AVOUT : 0); ++ + return eld_changed; + } + +@@ -1566,7 +1609,6 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, + * the unsolicited response to avoid custom WARs. + */ + int present; +- bool ret; + bool do_repoll = false; + + present = snd_hda_jack_pin_sense(codec, pin_nid, dev_id); +@@ -1600,45 +1642,14 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, + else + update_eld(codec, per_pin, eld); + +- ret = !repoll || !eld->monitor_present || eld->eld_valid; +- + jack = snd_hda_jack_tbl_get_mst(codec, pin_nid, per_pin->dev_id); + if (jack) { +- jack->block_report = !ret; ++ jack->block_report = do_repoll; + jack->pin_sense = (eld->monitor_present && eld->eld_valid) ? + AC_PINSENSE_PRESENCE : 0; + } + mutex_unlock(&per_pin->lock); +- return ret; +-} +- +-static struct snd_jack *pin_idx_to_jack(struct hda_codec *codec, +- struct hdmi_spec_per_pin *per_pin) +-{ +- struct hdmi_spec *spec = codec->spec; +- struct snd_jack *jack = NULL; +- struct hda_jack_tbl *jack_tbl; +- +- /* if !dyn_pcm_assign, get jack from hda_jack_tbl +- * in !dyn_pcm_assign case, spec->pcm_rec[].jack is not +- * NULL even after snd_hda_jack_tbl_clear() is called to +- * free snd_jack. This may cause access invalid memory +- * when calling snd_jack_report +- */ +- if (per_pin->pcm_idx >= 0 && spec->dyn_pcm_assign) +- jack = spec->pcm_rec[per_pin->pcm_idx].jack; +- else if (!spec->dyn_pcm_assign) { +- /* +- * jack tbl doesn't support DP MST +- * DP MST will use dyn_pcm_assign, +- * so DP MST will never come here +- */ +- jack_tbl = snd_hda_jack_tbl_get_mst(codec, per_pin->pin_nid, +- per_pin->dev_id); +- if (jack_tbl) +- jack = jack_tbl->jack; +- } +- return jack; ++ return !do_repoll; + } + + /* update ELD and jack state via audio component */ +@@ -1647,8 +1658,6 @@ static void sync_eld_via_acomp(struct hda_codec *codec, + { + struct hdmi_spec *spec = codec->spec; + struct hdmi_eld *eld = &spec->temp_eld; +- struct snd_jack *jack = NULL; +- bool changed; + int size; + + mutex_lock(&per_pin->lock); +@@ -1671,17 +1680,8 @@ static void sync_eld_via_acomp(struct hda_codec *codec, + eld->eld_size = 0; + } + +- /* pcm_idx >=0 before update_eld() means it is in monitor +- * disconnected event. Jack must be fetched before update_eld() +- */ +- jack = pin_idx_to_jack(codec, per_pin); +- changed = update_eld(codec, per_pin, eld); +- if (jack == NULL) +- jack = pin_idx_to_jack(codec, per_pin); +- if (changed && jack) +- snd_jack_report(jack, +- (eld->monitor_present && eld->eld_valid) ? +- SND_JACK_AVOUT : 0); ++ update_eld(codec, per_pin, eld); ++ + mutex_unlock(&per_pin->lock); + } + +-- +cgit v1.2.1-1-g437b + diff --git a/0003-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch b/0004-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch index 496cc6f..496cc6f 100644 --- a/0003-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch +++ b/0004-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch @@ -14,7 +14,7 @@ pkgbase=linux _supver=5 _majver=5 -_minver=1 +_minver=2 _gccpatchver='20191217' if [ "$_minver" == "0" ]; then pkgver=${_supver}.${_majver} @@ -37,7 +37,8 @@ source=( https://www.kernel.org/pub/linux/kernel/v${_supver}.x/${_srcname}.tar.{xz,sign} 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch 0002-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch - 0003-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch + 0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch + 0004-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch graysky_bdver2-hotfix.patch kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz ath9k-regdom-hack.patch @@ -49,16 +50,17 @@ validpgpkeys=( '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) # https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc -b2sums=('abad485b7c995803a4a1d39773fc8eab02e899f65a9f14e9d4fb21bf6f8fa0b82f2e31676acff0c165bf49c0144c6c63783ff3f163d4f0cafc43ae8d28423afa' +b2sums=('9587b8d8307c134a7732482e5495d9203a6367483ca30be06c13b270f4ce34b532d935874decb6c4c3e8b4dfb828c69814b35ef32e5e55db7c3845ee436aa1fc' 'SKIP' 'ab1fb19c67d4c107f75767581c33d9c1458b4d9fdb88f4adb41d30a36f5a2f95f1c48ef079eb87e1e6e8ce2f98b293195cb2c0f2a8ec975aa817453289158c6e' '2e822cf7d4ff8b7458e22d3ce110fd8534e17a9aac2feace41c591f70697e1fab7bd9ce307c60a6361fbe525d10dab74c8b76fcb5276cd27f6e945f8fdfcc25c' + 'ea755ddfbc59fd8a6eb2b23b80acec6f357fd7fbb2dac48275cec24d388c70c484808e8edf7450edf609ae2f33ab0e718075ba2636666cdd2f99ed64df796a79' 'b3f2c12f0d298ffec1a0d8237de80741d935af7b64f967f6ea2473741fbe4616edb7c321dc7a69c57b50d2313330a581b1f3086f64b15a10b2b640e26af659c4' '1892bd22775eac3bcc4d37f4fd30c95346bf3a0888cbbff57fd614973b525390dff2e315ce35b2e498523cceaab94ff21a80475dee8df3de4dd8fc0fab07d74e' 'd76bd0bf237ea2bb7999fd3715cb664d89148cb0ade8057d57cdb40bc0a7954336e50ee077312e5e192398b0f35f055786deb98af9130d57e60f2ea040fbb66f' '2e58bb89b247b1678355368956e67c1de51fcde97a227b2162f6771e30f17fa5520faafe7be4b6816a542e7ae10d05f64c6b6354f352c12746d4b8da632936dd' 'fde132f3705d908e6f2147c78a2193289916d72304ca5efa2229d79fc3e57a857314ce94e71425caef2f7f7b6cf87f05ef86335dc8bd4be78e7035afe608005a' - '3b7454976c1934ea946c710ed7db51aab5e6823ef30b190beb979682b6f4f51cff288a8fc13035bb903ef3a53ce0801757bf0b7d02b0d204404bdaf819d3e55b') + 'ef794e6fa5e9aad1b6dd18396ac348433c391eca890e20fb7ceb947f3b703be218cf94e3212501d141ea72dc42731c11e9a7991318b8ede434259152236cd866') #export KBUILD_BUILD_HOST=arc4linux export KBUILD_BUILD_USER=$pkgbase @@ -78,7 +80,8 @@ prepare() { echo "Applying hotfixes" patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch patch -p1 -i ../0002-iwlwifi-pcie-restore-support-for-Killer-Qu-C0-NICs.patch - patch -p1 -i ../0003-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch + patch -p1 -i ../0003-ALSA-hda-Fix-DP-MST-support-for-NVIDIA-codecs.patch + patch -p1 -i ../0004-btrfs-send-fix-emission-of-invalid-clone-operations-within-the-same.patch # graysky gcc hotfixes @@ -8720,7 +8720,7 @@ CONFIG_AMD_IOMMU_V2=y CONFIG_DMAR_TABLE=y CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y -CONFIG_INTEL_IOMMU_DEFAULT_ON=y +# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y CONFIG_IRQ_REMAP=y CONFIG_HYPERV_IOMMU=y |