Module Name: src
Committed By: nonaka
Date: Tue Feb 21 14:19:40 UTC 2017
Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drmP.h
src/sys/external/bsd/drm2/pci: drm_pci.c
Log Message:
drmkms_pci: use MSI if available.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/pci/drm_pci.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.11 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.12
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.11 Wed Apr 29 04:38:55 2015
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h Tue Feb 21 14:19:39 2017
@@ -1268,6 +1268,7 @@ struct drm_device {
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 */
Index: src/sys/external/bsd/drm2/pci/drm_pci.c
diff -u src/sys/external/bsd/drm2/pci/drm_pci.c:1.13 src/sys/external/bsd/drm2/pci/drm_pci.c:1.14
--- src/sys/external/bsd/drm2/pci/drm_pci.c:1.13 Wed Apr 29 04:38:55 2015
+++ src/sys/external/bsd/drm2/pci/drm_pci.c Tue Feb 21 14:19:40 2017
@@ -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 @@ drm_pci_irq_install(struct drm_device *d
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 @@ drm_pci_irq_uninstall(struct drm_device
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 *