genode/repos/dde_bsd/patches/azalia_c.patch

56 lines
1.6 KiB
Diff
Raw Normal View History

--- a/dev/pci/azalia.c
+++ b/dev/pci/azalia.c
@@ -492,7 +492,7 @@
azalia_t *sc;
struct pci_attach_args *pa;
pcireg_t v;
- uint8_t reg;
+ // uint8_t reg;
pci_intr_handle_t ih;
const char *interrupt_str;
@@ -518,12 +518,18 @@
azalia_configure_pci(sc);
- /* disable MSI, use INTx instead */
- if (PCI_VENDOR(sc->pciid) == PCI_VENDOR_INTEL) {
- reg = azalia_pci_read(sc->pc, sc->tag, ICH_PCI_MMC);
- reg &= ~(ICH_PCI_MMC_ME);
- azalia_pci_write(sc->pc, sc->tag, ICH_PCI_MMC, reg);
- }
+ // This was added in CVS rev 1.168 because certain devices do not
+ // support MSIs. For reasons that are not clear yet, this breaks
+ // when using the platform_drv on x86 with MSI support and IOMMU
+ // enabled. All hw we tested seems to work fine when it is removed,
+ // even older kernels, e.g. OKL4, that use legacy IRQs,
+ //
+ // /* disable MSI, use INTx instead */
+ // if (PCI_VENDOR(sc->pciid) == PCI_VENDOR_INTEL) {
+ // reg = azalia_pci_read(sc->pc, sc->tag, ICH_PCI_MMC);
+ // reg &= ~(ICH_PCI_MMC_ME);
+ // azalia_pci_write(sc->pc, sc->tag, ICH_PCI_MMC, reg);
+ // }
/* disable MSI for AMD Summit Ridge/Raven Ridge HD Audio */
if (PCI_VENDOR(sc->pciid) == PCI_VENDOR_AMD) {
@@ -3973,6 +3979,10 @@
azalia_set_blksz(void *v, int mode,
struct audio_params *p, struct audio_params *r, unsigned int blksz)
{
+ // XXX using mult leads to a blksz of 416 in case of a
+ // requested blksz of 441 which in return results in distored
+ // playback.
+#if 0
int mult;
/* must be multiple of 128 bytes */
@@ -3981,6 +3991,7 @@
blksz -= blksz % mult;
if (blksz == 0)
blksz = mult;
+#endif
return blksz;
}