Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci Use t...



details:   https://anonhg.NetBSD.org/src/rev/7ba6b059c260
branches:  trunk
changeset: 744494:7ba6b059c260
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Feb 03 16:22:25 2020 +0000

description:
Use the correct PCI interrupt type based on what the driver has configured

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c |  12 ++++++---
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r b4b6a1ea40ff -r 7ba6b059c260 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c     Mon Feb 03 15:47:03 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_base.c     Mon Feb 03 16:22:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.4 2018/12/19 09:20:56 maya Exp $    */
+/*     $NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $        */
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs <bskeggs%redhat.com@localhost>
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.4 2018/12/19 09:20:56 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_pci_base.c,v 1.5 2020/02/03 16:22:25 jmcneill Exp $");
 
 #include "priv.h"
 #include "agp.h"
@@ -142,14 +142,18 @@
 #ifdef __NetBSD__
     {
        const struct pci_attach_args *pa = &pdev->pd_pa;
+       const pci_intr_type_t intr_type = pci->msi ?
+           PCI_INTR_TYPE_MSI : PCI_INTR_TYPE_INTX;
+
        int counts[PCI_INTR_TYPE_SIZE] =  {
-                       [PCI_INTR_TYPE_INTX] = 1,
+                       [PCI_INTR_TYPE_INTX] = 0,
                        [PCI_INTR_TYPE_MSI] = 0,
                        [PCI_INTR_TYPE_MSIX] = 0,
        };
+       counts[intr_type] = 1;
 
        /* XXX errno NetBSD->Linux */
-       ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, PCI_INTR_TYPE_INTX);
+       ret = -pci_intr_alloc(pa, &pci->pci_ihp, counts, intr_type);
        if (ret)
                return ret;
        pci->pci_intrcookie = pci_intr_establish_xname(pa->pa_pc,



Home | Main Index | Thread Index | Old Index