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 drmkms_pci: use MSI if available.
details: https://anonhg.NetBSD.org/src/rev/7c4f97656ada
branches: trunk
changeset: 351654:7c4f97656ada
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Feb 21 14:19:39 2017 +0000
description:
drmkms_pci: use MSI if available.
diffstat:
sys/external/bsd/drm2/dist/include/drm/drmP.h | 1 +
sys/external/bsd/drm2/pci/drm_pci.c | 14 ++++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diffs (59 lines):
diff -r 9ccfd6cf1135 -r 7c4f97656ada sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h Tue Feb 21 13:09:56 2017 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h Tue Feb 21 14:19:39 2017 +0000
@@ -1268,6 +1268,7 @@
bool irq_enabled; /**< True if irq handler is enabled */
#ifdef __NetBSD__
struct drm_bus_irq_cookie *irq_cookie;
+ pci_intr_handle_t *intr_handles;
#endif
__volatile__ long context_flag; /**< Context swapping flag */
int last_context; /**< Last current context */
diff -r 9ccfd6cf1135 -r 7c4f97656ada sys/external/bsd/drm2/pci/drm_pci.c
--- a/sys/external/bsd/drm2/pci/drm_pci.c Tue Feb 21 13:09:56 2017 +0000
+++ b/sys/external/bsd/drm2/pci/drm_pci.c Tue Feb 21 14:19:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_pci.c,v 1.13 2015/04/29 04:38:55 riastradh Exp $ */
+/* $NetBSD: drm_pci.c,v 1.14 2017/02/21 14:19:40 nonaka Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.13 2015/04/29 04:38:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.14 2017/02/21 14:19:40 nonaka Exp $");
#include <sys/types.h>
#include <sys/errno.h>
@@ -232,16 +232,17 @@
struct drm_bus_irq_cookie **cookiep)
{
const struct pci_attach_args *const pa = drm_pci_attach_args(dev);
- pci_intr_handle_t ih;
const char *intrstr;
void *ih_cookie;
char intrbuf[PCI_INTRSTR_LEN];
- if (pci_intr_map(pa, &ih))
+ if (pci_intr_alloc(pa, &dev->intr_handles, NULL, 0))
return -ENOENT;
- intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
- ih_cookie = pci_intr_establish(pa->pa_pc, ih, IPL_DRM, handler, arg);
+ intrstr = pci_intr_string(pa->pa_pc, dev->intr_handles[0], intrbuf,
+ sizeof(intrbuf));
+ ih_cookie = pci_intr_establish(pa->pa_pc, dev->intr_handles[0],
+ IPL_DRM, handler, arg);
if (ih_cookie == NULL) {
aprint_error_dev(dev->dev,
"couldn't establish interrupt at %s (%s)\n",
@@ -262,6 +263,7 @@
const struct pci_attach_args *pa = drm_pci_attach_args(dev);
pci_intr_disestablish(pa->pa_pc, (void *)cookie);
+ pci_intr_release(pa->pa_pc, dev->intr_handles, 1);
}
static const char *
Home |
Main Index |
Thread Index |
Old Index