[haiku-commits] Change in haiku[master]: hda: disable TCSEL on ATI/AMD for non-hmdi

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 28 Feb 2020 09:40:24 +0000

From Jérôme Duval <jerome.duval@xxxxxxxxx>:

Jérôme Duval has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2290 ;)


Change subject: hda: disable TCSEL on ATI/AMD for non-hmdi
......................................................................

hda: disable TCSEL on ATI/AMD for non-hmdi

also disable MSI with C-MEDIA 0x5011 (reference alsa)
---
M src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
1 file changed, 14 insertions(+), 8 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/90/2290/1

diff --git a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp 
b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
index f778a9e..c69fd31 100644
--- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
+++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
@@ -37,6 +37,7 @@
 #define PCI_VENDOR_ATI                 0x1002
 #define PCI_VENDOR_AMD                 0x1022
 #define PCI_VENDOR_CREATIVE            0x1102
+#define PCI_VENDOR_CMEDIA              0x13f6
 #define PCI_VENDOR_INTEL               0x8086
 #define PCI_VENDOR_NVIDIA              0x10de
 #define PCI_VENDOR_VMWARE              0x15ad
@@ -46,6 +47,7 @@
 #define HDA_QUIRK_SNOOP                                        0x0001
 #define HDA_QUIRK_NO_MSI                               0x0002
 #define HDA_QUIRK_NO_CORBRP_RESET_ACK  0x0004
+#define HDA_QUIRK_NOTCSEL                              0x0008


 static const struct {
@@ -92,17 +94,18 @@
        { PCI_VENDOR_INTEL, 0xa2f0, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0xa348, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0xa3f0, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_ATI, 0x437b, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_ATI, 0x4383, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_AMD, 0x157a, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_AMD, 0x780d, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_AMD, 0x1457, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_AMD, 0x1487, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_AMD, 0x15e3, HDA_QUIRK_SNOOP },
+       { PCI_VENDOR_ATI, 0x437b, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_ATI, 0x4383, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_AMD, 0x157a, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_AMD, 0x780d, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_AMD, 0x1457, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_AMD, 0x1487, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
+       { PCI_VENDOR_AMD, 0x15e3, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
        // Enable snooping for Nvidia, right now for all their hda-devices,
        // but only based on guessing.
        { PCI_VENDOR_NVIDIA, PCI_ALL_DEVICES, HDA_QUIRK_SNOOP | HDA_QUIRK_NO_MSI
                | HDA_QUIRK_NO_CORBRP_RESET_ACK },
+       { PCI_VENDOR_CMEDIA, 0x5011, HDA_QUIRK_NO_MSI },
        { PCI_VENDOR_CREATIVE, 0x0010, HDA_QUIRK_NO_MSI },
        { PCI_VENDOR_CREATIVE, 0x0012, HDA_QUIRK_NO_MSI },
        { PCI_VENDOR_VMWARE, PCI_ALL_DEVICES, HDA_QUIRK_NO_CORBRP_RESET_ACK },
@@ -1060,7 +1063,10 @@
                goto no_irq;

        // TCSEL is reset to TC0 (clear 0-2 bits)
-       update_pci_register(controller, PCI_HDA_TCSEL, PCI_HDA_TCSEL_MASK, 0, 
1);
+       if ((quirks & HDA_QUIRK_NOTCSEL) == 0) {
+               update_pci_register(controller, PCI_HDA_TCSEL, 
PCI_HDA_TCSEL_MASK, 0,
+                       1);
+       }

        controller->dma_snooping = false;


--
To view, visit https://review.haiku-os.org/c/haiku/+/2290
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I51e0b8f046df13a23a0b39998e4155a2ec40f5f2
Gerrit-Change-Number: 2290
Gerrit-PatchSet: 1
Gerrit-Owner: Jérôme Duval <jerome.duval@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: hda: disable TCSEL on ATI/AMD for non-hmdi - Gerrit