[haiku-commits] haiku: hrev50443 - src/add-ons/kernel/drivers/audio/hda

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 22 Jul 2016 01:22:40 +0200 (CEST)

hrev50443 adds 1 changeset to branch 'master'
old head: 4e793ddd87082e427fb7f72f837ff7cdd8a7d7c9
new head: 0c1281a14f4ddf0482dfa4674e42156e3b57b198
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=0c1281a14f4d+%5E4e793ddd8708

----------------------------------------------------------------------------

0c1281a14f4d: hda: Create HDA_QUIRK_NO_CORBRP_RESET_ACK and use it.
  
  This is instead of just checking for NVIDIA devices. Also add an entry
  for Intel 0x2668 (VirtualBox's HDA controller). Gets HDA a bit further
  in VirtualBox, but an acquire_sem() times out later on.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50443
Commit:      0c1281a14f4ddf0482dfa4674e42156e3b57b198
URL:         http://cgit.haiku-os.org/haiku/commit/?id=0c1281a14f4d
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Jul 21 23:10:27 2016 UTC

----------------------------------------------------------------------------

1 file changed, 11 insertions(+), 9 deletions(-)
.../kernel/drivers/audio/hda/hda_controller.cpp  | 20 +++++++++++---------

----------------------------------------------------------------------------

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 13905a6..ca95666 100644
--- a/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
+++ b/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
@@ -39,8 +39,9 @@
 #define PCI_VENDOR_INTEL               0x8086
 #define PCI_VENDOR_NVIDIA              0x10de
 #define PCI_ALL_DEVICES                        0xffffffff
-#define HDA_QUIRK_SNOOP                        0x0001
-#define HDA_QUIRK_NO_MSI               0x0002
+#define HDA_QUIRK_SNOOP                                        0x0001
+#define HDA_QUIRK_NO_MSI                               0x0002
+#define HDA_QUIRK_NO_CORBRP_RESET_ACK  0x0004
 
 
 static const struct {
@@ -50,6 +51,7 @@ static const struct {
        { PCI_VENDOR_INTEL, 0x1c20, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0x1d20, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0x1e20, HDA_QUIRK_SNOOP },
+       { PCI_VENDOR_INTEL, 0x2668, HDA_QUIRK_NO_CORBRP_RESET_ACK },
        { PCI_VENDOR_INTEL, 0x8c20, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0x8d20, HDA_QUIRK_SNOOP },
        { PCI_VENDOR_INTEL, 0x8d21, HDA_QUIRK_SNOOP },
@@ -66,7 +68,8 @@ static const struct {
        // Enable snooping for ATI and Nvidia, right now for all their 
hda-devices,
        // but only based on guessing.
        { PCI_VENDOR_AMD, PCI_ALL_DEVICES, HDA_QUIRK_SNOOP },
-       { PCI_VENDOR_NVIDIA, PCI_ALL_DEVICES, HDA_QUIRK_SNOOP | 
HDA_QUIRK_NO_MSI },
+       { PCI_VENDOR_NVIDIA, PCI_ALL_DEVICES, HDA_QUIRK_SNOOP | HDA_QUIRK_NO_MSI
+               | HDA_QUIRK_NO_CORBRP_RESET_ACK },
        { PCI_VENDOR_CREATIVE, 0x0010, HDA_QUIRK_NO_MSI },
        { PCI_VENDOR_CREATIVE, 0x0012, HDA_QUIRK_NO_MSI }
 };
@@ -431,7 +434,7 @@ reset_controller(hda_controller* controller)
        positioning is actually enabled in hda_stream_setup_buffers()).
 */
 static status_t
-init_corb_rirb_pos(hda_controller* controller)
+init_corb_rirb_pos(hda_controller* controller, uint32 quirks)
 {
        // Determine and set size of CORB
        uint8 corbSize = controller->Read8(HDAC_CORB_SIZE);
@@ -540,10 +543,9 @@ init_corb_rirb_pos(hda_controller* controller)
                dprintf("hda: CORB read pointer reset not acknowledged\n");
 
                // According to HDA spec v1.0a ch3.3.21, software must read the
-               // bit as 1 to verify that the reset completed. However, at 
least
-               // some nVidia HDA controllers do not update the bit after 
reset.
-               // Thus don't fail here on nVidia controllers.
-               if (controller->pci_info.vendor_id != PCI_VENDOR_NVIDIA)
+               // bit as 1 to verify that the reset completed, but not all HDA
+               // controllers follow that...
+               if ((quirks & HDA_QUIRK_NO_CORBRP_RESET_ACK) == 0)
                        return B_BUSY;
        }
 
@@ -1075,7 +1077,7 @@ hda_hw_init(hda_controller* controller)
        }
 
        // Setup CORB/RIRB/DMA POS
-       status = init_corb_rirb_pos(controller);
+       status = init_corb_rirb_pos(controller, quirks);
        if (status != B_OK) {
                dprintf("hda: init_corb_rirb_pos failed\n");
                goto corb_rirb_failed;


Other related posts:

  • » [haiku-commits] haiku: hrev50443 - src/add-ons/kernel/drivers/audio/hda - waddlesplash